{"id":15042337,"url":"https://github.com/gitgnu/gnu_devilspie2","last_synced_at":"2025-10-19T19:30:36.106Z","repository":{"id":84520437,"uuid":"90382052","full_name":"gitGNU/gnu_devilspie2","owner":"gitGNU","description":null,"archived":false,"fork":false,"pushed_at":"2017-05-05T14:04:56.000Z","size":592,"stargazers_count":4,"open_issues_count":2,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-07T11:27:13.638Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitGNU.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-05T14:04:51.000Z","updated_at":"2023-12-07T15:16:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"38267261-cc8e-4474-8b47-81ce6e4744f9","html_url":"https://github.com/gitGNU/gnu_devilspie2","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitGNU%2Fgnu_devilspie2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitGNU%2Fgnu_devilspie2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitGNU%2Fgnu_devilspie2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitGNU%2Fgnu_devilspie2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitGNU","download_url":"https://codeload.github.com/gitGNU/gnu_devilspie2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219869272,"owners_count":16555575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T20:47:08.565Z","updated_at":"2025-10-19T19:30:30.731Z","avatar_url":"https://github.com/gitGNU.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"#\n# Copyright © 2011-2015 Andreas Rönnquist.\n# This file is distributed under the same license\n# as the devilspie2 package, see COPYING file.\n#\n\nDevilspie 2\n-----------\n\nDevilspie 2 is based on the excellent program Devil's Pie by Ross Burton, and\ntakes a folder as indata, and checks that folder for Lua scripts. These\nscripts are run each time a window is opened or closed, and the rules in them\nare applied on the window.\n\nUnfortunately the rules of the original Devils Pie are not supported.\n\nIf you don't give devilspie2 any folder with --folder, it will read Lua scripts\nfrom the folder that it gets from the GLib function g_get_user_config_dir with\ndevilspie2/ added to the end - g_get_user_config_dir returns the config\ndirectory as defined in the XDG Base Directory Specification. In most cases\nwould be the ~/.config/devilspie2/ folder, and this folder will be created if\nit doesn't already exist. This folder is changeable with the --folder option.\nIf devilspie2 doesn't find any Lua files in the folder, it will stop execution.\n\nDevilspie2 will load all the Lua files in this folder in alphabetical order.\n\nDevilspie2 takes some options:\n\n-h, --help          Show help options\n\n-d, --debug         Print debug information to stdout\n-e, --emulate       Don't apply any rules, but only emulate execution\n-f, --folder        From which folder should we load our Lua scripts\n-v, --version       Print program version and quit\n-w, --wnck-version  Show version of libwnck and quit\n\n\nConfig\n-------\n\nA config is read from the folder where we read all scripts, and is customizable\nby the --folder option. By default this folder is ~/.config/devilspie2/.\n\nIf there is a file named devilspie2.lua in this folder, it is read and it is\nsearched for a variable (a lua table of strings) named either\nscripts_window_close, scripts_window_focus or scripts_window_blur -\nThe filenames in the strings in this table will be called when windows are\nclosed, focused or blurred respectively. If these variables isn't present in\nthis file, it will be called as a devilspie2 script file like any other.\n\nFor example:\n\n--\nscripts_window_close = {\n   \"file1.lua\",\n   \"file2.lua\"\n}\n\nThis would make the files file1.lua and file2.lua interpreted when windows are\nclosing instead of when windows are opening.\n\n\nScripting\n---------\n\nYou can choose to have all script functionality in one file, or you can split\nit up into several, Devilspie2 runs on all Lua files in your requested\ndevilspie2 folder, by default ~/.config/devilspie2 - that is all files with a\n.lua extension.\n\nThe scripting language used is Lua (see www.lua.org) - See FAQ at\n\nwww.lua.org/FAQ.html\n\n, documentation at\n\nwww.lua.org/docs.html\n\n, and tutorials at\n\nhttp://lua-users.org/wiki/TutorialDirectory\n\n\nThe following commands are recognized by the Devilspie2 Lua interpreter:\n\nFirst; a function to show some debug info\n\n\ndebug_print(string)\n\n   Debug helper that prints a string to stdout. The string is only printed to\n   stdout if devilspie2 is run with the --debug option, otherwise nothing will\n   be printed.\n\n\n\n\nThen, there's the functions to get the properties of a window, and related\ninformation:\n\n\nget_window_name()\n\n   returns a string containing the name of the current window.\n\n\nget_window_has_name()\n\n   return true or false depending on if the window has a name or not\n   (from version 0.20)\n\n\nget_application_name()\n\n   returns the application name of the current window.\n\n\nget_window_geometry()\n\n   Returns the window geometry as four numbers - x-position, y-position,\n   width and height. (from version 0.16) - for example you can do something\n\tlike this:\n\n\tx, y, width, height = get_window_geometry();\n\tprint(\"X: \"..x..\", Y: \"..y..\", width: \"..width..\", height: \"..height);\n\n\nget_window_client_geometry()\n\n   returns the window geometry excluding the window manager borders as four\n   numbers, x-position, y-position, width and height. (from version 0.16) -\n\tsee get_window_geometry for an example on how to use this function.\n\n\nget_window_is_maximized()\n\n   Returns true if the window is maximized, false otherwise. (available from\n   version 0.21)\n\n\nget_window_is_maximized_vertically()\n\n   Returns true if the window is vertically maximized, false otherwise.\n   (available from version 0.21)\n\n\nget_window_is_maximized_horizontally()\n\n   Returns true if the window is horizontally maximized, false otherwise.\n   (available from version 0.21)\n\n\nget_window_type()\n\n   Returns the type of the window - The result type is a string, and can\n   be one of the following:\n\n   \"WINDOW_TYPE_NORMAL\"\n   \"WINDOW_TYPE_DESKTOP\"\n   \"WINDOW_TYPE_DOCK\"\n   \"WINDOW_TYPE_DIALOG\"\n   \"WINDOW_TYPE_TOOLBAR\"\n   \"WINDOW_TYPE_MENU\"\n   \"WINDOW_TYPE_UTILITY\"\n   \"WINDOW_TYPE_SPLASHSCREEN\"\n\n   or \"WINDOW_TYPE_UNRECOGNIZED\" if libwnck didn't recognize the type.\n\n   If the function for some reason didn't have a window to work on the string\n   result is \"WINDOW_ERROR\".\n\n   (available from version 0.21)\n\n\nget_class_instance_name()\n\n   Gets the class instance name from the WM_CLASS Property for the current\n   window. Only available on libwnck 3+, and in devilspie2 version 0.21 or\n   later.\n\n\nget_window_property(property)\n\n   Returns the window property described in the property string. For a list of\n   available properties, you should see the page\n   http://standards.freedesktop.org/wm-spec/wm-spec-latest.html\n\n   (Available from version 0.21)\n\n\nget_window_role\n\n   Returns a string describing the current window role of the matched window as\n   defined by it's WM_WINDOW_ROLE hint.\n\n\nget_window_xid\n\n   Returns the X window id of the current window.\n\n\nget_window_class\n\n   Returns a string representing the class of the current window.\n\n\nget_workspace_count\n\n\tReturn the number of workspaces available (available from version 0.27)\n\n\nget_screen_geometry\n\n\tReturns the screen geometry (two numbers) for the screen of the\n\tcurrent window (available from version 0.29)\n\n\nget_window_fullscreen\nget_fullscreen\n\n\tReturns TRUE if the window is fullscreen, FALSE otherwise\n\t(available from version 0.32)\n\n\nand the rest of the commands are used to modify the properties of the windows:\n\n\nset_window_position(xpos, ypos)\n\n   Set the position of a window.\n\n\nset_window_position2(xpos, ypos)\n\n   Set the position of a window - Compared to set_window_position, this\n   function uses XMoveWindow instead of wnck_window_set_geometry which\n   gives a slightly different result.\n   (Available from version 0.21)\n\n\nset_window_size (xsize, ysize)\n\n   Sets the size of a window - takes xsize and ysize as parameters.\n\n\nset_window_geometry (xpos, ypos, xsize, ysize)\n\n   Sets both size and position of a window in one command. Takes four\n   parameters, xpos, ypos, xsize and ysize.\n\n\nset_window_geometry2 (xpos, ypos, xsize, ysize)\n\n   Sets the window geometry just as set_window_geometry, using\n   XMoveResizeWindow instead of its libwnck alternative. This results in\n   different coordinates than the set_window_geometry function, and results\n   are more similar to the results of the original devilspie geometry function.\n   (available from version 0.21)\n\n\nmake_always_on_top()\n\n   Sets a window always on top.\n\n\nset_on_top()\n\n   sets a window on top of the others. (unlike make_always_on_top, it doesn't\n   lock the window in this position.)\n\n\nshade()\n\n   \"Shades\" a window, showing only the title-bar.\n\n\nunshade()\n\n   Unshades a window - the opposite of \"shade\"\n\n\nmaximize()\n\n   maximizes a window\n\n\nunmaximize()\n\n   unmaximizes a window\n\n\nmaximize_vertically()\n\n   maximizes the current window vertically.\n\n\nmaximize_horizontally()\n\n   maximizes the current window horizontally.\n\n\nminimize()\n\n   minimizes a window\n\n\nunminimize()\n\n   unminimizes a window, that is bringing it back to screen from the minimized\n   position/size.\n\n\ndecorate_window()\n\n   Shows all window decoration.\n\n\nundecorate_window()\n\n   Removes all window decorations.\n\n\nclose_window()\n\n\tCloses the window. (Available from 0.31)\n\n\nset_window_workspace(number)\n\n   Moves a window to another workspace. The number variable starts counting at\n   1.\n\n\nchange_workspace(number)\n\n   Changes the current workspace to another. The number variable starts counting\n   at 1.\n\n\npin_window()\n\n   asks the window manager to put the window on all workspaces.\n\n\nunpin_window()\n\n   Asks the window manager to put window only in the currently active workspace.\n\n\nstick_window()\n\n   Asks the window manager to keep the window's position fixed on the screen,\n   even when the workspace or viewport scrolls.\n\n\nunstick_window()\n\n   Asks the window manager to not have window's position fixed on the screen\n   when the workspace or viewport scrolls.\n\n\nset_skip_tasklist(skip)\n\n   Set this to true if you would like the window to skip listing in your\n   tasklist. Takes a boolean(true or false) as value. (from version 0.16)\n\n\nset_skip_pager(skip)\n\n   Set this to true if you would like the window to skip listing in your pager.\n   Takes a boolean(true or false) as value. (from version 0.16)\n\n\nset_window_above([above])\n\n   Set the current window above all normal windows. (available from version\n   0.21)\n   Optionally takes a boolean(true or false) as value.\n\n\nset_window_below([below])\n\n   Set the current window below all normal windows. (available from version\n   0.21)\n   Optionally takes a boolean(true or false) as value.\n\n\nset_window_fullscreen(fullscreen)\n\n   Asks the window manager to set the fullscreen state of the window according\n   to the fullscreen boolean. (available from version 0.24)\n\n\nset_viewport(viewport)\n\n   Using one indata, moves the window to the requested viewport - Counting\n\tstarts at number 1. (Available from version 0.25)\n\t- Also see the alternative usage of this function below.\n\nset_viewport(x, y)\n\t\n\tIf you are using two indata to the set_viewport function, you can decide\n\twhere in the viewport the window will be placed.\n\t(Available from version 0.40)\n\ncenter()\n\n   Centers the current window on the current workspace.\n   (Available from version 0.26)\n\n\nset_opacity(value)\nset_window_opacity(value)\n\n\tSets the window opacity, takes a float value, 1.0 = completely opaque,\n\t0.0, completely see-through. Both set_opacity and set_window_opacity\n\twill do the same thing.\n\t(Available from version 0.28, set_window_opacity from 0.29)\n\n\nset_window_type(type)\n\n\tSets the window type, according to _NET_WM_WINDOW_TYPE. The allowed types\n\tare the standard _NET_WM ones (formatted as a string):\n\n\t\"_NET_WM_WINDOW_TYPE_DESKTOP\"\n\t\"_NET_WM_WINDOW_TYPE_DOCK\"\n\t\"_NET_WM_WINDOW_TYPE_TOOLBAR\"\n\t\"_NET_WM_WINDOW_TYPE_MENU\"\n\t\"_NET_WM_WINDOW_TYPE_UTILITY\"\n\t\"_NET_WM_WINDOW_TYPE_SPLASH\"\n\t\"_NET_WM_WINDOW_TYPE_DIALOG\"\n\t\"_NET_WM_WINDOW_TYPE_NORMAL\"\n\n\tor shorter versions of the same values\n\n\t\"WINDOW_TYPE_DESKTOP\"\n\t\"WINDOW_TYPE_DOCK\"\n\t\"WINDOW_TYPE_TOOLBAR\"\n\t\"WINDOW_TYPE_MENU\"\n\t\"WINDOW_TYPE_UTILITY\"\n\t\"WINDOW_TYPE_SPLASH\"\n\t\"WINDOW_TYPE_DIALOG\"\n\t\"WINDOW_TYPE_NORMAL\"\n\n\t(Function is available from version 0.28)\n\nfocus()\nfocus_window()\n\n\tFocuses the current window. (Function is available from version 0.30)\n\n\nset_window_strut(left, right, top, bottom)\n\n\tSet the reserved area at the borders of the desktop for a docking area such\n\tas a taskbar or a panel (available from version 0.32)\n\n\nxy(x, y), xy()\n    Set the position of a window, or if you don't give any input, get the\n    position of a window\n\n\nxywh(x, y, w, h), xywh()\n    Set the position and size of a window, or if you don't give any input, get\n    the position and size of a window.\n\n\nPlease note that strings comparisons are case sensitive, comparing\n\"SomeProgram\" with \"someprogram\" will not report equality.\n\n\nSimple script example\n---------------------\n\n\n---------------------8\u003c---------------------\n\n-- the debug_print command does only print anything to stdout\n-- if devilspie2 is run using the --debug option\ndebug_print(\"Window Name: \" .. get_window_name());\ndebug_print(\"Application name: \" .. get_application_name())\n\n-- I want my Xfce4-terminal to the right on the second screen of my two-monitor\n-- setup. (String comparison are case sensitive, please note this when\n-- creating rule scripts.)\nif (get_window_name() == \"Terminal\") then\n   -- x,y, xsize, ysize\n   set_window_geometry(1600, 300, 900, 700);\nend\n\n-- Make Iceweasel always start maximized.\nif (get_application_name() == \"Iceweasel\") then\n   maximize();\nend\n\n---------------------\u003e8---------------------\n\n\nTranslations\n------------\n\nDevilspie2 is now translatable using gettext - see README.translators for more\ninformation.\n\n\nAuthors\n-------\n\nsee the AUTHORS file\n\n\nContact\n-------\n\nAuthor: Andreas Rönnquist\nE-mail: devilspie2 (at) gusnan (dot) se\nHomepage: http://www.gusnan.se/devilspie2\nMailinglist: devilspie2-discuss@nongnu.org,\n             https://lists.nongnu.org/mailman/listinfo/devilspie2-discuss\n\nIRC: #devilspie2 on irc.freenode.net\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitgnu%2Fgnu_devilspie2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitgnu%2Fgnu_devilspie2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitgnu%2Fgnu_devilspie2/lists"}