Question

I'm experimenting with using the i3 window manager (in a VM). One issue I have with it is it does not save window positions after logout. So, I'm looking for a means to save and execute the key combinations to get the specific windows where I'd like them.

Does anyone know how I might go about doing this? The manipulation would require things like alt+d and alt+enter, but also strings (like "firefox") to open things other than terminals.

Obviously, this isn't a crucial thing. Its just one of those things that would be convenient. Especially when you have lots of windows spread across 3 screens. I can see it getting a little tedious.

Any suggestions would be greatly appreciated.

Was it helpful?

Solution

Ok, so far I've managed to kinda figure this out.

I use xdotool to issue commands to X through a shell script. It would have to be run on login. (I have to do it manually, but I think thats bc Ubuntu is stupid) The example below switches to tabbed layout, uses dmenu to search for gnome-terminal, opens it, then runs archey.

xdotool key Alt_L+w
xdotool key Alt_L+d
xdotool type gnome-terminal
xdotool key Return
sleep .5  #small delay to allow terminal to open
xdotool type archey
xdotool key Return

Use xev to determine what the key codes are. For some unknown reason xdotool key Alt_L+Return does not open a new terminal...

Obviously change things as needed, for you, but this seems to work.

I hope this might be useful to somebody.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top