Modernize Qtile Configuration for Wayland and Latest API#4
Open
Pakrohk wants to merge 7 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
screen_changehook to auto-reconfigure screens whenmonitors are connected/disconnected (no manual reload needed).
2. Audio Backend Separation
scripts/volume_controllernow detects session type:wpctl(WirePlumber/PipeWire)amixer(fallback) or can be switched topactl3. Power Management Widget
widgets/power_menu.py(icon: ⏻) in top bar.4. Dynamic DPI / Scaling Menu
widgets/scaling_menu.py(icon: 🔍).scripts/change_scaling.sh).5. Help Menu (F1 Key)
yad.dunstifyifyadis unavailable.6. Compositor Toggle (X11 only)
Super + Shift + Ctogglespicomon/off.scripts/toggle_compositor.sh.7. Screenshot Enhancements
scripts/screenshotnow supports full-screen (--full) andarea selection on Wayland with proper clipboard copy.
grim/slurp/wl-copyon Wayland,maim/xclipon X11.8. Backend-Aware Clipboard & Systray
bindings/apps.pyusesqtile.core.name(cliphist+wl-copy for Wayland, greenclip for X11).
StatusNotifieron Wayland,Systrayon X11.Improvements & Refactors
qtile.core.nameconditionals inside@hook.subscribe.startupto avoid
Nonevalue at config load time.layouts/bsp.pyusing nativegrow_methods.bar.Bararguments (floating,draw_shadow).autostarthook: separate general services from backend-specific ones.dmenu_run, etc.) by removing manual session checks.Visual Polish (Optional, documented in README)
layout.margin = 8, bar height 28, widget fontsize 14.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/clipboardwpctl(wireplumber) – Wayland audioTesting
References