Skip to main content

This utility is for users using i3wm on their laptops who frequently jump between multiple (multi-)monitor setups.

For example single display output when you are on road, triple-monitor setup at work and two-monitor setup at home.

i3-workscreen executable provided by this package should be triggered by udev rule which will listen for specific events caused by plugging/unplugging display output cable(s) (eg.: HDMI). The utility will then enable configured display outputs and reassign existing workspaces based on your json configuration.

An example of the udev rule is provided in the root of the git repository and should be EDITED by the user and copied to /etc/udev/rules.d/98-monitor-hotplug.rules on you system.

You may also need to execute i3-workscreen in your .i3/config as the udev event is emitted way too early on a system startup before the X.org server is running.

exec --no-startup-id "i3-workscreen"

Installation:

/home/user> pip install git+https://github.com/fogine/i3-workscreen.git

# or

/home/user> pip install i3-workscreen

Dependencies:

  • i3-msg

  • xrandr (xlib)

  • python 3.5

  • logger (write messages into the system log)

Configuration:

/home/user> i3-workscreen -h

usage: i3workscreen.py [-h] [--toggle]

Required configuration file is fetched from:
`$HOME/.config/i3-workscreen/config.json`

optional arguments:
  -h, --help  show this help message and exit
  --toggle    Toggles between mirrored & extended display mode

The bellow configuration example shows setup of maximum of three monitors. In this case eDP-1 is my laptop screen and HDMI-1 & DP-1 are external monitors.

Four scenarios may happen with the configuration:

  1. eDP-1 connected, HDMI-1 & DP-1 disconnected

    In this case all workspaces are assigned to the single screen

  2. eDP-1 connected, HDMI-1 connected, DP-1 disconnected

    In this case workspaces 1-5 belong to eDP-1 and workspaces 6-0 belong to HDMI-1

  3. eDP-1 connected, HDMI-1 disconnected, DP-1 connected

    In this case workspaces 1-5 belong to DP-1 and workspaces 6-0 belong to eDP-1

  4. eDP-1 connected, HDMI-1 connected, DP-1 connected

    In this case workspaces 1-5 belong to DP-1 and workspaces 6-0 belong to HDMI-1. eDP-1 was stolen all workspaces by higher priority outputs and because disableEmptyOutputs=true, eDP-1 display output will be disabled. if the option was set to false, the output would be enabled and you could interact with the connected monitor and i3 would assign to it first empty workspace (workspace without any windows in it)

{
    "disableEmptyOutputs": true,
    "outputs": [
        {
            "name": "eDP-1",
            "workspaces": [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" ]
        },
        {
            "name": "HDMI-1",
            "xrandr": ["--above", "eDP-1"],
            "workspaces": [ "6", "7", "8", "9", "0" ]
        },
        {
            "name": "DP-1",
            "workspaces": ["1", "2", "3", "4", "5"]
        }
    ]
}

Metadata

Release files for i3-workscreen 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for i3-workscreen 1.0.1
File Size Uploaded Provenance Actions
i3-workscreen-1.0.1.tar.gz 7.2 kB Without provenance Details for i3-workscreen-1.0.1.tar.gz

Release files / i3-workscreen-1.0.1.tar.gz

Download URL i3-workscreen-1.0.1.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
298ab0830d9176b839437cf9f01dd34bbc205e0f48d2bd25786c051fd174d66e
BLAKE2b-256 checksum
How to use checksums
594dbfe6c8730127c4fe2b929bd917ed5010ee0d22d7e3ddd9572d5f3660cc88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Security for i3-workscreen 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page