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 module 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 module 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 module 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:
- 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,Pycharm) - It simplifies supplying arguments (
terminal) - Some applications need 2 or more windows to be moved (
jupyter-lab) Currently, we have functions for launching:
gnome-terminalfirefoxjupyter_labtexstudiopycharm
All these functions return the IDs of windows they create so they can be further positioned on monitors using the functions from displays.
Installation
Requirements
tested with Gnome 3.34.1 on Ubuntu 19.10
python3 -m pip install launch_on_workspace
Usage 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 | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file launch_on_workspace-1.1.1.tar.gz.
File metadata
- Download URL: launch_on_workspace-1.1.1.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f789dbe3036f40680db545aa83577174d6fcbf94e6ff8a1f586ae355ebe9237
|
|
| MD5 |
2eb016e0b4faf436217bc0f1dbac9a2b
|
|
| BLAKE2b-256 |
9b3ad1684921a18a3e71cbcb826c50c48e812a4ca33421ff06dbb2ae8f956dd7
|
File details
Details for the file launch_on_workspace-1.1.1-py3-none-any.whl.
File metadata
- Download URL: launch_on_workspace-1.1.1-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8b1928ce2409c28453d6c820d92cd322b84a68176732f9826a182d05ab61420
|
|
| MD5 |
b906ce3771ab314f5f9f724f3f205149
|
|
| BLAKE2b-256 |
1fd515706fe986920e2d562546df47f74d40551b1a001034381f3fe9774f7b86
|