diff --git a/bin/omarchy-capture-screenshot b/bin/omarchy-capture-screenshot index 682ae65d..eae51f04 100755 --- a/bin/omarchy-capture-screenshot +++ b/bin/omarchy-capture-screenshot @@ -11,7 +11,7 @@ OUTPUT_DIR="${OMARCHY_SCREENSHOT_DIR:-${XDG_PICTURES_DIR:-$HOME/Pictures}}" if [[ ! -d $OUTPUT_DIR ]]; then mkdir -p "$OUTPUT_DIR" - notify-send -a omarchy-action "Created screenshot directory: $OUTPUT_DIR" -u normal -t 2000 + omarchy-notification-send "Created screenshot directory: $OUTPUT_DIR" -t 2000 fi pkill slurp && exit 0 diff --git a/bin/omarchy-capture-text-extraction b/bin/omarchy-capture-text-extraction index 6b304da5..b9b31302 100755 --- a/bin/omarchy-capture-text-extraction +++ b/bin/omarchy-capture-text-extraction @@ -23,4 +23,4 @@ TEXT=$(grim -g "$SELECTION" - | tesseract stdin stdout --oem 1 --psm 6 -l "${OMA [[ -z $TEXT ]] && exit 1 printf "%s" "$TEXT" | wl-copy -notify-send -a omarchy-action "󰴑 Copied text from selection to clipboard" +omarchy-notification-send -g 󰴑 "Copied text from selection to clipboard" diff --git a/bin/omarchy-default-browser b/bin/omarchy-default-browser index 33df4145..10f96736 100755 --- a/bin/omarchy-default-browser +++ b/bin/omarchy-default-browser @@ -37,4 +37,4 @@ xdg-mime default "$desktop_id" x-scheme-handler/http xdg-mime default "$desktop_id" x-scheme-handler/https xdg-mime default "$desktop_id" text/html -notify-send -a omarchy-action -u low "$glyph $name is now the default browser" +omarchy-notification-send -g $glyph "$name is now the default browser" diff --git a/bin/omarchy-default-editor b/bin/omarchy-default-editor index 7a742809..7247ec79 100755 --- a/bin/omarchy-default-editor +++ b/bin/omarchy-default-editor @@ -27,4 +27,4 @@ esac sed -i "s/^export EDITOR=.*/export EDITOR=$editor/" ~/.config/uwsm/default export EDITOR="$editor" -notify-send -a omarchy-action -u low "$glyph $name is now the default editor" " Effective after logging out" +omarchy-notification-send -g $glyph "$name is now the default editor" "Effective after logging out" diff --git a/bin/omarchy-default-terminal b/bin/omarchy-default-terminal index cea4e7f7..af0563ca 100755 --- a/bin/omarchy-default-terminal +++ b/bin/omarchy-default-terminal @@ -33,4 +33,4 @@ cat >~/.config/xdg-terminals.list </dev/null || true -omarchy-notification-send -g "󰯉" "$game_name installed" "Start it with Super + Space" +omarchy-notification-send -g 󰯉 "$game_name installed" "Start it with Super + Space" diff --git a/bin/omarchy-hyprland-toggle b/bin/omarchy-hyprland-toggle index 284dad35..158e28ac 100755 --- a/bin/omarchy-hyprland-toggle +++ b/bin/omarchy-hyprland-toggle @@ -1,35 +1,14 @@ #!/bin/bash # omarchy:summary=Toggle permanent Hyprland flags by copying them into a directory that's sourced entirely. -# omarchy:args=[--enabled-notification ] [--disabled-notification ] [on|off|toggle] +# omarchy:args= [on|off|toggle] -ENABLED_NOTIFICATION="" -DISABLED_NOTIFICATION="" - -while (($# > 0)); do - case $1 in - --enabled-notification) - if (($# < 2)); then - echo "Missing value for $1" >&2 - exit 1 - fi - ENABLED_NOTIFICATION="$2" - shift 2 - ;; - --disabled-notification) - if (($# < 2)); then - echo "Missing value for $1" >&2 - exit 1 - fi - DISABLED_NOTIFICATION="$2" - shift 2 - ;; - *) break ;; - esac -done +usage() { + echo "Usage: omarchy-hyprland-toggle [on|off|toggle]" >&2 +} if (($# < 1)); then - echo "Usage: omarchy-hyprland-toggle [--enabled-notification ] [--disabled-notification ] [on|off|toggle]" >&2 + usage exit 1 fi @@ -42,7 +21,6 @@ on() { if [[ -f $FLAG_SOURCE ]]; then mkdir -p "$(dirname "$FLAG_FILE")" cp "$FLAG_SOURCE" "$FLAG_FILE" - [[ -n $ENABLED_NOTIFICATION ]] && notify-send -a omarchy-action -u low "$ENABLED_NOTIFICATION" else echo "Flag not found: $FLAG_NAME" >&2 exit 1 @@ -51,7 +29,6 @@ on() { off() { rm -f "$FLAG_FILE" - [[ -n $DISABLED_NOTIFICATION ]] && notify-send -a omarchy-action -u low "$DISABLED_NOTIFICATION" } toggle() { @@ -69,7 +46,7 @@ case $ACTION in off) off ;; toggle) toggle ;; *) - echo "Usage: omarchy-hyprland-toggle [--enabled-notification ] [--disabled-notification ] [on|off|toggle]" >&2 + usage exit 1 ;; esac diff --git a/bin/omarchy-hyprland-workspace-layout-toggle b/bin/omarchy-hyprland-workspace-layout-toggle index 39360572..28f76337 100755 --- a/bin/omarchy-hyprland-workspace-layout-toggle +++ b/bin/omarchy-hyprland-workspace-layout-toggle @@ -12,4 +12,4 @@ esac hyprctl eval "hl.workspace_rule({ workspace = \"$ACTIVE_WORKSPACE\", layout = \"$NEW_LAYOUT\" })" >/dev/null 2>&1 || \ hyprctl keyword workspace $ACTIVE_WORKSPACE, layout:$NEW_LAYOUT -notify-send -a omarchy-action -u low "󱂬 Workspace layout set to $NEW_LAYOUT" +omarchy-notification-send -g 󱂬 "Workspace layout set to $NEW_LAYOUT" diff --git a/bin/omarchy-launch-screensaver b/bin/omarchy-launch-screensaver index cee5338b..508fba8a 100755 --- a/bin/omarchy-launch-screensaver +++ b/bin/omarchy-launch-screensaver @@ -47,7 +47,7 @@ for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do hypr_exec "kitty --class=org.omarchy.screensaver --override font_size=18 --override window_padding_width=0 -e omarchy-screensaver" ;; *) - notify-send -a omarchy-action -u low "✋ Screensaver only runs in Alacritty, Foot, Ghostty, or Kitty" + omarchy-notification-send -g ✋ "Screensaver only runs in Alacritty, Foot, Ghostty, or Kitty" ;; esac done diff --git a/bin/omarchy-notification-send b/bin/omarchy-notification-send index db61107c..578ff29c 100755 --- a/bin/omarchy-notification-send +++ b/bin/omarchy-notification-send @@ -1,14 +1,14 @@ #!/bin/bash -# omarchy:summary=Send a desktop notification with Omarchy glyph and body spacing -# omarchy:args= [description] [-g ] [-u ] [notify-send options] +# omarchy:summary=Send an Omarchy desktop notification +# omarchy:args=[-g ] [-u ] [description] [notify-send options] # omarchy:examples=omarchy notification send "Reminder" "5 minutes are up" -g 󰔛 -u critical set -euo pipefail headline="" description="" -glyph="" +glyph= urgency="low" args=() @@ -19,7 +19,7 @@ parse_omarchy_option() { echo "Missing value for $1" >&2 exit 1 fi - glyph="$2" + glyph=$2 return 0 ;; -u | --urgency) @@ -65,16 +65,13 @@ while (($# > 0)); do fi done +if [[ -n $glyph ]]; then + args+=(--hint=string:omarchy-glyph:$glyph) +fi + # Tag as a user-action toast so it pops through DND. See dnd-fix-plan.md. args+=("-a" "omarchy-action" "-u" "$urgency") -# Send the glyph in a summary prefix inline. This keeps the notification -# thin and compact, replicating the old Mako style, because Quickshell won't -# render the 40x40 icon slot if the custom hint isn't present. -if [[ -n $glyph ]]; then - headline="$glyph $headline" -fi - if [[ -n $description ]]; then notify-send "${args[@]}" "$headline" "$description" else diff --git a/bin/omarchy-toggle b/bin/omarchy-toggle index bb3e879c..61370e1d 100755 --- a/bin/omarchy-toggle +++ b/bin/omarchy-toggle @@ -1,27 +1,19 @@ #!/bin/bash # omarchy:summary=Toggle Omarchy features between enabled and disabled -# omarchy:args=[--enabled-notification ] [--disabled-notification ] +# omarchy:args= -ENABLED_NOTIFICATION="" -DISABLED_NOTIFICATION="" - -while [[ $# -gt 1 ]]; do - case $1 in - --enabled-notification) ENABLED_NOTIFICATION="$2"; shift 2 ;; - --disabled-notification) DISABLED_NOTIFICATION="$2"; shift 2 ;; - *) break ;; - esac -done +if (($# < 1)); then + echo "Usage: omarchy-toggle " >&2 + exit 1 +fi FLAG_NAME="$1" FLAG="$HOME/.local/state/omarchy/toggles/$FLAG_NAME" if [[ -f $FLAG ]]; then - rm $FLAG - [[ -n $DISABLED_NOTIFICATION ]] && notify-send -a omarchy-action -u low "$DISABLED_NOTIFICATION" + rm -f "$FLAG" else - mkdir -p "$(dirname $FLAG)" - touch $FLAG - [[ -n $ENABLED_NOTIFICATION ]] && notify-send -a omarchy-action -u low "$ENABLED_NOTIFICATION" + mkdir -p "$(dirname "$FLAG")" + touch "$FLAG" fi diff --git a/bin/omarchy-toggle-idle b/bin/omarchy-toggle-idle index 28eb948d..4b02b919 100755 --- a/bin/omarchy-toggle-idle +++ b/bin/omarchy-toggle-idle @@ -4,10 +4,10 @@ if pgrep -x hypridle >/dev/null; then pkill -x hypridle - notify-send -a omarchy-action -u low "󱫖 Stop locking computer when idle" + omarchy-notification-send -g 󱫖 "Stop locking computer when idle" else uwsm-app -- hypridle >/dev/null 2>&1 & - notify-send -a omarchy-action -u low "󱫖 Now locking computer when idle" + omarchy-notification-send -g 󱫖 "Now locking computer when idle" fi omarchy-shell-ipc --if-running bar refreshIndicators >/dev/null 2>&1 || true diff --git a/bin/omarchy-toggle-nightlight b/bin/omarchy-toggle-nightlight index fa6e49a3..5d52b1b6 100755 --- a/bin/omarchy-toggle-nightlight +++ b/bin/omarchy-toggle-nightlight @@ -17,8 +17,8 @@ CURRENT_TEMP=$(hyprctl hyprsunset temperature 2>/dev/null | grep -oE '[0-9]+') if [[ $CURRENT_TEMP == $OFF_TEMP ]]; then hyprctl hyprsunset temperature $ON_TEMP - notify-send -a omarchy-action -u low " Nightlight screen temperature" + omarchy-notification-send -g  "Nightlight screen temperature" else hyprctl hyprsunset temperature $OFF_TEMP - notify-send -a omarchy-action -u low " Daylight screen temperature" + omarchy-notification-send -g  "Daylight screen temperature" fi diff --git a/bin/omarchy-toggle-screensaver b/bin/omarchy-toggle-screensaver index 681c35ef..a0f74ea7 100755 --- a/bin/omarchy-toggle-screensaver +++ b/bin/omarchy-toggle-screensaver @@ -2,7 +2,10 @@ # omarchy:summary=Toggle screensaver availability -omarchy-toggle \ - --enabled-notification "󱄄 Screensaver disabled" \ - --disabled-notification "󱄄 Screensaver enabled" \ - screensaver-off +if omarchy-toggle-enabled screensaver-off; then + omarchy-toggle screensaver-off + omarchy-notification-send -g 󱄄 "Screensaver enabled" +else + omarchy-toggle screensaver-off + omarchy-notification-send -g 󱄄 "Screensaver disabled" +fi diff --git a/bin/omarchy-toggle-suspend b/bin/omarchy-toggle-suspend index c9ecac0a..22cda36f 100755 --- a/bin/omarchy-toggle-suspend +++ b/bin/omarchy-toggle-suspend @@ -2,7 +2,10 @@ # omarchy:summary=Toggle suspend availability in the system menu -omarchy-toggle \ - --enabled-notification "󰒲 Suspend removed from system menu" \ - --disabled-notification "󰒲 Suspend now available in system menu" \ - suspend-off +if omarchy-toggle-enabled suspend-off; then + omarchy-toggle suspend-off + omarchy-notification-send -g 󰒲 "Suspend now available in system menu" +else + omarchy-toggle suspend-off + omarchy-notification-send -g 󰒲 "Suspend removed from system menu" +fi diff --git a/bin/omarchy-voxtype-install b/bin/omarchy-voxtype-install index 0f712db2..7edc5bcf 100755 --- a/bin/omarchy-voxtype-install +++ b/bin/omarchy-voxtype-install @@ -21,5 +21,5 @@ if gum confirm "Install Voxtype + AI model (~150MB) to enable dictation?"; then voxtype setup systemd omarchy-restart-shell - notify-send -a omarchy-action " Voxtype Dictation Ready" "Hold F9 to dictate (or toggle with Super + Ctrl + X)." -t 10000 + omarchy-notification-send -g  "Voxtype Dictation Ready" "Hold F9 to dictate (or toggle with Super + Ctrl + X)." -t 10000 fi diff --git a/bin/omarchy-windows-vm b/bin/omarchy-windows-vm index 9c1d6c5d..0549d9ac 100755 --- a/bin/omarchy-windows-vm +++ b/bin/omarchy-windows-vm @@ -293,7 +293,7 @@ launch_windows() { echo "Starting Windows VM..." # Send desktop notification - notify-send -a omarchy-action " Starting Windows VM" " This can take 15-30 seconds" -t 15000 + omarchy-notification-send -g  "Starting Windows VM" "This can take 15-30 seconds" -t 15000 if ! docker-compose -f "$COMPOSE_FILE" up -d 2>&1; then echo "❌ Failed to start Windows VM!" diff --git a/default/quickshell/omarchy-shell/plugins/menu/Menu.qml b/default/quickshell/omarchy-shell/plugins/menu/Menu.qml index 54a6f6b7..318b01e9 100644 --- a/default/quickshell/omarchy-shell/plugins/menu/Menu.qml +++ b/default/quickshell/omarchy-shell/plugins/menu/Menu.qml @@ -606,6 +606,7 @@ Item { navStack = [] filterText = "" selectedIndex = 0 + root.evaluateGuards() opened = true rebuildDisplay() loadProviderForMenu(activeMenu) diff --git a/default/quickshell/omarchy-shell/plugins/notifications/Service.qml b/default/quickshell/omarchy-shell/plugins/notifications/Service.qml index b81e2eea..db5f0044 100644 --- a/default/quickshell/omarchy-shell/plugins/notifications/Service.qml +++ b/default/quickshell/omarchy-shell/plugins/notifications/Service.qml @@ -134,8 +134,8 @@ Item { // "Screenshot saved"). The user JUST did something — their feedback // should show. // - urgency=critical AND app_name=notify-send: bare-CLI emergency alerts - // (omarchy-battery-monitor uses this for low-battery; install-time - // scripts for wifi setup, etc.). Trusted because it's almost always + // (omarchy-battery-monitor uses this for low-battery; a few scripts + // use it for emergency failures). Trusted because it's almost always // omarchy or system shell scripts — chat apps set app_name to // their brand (Discord/Slack/Vesktop) which falls outside this rule. function shouldBypassDnd(notification) { @@ -366,7 +366,7 @@ Item { // Invoke the libnotify "default" action on the popup's underlying // notification, if it has one, then dismiss. Clients register the default // action with the canonical identifier "default"; e.g. screenshot toasts - // use `notify-send -A default=Edit` so click-the-card opens the editor. + // use `notify-send -A default=Edit ...` so click-the-card opens the editor. function invokePopupDefault(index) { if (index < 0 || index >= popupModel.count) return var entry = popupModel.get(index) diff --git a/default/quickshell/omarchy-shell/plugins/notifications/components/NotificationCard.qml b/default/quickshell/omarchy-shell/plugins/notifications/components/NotificationCard.qml index 3ef16199..38fe679e 100644 --- a/default/quickshell/omarchy-shell/plugins/notifications/components/NotificationCard.qml +++ b/default/quickshell/omarchy-shell/plugins/notifications/components/NotificationCard.qml @@ -64,8 +64,7 @@ Rectangle { // `appIcon` (-i flag) still get one. readonly property string smallIconSource: image.length > 0 ? image : appIcon readonly property bool hasGlyph: glyph.length > 0 - readonly property bool inlineGlyph: summary.match(/^[^\s]+\s{2,}/) !== null - readonly property bool hasSmallIcon: !mediaMode && !inlineGlyph && (smallIconSource.length > 0 || hasGlyph) + readonly property bool hasSmallIcon: !mediaMode && (smallIconSource.length > 0 || hasGlyph) readonly property bool chromiumDerived: { var source = (app + "\n" + appIcon).toLowerCase() return source.indexOf("chrom") >= 0 || source.indexOf("brave") >= 0 || diff --git a/install/first-run/install-voxtype.hook b/install/first-run/install-voxtype.hook index 8da281b4..ebb7d250 100644 --- a/install/first-run/install-voxtype.hook +++ b/install/first-run/install-voxtype.hook @@ -6,6 +6,6 @@ set -e rm -f "$0" ( - action=$(notify-send " Install Dictation with Voxtype" "Click to install voice dictation for Omarchy." -u critical -A "default=Install") + action=$(notify-send -a omarchy-action -u critical --hint=string:omarchy-glyph: "Install Dictation with Voxtype" "Click to install voice dictation for Omarchy." -A "default=Install") [[ $action == "default" ]] && omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install ) >/dev/null 2>&1 & diff --git a/install/first-run/welcome.sh b/install/first-run/welcome.sh index 3680c0e4..a740846a 100644 --- a/install/first-run/welcome.sh +++ b/install/first-run/welcome.sh @@ -1,4 +1,4 @@ ( - action=$(notify-send " Learn Keybindings" "Super + K for cheatsheet.\nSuper + Space for application launcher.\nSuper + Alt + Space for Omarchy Menu." -u critical -A "default=Open") + action=$(notify-send -a omarchy-action -u critical --hint=string:omarchy-glyph: "Learn Keybindings" "Super + K for cheatsheet.\nSuper + Space for application launcher.\nSuper + Alt + Space for Omarchy Menu." -A "default=Open") [[ $action == "default" ]] && omarchy-menu-keybindings ) >/dev/null 2>&1 & diff --git a/install/first-run/wifi.sh b/install/first-run/wifi.sh index a680b331..9d6667d1 100644 --- a/install/first-run/wifi.sh +++ b/install/first-run/wifi.sh @@ -1,13 +1,13 @@ notify_update() { ( - action=$(notify-send " Update System" "$1" -u critical -A "default=Update") + action=$(notify-send -a omarchy-action -u critical --hint=string:omarchy-glyph: "Update System" "$1" -A "default=Update") [[ $action == "default" ]] && omarchy-launch-floating-terminal-with-presentation omarchy-update ) >/dev/null 2>&1 & } notify_wifi() { ( - action=$(notify-send "󰖩 Click to Setup Wi-Fi" "Tab to navigate, Space to select, ? for help." -u critical -A "default=Setup") + action=$(notify-send -a omarchy-action -u critical --hint=string:omarchy-glyph:󰖩 "Click to Setup Wi-Fi" "Tab to navigate, Space to select, ? for help." -A "default=Setup") [[ $action == "default" ]] && omarchy-launch-wifi ) >/dev/null 2>&1 & }