Devilspie 2

window-matching utility, allowing the user to perform scripted actions on X11 windows as they are created: position a window on a specific workspace.

Cost / License

  • Free
  • Open Source

Platforms

  • Linux  Debian package name: devilspie2.
-
No reviews
2likes
0comments
0news articles

Features

Suggest and vote on features
  1.  Support for scripting
  2.  X server
  3.  Lua scripting
  4.  Workflow Automation

Devilspie 2 News & Activities

Highlights All activities

Recent activities

Show all activities

Devilspie 2 information

  • Developed by

    GB flagDarren Salt
  • Licensing

    Open Source (GPL-3.0) and Free product.
  • Written in

  • Alternatives

    3 alternatives listed
  • Supported Languages

    • English

AlternativeTo Categories

Office & ProductivityOS & Utilities

GitHub repository

  •  203 Stars
  •  19 Forks
  •  18 Open Issues
  •   Updated  
View on GitHub
Devilspie 2 was added to AlternativeTo by ab1 on and this page was last updated .
No comments or reviews, maybe you want to be first?
Post comment/review

What is Devilspie 2 ?

If you don't give devilspie2 any folder with --folder, it will read Lua scripts from the folder that it gets from the GLib function g_get_user_config_dir with devilspie2/ added to the end - g_get_user_config_dir returns the config directory as defined in the XDG Base Directory Specification. In most cases would be the ~/.config/devilspie2/ folder, and this folder will be created if it doesn't already exist. This folder is changeable with the --folder option. If devilspie2 doesn't find any Lua files in the folder, it will stop execution.

Devilspie2 will load all the Lua files in this folder in alphabetical order.

Config

A config is read from the folder where we read all scripts, and is customizable by the --folder option. By default this folder is ~/.config/devilspie2/.

If there is a file named devilspie2.lua in this folder, it is read and it is searched for a variable (a lua table of strings) named either scripts_window_close, scripts_window_focus or scripts_window_blur - The filenames in the strings in this table will be called when windows are closed, focused or blurred respectively. If these variables isn't present in this file, it will be called as a devilspie2 script file like any other.

For example:

-- scripts_window_close = { "file1.lua", "file2.lua" }

This would make the files file1.lua and file2.lua interpreted when windows are closing instead of when windows are opening.

Scripting

You can choose to have all script functionality in one file, or you can split it up into several, Devilspie2 runs on all Lua files in your requested devilspie2 folder, by default ~/.config/devilspie2 - that is all files with a .lua extension.

The scripting language used is Lua; www.lua.org/

FAQ: https://www.lua.org/FAQ.html Documentation: https://www.lua.org/docs.html Tutorials: http://lua-users.org/wiki/TutorialDirectory

Please note that strings comparisons are case sensitive, comparing "SomeProgram" with "someprogram" will not report equality.

Simple script example

-- the debug_print command does only print anything to stdout -- if devilspie2 is run using the --debug option debug_print("Window Name: " .. get_window_name()); debug_print("Application name: " .. get_application_name())

-- I want my Xfce4-terminal to the right on the second screen of my two-monitor -- setup. (String comparison are case sensitive, please note this when -- creating rule scripts.) if (get_window_name() == "Terminal") then -- x,y, xsize, ysize set_window_geometry(1600, 300, 900, 700); end

-- Make Firefox always start maximized. if (get_application_name() == "Firefox") then maximize(); end

Contact Author: Darren Salt IRC: #devilspie2 on irc.libera.chat

Official Links