Skip to content

Instantly share code, notes, and snippets.

Created November 17, 2014 08:10
Show Gist options
  • Save anonymous/04227325f21aaae42fc2 to your computer and use it in GitHub Desktop.
Save anonymous/04227325f21aaae42fc2 to your computer and use it in GitHub Desktop.
-- http://www.gusnan.se/devilspie2/manual.php
-- undecorate_window();
-- set_window_position(0, 10);
-- set_window_size(262,322);
-- set_window_strut(0, 0, 30, 0)
gwc=get_window_class()
gwt=get_window_type()
gan=get_application_name()
gcin=get_class_instance_name()
-- storeBackup term window launched by anacron
if gwc=="terminator-Terminator" then
debug_print("storeBackup's term");
set_window_geometry(236, 10, 1125, 732);
change_workspace(8);
set_window_workspace(8);
maximize();
set_on_top();
focus_window();
end
-- SVG viewer
if gwc=="Rsvg-view-3" then
debug_print("SVG viewer");
-- Wait half a second before attempting to maximize.
-- Otherwise only works when dp (re-)activated after windows launch
os.execute("sleep 0.5");
set_window_geometry(420, 170, 260, 320);
-- center();
end
-- Delicious extension pop-up
if gcin=="crx_gclkcflnjahgejhappicbhcpllkpakej" then
debug_print("Delicious Chrome extension");
-- set_window_position(3, 10);
set_window_geometry(3, 10, 502, 560);
set_on_top();
focus_window();
end
if gwc=="Hamster-indicator" then
debug_print("Hamster Indicator");
if string.find(get_window_name(), "20") then
set_window_geometry(3,10,555,731);
else set_window_position(564,10);
end
end
if gan=="sqlite-manager" then
debug_print("SQLite Manager");
set_window_geometry(459,10,903,731);
end
if gwc=="Zim" then
set_on_top();
focus_window();
if gwt=="WINDOW_TYPE_DIALOG" then
if get_window_name()=="Search - Zim"
or get_window_name()=="Task List - Zim"
or get_window_name()=="Calendar - Zim" then
debug_print(" Zim - Nav");
set_window_geometry(3,10,679,731);
else
debug_print(" Zim - Other");
center();
end
end
if gwt=="WINDOW_TYPE_NORMAL" then
debug_print("Zim - Main");
set_window_geometry(459,10,903,731);
end
end
if (gwc=="Nemo" or gwc=="Nautilus" or gwc=="Pantheon-files")
and gwt=="WINDOW_TYPE_DIALOG" then
center();
set_on_top();
focus_window();
end
if (gcin=="Conky_hh-wallpapuz") then
set_window_type("WINDOW_TYPE_DESKTOP")
set_window_below(true)
end
if (gan=="Midnight Commander") then
change_workspace(8);
set_window_workspace(8);
-- undecorate_window();
maximize();
-- set_window_geometry(0, 27, 1366, 741);
set_on_top();
focus_window();
end
if (get_window_name()=="systray" and gwt=="WINDOW_TYPE_NORMAL") then
-- HH note three below just don't work wrt conky normal window even set to below
set_window_type("WINDOW_TYPE_DOCK");
make_always_on_top();
set_window_above();
-- use cairo config to set position
end
if get_window_name()=="MPlayer" then
pin_window();
undecorate_window();
set_window_type("WINDOW_TYPE_DESKTOP");
set_window_geometry(0,0,1366,768);
end
--if (gwc=="Terminator") then
-- set_window_position(685,10);
--end
if ((gwc=="Terminator" and gan~="Midnight Commander") or gwc=="Pantheon-terminal" or gwc=="Nemo" or gwc=="Nautilus" or gwc=="Pantheon-files" or gwc=="Gedit" or gwc=="Scratch-text-editor" or gcin=="gnome-system-monitor") and gwt=="WINDOW_TYPE_NORMAL" then
set_window_geometry(685,10,676,731);
set_on_top();
focus_window();
end
-- Chrome & other apps needing lots of space
if (get_window_role()=="browser" or gcin=="libreoffice") then
set_window_geometry(236, 10, 1125, 732);
end
-- Tabs Outliner pop-up
if gcin=="crx_eggkanocgddhmamlbiijnphhppkpkmkl" then
-- shade()
-- Wait half a second before attempting to maximize.
-- Otherwise only works when dp (re-)activated after windows launch
os.execute("sleep 0.5");
set_window_geometry(3, 10, 230, 732);
end
if (gwc~="Rsvg-view-3" and gwc~="Hamster-indicator" and gwc~="Terminator" and gwc~="Pantheon-terminal" and gan~="Midnight Commander" and gwc~="Nemo" and gwc~="Nautilus" and gwc~="Pantheon-files" and get_window_role()~="browser" and gcin~="libreoffice" and gan~="sqlite-manager" and gwc~="Zim" and gwc~="Gedit" and gwc~="Scratch-text-editor" and gwc~="Google-chrome-stable" and gwc~="Skype" and gcin~="Conky_hh-dtL" and gcin~="Conky_hh-wallpapuz" and gcin~="Conky_hh-top-bar" and get_window_name()~="systray" and gcin~="gnome-system-monitor")
and (gwt=="WINDOW_TYPE_NORMAL" or get_window_role()=="pop-up") then
center();
set_on_top();
focus_window();
end
-- debug_print("Workspace count: " .. get_workspace_count());
debug_print("Window name: " .. get_window_name());
debug_print("Application name: " .. gan);
debug_print("Window type: " .. gwt);
debug_print("Window role: " .. get_window_role());
debug_print("Window class: " .. gwc);
debug_print("Class instance: " .. gcin);
x, y, width, height = get_window_geometry();
debug_print("X: "..x..", Y: "..y..", width: "..width..", height: "..height);
debug_print("--------------------------------------------------")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment