· Ashlin Darius Govindasamy · 6 min read

I cloned macOS Force Quit for Linux (and made Super+Alt+Esc work on Wayland)

If you've used a Mac, you know ⌘+⌥+esc. An app freezes, you press it, a small window lists your apps, you click Force Quit, and you're back to work. When I moved to Ubuntu, I missed that window more than anything else from macOS.

Linux has ways to kill apps (I go through all of them in this guide), but nothing as quick. So I built one: Force Quit Applications for Linux, opened with Super+Alt+Esc.

The Force Quit Applications window running on Ubuntu 26.04
Running on Ubuntu 26.04 with GNOME 50 on Wayland.

The hard part: Wayland won't list windows

On X11 you'd just ask the X server for every window and its PID. That's how xkill and wmctrl work. Wayland deliberately doesn't allow this: a client can see only its own windows. That's good for security, but it means a Force Quit app can't simply ask what's open.

The answer was systemd. When GNOME Shell launches an app, it puts the app in its own transient systemd scope, named after the app's desktop file:

$ cat /proc/23213/cgroup
0::/user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-org.gnome.Calculator-23213.scope

That unit name contains org.gnome.Calculator, which maps straight to org.gnome.Calculator.desktop, which gives the app's name and icon. So the plan is to read /proc/*/cgroup for every process you own and group them by app. No compositor access needed.

The edge cases

Killing it like a Mac does

macOS Force Quit doesn't politely ask the app to close. It sends SIGKILL. This tool does the same: it collects the app's processes and all of their descendants, then kills them. A frozen app can't ignore SIGKILL, and that's why it works.

Confirmation dialog: Do you want to force AnyDesk to quit?
The same confirmation as on the Mac, with the app's icon.

Making GTK 4 look like macOS

The UI is a single GTK 4 window with custom CSS: traffic-light buttons, a #ececec window background, a white list with the #0064e1 selection blue, and a gradient default button. One surprise: my own ~/.config/gtk-4.0/gtk.css (an Orchis theme) loads at user priority, which beats normal application CSS. Loading the stylesheet at STYLE_PROVIDER_PRIORITY_USER + 1 keeps the Mac look on any theme.

Details copied from the Mac:

Binding Super+Alt+Esc

install.sh adds a GNOME custom keybinding through gsettings. It appends to your existing custom shortcuts instead of replacing them. Super+Alt+Esc is free on stock GNOME: Alt+Esc cycles windows and Super+Esc restores shortcuts, but the combination of all three isn't taken.

Try it: git clone https://github.com/adgsenpai/AppleLinuxLikeForceQuit && cd AppleLinuxLikeForceQuit && ./install.sh
Source and issues on GitHub. A ⭐ helps other people find it.