Skip to content

feat(quickshell): add native live window app switcher hud with alt-tab cycling - #1823

Open
anshifmonz wants to merge 3 commits into
mylinuxforwork:mainfrom
anshifmonz:feat/app-switcher
Open

feat(quickshell): add native live window app switcher hud with alt-tab cycling#1823
anshifmonz wants to merge 3 commits into
mylinuxforwork:mainfrom
anshifmonz:feat/app-switcher

Conversation

@anshifmonz

Copy link
Copy Markdown
Contributor

This PR introduces a native, hardware-accelerated Quickshell App Switcher HUD bound to Alt + Tab, providing fast, workspace-scoped window switching with live Wayland window previews and dynamic Matugen theming.

All keybindings and autostart hooks are pre-configured in this PR; it works completely out-of-the-box with zero manual setup.

Changes

  • Improved
  • Bug Fixes
  • Feature
  • Documentation
  • Other

Modified / Added Files:

  • dotfiles/.config/quickshell/overview/modules/appswitcher/ - App switcher QML component & manifest
  • dotfiles/.config/quickshell/overview/services/ - Reactive states & Hyprland client tracking service
  • dotfiles/.config/quickshell/overview/shell.qml - Dedicated switcher shell root
  • dotfiles/.config/hypr/conf/keybindings/default.lua - Pre-wired Alt+Tab IPC bindings
  • dotfiles/.config/ml4w/scripts/ml4w-autostart - Non-blocking daemon autostart with systemd conflict avoidance
  • dotfiles/.config/systemd/user/quickshell-overview.service - Optional user systemd daemon unit

Context

While ML4W already has an excellent full-screen Overview (Super + Tab) spanning all monitors and workspaces, quick micro-switching between applications on the active workspace felt like a missing piece of the daily workflow.

Rather than relying on rofi text lists, this feature adds a modern, macOS/visionOS-inspired acrylic glass carousel built directly on Quickshell and Wayland protocols:

  • Active Workspace Scoped: Only lists windows on your current workspace, sorted by most recent focus history.
  • Auto-Centering Horizontal Carousel: Uses a responsive ListView stage that maintains widescreen (16:10 / 16:9) cards that never clip or squash, even with 10+ windows open.
  • Live Wayland Previews with Icon Fallbacks: Displays real-time window frames via ScreencopyView, with automatic fallback to high-res application desktop icons.
  • Dynamic Matugen Sync: Automatically reads ~/.config/ml4w/colors/primary on startup and on open, so borders, active indicators, and glow accents dynamically match the current wallpaper palette.
  • Intuitive Inputs:
    • Hold Alt + press Tab to cycle
    • Release Alt to instantly focus and switch to the window
    • Also supports arrow keys, Vim keys (H/L), Enter, Esc, mouse clicks, and mouse wheel scrolling.

Performance & Resource Usage

To ensure there is zero CPU/GPU overhead or battery drain:

  • Lazy / On-Demand Screencopy: ScreencopyView.live is bound strictly to GlobalStates.appSwitcherOpen (live: GlobalStates.appSwitcherOpen).
  • Zero Idle Overhead: When the HUD is closed, Wayland screencopy streams are completely suspended and render passes are stopped. The daemon idles at 0.0% CPU and ~70MB resident memory.
  • Event Debouncing: Hyprland window focus events are debounced (20ms) to eliminate redundant hyprctl socket polling during rapid window moves or tiling resizes.

How Has This Been Tested?

  • Tested on Arch Linux/Based Distro (Hyprland + Lua configuration).
  • Tested on Fedora Linux/Based Distro.
  • Tested on openSuse.

Testing steps performed:

  1. Fresh Launch Test: Tested clean configuration load via qs -p dotfiles/.config/quickshell/overview (0 errors, 0 warnings).
  2. Idle & Active Resource Inspection: Monitored CPU via btop during idle (0.0% CPU) and active cycling (<2% momentary frame rendering).
  3. Card Stage Geometry: Cycled between 2, 5, and 12+ windows across multiple workspaces; verified auto-centering and card geometry without clipping.
  4. Theming: Changed wallpapers using ml4w-wallpaper-app; verified that the accent color dynamically reloaded.
  5. Edge Cases: Tested single-window workspaces, minimized/hidden windows, clicking outside the HUD to dismiss, and rapid Alt key release.

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • My changes do not introduce new warnings.
  • Screencopy and rendering are strictly dormant when HUD is closed.
  • Keybindings and autostart are pre-wired and tested.

Additional Notes

The module is completely self-contained in dotfiles/.config/quickshell/overview/ with its own HyprlandData and GlobalStates services, so it doesn't conflict with or depend on external repos. Feedback and tweaks are very welcome!

Demo

app-switcher-demo.mp4

@mylinuxforwork

Copy link
Copy Markdown
Owner

Hi. This is super nice. Dors it also support special workspaces?

I would suggest that you create and maintain an own repo for this.

I can install it then during the setup script. What do you think?

@anshifmonz

Copy link
Copy Markdown
Contributor Author

Hi Stephan,

Glad you like it; It actually didn't support special workspaces before, but I just added full support for them; it now detects active scratchpads properly.

I also went ahead with your suggestion and set up a dedicated repo for it:
https://github.com/anshifmonz/hypr-app-switcher

It comes with an install.sh matching the quickshell-overview setup so it can be pulled easily during installation:

bash <(curl -s https://raw.githubusercontent.com/anshifmonz/hypr-app-switcher/main/install.sh)

And wired in default.lua:

hl.bind("ALT + Tab", hl.dsp.exec_cmd("qs -p ~/.local/share/hypr-app-switcher ipc call app-switcher next"), { description = "Switch applications on active workspace" })

How would you like to handle this PR? I'm happy to update it so it just adds the install hook to the setup scripts and the keybinding, or if you prefer to wire it up on your end, we can go ahead and close this one out.

Cheers!

@mylinuxforwork

Copy link
Copy Markdown
Owner

Thanks again.
I have moved the installer for current quickshell overview to a dedicated repo too.

https://github.com/mylinuxforwork/ml4w-quickshell-overview

You see that I install it into .local/share Maybe this is an approach for you as well.

I will do the same with my status bar and dock.

Will be on vacation the next two weeks. I will continue testing afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants