Skip to content

devilspie2

WM automation tools

minus : scripting must be done in lua (yet another scripting language, but it is not a hard one)
installed with synaptic , there is a GUI version

run as a service

auto run met startup apps tool werkt niet
zie run an exec as a service
ik start het (voorlopig) manueel met een shell stript [TODO]

tutorial & info :

https://www.howtoforge.com/tutorial/ubuntu-desktop-devilspie-2/
https://www.linux-magazine.com/Issues/2017/205/Tutorial-Devilspie2k
1. Devilspie2:http://www.nongnu.org/devilspie2/
2. Lua:https://www.lua.org
3. Devilspie2 manual:http://www.gusnan.se/devilspie2/manual.php
4. Devilspie2 README:http://git.savannah.gnu.org/cgit/devilspie2.git/plain/README
5. wmctrl:http://tripie.sweb.cz/utils/wmctrl/
6. xdotool

automate

  1. scripts are in : ~/.config/devilspie2/
    deze moeten verplicht in de home folder , anders werkt devilpie2 niet
    de source scripts zijn echter , zoals al mijn scripts, in /SYS te bewaren
    => een symlink
cd /home/ward/.config/devilspie2/
cd /mnt/data/SYS/scripts/devilspie-lua/ 

ofwel : nemo -t '/mnt/data/SYS/scripts/devilspie-lua/' '/home/ward/.config/devilspie2' & disown

  1. make a script ‘debug.lua’
debug_print("Application: " .. get_application_name())
debug_print("Window: " .. get_window_name());

we use this script to capture linux window information
place that script in the config folder.

3 execute in devilspie2 debug modus


this starts a daemon process from terminal , which will run as long as the terminal is open
if the debug script is present, capturing will take place, otherwise nothing will happen.
the captured info is outputted to the terminal screen , example :
Application: Thunderbird
Window: Inbox - ward.malesys@telenet.be - Mozilla Thunderbird

  1. we can use the info there to automate window placements :
    make a script ‘window-placement.lua’
    ( example see: lxm-window-API-information )

with script blocks like the following

if (get_window_name() == "AutoKey") then
   set_window_geometry(50, 100, 800, 600);
end

= define the window geometry by four numbers == position x_, pixels y, width, and height
this script instructs Devilspie2 to place newly created Mozilla Firefox windows at 50 pixels from the left of the screen and 100 from the top and to set the window at 800 pixels wide and 600 pixels high.

een techniek (workaround ) om een windowALTIJD gemaximaalizeerd op de hoofdmonitor te krijgen :
eerst positioneren om een x,y locatie op de hoofdmonitor
daarna pas de maximize() functie aanreoepen

  1. execute
devilspie2 

devilspie2 will execute automatically the script created in step 5 , if present in the correct location