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
  hints:
    name: ^Unsaved Document.*
  position: 166,492
  # Regular expression to help locate the window
- 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.
  #   copy_environment: false
  environment:
    foo: bar
    asdf: qwer
  geometry: 1174x710
  hint_method: OR
  hints:
    class: Gnome-terminal
    name: Terminal
  position: 213,134
  shell: true
  start_directory: /tmp

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.1.tar.gz (37.0 kB view details)

Uploaded Source

Built Distribution

xsessionp-0.1.1-py3-none-any.whl (44.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xsessionp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0971790e81a8bb6fcf4b64dbb05a54ed98a18f0e70904cd808cb6ad441f8ddf0
MD5 e7b7fa2c87d84260a51dab8e42f15890
BLAKE2b-256 c848214ab9e7756520c140800991be5b7c5db0a84e13434e260e63de129e9a47

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for xsessionp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fff2b6c341cb372536b493dff5cfd3f461dbc0cdab815331c0ae3fe4f360b0af
MD5 66ec2edce611ff4be8c348663c293c96
BLAKE2b-256 df4f3eb7984159ab59f65a641db60552515ca9f95e0312be90e6f69a70cc4105

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