wmctrl: moving current window up/down/left/right?
Hi,
I have coded a code that is very complicated to move the window to +X few pixels on the current desktop. I based on: http://www.linuxjournal.com/magazine...desktop-wmctrl Would you know a very simple command to move the current window? thanks |
To move the currently focused window to coordinates 50,100
Code:
xdotool getwindowfocus windowmove 50 100 |
Quote:
maybe you would know the wmctrl alternative? I havent come so far yet with it. I can play around with wmctrl a bit but my skills are still limited on this app |
Quote:
Code:
apt-get install xdotool Quote:
So a relative move isn't easy with wmctrl. But if you already have some desired coordinates, $x $y, then the current window can be moved with... Code:
wmctrl -r :ACTIVE: -e 0,$x,$y,-1,-1 Code:
# get the window_id for the current active window |
Quote:
Hi! Sounds good. With these information, I will be capable to build a bash code to move it relatively purely based on minimum dependencies (i.e. without xdotool). Please give me bit of time 1-2 weeks to write the code. I'll be back soon !! wmctrl is quite nice. In the past, we didnt have this app. |
actually it would be nice to add a script to openbox, so that it maximizes it !
because openbox locks resizing when you click on the top bar "Maximize" wmctrl detects the current win then you calc the max width and height of monitor (xrandr) and you ask wmctrl to locate it to x,y of 0,0 and you compute with bash the required new size. here it is. It is fairly possible. What do you think? |
Quote:
what about this working one? Code:
<keybind key="W-0"> Code:
#!/bin/sh |
Quote:
Hi back with a possible solution... Code:
|
Okay, I've had a look, and this might work. Try out the modified script on a window without window decorations, because it may not work otherwise - I'll explain why below. My terminals are already undecorated thanks to devilspie, but I imagine there is a commandline method for that somewhere.
Code:
#!/bin/sh Code:
#!/bin/sh Code:
$ ./test7.sh 0 0 Code:
$ ./test7.sh 0 0 In summary, the move-script above works okay, but for undecorated windows only. That tools like wmctrl have quirks and unexpected behaviors to trip us up. And that you should also consider clicking the "Yes" link for a helpful post. Happy with ur solution... then tick "yes" and mark as Solved! |
Good morning,
thx a lot for similar interests ! Bit late this morning, but already some outputs ... (well,... Err associated to Env probably) Quote:
Quote:
---------- Post added 03-29-13 at 02:50 AM ---------- Good morning, thx a lot for similar interests ! Bit late this morning, but already some outputs ... (well,... Err associated to Env probably) Quote:
Quote:
|
All times are GMT -5. The time now is 05:59 AM. |