Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

wledges

Active edges for Wayland compositors.

You might also be interested in wlosd which provides on-screen display for Wayland compositors.

Supported Desktops

Tested on Sway, but should work on all Wayland compositors that support the Layer Shell protocol. More precisely, it should work on all desktops supported by gtk4-layer-shell.

Installation

Dependencies:

Debian/Ubuntu:

sudo apt install libgirepository-1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-4.0 libgtk4-layer-shell-dev
pip install pygobject

Fedora:

sudo dnf install gcc gobject-introspection-devel cairo-gobject-devel pkg-config python3-devel gtk4 gtk4-layer-shell-devel
pip install pygobject

Arch Linux:

sudo pacman -S python cairo pkgconf gobject-introspection gtk4 gcc gtk4-layer-shell
pip install pygobject

For other distributions, you will need:

Install wledges:

From PyPi:

pip install wledges

Or clone this repository.

Usage

wledges allocates for each screen edge, and corner, specified on the command line, a rectangular area of the specified size. Every time the mouse cursor interacts with those areas (moves in, clicked on, scrolled on) wledges prints a line to standard output. The line indicates which edge or corner was interacted with, and what was the interaction.

For example, running the following command in a terminal allocates a 1 pixel active line, 30% the length of the screen, at the top (centre) of the DP-1 output, and a 1 by 1 active pixel at the top-left corner of the screen.

wledges --top 30%x1 --top-left 1x1 DP-1

The command displays a slightly bigger rectangle (30%x50) to indicate that this edge is active. The --css command line argument can be used to pass a GTK4 style sheet (see style.css for example, and overview and properties for documentation), that can be used to style the indicator, to make it less obtrusive. In any case, only input events from the (smaller) active area are captured by wledges; other events are sent to the window below.

Moving the mouse cursor to the very top of the screen (being inside the displayed 30%x50 rectangle is not enough, the cursor must be in the 30%x1 active area) first prints (after a delay of 0.75 seconds) "top timeout", and then repeatedly (every 0.75 second) "top repeat", until the cursor is moved out of the rectangle. Clicking the mouse left button while the cursor is in the active rectangle prints "top press-1", and similarly for the other mouse buttons. Scrolling the mouse wheel prints "top scroll-DIRECTION" where DIRECTION is one of up, down, left, right. Clicking or scrolling the mouse also cancels the timeout and repeat lines, until the cursor moves out of the active area, and comes back in.

If you are using Sway, the following Bash script can be used to switch workspaces when the mouse cursor touches the left or right edges of the screen (change the first line to match your output, see swaymsg -t get_outputs for a list of outputs):

output='DP-1'

while IFS=' ' read -r line; do
  case "${line}" in
    left\ timeout | left\ repeat)
      swaymsg "focus output ${output} ; workspace prev_on_output"
      ;;
    right\ timeout | right\ repeat)
      swaymsg "focus output ${output} ; workspace next_on_output"
      ;;
  esac
done < <(python -m wledges --left 1x50% --right 1x50% "${output}")

License

MIT, see LICENSE

Metadata

Release files for wledges 1b1

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

Source distribution (sdist)

Source distribution for wledges 1b1
File Size Uploaded Provenance Actions
wledges-1b1.tar.gz 9.9 kB Without provenance Details for wledges-1b1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wledges 1b1
File Interpreter ABI Platform Actions
wledges-1b1-py3-none-any.whl Python 3 none any Details for wledges-1b1-py3-none-any.whl

Total release size: 18.3 kB

Release files / wledges-1b1.tar.gz

Download URL wledges-1b1.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cc0e6a9178d0e4b1bcae1d56eaafe26c37cd6300b8aa590d00d3674a8e370545
BLAKE2b-256 checksum
How to use checksums
5344ee0c8edc8d55310f359f0f5d3f2a208173f026dc26811bcf74878f1eb069
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.9

Release files / wledges-1b1-py3-none-any.whl

Download URL wledges-1b1-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b90cd6ebafc8675eb49b43b66d724c847e23461b6666fe97879a8c400d54dee1
BLAKE2b-256 checksum
How to use checksums
c36ce0bbf0c04b51c8d9a1a095e9455e18eef70873dbaefa90ca88b5af893873
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.9

Security for wledges 1b1

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
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