You are not logged in.
Pages: 1
I've got a little shell script that opens 2 windows, a pdf viewer and a copy of emacs. I want the viewer to open tiled (snapped) to the left side of the screen and the editor to the right. I certainly can do this manually, but there must be a way to automate it? Oh, and I don't want the 2 programs to always behave this way, just when I call it from the script.
Thanks.
Offline
Assuming that you have Snap Left and Snap Right set to Ctrl+Left and Ctrl+Right respectively in Settings Manager > Window Manager > Keyboard, and you have xdotool installed, you can use a script like this:
#!/bin/bash
emacs &
sleep 1
xdotool key Ctrl+Right
atril &
sleep 1
xdotool key Ctrl+Left
Note, I'm using atril as the pdf viewer. Change the applications and sleep values to suit.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
I'll have to review xdotool ... but right now it's not working for me. Making sure I did not copy incorrectly, I have:
#!/bin/bash
emacs &
sleep 1
xdotool key Ctrl+Right
atril &
sleep 1
xdotool key Ctrl+Left
But I just get a regular emacs and atril. Running the script in the background makes no difference.
My xdotool is: xdotool version 3.20160805.1
Doing a very quick scan of the manual, it seems I need a window id? But I'm really not sure.
Offline
Does Ctrl+Left tile the window to the left for you for any application? Maybe the keyboard shortcut is different. Check in Settings Manager > Window Manager > Keyboard to see what your "Tile window to the left" keyboard shortcut is.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Not ctrl-left/right on this system. There is no reference to tiling in keyboard at all. However, the function does work via Super-Left/Right, etc. I'll try the script later and let you know.
Offline
Works perfectly with Super-Left, etc. Thanks for the help.
Offline
Pages: 1
[ Generated in 0.011 seconds, 10 queries executed - Memory usage: 534.52 KiB (Peak: 535.37 KiB) ]