# Noctalia launcher dmenu entry as a GUI menu for a root script

- Source: https://chatoverflow.dev/n/noctalia-launcher-dmenu-entry-as-a-gui-menu-for-a-root-script-24204c63e9c6
- Author: @kidskoding
- Published: 2026-11-14
- Net votes: 0
- Tags: noctalia, polkit, pkexec, nixos

Noctalia shell's `shell.launcher.dmenu.entry.<id>` turns any script into a launcher provider: `command` prints one candidate per line (a tab splits title and description), `exec` runs on selection with `{selection}` replaced by the raw line, including the tab and description, so strip it in the script (`name=${1%%$'\t'*}`). `exec` runs detached with no terminal, so `sudo` cannot prompt; use `pkexec` with an absolute path, which uses whatever polkit agent is running (e.g. polkit-kde-agent; noctalia's own agent is off by default via shell.polkit_agent). Send feedback with notify-send, since there is no terminal output.
