Skip to content

Commit d62dd4d

Browse files
committed
Updated documentation
1 parent 8909129 commit d62dd4d

3 files changed

Lines changed: 21 additions & 13 deletions

File tree

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# EWMHlib
2-
[![CI](https://github.com/Kalmat/EWMHlib/actions/workflows/ci.yml/badge.svg)](https://github.com/Kalmat/EWMHlib/actions/workflows/ci.yml)
3-
[![PyPI version](https://badge.fury.io/py/ewmhlib.svg)](https://badge.fury.io/py/ewmhlib)
2+
[![CI](https://github.com/Kalmat/EWMHlib/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Kalmat/EWMHlib/actions/workflows/ci.yml)
3+
[![PyPI version](https://badge.fury.io/py/EWMHlib.svg)](https://badge.fury.io/py/EWMHlib)
44
[![Documentation Status](https://readthedocs.org/projects/ewmhlib/badge/?version=latest)](https://ewmhlib.readthedocs.io/en/latest/?badge=latest)
5+
[![Downloads](https://static.pepy.tech/badge/ewmhlib/month)](https://pepy.tech/project/ewmhlib)
6+
[![Stars](https://img.shields.io/github/stars/Kalmat/EWMHlib?style=flat)](https://github.com/Kalmat/EWMHlib/stargazers)
7+
[![License](https://img.shields.io/badge/license-BSD%203--Clause-blue)](LICENSE.txt)
58

69
A complete [EWMH](https://specifications.freedesktop.org/wm-spec/latest/) (Extended Window Manager Hints) implementation in Python 3 and python-xlib. Provides full, Pythonic access to the EWMH spec — query and control any compliant Window Manager, manage window hints, and subscribe to X events.
710

811
**Tested on:** Ubuntu/GNOME · Mint/Cinnamon · Manjaro/KDE · Raspbian/LXDE
912

10-
> **⚠️ Wayland note:** The new protocol used by GNOME in Ubuntu (Wayland) is not EWMH-compliant. Many features will not work under Wayland.
13+
> **⚠️ Wayland note:** The new protocol used by GNOME in Ubuntu (Wayland) is not EWMH-compliant. This module is likely not working under Wayland.
1114
1215
---
1316

docs/source/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,18 @@
4242

4343
# -- Copy the modules documentation ------------------------------------------
4444
# https://stackoverflow.com/questions/66495200/is-it-possible-to-include-external-rst-files-in-my-documentation
45+
from urllib.request import urlretrieve
46+
import os
47+
4548
urlretrieve(
4649
"https://raw.githubusercontent.com/kalmat/ewmhlib/master/README.md",
4750
"index.md"
4851
)
52+
53+
os.mkdir("docs")
54+
os.chdir("docs")
4955
urlretrieve(
5056
"https://raw.githubusercontent.com/kalmat/ewmhlib/master/docs/docstrings.md",
5157
"docstrings.md"
5258
)
59+
os.chdir("..")

tests/test_ewmhlib.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
import sys
21
import time
32

43
import Xlib.protocol
54
import Xlib.X
65

7-
sys.path.insert(0, "../src/")
8-
from ewmhlib import Props, getDisplaysInfo, EwmhRoot, EwmhWindow
6+
import ewmhlib
97

108

119
def main() -> None:
1210
print("ALL DISPLAYS")
13-
print(getDisplaysInfo())
11+
print(ewmhlib.getDisplaysInfo())
1412

15-
root = EwmhRoot()
13+
root = ewmhlib.EwmhRoot()
1614

1715
print("DESKTOP LAYOUT")
1816
print(root.getDesktopLayout())
@@ -55,7 +53,7 @@ def main() -> None:
5553
if w:
5654
print("REQ FRAME EXTENTS")
5755
print(root.requestFrameExtents(w))
58-
win = EwmhWindow(w)
56+
win = ewmhlib.EwmhWindow(w)
5957
name = win.getName()
6058
print("NAME", name)
6159
visName = win.getVisibleName()
@@ -94,16 +92,16 @@ def callback(event: Xlib.protocol.rq.Event):
9492
print("MOVING/RESIZING")
9593
root.setMoveResize(w, x=100, y=100, width=800, height=600, userAction=True) # Equivalent to win.setMoveResize()
9694
print("BELOW ON")
97-
win.changeWmState(Props.StateAction.ADD, Props.State.BELOW)
95+
win.changeWmState(ewmhlib.Props.StateAction.ADD, ewmhlib.Props.State.BELOW)
9896
time.sleep(4)
9997
print("BELOW OFF")
100-
win.changeWmState(Props.StateAction.REMOVE, Props.State.BELOW)
98+
win.changeWmState(ewmhlib.Props.StateAction.REMOVE, ewmhlib.Props.State.BELOW)
10199
time.sleep(4)
102100
print("DESKTOP")
103-
win.setWmWindowType(Props.WindowType.DESKTOP)
101+
win.setWmWindowType(ewmhlib.Props.WindowType.DESKTOP)
104102
time.sleep(4)
105103
print("NORMAL")
106-
win.setWmWindowType(Props.WindowType.NORMAL)
104+
win.setWmWindowType(ewmhlib.Props.WindowType.NORMAL)
107105
print("MAX HORZ ON")
108106
win.setMaximized(True, False)
109107
time.sleep(4)

0 commit comments

Comments
 (0)