Skip to main content

Launch applications on a given workspace and given monitor in Linux

Project description

Launch-on-workspace

Launch applications on a specified workspace in Linux.

The script launcher implements several useful functions that can launch (in a scriptable manner) applications on designated workspaces on X in Linux. Relies on wmctrl to manipulate windows on workspaces.

The scripts displays moves windows to displays in similar manner. Right now it relies on xrandr to get mapping of displays to workspace coordinates. You can use it even without xrandr by supplying the right coordinates for wmctrl by yourself.

The script custom_launchers uses the functionality of launcher to provide functions that launch specific programs. They serve as an easy abstraction from some implementation details for non-standard situations. The motivation for these is threefold:

  1. Some programs need carefull treatment as they (a) use some temporary window at startup and we actually want to move the second one (texstudio), or (b) you usually have some other instances running in the system and no new process is created (firefox)
  2. It simplifies supplying arguments (terminal)
  3. Some applications need 2 or more windows to be moved (jupyter-lab) Currently, we have functions for launching:
  • gnome-terminal
  • firefox
  • jupyter_lab
  • texstudio All these functions return the IDs of windows they create so they can be further positioned on monitors using the functions from displays.

Requirements

tested with Gnome 3.34.1 on Ubuntu 19.10

Examples

The following command launches a new window of Firefox that opens YouTube on workspace 2 (in wmctrl) which is a workspace 3 in Gnome. It is then moved to display connected to DisplayPort#1 (name "DP-1" in xrandr) and switched to fullscreen mode.

import launch_on_workspace as low

wid = low.firefox(2, "youtube.com")
low.move_win_to_display(wid, "DP-1", "full")

The following command opens a gedit on workspace 4 in Gnome

low.launch_and_move(['gedit'], 3)

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for launch-on-workspace, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size launch_on_workspace-1.0.0-py3-none-any.whl (10.1 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size launch_on_workspace-1.0.0.tar.gz (6.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page