#!/bin/bash # omarchy:summary=Launch the Omarchy Menu or takes a parameter to jump straight to a submenu. # Set to true when going directly to a submenu, so we can exit directly BACK_TO_EXIT=false back_to() { local parent_menu="$1" if [[ $BACK_TO_EXIT == "true" ]]; then exit 0 elif [[ -n $parent_menu ]]; then "$parent_menu" else show_main_menu fi } toggle_existing_menu() { if pgrep -f "walker.*--dmenu" >/dev/null; then walker --close >/dev/null 2>&1 exit 0 fi } menu() { local prompt="$1" local options="$2" local extra="$3" local preselect="$4" read -r -a args <<<"$extra" if [[ -n $preselect ]]; then local index index=$(echo -e "$options" | grep -nxF "$preselect" | cut -d: -f1) if [[ -n $index ]]; then args+=("-c" "$index") fi fi echo -e "$options" | omarchy-launch-walker --dmenu --width 295 --minheight 1 --maxheight 630 -p "$prompt…" "${args[@]}" 2>/dev/null } terminal() { xdg-terminal-exec --app-id=org.omarchy.terminal "$@" } present_terminal() { omarchy-launch-floating-terminal-with-presentation $1 } open_in_editor() { notify-send -u low "Editing config file" "$1" omarchy-launch-editor "$1" } install() { present_terminal "echo 'Installing $1...'; omarchy-pkg-add $2" } install_and_launch() { present_terminal "echo 'Installing $1...'; omarchy-pkg-add $2 && setsid gtk-launch $3" } install_font() { present_terminal "echo 'Installing $1...'; omarchy-pkg-add $2 && sleep 2 && omarchy-font-set '$3'" } install_terminal() { present_terminal "omarchy-install-terminal $1" } aur_install() { present_terminal "echo 'Installing $1 from AUR...'; omarchy-pkg-aur-add $2" } aur_install_and_launch() { present_terminal "echo 'Installing $1 from AUR...'; omarchy-pkg-aur-add $2 && setsid gtk-launch $3" } show_learn_menu() { case $(menu "Learn" " Keybindings\n Omarchy\n Hyprland\n󰣇 Arch\n Neovim\n󱆃 Bash") in *Keybindings*) omarchy-menu-keybindings ;; *Omarchy*) omarchy-launch-webapp "https://learn.omacom.io/2/the-omarchy-manual" ;; *Hyprland*) omarchy-launch-webapp "https://wiki.hypr.land/" ;; *Arch*) omarchy-launch-webapp "https://wiki.archlinux.org/title/Main_page" ;; *Bash*) omarchy-launch-webapp "https://devhints.io/bash" ;; *Neovim*) omarchy-launch-webapp "https://www.lazyvim.org/keymaps" ;; *) show_main_menu ;; esac } show_trigger_menu() { case $(menu "Trigger" "󰔛 Reminder\n Capture\n󰧸 Transcode\n Share\n󰔎 Toggle\n Hardware") in *Reminder*) show_reminder_menu ;; *Capture*) show_capture_menu ;; *Transcode*) omarchy-transcode || back_to show_trigger_menu ;; *Share*) show_share_menu ;; *Toggle*) show_toggle_menu ;; *Hardware*) show_hardware_menu ;; *) show_main_menu ;; esac } show_reminder_menu() { case $(menu "Reminder" "󰔛 Set one\n󰔛 Show all\n󰔛 Clear all") in *Set*) show_custom_reminder_input ;; *"Show all"*) omarchy-reminder show ;; *"Clear all"*) omarchy-reminder clear ;; *) back_to show_trigger_menu ;; esac } show_custom_reminder_input() { local minutes minutes=$(omarchy-menu-input "Remind in minutes") if [[ $minutes =~ ^[0-9]+$ ]] && ((minutes > 0)); then show_reminder_message_input "$minutes" elif [[ -n $minutes ]]; then omarchy-notification-send "󰔛" "Invalid reminder" "Enter the number of minutes" -u critical show_custom_reminder_input else back_to show_reminder_menu fi } show_reminder_message_input() { local minutes="$1" local message message=$(omarchy-menu-input "Reminder message") if [[ -n $message ]]; then omarchy-reminder "$minutes" "$message" else omarchy-reminder "$minutes" fi } show_capture_menu() { case $(menu "Capture" " Screenshot\n Screenrecord\n󰴑 Text Extraction\n󰃉 Color") in *Screenshot*) omarchy-capture-screenshot ;; *Screenrecord*) show_screenrecord_menu ;; *Text*) omarchy-capture-text-extraction ;; *Color*) pkill hyprpicker || hyprpicker -a ;; *) back_to show_trigger_menu ;; esac } get_webcam_list() { v4l2-ctl --list-devices 2>/dev/null | while IFS= read -r line; do if [[ $line != $'\t'* && -n $line ]]; then local name="$line" IFS= read -r device || break device=$(echo "$device" | tr -d '\t' | head -1) [[ -n $device ]] && echo "$device $name" fi done } show_webcam_select_menu() { local devices=$(get_webcam_list) local count=$(echo "$devices" | grep -c . 2>/dev/null || echo 0) if [[ -z $devices ]] || ((count == 0)); then notify-send "No webcam devices found" -u critical -t 3000 return 1 fi if ((count == 1)); then echo "$devices" | awk '{print $1}' else menu "Select Webcam" "$devices" | awk '{print $1}' fi } show_screenrecord_menu() { omarchy-capture-screenrecording --stop-recording && exit 0 case $(menu "Screenrecord" " With no audio\n With desktop audio\n With desktop + microphone audio\n With desktop + microphone audio + webcam") in *"With no audio") omarchy-capture-screenrecording ;; *"With desktop audio") omarchy-capture-screenrecording --with-desktop-audio ;; *"With desktop + microphone audio") omarchy-capture-screenrecording --with-desktop-audio --with-microphone-audio ;; *"With desktop + microphone audio + webcam") local device=$(show_webcam_select_menu) || { back_to show_capture_menu return } omarchy-capture-screenrecording --with-desktop-audio --with-microphone-audio --with-webcam --webcam-device="$device" ;; *) back_to show_capture_menu ;; esac } show_share_menu() { case $(menu "Share" " Clipboard\n File \n Folder") in *Clipboard*) omarchy-menu-share clipboard ;; *File*) terminal bash -c "omarchy-menu-share file" ;; *Folder*) terminal bash -c "omarchy-menu-share folder" ;; *) back_to show_trigger_menu ;; esac } show_toggle_menu() { local options="󱄄 Screensaver\n󰔎 Nightlight\n󱫖 Idle Lock\n󰂛 Notifications\n󰍜 Top Bar\n󱂬 Workspace Layout\n Window Gaps\n 1-Window Ratio\n󰍹 Monitor Scaling\n Direct Boot\n󰟵 Passwordless Sudo" case $(menu "Toggle" "$options") in *Screensaver*) omarchy-toggle-screensaver ;; *Nightlight*) omarchy-toggle-nightlight ;; *Idle*) omarchy-toggle-idle ;; *Notifications*) omarchy-toggle-notification-silencing ;; *Bar*) omarchy-toggle-waybar ;; *Layout*) omarchy-hyprland-workspace-layout-toggle ;; *Ratio*) omarchy-hyprland-window-single-square-aspect-toggle ;; *Gaps*) omarchy-hyprland-window-gaps-toggle ;; *Scaling*) omarchy-hyprland-monitor-scaling-cycle ;; *"Direct Boot"*) present_terminal omarchy-config-direct-boot ;; *"Passwordless Sudo"*) present_terminal omarchy-sudo-passwordless ;; *) back_to show_trigger_menu ;; esac } show_hardware_menu() { local options="󰛧 Laptop Display\n 󰍹 Mirror Display" if omarchy-hw-hybrid-gpu; then options="$options\n Hybrid GPU" fi if omarchy-hw-touchpad; then options="$options\n󰟸 Touchpad" fi if omarchy-hw-dell-xps-haptic-touchpad && omarchy-cmd-present dell-xps-touchpad-haptics; then options="$options\n󰌌 Touchpad Haptics" fi if omarchy-hw-touchscreen; then options="$options\n󰆽 Touchscreen" fi case $(menu "Toggle" "$options") in *Laptop*) omarchy-hyprland-monitor-internal toggle ;; *Mirror*) omarchy-hyprland-monitor-internal-mirror toggle ;; *Haptics*) show_hardware_touchpad_haptics_menu ;; *Touchpad*) omarchy-toggle-touchpad ;; *Touchscreen*) omarchy-toggle-touchscreen ;; *"Hybrid GPU"*) present_terminal omarchy-toggle-hybrid-gpu ;; *) back_to show_trigger_menu ;; esac } show_hardware_touchpad_haptics_menu() { local current=$(dell-xps-touchpad-haptics get) local selected=$(menu "Touchpad Haptics" "low\nmid\nhigh" "" "$current") if [[ -n $selected ]]; then dell-xps-touchpad-haptics set "$selected" else back_to show_hardware_menu fi } show_style_menu() { case $(menu "Style" "󰸌 Theme\n󰟵 Unlock\n Font\n Background\n Hyprland\n󱄄 Screensaver\n About") in *Theme*) show_theme_menu ;; *Unlock*) omarchy-launch-walker -m menus:omarchyunlocks --width 800 --minheight 400 ;; *Font*) show_font_menu ;; *Background*) show_background_menu ;; *Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;; *Screensaver*) show_screensaver_menu ;; *About*) show_about_menu ;; *) show_main_menu ;; esac } show_about_menu() { case $(menu "About" " Edit Text\n Set From Image\n Restore Default") in *Text*) omarchy-branding-about text ;; *Image*) omarchy-branding-about image ;; *Default*) omarchy-branding-about reset ;; *) show_style_menu ;; esac } show_screensaver_menu() { case $(menu "Screensaver" " Edit Text\n Set From Image\n Restore Default") in *Text*) omarchy-branding-screensaver text ;; *Image*) omarchy-branding-screensaver image ;; *Default*) omarchy-branding-screensaver reset ;; *) show_style_menu ;; esac } show_theme_menu() { omarchy-launch-walker -m menus:omarchythemes --width 800 --minheight 400 } show_background_menu() { omarchy-launch-walker -m menus:omarchyBackgroundSelector --width 800 --minheight 400 } show_font_menu() { theme=$(menu "Font" "$(omarchy-font-list)" "--width 350" "$(omarchy-font-current)") if [[ $theme == "CNCLD" || -z $theme ]]; then back_to show_style_menu else omarchy-font-set "$theme" fi } show_setup_menu() { local options=" Audio\n Wifi\n󰂯 Bluetooth\n󱐋 Power Profile\n System Sleep\n󰍹 Monitors" [[ -f ~/.config/hypr/bindings.conf ]] && options="$options\n Keybindings" [[ -f ~/.config/hypr/input.conf ]] && options="$options\n Input" options="$options\n Defaults\n󰱔 DNS\n Security\n Config" case $(menu "Setup" "$options") in *Audio*) omarchy-launch-audio ;; *Wifi*) omarchy-launch-wifi ;; *Bluetooth*) omarchy-launch-bluetooth ;; *Power*) show_setup_power_menu ;; *System*) show_setup_system_menu ;; *Monitors*) open_in_editor ~/.config/hypr/monitors.conf ;; *Keybindings*) open_in_editor ~/.config/hypr/bindings.conf ;; *Input*) open_in_editor ~/.config/hypr/input.conf ;; *Defaults*) show_setup_default_menu ;; *DNS*) present_terminal omarchy-setup-dns ;; *Security*) show_setup_security_menu ;; *Config*) show_setup_config_menu ;; *) show_main_menu ;; esac } show_setup_power_menu() { profile=$(menu "Power Profile" "$(omarchy-powerprofiles-list)" "" "$(powerprofilesctl get)") if [[ $profile == "CNCLD" || -z $profile ]]; then back_to show_setup_menu else powerprofilesctl set "$profile" fi } show_setup_security_menu() { case $(menu "Setup" "󰈷 Fingerprint\n Fido2") in *Fingerprint*) present_terminal omarchy-setup-security-fingerprint ;; *Fido2*) present_terminal omarchy-setup-security-fido2 ;; *) show_setup_menu ;; esac } show_setup_default_menu() { case $(menu "Default" " Browser\n Terminal\n Editor") in *Browser*) show_setup_default_browser_menu ;; *Terminal*) show_setup_default_terminal_menu ;; *Editor*) show_setup_default_editor_menu ;; *) show_setup_menu ;; esac } browser_desktop_exists() { [[ -f ~/.local/share/applications/$1 || -f ~/.nix-profile/share/applications/$1 || -f /usr/share/applications/$1 ]] } show_setup_default_browser_menu() { local options="" browser_desktop_exists chromium.desktop && options="$options Chromium" browser_desktop_exists google-chrome.desktop && options="${options:+$options\n}󰊯 Chrome" browser_desktop_exists brave-browser.desktop && options="${options:+$options\n}󰖟 Brave" browser_desktop_exists brave-origin-beta.desktop && options="${options:+$options\n}󰖟 Brave Origin" browser_desktop_exists microsoft-edge.desktop && options="${options:+$options\n}󰇩 Edge" browser_desktop_exists firefox.desktop && options="${options:+$options\n}󰈹 Firefox" browser_desktop_exists zen.desktop && options="${options:+$options\n}󰖟 Zen" local current="" case "$(omarchy-default-browser)" in chromium) current=" Chromium" ;; chrome) current="󰊯 Chrome" ;; brave) current="󰖟 Brave" ;; brave-origin) current="󰖟 Brave Origin" ;; edge) current="󰇩 Edge" ;; firefox) current="󰈹 Firefox" ;; zen) current="󰖟 Zen" ;; esac case $(menu "Default Browser" "$options" "" "$current") in *Chromium*) omarchy-default-browser chromium ;; *Chrome*) omarchy-default-browser chrome ;; *"Brave Origin"*) omarchy-default-browser brave-origin ;; *Brave*) omarchy-default-browser brave ;; *Edge*) omarchy-default-browser edge ;; *Firefox*) omarchy-default-browser firefox ;; *Zen*) omarchy-default-browser zen ;; *) show_setup_default_menu ;; esac } show_setup_default_terminal_menu() { local options="" omarchy-cmd-present alacritty && options="$options Alacritty" omarchy-cmd-present foot && options="${options:+$options\n} Foot" omarchy-cmd-present ghostty && options="${options:+$options\n} Ghostty" omarchy-cmd-present kitty && options="${options:+$options\n} Kitty" local current="" case "$(omarchy-default-terminal)" in alacritty) current=" Alacritty" ;; foot) current=" Foot" ;; ghostty) current=" Ghostty" ;; kitty) current=" Kitty" ;; esac case $(menu "Default Terminal" "$options" "" "$current") in *Alacritty*) omarchy-default-terminal alacritty ;; *Foot*) omarchy-default-terminal foot ;; *Ghostty*) omarchy-default-terminal ghostty ;; *Kitty*) omarchy-default-terminal kitty ;; *) show_setup_default_menu ;; esac } show_setup_default_editor_menu() { local options="" omarchy-cmd-present nvim && options="$options Neovim" omarchy-cmd-present code && options="${options:+$options\n} VSCode" omarchy-cmd-present cursor && options="${options:+$options\n} Cursor" omarchy-cmd-present zeditor && options="${options:+$options\n} Zed" omarchy-cmd-present sublime_text && options="${options:+$options\n} Sublime Text" omarchy-cmd-present helix && options="${options:+$options\n} Helix" omarchy-cmd-present vim && options="${options:+$options\n} Vim" omarchy-cmd-present emacs && options="${options:+$options\n} Emacs" local current="" case "$(omarchy-default-editor)" in nvim) current=" Neovim" ;; code) current=" VSCode" ;; cursor) current=" Cursor" ;; zed | zeditor) current=" Zed" ;; sublime_text) current=" Sublime Text" ;; helix) current=" Helix" ;; vim) current=" Vim" ;; emacs) current=" Emacs" ;; esac case $(menu "Default Editor" "$options" "" "$current") in *Neovim*) omarchy-default-editor nvim ;; *VSCode*) omarchy-default-editor code ;; *Cursor*) omarchy-default-editor cursor ;; *Zed*) omarchy-default-editor zed ;; *Sublime*) omarchy-default-editor sublime_text ;; *Helix*) omarchy-default-editor helix ;; *Vim*) omarchy-default-editor vim ;; *Emacs*) omarchy-default-editor emacs ;; *) show_setup_default_menu ;; esac } show_setup_config_menu() { case $(menu "Setup" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Swayosd\n󰌧 Walker\n󰍜 Waybar\n󰞅 XCompose") in *Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;; *Hypridle*) open_in_editor ~/.config/hypr/hypridle.conf && omarchy-restart-hypridle ;; *Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;; *Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && omarchy-restart-hyprsunset ;; *Swayosd*) open_in_editor ~/.config/swayosd/config.toml && omarchy-restart-swayosd ;; *Walker*) open_in_editor ~/.config/walker/config.toml && omarchy-restart-walker ;; *Waybar*) open_in_editor ~/.config/waybar/config.jsonc && omarchy-restart-waybar ;; *XCompose*) open_in_editor ~/.XCompose && omarchy-restart-xcompose ;; *) show_setup_menu ;; esac } show_setup_system_menu() { local options="" if omarchy-toggle-enabled suspend-off; then options="$options󰒲 Enable Suspend" else options="$options󰒲 Disable Suspend" fi if omarchy-hibernation-available; then options="$options\n󰤁 Disable Hibernate" else options="$options\n󰤁 Enable Hibernate" fi case $(menu "System" "$options") in *Suspend*) omarchy-toggle-suspend ;; *"Enable Hibernate"*) present_terminal omarchy-hibernation-setup ;; *"Disable Hibernate"*) present_terminal omarchy-hibernation-remove ;; *) show_setup_menu ;; esac } show_install_menu() { case $(menu "Install" "󰣇 Package\n󰣇 AUR\n Web App\n TUI\n Service\n Style\n󰵮 Development\n Editor\n Terminal\n Browser\n󱚤 AI\n Gaming\n󰍲 Windows") in *Package*) terminal omarchy-pkg-install ;; *AUR*) terminal omarchy-pkg-aur-install ;; *Web*) present_terminal omarchy-webapp-install ;; *TUI*) present_terminal omarchy-tui-install ;; *Service*) show_install_service_menu ;; *Style*) show_install_style_menu ;; *Development*) show_install_development_menu ;; *Editor*) show_install_editor_menu ;; *Terminal*) show_install_terminal_menu ;; *Browser*) show_install_browser_menu ;; *Gaming*) show_install_gaming_menu ;; *AI*) show_install_ai_menu ;; *Windows*) present_terminal "omarchy-windows-vm install" ;; *) show_main_menu ;; esac } show_install_browser_menu() { case $(menu "Install" " Chrome\n Edge\n Brave\n Brave Origin\n Firefox\n󰖟 Zen") in *Chrome*) present_terminal "omarchy-install-browser chrome" ;; *Edge*) present_terminal "omarchy-install-browser edge" ;; *"Brave Origin"*) present_terminal "omarchy-install-browser brave-origin" ;; *Brave*) present_terminal "omarchy-install-browser brave" ;; *Firefox*) present_terminal "omarchy-install-browser firefox" ;; *Zen*) present_terminal "omarchy-install-browser zen" ;; *) show_install_menu ;; esac } show_install_service_menu() { case $(menu "Install" " Dropbox\n Tailscale\n󱇱 NordVPN [AUR]\n󰏖 ONCE\n󰟵 Bitwarden\n Chromium Account") in *Dropbox*) present_terminal omarchy-install-dropbox ;; *Tailscale*) present_terminal omarchy-install-tailscale ;; *NordVPN*) present_terminal omarchy-install-nordvpn ;; *ONCE*) present_terminal omarchy-install-once ;; *Bitwarden*) install_and_launch "Bitwarden" "bitwarden bitwarden-cli" "bitwarden" ;; *Chromium*) present_terminal omarchy-install-chromium-google-account ;; *) show_install_menu ;; esac } show_install_editor_menu() { case $(menu "Install" " VSCode\n Cursor\n Zed\n Sublime Text\n Helix\n Vim\n Emacs") in *VSCode*) present_terminal omarchy-install-vscode ;; *Cursor*) install_and_launch "Cursor" "cursor-bin" "cursor" ;; *Zed*) present_terminal omarchy-install-zed ;; *Sublime*) install_and_launch "Sublime Text" "sublime-text-4" "sublime_text" ;; *Helix*) present_terminal omarchy-install-helix ;; *Vim*) install "Vim" "vim" ;; *Emacs*) install "Emacs" "emacs-wayland" && systemctl --user enable --now emacs.service ;; *) show_install_menu ;; esac } show_install_terminal_menu() { case $(menu "Install" " Alacritty\n Foot\n Ghostty\n Kitty") in *Alacritty*) install_terminal "alacritty" ;; *Foot*) install_terminal "foot" ;; *Ghostty*) install_terminal "ghostty" ;; *Kitty*) install_terminal "kitty" ;; *) show_install_menu ;; esac } show_install_ai_menu() { ollama_pkg=$( (omarchy-cmd-present nvidia-smi && echo ollama-cuda) || (omarchy-cmd-present rocminfo && echo ollama-rocm) || echo ollama ) case $(menu "Install" " Dictation\n󱚤 LM Studio\n󱚤 Ollama\n󱚤 Crush") in *Dictation*) present_terminal omarchy-voxtype-install ;; *Studio*) install "LM Studio" "lmstudio-bin" ;; *Ollama*) install "Ollama" $ollama_pkg ;; *Crush*) install "Crush" "crush-bin" ;; *) show_install_menu ;; esac } show_install_gaming_menu() { case $(menu "Install" " Steam\n RetroArch\n󰍳 Minecraft\n󰢹 NVIDIA GeForce NOW\n Xbox Cloud Gaming\n󰂯 Xbox Controller\n󰍹 Moonlight (GameStream)\n Lutris (Battle.net)\n󱓟 Heroic (Epic Games)") in *Steam*) present_terminal omarchy-install-gaming-steam ;; *RetroArch*) present_terminal omarchy-install-gaming-retroarch ;; *Minecraft*) install_and_launch "Minecraft" "minecraft-launcher" "minecraft-launcher" ;; *GeForce*) present_terminal omarchy-install-gaming-geforce-now ;; *"Xbox Cloud"*) present_terminal omarchy-install-gaming-xbox-cloud ;; *Xbox*) present_terminal omarchy-install-gaming-xbox-controllers ;; *Lutris*) present_terminal omarchy-install-gaming-lutris ;; *Heroic*) present_terminal omarchy-install-gaming-heroic ;; *Moonlight*) present_terminal omarchy-install-gaming-moonlight ;; *) show_install_menu ;; esac } show_install_style_menu() { case $(menu "Install" "󰸌 Theme\n Background\n Font") in *Theme*) present_terminal omarchy-theme-install ;; *Background*) omarchy-theme-bg-install ;; *Font*) show_install_font_menu ;; *) show_install_menu ;; esac } show_install_font_menu() { case $(menu "Install" " Cascadia Mono\n Meslo LG Mono\n Fira Code\n Victor Code\n Bitstream Vera Mono\n Iosevka" "--width 350") in *Cascadia*) install_font "Cascadia Mono" "ttf-cascadia-mono-nerd" "CaskaydiaMono Nerd Font" ;; *Meslo*) install_font "Meslo LG Mono" "ttf-meslo-nerd" "MesloLGL Nerd Font" ;; *Fira*) install_font "Fira Code" "ttf-firacode-nerd" "FiraCode Nerd Font" ;; *Victor*) install_font "Victor Code" "ttf-victor-mono-nerd" "VictorMono Nerd Font" ;; *Bitstream*) install_font "Bitstream Vera Code" "ttf-bitstream-vera-mono-nerd" "BitstromWera Nerd Font" ;; *Iosevka*) install_font "Iosevka" "ttf-iosevka-nerd" "Iosevka Nerd Font Mono" ;; *) show_install_menu ;; esac } show_install_development_menu() { case $(menu "Install" "󰫏 Ruby on Rails\n Docker DB\n JavaScript\n Go\n PHP\n Python\n Elixir\n Zig\n Rust\n Java\n .NET\n OCaml\n Clojure\n Scala") in *Rails*) present_terminal "omarchy-install-dev-env ruby" ;; *Docker*) present_terminal omarchy-install-docker-dbs ;; *JavaScript*) show_install_javascript_menu ;; *Go*) present_terminal "omarchy-install-dev-env go" ;; *PHP*) show_install_php_menu ;; *Python*) present_terminal "omarchy-install-dev-env python" ;; *Elixir*) show_install_elixir_menu ;; *Zig*) present_terminal "omarchy-install-dev-env zig" ;; *Rust*) present_terminal "omarchy-install-dev-env rust" ;; *Java*) present_terminal "omarchy-install-dev-env java" ;; *NET*) present_terminal "omarchy-install-dev-env dotnet" ;; *OCaml*) present_terminal "omarchy-install-dev-env ocaml" ;; *Clojure*) present_terminal "omarchy-install-dev-env clojure" ;; *Scala*) present_terminal "omarchy-install-dev-env scala" ;; *) show_install_menu ;; esac } show_install_javascript_menu() { case $(menu "Install" " Node.js\n Bun\n Deno") in *Node*) present_terminal "omarchy-install-dev-env node" ;; *Bun*) present_terminal "omarchy-install-dev-env bun" ;; *Deno*) present_terminal "omarchy-install-dev-env deno" ;; *) show_install_development_menu ;; esac } show_install_php_menu() { case $(menu "Install" " PHP\n Laravel\n Symfony") in *PHP*) present_terminal "omarchy-install-dev-env php" ;; *Laravel*) present_terminal "omarchy-install-dev-env laravel" ;; *Symfony*) present_terminal "omarchy-install-dev-env symfony" ;; *) show_install_development_menu ;; esac } show_install_elixir_menu() { case $(menu "Install" " Elixir\n Phoenix") in *Elixir*) present_terminal "omarchy-install-dev-env elixir" ;; *Phoenix*) present_terminal "omarchy-install-dev-env phoenix" ;; *) show_install_development_menu ;; esac } show_remove_menu() { case $(menu "Remove" "󰣇 Package\n Web App\n TUI\n󰵮 Development\n󰸌 Theme\n Browser\n Dictation\n Gaming\n󰍲 Windows\n󰏓 Preinstalls\n Security") in *Package*) terminal omarchy-pkg-remove ;; *Web*) present_terminal omarchy-webapp-remove ;; *TUI*) present_terminal omarchy-tui-remove ;; *Development*) show_remove_development_menu ;; *Theme*) present_terminal omarchy-theme-remove ;; *Browser*) show_remove_browser_menu ;; *Dictation*) present_terminal omarchy-voxtype-remove ;; *Gaming*) show_remove_gaming_menu ;; *Windows*) present_terminal "omarchy-windows-vm remove" ;; *Preinstalls*) present_terminal omarchy-remove-preinstalls ;; *Security*) show_remove_security_menu ;; *) show_main_menu ;; esac } show_remove_security_menu() { case $(menu "Remove" "󰈷 Fingerprint\n Fido2") in *Fingerprint*) present_terminal omarchy-remove-security-fingerprint ;; *Fido2*) present_terminal omarchy-remove-security-fido2 ;; *) show_remove_menu ;; esac } show_remove_browser_menu() { case $(menu "Remove" " Chrome\n Edge\n Brave\n Brave Origin\n Firefox\n Zen") in *Chrome*) present_terminal "omarchy-remove-browser chrome" ;; *Edge*) present_terminal "omarchy-remove-browser edge" ;; *"Brave Origin"*) present_terminal "omarchy-remove-browser brave-origin" ;; *Brave*) present_terminal "omarchy-remove-browser brave" ;; *Firefox*) present_terminal "omarchy-remove-browser firefox" ;; *Zen*) present_terminal "omarchy-remove-browser zen" ;; *) show_remove_menu ;; esac } show_remove_gaming_menu() { case $(menu "Remove" " Steam\n RetroArch\n󰍳 Minecraft\n󰢹 NVIDIA GeForce NOW\n Xbox Cloud Gaming\n󰖺 Xbox Controller (󰂯)\n󰍹 Moonlight (GameStream)\n Lutris (Battle.net)\n󱓟 Heroic (Epic Games)") in *Steam*) present_terminal omarchy-remove-gaming-steam ;; *RetroArch*) present_terminal omarchy-remove-gaming-retroarch ;; *Minecraft*) present_terminal omarchy-remove-gaming-minecraft ;; *GeForce*) present_terminal omarchy-remove-gaming-geforce-now ;; *"Xbox Cloud"*) present_terminal omarchy-remove-gaming-xbox-cloud ;; *Xbox*) present_terminal omarchy-remove-gaming-xbox-controllers ;; *Moonlight*) present_terminal omarchy-remove-gaming-moonlight ;; *Lutris*) present_terminal omarchy-remove-gaming-lutris ;; *Heroic*) present_terminal omarchy-remove-gaming-heroic ;; *) show_remove_menu ;; esac } show_remove_development_menu() { case $(menu "Remove" "󰫏 Ruby on Rails\n JavaScript\n Go\n PHP\n Python\n Elixir\n Zig\n Rust\n Java\n .NET\n OCaml\n Clojure\n Scala") in *Rails*) present_terminal "omarchy-remove-dev-env ruby" ;; *JavaScript*) show_remove_javascript_menu ;; *Go*) present_terminal "omarchy-remove-dev-env go" ;; *PHP*) show_remove_php_menu ;; *Python*) present_terminal "omarchy-remove-dev-env python" ;; *Elixir*) show_remove_elixir_menu ;; *Zig*) present_terminal "omarchy-remove-dev-env zig" ;; *Rust*) present_terminal "omarchy-remove-dev-env rust" ;; *Java*) present_terminal "omarchy-remove-dev-env java" ;; *NET*) present_terminal "omarchy-remove-dev-env dotnet" ;; *OCaml*) present_terminal "omarchy-remove-dev-env ocaml" ;; *Clojure*) present_terminal "omarchy-remove-dev-env clojure" ;; *Scala*) present_terminal "omarchy-remove-dev-env scala" ;; *) show_remove_menu ;; esac } show_remove_javascript_menu() { case $(menu "Remove" " Node.js\n Bun\n Deno") in *Node*) present_terminal "omarchy-remove-dev-env node" ;; *Bun*) present_terminal "omarchy-remove-dev-env bun" ;; *Deno*) present_terminal "omarchy-remove-dev-env deno" ;; *) show_remove_development_menu ;; esac } show_remove_php_menu() { case $(menu "Remove" " PHP\n Laravel\n Symfony") in *PHP*) present_terminal "omarchy-remove-dev-env php" ;; *Laravel*) present_terminal "omarchy-remove-dev-env laravel" ;; *Symfony*) present_terminal "omarchy-remove-dev-env symfony" ;; *) show_remove_development_menu ;; esac } show_remove_elixir_menu() { case $(menu "Remove" " Elixir\n Phoenix") in *Elixir*) present_terminal "omarchy-remove-dev-env elixir" ;; *Phoenix*) present_terminal "omarchy-remove-dev-env phoenix" ;; *) show_remove_development_menu ;; esac } show_update_menu() { case $(menu "Update" "  Omarchy\n󰔫 Channel\n Config\n󰸌 Extra Themes\n Process\n󰇅 Hardware\n Firmware\n Password\n Timezone\n Time") in *Omarchy*) present_terminal omarchy-update ;; *Channel*) show_update_channel_menu ;; *Config*) show_update_config_menu ;; *Themes*) present_terminal omarchy-theme-update ;; *Process*) show_update_process_menu ;; *Hardware*) show_update_hardware_menu ;; *Firmware*) present_terminal omarchy-update-firmware ;; *Timezone*) present_terminal omarchy-tz-select ;; *Time*) present_terminal omarchy-update-time ;; *Password*) show_update_password_menu ;; *) show_main_menu ;; esac } show_update_channel_menu() { case $(menu "Update channel" "🟢 Stable\n🟡 RC\n🟠 Edge\n🔴 Dev") in *Stable*) present_terminal "omarchy-channel-set stable" ;; *RC*) present_terminal "omarchy-channel-set rc" ;; *Edge*) present_terminal "omarchy-channel-set edge" ;; *Dev*) present_terminal "omarchy-channel-set dev" ;; *) show_update_menu ;; esac } show_update_process_menu() { case $(menu "Restart" " Hypridle\n Hyprsunset\n󰎟 Mako\n Swayosd\n󰌧 Walker\n󰍜 Waybar") in *Hypridle*) omarchy-restart-hypridle ;; *Hyprsunset*) omarchy-restart-hyprsunset ;; *Mako*) omarchy-restart-mako ;; *Swayosd*) omarchy-restart-swayosd ;; *Walker*) omarchy-restart-walker ;; *Waybar*) omarchy-restart-waybar ;; *) show_update_menu ;; esac } show_update_config_menu() { case $(menu "Use default config" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n󱣴 Plymouth\n Swayosd\n Tmux\n󰌧 Walker\n󰍜 Waybar") in *Hyprland*) present_terminal omarchy-refresh-hyprland ;; *Hypridle*) present_terminal omarchy-refresh-hypridle ;; *Hyprlock*) present_terminal omarchy-refresh-hyprlock ;; *Hyprsunset*) present_terminal omarchy-refresh-hyprsunset ;; *Plymouth*) present_terminal omarchy-refresh-plymouth ;; *Swayosd*) present_terminal omarchy-refresh-swayosd ;; *Tmux*) present_terminal omarchy-refresh-tmux ;; *Walker*) present_terminal omarchy-refresh-walker ;; *Waybar*) present_terminal omarchy-refresh-waybar ;; *) show_update_menu ;; esac } show_update_hardware_menu() { case $(menu "Restart" " Audio\n󱚾 Wi-Fi\n󰂯 Bluetooth\n󰟸 Trackpad") in *Audio*) present_terminal omarchy-restart-pipewire ;; *Wi-Fi*) present_terminal omarchy-restart-wifi ;; *Bluetooth*) present_terminal omarchy-restart-bluetooth ;; *Trackpad*) present_terminal omarchy-restart-trackpad ;; *) show_update_menu ;; esac } show_update_password_menu() { case $(menu "Update Password" " Drive Encryption\n User") in *Drive*) present_terminal omarchy-drive-password ;; *User*) present_terminal passwd ;; *) show_update_menu ;; esac } show_about() { omarchy-launch-about } show_system_menu() { local options="󱄄 Screensaver\n Lock" ! omarchy-toggle-enabled suspend-off && options="$options\n󰒲 Suspend" omarchy-hibernation-available && options="$options\n󰤁 Hibernate" options="$options\n󰍃 Logout\n󰜉 Restart\n󰐥 Shutdown" case $(menu "System" "$options") in *Screensaver*) omarchy-launch-screensaver force ;; *Lock*) omarchy-system-lock ;; *Suspend*) systemctl suspend ;; *Hibernate*) systemctl hibernate ;; *Logout*) omarchy-system-logout ;; *Restart*) omarchy-system-reboot ;; *Shutdown*) omarchy-system-shutdown ;; *) back_to show_main_menu ;; esac } show_main_menu() { go_to_menu "$(menu "Go" "󰀻 Apps\n󰧑 Learn\n󱓞 Trigger\n Style\n Setup\n󰉉 Install\n󰭌 Remove\n Update\n About\n System")" } go_to_menu() { case "${1,,}" in *apps*) walker -p "Launch…" ;; *learn*) show_learn_menu ;; *trigger*) show_trigger_menu ;; *toggle*) show_toggle_menu ;; *hardware*) show_hardware_menu ;; *share*) show_share_menu ;; *reminder-set*) show_custom_reminder_input ;; *reminder*) show_reminder_menu ;; *background*) show_background_menu ;; *capture*) show_capture_menu ;; *style*) show_style_menu ;; *theme*) show_theme_menu ;; *screenrecord*) show_screenrecord_menu ;; *setup*) show_setup_menu ;; *power*) show_setup_power_menu ;; *install*) show_install_menu ;; *remove*) show_remove_menu ;; *update*) show_update_menu ;; *about*) show_about ;; *system*) show_system_menu ;; esac } # Allow user extensions and overrides USER_EXTENSIONS="$HOME/.config/omarchy/extensions/menu.sh" [[ -f $USER_EXTENSIONS ]] && source "$USER_EXTENSIONS" toggle_existing_menu if [[ -n $1 ]]; then BACK_TO_EXIT=true go_to_menu "$1" else show_main_menu fi