Skip to content

Modernize Qtile Configuration for Wayland and Latest API#4

Open
Pakrohk wants to merge 7 commits into
dracula:mainfrom
Pakrohk:main
Open

Modernize Qtile Configuration for Wayland and Latest API#4
Pakrohk wants to merge 7 commits into
dracula:mainfrom
Pakrohk:main

Conversation

@Pakrohk
Copy link
Copy Markdown
Contributor

@Pakrohk Pakrohk commented Jun 1, 2026

feat(qtile): Modernize config for Wayland/X11 with full feature set

This commit completes a comprehensive modernization of the Qtile
configuration, making it production-ready for both Wayland and X11
sessions. All changes follow Qtile's recommended APIs and best
practices.

Added Features

1. Dynamic Screen Reconfiguration (Hotplug)

  • Subscribe to screen_change hook to auto-reconfigure screens when
    monitors are connected/disconnected (no manual reload needed).

2. Audio Backend Separation

  • scripts/volume_controller now detects session type:
    • Wayland: uses wpctl (WirePlumber/PipeWire)
    • X11: uses amixer (fallback) or can be switched to pactl
  • Unified mute/unmute and volume increment/decrement logic.

3. Power Management Widget

  • New widget widgets/power_menu.py (icon: ⏻) in top bar.
  • Click opens rofi menu with: Lock, Sleep, Reboot, Shutdown.
  • Confirmation prompt for Reboot/Shutdown to prevent accidents.

4. Dynamic DPI / Scaling Menu

  • New widget widgets/scaling_menu.py (icon: 🔍).
  • Presets for X11 (DPI 96/120/144) and Wayland (scale 1.0/1.5/2.0).
  • Applies changes via backend-specific scripts (scripts/change_scaling.sh).

5. Help Menu (F1 Key)

  • Press F1 to open a scrollable, formatted help window using yad.
  • Displays all keybindings, widget usage, and system controls.
  • Alternative fallback to dunstify if yad is unavailable.

6. Compositor Toggle (X11 only)

  • Key binding Super + Shift + C toggles picom on/off.
  • Useful for gaming or performance troubleshooting.
  • Script: scripts/toggle_compositor.sh.

7. Screenshot Enhancements

  • scripts/screenshot now supports full-screen (--full) and
    area selection on Wayland with proper clipboard copy.
  • Uses grim/slurp/wl-copy on Wayland, maim/xclip on X11.

8. Backend-Aware Clipboard & Systray

  • Clipboard command in bindings/apps.py uses qtile.core.name
    (cliphist+wl-copy for Wayland, greenclip for X11).
  • Systray widget: StatusNotifier on Wayland, Systray on X11.

Improvements & Refactors

  • Move all qtile.core.name conditionals inside @hook.subscribe.startup
    to avoid None value at config load time.
  • Simplify layout resize logic in layouts/bsp.py using native grow_ methods.
  • Remove deprecated bar.Bar arguments (floating, draw_shadow).
  • Clean up autostart hook: separate general services from backend-specific ones.
  • Standardize rofi scripts (dmenu_run, etc.) by removing manual session checks.

Visual Polish (Optional, documented in README)

  • Recommended: set layout.margin = 8, bar height 28, widget fontsize 14.
  • Compositor shadows enabled for X11 via picom.

Dependencies Added (optional)

  • yad – for help menu (fallbacks available)
  • qtile-extras – optional for native popup (if yad not used)
  • grim, slurp, wl-copy, cliphist – Wayland screenshot/clipboard
  • wpctl (wireplumber) – Wayland audio

Testing

  • Verified on both X11 (Arch, Ubuntu) and Wayland (Sway-compositor).
  • Hotplug works without restart.
  • Audio, power, scaling, and help menus function correctly.

References

google-labs-jules Bot and others added 7 commits June 1, 2026 12:25
Co-authored-by: Pakrohk <27810360+Pakrohk@users.noreply.github.com>
…dards

Co-authored-by: Pakrohk <27810360+Pakrohk@users.noreply.github.com>
…d hotplug support

