Window movement by bangs Thread last updated on 2004-08-28 03:20:35

Posted by member 45783 on 2004-08-26 11:08:30

My brother has some nice features in his Linux box, for example the possiblity to move open windows to specific corners of the screen. He used these features to open multiple terminals and slapped the keypad a few times, arranging the windows neatly - one in each corner.

I would like to be able to do the same, but I have no idea on how to get or pass information about the window sizes to bangs, so I don't know how much I should move the windows and thus cannot use Wndman or likewise modules to realize the idea.

Solutions, anyone?

Posted by member 103254 on 2004-08-26 11:43:02 link

Check out the module called wndman

Posted by member 5575 on 2004-08-26 13:20:37 link

...or winctrl.dll by Pavel Vitis. I assign the winctrl bangs to a hotkey, and then I can move and/or resize windows (e.g., "grow this window to the bottom right corner") with just a key press. You could also use gestures to activate these bang commands - I do this to move a window onto an adjacent desktop, or to "shade" it, for instance.

Posted by member 37809 on 2004-08-26 14:46:14 link

I would tackle your problem of moving windows to corners with a combination of RabidVWM, Timer, One, WndMan, and mzscript.

The solution's not often really pretty..
I'll see about posting a sample script sometime.

Posted by member 45783 on 2004-08-26 14:51:10 link

Funkyd00d & Boreas: Yeah, I know of those, but the point is that even with those I have no information about the size of a window, and I'm moving or resizing it blind. Something that I don't want to do with for example Winamp and terminal windows (which I've comfortambly concluded to be nice at 80x34). This was the actual problem.

But it seems that tnl has the solution. RabidVWM indeed did seem to have some sort of exported variables for this.

I'll get to work. When I finish, I'll post the results in the Code -section.

Posted by member 45783 on 2004-08-27 01:53:12 link

Problem, help needed (code from memory, concider the typos nonexistent):

; This is supposed to move the window to bottom right corner
*Hotkey Win Num3 !WndMove %active% -^@wsxs^ -^@wsys^


This does not work. I have no idea why, but it seems that the RabidVWM variables only produce numbers in some ocassions. Likewise something like !Alert ^@wsxs^ also just pops up a box with the text "^@wsxs^".

Is there something I should know about the RabidVWM variables?

Posted by member 37809 on 2004-08-27 08:52:09 link

You have to wrap your action with !VWMExec so they get expanded.

e.g. !VWMExec !Alert "^@wsxs^"

Posted by member 5575 on 2004-08-27 10:19:43 link

I'm not sure what you mean about "moving or resizing it blind". I have the following winctrl-bang hotkeys to move to any of the four corners (as defined by the LS desktop, so as not to cover up theme elements):
*Hotkey WIN+CTRL NUM1 !execute [!WinMoveDown][!WinMoveLeft]
*Hotkey WIN+CTRL NUM2 !WinMoveDown
*Hotkey WIN+CTRL NUM3 !execute [!WinMoveDown][!WinMoveRight]
*Hotkey WIN+CTRL NUM4 !WinMoveLeft
*Hotkey WIN+CTRL NUM5 !WinHome centered
*Hotkey WIN+CTRL NUM6 !WinMoveRight
*Hotkey WIN+CTRL NUM7 !execute [!WinMoveUp][!WinMoveLeft]
*Hotkey WIN+CTRL NUM8 !WinMoveUp
*Hotkey WIN+CTRL NUM9 !execute [!WinMoveUp][!WinMoveRight]

I use the same key combos but with ALT added to resize to those positions. The module already knows the screen size and where the corners are...

Posted by member 37809 on 2004-08-27 11:14:17 link

duh, we're blind!
I don't remember using winctrl before.

Posted by member 5575 on 2004-08-27 13:20:34 link

Maybe because you didn't? ;)

Posted by member 37809 on 2004-08-27 15:21:16 link

Boreas wins

Posted by member 45783 on 2004-08-27 16:10:48 link

Yeah, he sure does.
But.
From Loose-Screws, I can get Winctrl 1.4, and it does not have the bangs for example !WinMoveLeft. Have you created those, and if you have, you still need to know the windows width to move it correctly. Right?

Is there a newer version of the module somewhere?

Posted by member 5575 on 2004-08-27 20:15:37 link

Oops, yeah, I made myself a modified version. I thought those bangs were in there before, just under different names, but some of them are new. I never quite finished cleaning up and rebuilding the code, so I didn't release my update. I'll stick a copy here:
http://mysite.verizon.net/brian.wolven/LiteStep/winctrl-1.5.zip
The new bangs are undocumented, however, and the DLL is larger because it was built in Dev-C++. I'll have to get the new LS module package, recompile, and write some docs. Soon. Really.

Posted by member 5575 on 2004-08-27 20:18:39 link

And yes, the new version "knows" the window sizes. Actually the old version did too, but didn't give you bangs to move to the various edges and corners (really just two move-to-edges). I guess I updated it because I wanted to have the same features you were looking for - and I hadn't found them either.

Posted by member 45783 on 2004-08-28 02:52:06 link

Many thanks.

When you finish cleaning up the code and documenting it, send it to loose-screws for all to enjoy. I suppose many would like this functionality (actually some kind of module which would merge all the features of Wndman and Winctrl would be nice).

Posted by member 5575 on 2004-08-28 03:20:35 link

The hotkey examples above will get you going with the current version - it just maps the window position to the corresponding numpad postion. Replace "move" with "grow" and you've got the resizing bangs. Except there's no growHome. =P