Skip to main content

Scripting extension for NETWM compliant window managers

Project description

Orcsome3 is a port from python2 to python3 and rework of orcsome, which is a scripting extension for NETWM compliant window managers.

Features

  • Written on python3. It means very hackable.

  • Optimization, cpu and memory efficiency are top goals (cffi is used for xlib bindings).

  • Extensive use of python3 syntax to provide easy and expressive eDSL in configuration script.

  • Supports NETWM standards.

  • Very thin wrapper around X. You can use existing xlib background.

Installation

Before installing orcsome3 it is necessary to have the build dependencies installed:

orcsome3 uses the following libraries:

  • libev: Full-featured and high-performance event loop

  • X11

  • Xss: X11 Screen Saver extension client library

  • Xext: Misc X Extension Library

  • gd: GD graphics library

  • MagickWand: C API for ImageMagick

To install them:

Debian/Ubuntu

sudo apt install libev-dev libx11-dev libxss-dev libxext-dev libgd-dev

It is necessary to install ImageMagick7 from source:

sudo apt remove -y imagemagick imagemagick-6-common
sudo apt build-dep -y imagemagick
wget https://imagemagick.org/archive/ImageMagick.tar.gz
mkdir -p ./ImageMagick7
tar xvzf ImageMagick.tar.gz --directory ./ImageMagick7 --strip-components=1
cd ImageMagick7
./configure
make
sudo make install
sudo ldconfig /usr/local/lib

Arch Linux

sudo pacman -S libev libx11 libxss libxext imagemagick

After installing the build dependencies, orcsome3 can be installed:

From PyPI

python3 -m pip install orcsome3

From source

git clone --depth=1 git://github.com/ahsand97/orcsome3.git
cd orcsome3
python3 -m pip install .

orcsome3 installs an executable script “orcsome3” located in ~/.local/bin/orcsome3 at a user level or in /usr/bin/orcsome3 if it was installed as root


Quick start

Some of the functionalities offered are:

  • To bind global hot keys

  • To hide the title bar when a window is maximized

  • To change the icon of a window

Edit ~/.config/orcsome3/rc.py:

from orcsome3.orcsome import get_wm
from orcsome3.orcsome.wm import WM
from pathlib import Path

wm: WM = get_wm()

# Global hotkey
@wm.on_key(keydef="Control + b")
def on_pressed_hotkey() -> None:
    print("Control + b was pressed")

# Change window icon
@wm.on_manage(name="easyeffects", cls="easyeffects")
def on_create_easyeffects() -> None:
    path_imagen: Path = Path("/my/other/icon/icon.svg")
    wm.event_window.set_window_icon(icon=path_imagen)

# Hide title bar when a window is maximized
@wm.on_property_change(properties=["_NET_WM_STATE"])
def window_state_changed() -> None:
    if wm.event_window.maximized_horz and wm.event_window.maximized_vert:
        if wm.event_window.decorated:
            wm.set_window_state(window=wm.event_window, decorate=False)
    else:
        if not wm.event_window.decorated:
            wm.set_window_state(window=wm.event_window, decorate=True)

And start orcsome3. That’s all.

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

orcsome3-0.2.0.tar.gz (35.4 kB view details)

Uploaded Source

File details

Details for the file orcsome3-0.2.0.tar.gz.

File metadata

  • Download URL: orcsome3-0.2.0.tar.gz
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for orcsome3-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f788fc705fc1481e96e3d1238e9680067605aa03d6ce056eca466b9c17198ae7
MD5 8480cdd28c99b8fd86ce130ed69fe044
BLAKE2b-256 65f3d4ec2338f33b560d32a47f28adde1790ff5190fdbcb1f677a0d060a39cb0

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