Skip to content

Instantly share code, notes, and snippets.

@sixtyfive
Created June 9, 2015 10:23
Show Gist options
  • Save sixtyfive/c417f8bf964e799c1fe3 to your computer and use it in GitHub Desktop.
Save sixtyfive/c417f8bf964e799c1fe3 to your computer and use it in GitHub Desktop.
My Devil's Pie 2 configuration in the hopes that it might one day help someone.
-- debug_print command only prints anything to stdout
-- if devilspie2 is run using the --debug option!
x,y,w,h = get_window_geometry()
xs,ys = get_screen_geometry()
debug_print("There are "..get_workspace_count().." workspaces with a total area of "..xs.."x"..ys..".")
debug_print("Window '"..get_window_name().."' ("..w.."x"..h..", belonging to '"..get_application_name().."') open(ed) at "..x.."x"..y..".")
-- Make sure windows open on the external monitor.
if (get_screen_geometry() > 1600 and x < (1600-w+50)) then
debug_print("Moving to viewport 2 because window's x=" .. x .. " < monitor border at 1600-w+50="..(w+50)..".")
set_on_top()
set_window_position(1600+50, 50)
-- set_viewport(2)
end
-- Make Evince always appear with the same size.
if (get_application_name()=="Dokumentenbetrachter") then
debug_print("Changing Evince's size to sane values.")
set_window_geometry(x,y,1200,850)
end
-- Make Firefox always start maximized.
if (get_application_name()=="Firefox") then
debug_print("Maximising Firefox.")
maximize()
end
debug_print("------------")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment