case "${1:-menu}" in grid|monocle|tabbed|scrolling) hyprctl eval "desktop.layout_set(\"$1\")" ;; cycle) hyprctl eval 'desktop.layout_cycle()' ;; dual) hyprctl eval 'desktop.display_profile(true)' ;; solo) hyprctl eval 'desktop.display_profile(false)' ;; hdr) hyprctl eval 'desktop.hdr_toggle()' ;; wake) hyprctl eval 'desktop.wake()' ;; sleep) hyprctl eval 'hl.dispatch(hl.dsp.dpms({action="disable"}))' ;; status) exec desktop-panel --once ;; help) hyprctl -j binds | jq -r 'map(select(.description != "")) | .[] | ([if (.modmask % 128 >= 64) then "Super" else empty end, if (.modmask % 8 >= 4) then "Ctrl" else empty end, if (.modmask % 16 >= 8) then "Alt" else empty end, if (.modmask % 2 == 1) then "Shift" else empty end, .key] | join("+")) + " - " + .description' | wofi --dmenu --prompt 'Shortcuts' --width 750 --height 650 >/dev/null ;; menu) choice=$(printf '%s\n' 'Grid' 'Monocle' 'Tabs' 'Scroll' 'Dual monitors' 'OLED only' 'Toggle HDR' 'Retrain LG HDMI' 'Lock' 'Suspend' 'Log out' | wofi --dmenu --prompt 'Desktop') || exit 0 case "$choice" in Grid) desktopctl grid ;; Monocle) desktopctl monocle ;; Tabs) desktopctl tabbed ;; Scroll) desktopctl scrolling ;; 'Dual monitors') desktopctl dual ;; 'OLED only') desktopctl solo ;; 'Toggle HDR') desktopctl hdr ;; 'Retrain LG HDMI') desktopctl wake ;; Lock) hyprlock ;; Suspend) systemctl suspend ;; 'Log out') uwsm stop ;; esac ;; *) echo 'Usage: desktopctl {grid|monocle|tabbed|scrolling|cycle|dual|solo|hdr|wake|sleep|status|help|menu}' >&2; exit 2 ;; esac