Skip to main content

A declarative window instantiation utility for x11 sessions, heavily inspired by tmuxp.

Project description

xsessionp

Overview

A declarative window instantiation utility for x11 sessions, heavily inspired by tmuxp.

Compatibility

  • Tested with python 3.8

Installation

From pypi.org

$ pip install xsessionp

From source code

$ git clone https://github.com/crashvb/xsessionp
$ cd xsessionp
$ virtualenv env
$ source env/bin/activate
$ python -m pip install --editable .[dev]

Usage

Define a configuration file(s) containing the desired end state:

# Any value provided at the root level (globals) will propagate to all windows as the default value for that key.
# Globals can be overridden in individual window configurations, or omitted by added a key with a "no_" prefix (e.g.
# no_geometry).
desktop: 0
windows:
- command:
  - /usr/bin/xed
  - --new-window
  focus: true
  geometry: 926x656
  position: 166,492
  # Regular expression to help locate the window
  title_hint: ^Unsaved Document.*
- command:
  - /usr/bin/gnome-terminal
  - --command=tmux
  - --full-screen
  - --hide-menubar
  - --window-with-profile=tmux
  desktop: 1
  # By default, windows are started with a copy of the parent environment, then augmented. Uncomment the line below
  # to augment an empty environment instead.
  #   do_not_copy_environment: true
  environment:
    foo: bar
    asdf: qwer
  geometry: 1174x710
  position: 213,134
  shell: true
  start_directory: /tmp
  title_hint: Terminal

Configurations can be listed using the ls command:

$ xsessionp ls
/home/user/.xsessionp/python-dev.yml

A configuration can be instantiated using the load command:

$ xsessionp load desktop0
Loading: /home/user/.xsessionp/python-dev.yml

To assist with developing configurations, the learn command can be used to graphically select a window and capture metadata:

$ xsessionp learn

windows:
- command: nemo /home/user
  desktop: 0
  geometry: 1236x689
  position: 2210,476

Environment Variables

Variable Default Value Description
XSESSIONP_CONFIGDIR ~/.xsessionp xsessionp configuration directory.

Development

Source Control

Project details


Download files

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

Source Distribution

xsessionp-0.1.0.tar.gz (34.9 kB view details)

Uploaded Source

Built Distribution

xsessionp-0.1.0-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file xsessionp-0.1.0.tar.gz.

File metadata

  • Download URL: xsessionp-0.1.0.tar.gz
  • Upload date:
  • Size: 34.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.3

File hashes

Hashes for xsessionp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c40cb1ce672aaa08adf4add28d5603b809c022158f015e729cd049d26d42232c
MD5 9b76fd855aab02240320c64c53d7cf29
BLAKE2b-256 4374c33332e3c9fb390477f4dd54abe50e0885c22cdf2302ba3e2537098a53d6

See more details on using hashes here.

File details

Details for the file xsessionp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: xsessionp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 43.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.3

File hashes

Hashes for xsessionp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4745f4ae858ed7c554a2a0f8c0d425ae6d1d597a4c48008a1ebe0f49efb4ea23
MD5 afbee90d05406bc70828f6ba780c842f
BLAKE2b-256 6bdae703ab00b6499d8a932c6af0becbd56749ddd811fc87f46c372e30520263

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page