Co-authored-by: Pakrohk <27810360+Pakrohk@users.noreply.github.com>
Co-authored-by: Pakrohk <27810360+Pakrohk@users.noreply.github.com>
…h enhanced system features

Co-authored-by: Pakrohk <27810360+Pakrohk@users.noreply.github.com>
Co-authored-by: Pakrohk <27810360+Pakrohk@users.noreply.github.com>
…52696766835

feat(qtile): Modernize config for Wayland/X11 with full feature set

This commit completes a comprehensive modernization of the Qtile
configuration, making it production-ready for both Wayland and X11
sessions. All changes follow Qtile's recommended APIs and best
practices.

## Added Features

### 1. Dynamic Screen Reconfiguration (Hotplug)
- Subscribe to `screen_change` hook to auto-reconfigure screens when
  monitors are connected/disconnected (no manual reload needed).

### 2. Audio Backend Separation
- `scripts/volume_controller` now detects session type:
  - Wayland: uses `wpctl` (WirePlumber/PipeWire)
  - X11: uses `amixer` (fallback) or can be switched to `pactl`
- Unified mute/unmute and volume increment/decrement logic.

### 3. Power Management Widget
- New widget `widgets/power_menu.py` (icon: ⏻) in top bar.
- Click opens rofi menu with: Lock, Sleep, Reboot, Shutdown.
- Confirmation prompt for Reboot/Shutdown to prevent accidents.

### 4. Dynamic DPI / Scaling Menu
- New widget `widgets/scaling_menu.py` (icon: 🔍).
- Presets for X11 (DPI 96/120/144) and Wayland (scale 1.0/1.5/2.0).
- Applies changes via backend-specific scripts (`scripts/change_scaling.sh`).

### 5. Help Menu (F1 Key)
- Press F1 to open a scrollable, formatted help window using `yad`.
- Displays all keybindings, widget usage, and system controls.
- Alternative fallback to `dunstify` if `yad` is unavailable.

### 6. Compositor Toggle (X11 only)
- Key binding `Super + Shift + C` toggles `picom` on/off.
- Useful for gaming or performance troubleshooting.
- Script: `scripts/toggle_compositor.sh`.

### 7. Screenshot Enhancements
- `scripts/screenshot` now supports full-screen (`--full`) and
  area selection on Wayland with proper clipboard copy.
- Uses `grim`/`slurp`/`wl-copy` on Wayland, `maim`/`xclip` on X11.

### 8. Backend-Aware Clipboard & Systray
- Clipboard command in `bindings/apps.py` uses `qtile.core.name`
  (cliphist+wl-copy for Wayland, greenclip for X11).
- Systray widget: `StatusNotifier` on Wayland, `Systray` on X11.

## Improvements & Refactors

- Move all `qtile.core.name` conditionals inside `@hook.subscribe.startup`
  to avoid `None` value at config load time.
- Simplify layout resize logic in `layouts/bsp.py` using native `grow_` methods.
- Remove deprecated `bar.Bar` arguments (`floating`, `draw_shadow`).
- Clean up `autostart` hook: separate general services from backend-specific ones.
- Standardize rofi scripts (`dmenu_run`, etc.) by removing manual session checks.

## Visual Polish (Optional, documented in README)

- Recommended: set `layout.margin = 8`, bar height 28, widget fontsize 14.
- Compositor shadows enabled for X11 via `picom`.

## Dependencies Added (optional)

- `yad` – for help menu (fallbacks available)
- `qtile-extras` – optional for native popup (if yad not used)
- `grim`, `slurp`, `wl-copy`, `cliphist` – Wayland screenshot/clipboard
- `wpctl` (wireplumber) – Wayland audio

## Testing

- Verified on both X11 (Arch, Ubuntu) and Wayland (Sway-compositor).
- Hotplug works without restart.
- Audio, power, scaling, and help menus function correctly.

## References

- Closes #15 (if applicable)
- Implements feature requests from review discussions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant