Project

sapristi

0.0
No commit activity in last 3 years
No release in over 3 years
A gem to rule your apps in GNOME workspaces.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.17
~> 6.1.0
~> 2.5.0
~> 1.2.0
~> 4.7.3
~> 0.12.2
~> 10.0
~> 6.0.2
~> 3.10
~> 1.3.1
~> 4.5.2
~> 0.19.0

Runtime

~> 3.4.3
~> 1.1.0
~> 0.0.8
 Project Readme

Sapristi

Maintainability Gem

Sapristi image

An efficient tool to control your multi-monitor, multi-workspace enviroment. Just define your favorite working arragement in ~/sapristi.csv and execute sapristi to load your applications and align them in your favorite fashion.

Installation

Install build dependencies

`$ sudo apt install build-essential ruby-dev libx11-dev libglib2.0-dev libxmu-dev libgtk-3-dev`

Install gem

`$ gem install sapristi`

Usage

sapristi load definitions from default configuration file (~/.sapristi.csv) If default configuration file is not found, it will create an empty one.

-f FILE load your definitions from another file, ie: sapristi -f ~/machine_learning_definitions.csv

-v | --verbose verbose mode

--dry-run dry mode, show your definitions but it doesn't execute them

-g|--group name load definitions tagged with group, ie: sapristi -g social

-h|--help show help

-m|--monitors show available monitors info (including work area size) and exits

-w|--wait-time wait-time-in-seconds set wait time for detecting a window (default: 30)

Configuration example: ~/.sapristi.csv

Title Command Monitor X Y Width Height Workspace Group
subl ~/projects/ruby/sapristi 0% 0% 60% 100% 0 sapristi
terminator --working-directory=~/projects/ruby/sapristi 60% 0% 40% 50% 0 sapristi
zeal 60% 50% 40% 50% 0 sapristi
subl ~/projects/python/stuff 0% 0% 60% 100% 1 python
terminator --working-directory=~/projects/python/stuff 60% 0% 40% 50% 1 python
firefox --new-window https://docs.python.org/3/index.html 60% 50% 40% 50% 1 python
firefox --new-window https://www.gmail.com 0% 0% 50% 100% 2 social
firefox --new-window https://www.slack.com 50% 0% 50% 50% 2 social
firefox --new-window https://www.twitter.com 50% 0% 50% 50% 2 social
sol DP-2 0% 0% 100% 100% 3 games

The configuration file is a CSV file (comma delimited, no separator). First line is the header line, next lines are definitions. Each definition prescribes:

  • How choose a window from the current ones, or how to launch a program to produce the window: Title, Command
  • Which monitor to place it: Monitor
  • Which workspace: Workspace
  • Desired window geometry: X, Y, Width, Height

The table above represents a CSV file like the one below:

Title,Command,Monitor,X,Y,Width,Height,Workspace,Group
,subl ~/projects/ruby/sapristi,,0%,0%,60%,100%,0,sapristi
,terminator --working-directory=~/projects/ruby/sapristi,,60%,0%,40%,50%,0,sapristi
,zeal,,60%,50%,40%,50%,0,sapristi
,subl ~/projects/python/stuff,,0%,0%,60%,100%,1,python
,terminator --working-directory=~/projects/python/stuff,,60%,0%,40%,50%,1,python
,firefox --new-window https://docs.python.org/3/index.html,,60%,50%,40%,50%,1,python
,firefox --new-window https://www.gmail.com,,0%,0%,50%,100%,2,social
,firefox --new-window https://www.slack.com,,50%,0%,50%,50%,2,social
,firefox --new-window https://www.twitter.com,,50%,50%,50%,50%,2,social
,sol,DP-2,0%,0%,100%,100%,3,games

Fields:

  • Title(optional): Regex If defined, sapristi will try to find a window whose title matches the regular expression. Examples:

    • (sapristi) - Sublime
    • Twitter.+Firefox
    • System Monitor
  • Command(optional): A command. If Title is not provided or there isn't a window that matches it, sapristi will execute Command. Examples:

    (Every line has to define a Title, OR a Command or both)

  • Monitor(optional): Monitor name (check your monitor names with xrandr) If a definition specifies a monitor not present or if is empty, window will be placed in the main monitor of the actual environment.

    • Use monitor when specified.
    • Use main monitor if monitor name is not found.
    • Use main monitor if Monitor is not provided.
  • X(mandatory): Absolute or relative. Horizontal top left coordinate to place the window:

    • Absolute (monitor width): ie 100, 200, 250.
    • Relative (monitor workarea): 10%, 20%, 50%. Percentage has to be an integer between 0 and 100.
  • Y(mandatory): Absolute or relative. Vertical top left coordinate to place the window:

    • Absolute (monitor monitor height): ie 100, 200, 250.
    • Relative (monitor workarea): 10%, 20%, 50%. Percentage has to be an integer between 0 and 100.

    The work area should be considered when positioning menus and similar popups, to avoid placing them below panels, docks or other desktop components. workarea image

  • Width(mandatory): Absolute (pixels) or relative (workarea) Window width. Examples: 100, 50%.

  • Height(mandatory): Absolute (pixels) or relative (workarea) Window height. Examples: 100, 50%.

  • Workspace(optional): Workspace/desktop to place the window, current workspace if it is not defined. Examples: 0, 1, 5.

Requirements

Linux

See ruby-wmctrl (libx11-dev libglib2.0-dev libxmu-dev) and Ruby/GTK (libgtk-3-dev) gem requirements.

Caveats

Some programs use a main/server process to optimize their use of system resources. When you launch them, it is not possible to correlate the pid of the seed process with the pid of the window, Sapristi uses an heuristic approach to detect window instantiated under this type of strategy.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/sapristi-tool/sapristi.

License

Please see LICENSE for personal usage and COMM-LICENSE for commercial usage.

Credits

Photo by Dan Freeman on Unsplash