634 lines
23 KiB
Bash
Executable File
634 lines
23 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Launch the Nomarchy Menu or takes a parameter to jump straight to a submenu.
|
|
|
|
export PATH="$HOME/.local/share/nomarchy/bin:$PATH"
|
|
|
|
# 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" | nomarchy-launch-walker --dmenu --width 295 --minheight 1 --maxheight 630 -p "$prompt…" "${args[@]}" 2>/dev/null
|
|
}
|
|
|
|
terminal() {
|
|
xdg-terminal-exec --app-id=org.nomarchy.terminal "$@"
|
|
}
|
|
|
|
present_terminal() {
|
|
nomarchy-launch-floating-terminal-with-presentation $1
|
|
}
|
|
|
|
open_in_editor() {
|
|
notify-send -u low "Editing config file" "$1"
|
|
nomarchy-launch-editor "$1"
|
|
}
|
|
|
|
install() {
|
|
present_terminal "echo 'Installing $1...'; nomarchy-pkg-add $2"
|
|
}
|
|
|
|
install_and_launch() {
|
|
present_terminal "echo 'Installing $1...'; nomarchy-pkg-add $2 && setsid gtk-launch $3"
|
|
}
|
|
|
|
install_font() {
|
|
present_terminal "echo 'Installing $1...'; nomarchy-pkg-add $2 && sleep 2 && nomarchy-font-set '$3'"
|
|
}
|
|
|
|
install_terminal() {
|
|
present_terminal "nomarchy-install-terminal $1"
|
|
}
|
|
|
|
aur_install() {
|
|
present_terminal "echo 'Installing $1 from AUR...'; nomarchy-pkg-aur-add $2"
|
|
}
|
|
|
|
aur_install_and_launch() {
|
|
present_terminal "echo 'Installing $1 from AUR...'; nomarchy-pkg-aur-add $2 && setsid gtk-launch $3"
|
|
}
|
|
|
|
show_learn_menu() {
|
|
case $(menu "Learn" " Keybindings\n Nomarchy\n Hyprland\n Arch\n Neovim\n Bash") in
|
|
*Keybindings*) nomarchy-menu-keybindings ;;
|
|
*Nomarchy*) nomarchy-launch-webapp "https://learn.omacom.io/2/the-nomarchy-manual" ;;
|
|
*Hyprland*) nomarchy-launch-webapp "https://wiki.hypr.land/" ;;
|
|
*Arch*) nomarchy-launch-webapp "https://wiki.archlinux.org/title/Main_page" ;;
|
|
*Bash*) nomarchy-launch-webapp "https://devhints.io/bash" ;;
|
|
*Neovim*) nomarchy-launch-webapp "https://www.lazyvim.org/keymaps" ;;
|
|
*) show_main_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_trigger_menu() {
|
|
case $(menu "Trigger" " Capture\n Share\n Toggle\n Hardware") in
|
|
*Capture*) show_capture_menu ;;
|
|
*Share*) show_share_menu ;;
|
|
*Toggle*) show_toggle_menu ;;
|
|
*Hardware*) show_hardware_menu ;;
|
|
*) show_main_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_capture_menu() {
|
|
case $(menu "Capture" " Screenshot\n Screenrecord\n Color") in
|
|
*Screenshot*) nomarchy-cmd-screenshot ;;
|
|
*Screenrecord*) show_screenrecord_menu ;;
|
|
*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() {
|
|
nomarchy-cmd-screenrecord --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") nomarchy-cmd-screenrecord ;;
|
|
*"With desktop audio") nomarchy-cmd-screenrecord --with-desktop-audio ;;
|
|
*"With desktop + microphone audio") nomarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio ;;
|
|
*"With desktop + microphone audio + webcam")
|
|
local device=$(show_webcam_select_menu) || {
|
|
back_to show_capture_menu
|
|
return
|
|
}
|
|
nomarchy-cmd-screenrecord --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*) nomarchy-cmd-share clipboard ;;
|
|
*File*) terminal bash -c "nomarchy-cmd-share file" ;;
|
|
*Folder*) terminal bash -c "nomarchy-cmd-share folder" ;;
|
|
*) back_to show_trigger_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_toggle_menu() {
|
|
case $(menu "Toggle" " Screensaver\n Nightlight\n Idle Lock\n Top Bar\n Workspace Layout\n Window Gaps\n 1-Window Ratio\n Display Scaling") in
|
|
|
|
*Screensaver*) nomarchy-toggle-screensaver ;;
|
|
*Nightlight*) nomarchy-toggle-nightlight ;;
|
|
*Idle*) nomarchy-toggle-idle ;;
|
|
*Bar*) nomarchy-toggle-waybar ;;
|
|
*Layout*) nomarchy-hyprland-workspace-layout-toggle ;;
|
|
*Ratio*) nomarchy-hyprland-window-single-square-aspect-toggle ;;
|
|
*Gaps*) nomarchy-hyprland-window-gaps-toggle ;;
|
|
*Scaling*) nomarchy-hyprland-monitor-scaling-cycle ;;
|
|
*) back_to show_trigger_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_hardware_menu() {
|
|
case $(menu "Toggle" " Hybrid GPU") in
|
|
*"Hybrid GPU"*) present_terminal nomarchy-toggle-hybrid-gpu ;;
|
|
*) show_trigger_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_style_menu() {
|
|
case $(menu "Style" " Theme\n Font\n Background\n Hyprland\n Screensaver\n About") in
|
|
*Theme*) show_theme_menu ;;
|
|
*Font*) show_font_menu ;;
|
|
*Background*) show_background_menu ;;
|
|
*Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;;
|
|
*Screensaver*) open_in_editor ~/.config/nomarchy/branding/screensaver.txt ;;
|
|
*About*) open_in_editor ~/.config/nomarchy/branding/about.txt ;;
|
|
*) show_main_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_theme_menu() {
|
|
nomarchy-launch-walker -m menus:nomarchythemes --width 800 --minheight 400
|
|
}
|
|
|
|
show_background_menu() {
|
|
nomarchy-launch-walker -m menus:nomarchyBackgroundSelector --width 800 --minheight 400
|
|
}
|
|
|
|
show_font_menu() {
|
|
theme=$(menu "Font" "$(nomarchy-font-list)" "--width 350" "$(nomarchy-font-current)")
|
|
if [[ $theme == "CNCLD" || -z $theme ]]; then
|
|
back_to show_style_menu
|
|
else
|
|
nomarchy-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"
|
|
options="$options\n Key Remapping"
|
|
[[ -f ~/.config/hypr/input.conf ]] && options="$options\n Input"
|
|
options="$options\n DNS\n Security\n Config"
|
|
|
|
case $(menu "Setup" "$options") in
|
|
*Audio*) nomarchy-launch-audio ;;
|
|
*Wifi*) nomarchy-launch-wifi ;;
|
|
*Bluetooth*) nomarchy-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 ;;
|
|
*Key\ Remapping*) nomarchy-setup-makima && open_in_editor "$HOME/.config/makima/AT Translated Set 2 keyboard.toml" && nomarchy-restart-makima ;;
|
|
*DNS*) present_terminal nomarchy-setup-dns ;;
|
|
*Security*) show_setup_security_menu ;;
|
|
*Config*) show_setup_config_menu ;;
|
|
*) show_main_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_setup_power_menu() {
|
|
profile=$(menu "Power Profile" "$(nomarchy-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 nomarchy-setup-fingerprint ;;
|
|
*Fido2*) present_terminal nomarchy-setup-fido2 ;;
|
|
*) show_setup_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_setup_config_menu() {
|
|
case $(menu "Setup" " Defaults\n Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Swayosd\n Walker\n Waybar\n XCompose") in
|
|
*Defaults*) open_in_editor ~/.config/uwsm/default ;;
|
|
*Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;;
|
|
*Hypridle*) open_in_editor ~/.config/hypr/hypridle.conf && nomarchy-restart-hypridle ;;
|
|
*Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;;
|
|
*Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && nomarchy-restart-hyprsunset ;;
|
|
*Swayosd*) open_in_editor ~/.config/swayosd/config.toml && nomarchy-restart-swayosd ;;
|
|
*Walker*) open_in_editor ~/.config/walker/config.toml && nomarchy-restart-walker ;;
|
|
*Waybar*) open_in_editor ~/.config/waybar/config.jsonc && nomarchy-restart-waybar ;;
|
|
*XCompose*) open_in_editor ~/.XCompose && nomarchy-restart-xcompose ;;
|
|
*) show_setup_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_setup_system_menu() {
|
|
local options=""
|
|
|
|
if [[ -f ~/.local/state/nomarchy/toggles/suspend-off ]]; then
|
|
options="$options Enable Suspend"
|
|
else
|
|
options="$options Disable Suspend"
|
|
fi
|
|
|
|
if nomarchy-hibernation-available; then
|
|
options="$options\n Disable Hibernate"
|
|
else
|
|
options="$options\n Enable Hibernate"
|
|
fi
|
|
|
|
case $(menu "System" "$options") in
|
|
*Suspend*) nomarchy-toggle-suspend ;;
|
|
*"Enable Hibernate"*) present_terminal nomarchy-hibernation-setup ;;
|
|
*"Disable Hibernate"*) present_terminal nomarchy-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 AI\n Windows\n Gaming") in
|
|
*Package*) terminal nomarchy-pkg-install ;;
|
|
*AUR*) terminal nomarchy-pkg-aur-install ;;
|
|
*Web*) present_terminal nomarchy-webapp-install ;;
|
|
*TUI*) present_terminal nomarchy-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 ;;
|
|
*AI*) show_install_ai_menu ;;
|
|
*Windows*) present_terminal "nomarchy-windows-vm install" ;;
|
|
*Gaming*) show_install_gaming_menu ;;
|
|
*) show_main_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_install_service_menu() {
|
|
case $(menu "Install" " Dropbox\n Tailscale\n NordVPN [AUR]\n Bitwarden\n Chromium Account") in
|
|
*Dropbox*) present_terminal nomarchy-install-dropbox ;;
|
|
*Tailscale*) present_terminal nomarchy-install-tailscale ;;
|
|
*NordVPN*) present_terminal nomarchy-install-nordvpn ;;
|
|
*Bitwarden*) install_and_launch "Bitwarden" "bitwarden bitwarden-cli" "bitwarden" ;;
|
|
*Chromium*) present_terminal nomarchy-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 Emacs") in
|
|
*VSCode*) present_terminal nomarchy-install-vscode ;;
|
|
*Cursor*) install_and_launch "Cursor" "cursor-bin" "cursor" ;;
|
|
*Zed*) install_and_launch "Zed" "zed" "dev.zed.Zed" ;;
|
|
*Sublime*) install_and_launch "Sublime Text" "sublime-text-4" "sublime_text" ;;
|
|
*Helix*) install "Helix" "helix" ;;
|
|
*Emacs*) install "Emacs" "emacs-wayland" && systemctl --user enable --now emacs.service ;;
|
|
*) show_install_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_install_terminal_menu() {
|
|
case $(menu "Install" " Alacritty\n Ghostty\n Kitty") in
|
|
*Alacritty*) install_terminal "alacritty" ;;
|
|
*Ghostty*) install_terminal "ghostty" ;;
|
|
*Kitty*) install_terminal "kitty" ;;
|
|
*) show_install_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_install_ai_menu() {
|
|
ollama_pkg=$(
|
|
(command -v nvidia-smi &>/dev/null && echo ollama-cuda) ||
|
|
(command -v rocminfo &>/dev/null && echo ollama-rocm) ||
|
|
echo ollama
|
|
)
|
|
|
|
case $(menu "Install" " Dictation\n LM Studio\n Ollama\n Crush") in
|
|
*Dictation*) present_terminal nomarchy-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 NVIDIA GeForce NOW\n RetroArch [AUR]\n Minecraft\n Xbox Controller [AUR]") in
|
|
*Steam*) present_terminal nomarchy-install-steam ;;
|
|
*GeForce*) present_terminal nomarchy-install-geforce-now ;;
|
|
*RetroArch*) aur_install_and_launch "RetroArch" "retroarch retroarch-assets libretro libretro-fbneo" "com.libretro.RetroArch.desktop" ;;
|
|
*Minecraft*) install_and_launch "Minecraft" "minecraft-launcher" "minecraft-launcher" ;;
|
|
*Xbox*) present_terminal nomarchy-install-xbox-controllers ;;
|
|
*) show_install_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_install_style_menu() {
|
|
case $(menu "Install" " Theme\n Background\n Font") in
|
|
*Theme*) present_terminal nomarchy-theme-install ;;
|
|
*Background*) nomarchy-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 Bistream 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" ;;
|
|
*Bistream*) install_font "Bistream 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 "nomarchy-install-dev-env ruby" ;;
|
|
*Docker*) present_terminal nomarchy-install-docker-dbs ;;
|
|
*JavaScript*) show_install_javascript_menu ;;
|
|
*Go*) present_terminal "nomarchy-install-dev-env go" ;;
|
|
*PHP*) show_install_php_menu ;;
|
|
*Python*) present_terminal "nomarchy-install-dev-env python" ;;
|
|
*Elixir*) show_install_elixir_menu ;;
|
|
*Zig*) present_terminal "nomarchy-install-dev-env zig" ;;
|
|
*Rust*) present_terminal "nomarchy-install-dev-env rust" ;;
|
|
*Java*) present_terminal "nomarchy-install-dev-env java" ;;
|
|
*NET*) present_terminal "nomarchy-install-dev-env dotnet" ;;
|
|
*OCaml*) present_terminal "nomarchy-install-dev-env ocaml" ;;
|
|
*Clojure*) present_terminal "nomarchy-install-dev-env clojure" ;;
|
|
*Scala*) present_terminal "nomarchy-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 "nomarchy-install-dev-env node" ;;
|
|
*Bun*) present_terminal "nomarchy-install-dev-env bun" ;;
|
|
*Deno*) present_terminal "nomarchy-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 "nomarchy-install-dev-env php" ;;
|
|
*Laravel*) present_terminal "nomarchy-install-dev-env laravel" ;;
|
|
*Symfony*) present_terminal "nomarchy-install-dev-env symfony" ;;
|
|
*) show_install_development_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_install_elixir_menu() {
|
|
case $(menu "Install" " Elixir\n Phoenix") in
|
|
*Elixir*) present_terminal "nomarchy-install-dev-env elixir" ;;
|
|
*Phoenix*) present_terminal "nomarchy-install-dev-env phoenix" ;;
|
|
*) show_install_development_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_remove_menu() {
|
|
case $(menu "Remove" " Package\n Web App\n TUI\n Development\n Preinstalls\n Dictation\n Theme\n Windows\n Fingerprint\n Fido2") in
|
|
*Package*) terminal nomarchy-pkg-remove ;;
|
|
*Web*) present_terminal nomarchy-webapp-remove ;;
|
|
*TUI*) present_terminal nomarchy-tui-remove ;;
|
|
*Development*) show_remove_development_menu ;;
|
|
*Preinstalls*) present_terminal nomarchy-remove-preinstalls ;;
|
|
*Dictation*) present_terminal nomarchy-voxtype-remove ;;
|
|
*Theme*) present_terminal nomarchy-theme-remove ;;
|
|
*Windows*) present_terminal "nomarchy-windows-vm remove" ;;
|
|
*Fingerprint*) present_terminal "nomarchy-setup-fingerprint --remove" ;;
|
|
*Fido2*) present_terminal "nomarchy-setup-fido2 --remove" ;;
|
|
*) show_main_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 "nomarchy-remove-dev-env ruby" ;;
|
|
*JavaScript*) show_remove_javascript_menu ;;
|
|
*Go*) present_terminal "nomarchy-remove-dev-env go" ;;
|
|
*PHP*) show_remove_php_menu ;;
|
|
*Python*) present_terminal "nomarchy-remove-dev-env python" ;;
|
|
*Elixir*) show_remove_elixir_menu ;;
|
|
*Zig*) present_terminal "nomarchy-remove-dev-env zig" ;;
|
|
*Rust*) present_terminal "nomarchy-remove-dev-env rust" ;;
|
|
*Java*) present_terminal "nomarchy-remove-dev-env java" ;;
|
|
*NET*) present_terminal "nomarchy-remove-dev-env dotnet" ;;
|
|
*OCaml*) present_terminal "nomarchy-remove-dev-env ocaml" ;;
|
|
*Clojure*) present_terminal "nomarchy-remove-dev-env clojure" ;;
|
|
*Scala*) present_terminal "nomarchy-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 "nomarchy-remove-dev-env node" ;;
|
|
*Bun*) present_terminal "nomarchy-remove-dev-env bun" ;;
|
|
*Deno*) present_terminal "nomarchy-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 "nomarchy-remove-dev-env php" ;;
|
|
*Laravel*) present_terminal "nomarchy-remove-dev-env laravel" ;;
|
|
*Symfony*) present_terminal "nomarchy-remove-dev-env symfony" ;;
|
|
*) show_remove_development_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_remove_elixir_menu() {
|
|
case $(menu "Remove" " Elixir\n Phoenix") in
|
|
*Elixir*) present_terminal "nomarchy-remove-dev-env elixir" ;;
|
|
*Phoenix*) present_terminal "nomarchy-remove-dev-env phoenix" ;;
|
|
*) show_remove_development_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_update_menu() {
|
|
case $(menu "Update" " Nomarchy\n Channel\n Config\n Extra Themes\n Process\n Hardware\n Firmware\n Password\n Timezone\n Time") in
|
|
*Nomarchy*) present_terminal nomarchy-update ;;
|
|
*Channel*) show_update_channel_menu ;;
|
|
*Config*) show_update_config_menu ;;
|
|
*Themes*) present_terminal nomarchy-theme-update ;;
|
|
*Process*) show_update_process_menu ;;
|
|
*Hardware*) show_update_hardware_menu ;;
|
|
*Firmware*) present_terminal nomarchy-update-firmware ;;
|
|
*Timezone*) present_terminal nomarchy-tz-select ;;
|
|
*Time*) present_terminal nomarchy-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 "nomarchy-channel-set stable" ;;
|
|
*RC*) present_terminal "nomarchy-channel-set rc" ;;
|
|
*Edge*) present_terminal "nomarchy-channel-set edge" ;;
|
|
*Dev*) present_terminal "nomarchy-channel-set dev" ;;
|
|
*) show_update_menu ;;
|
|
esac
|
|
}
|
|
show_update_process_menu() {
|
|
case $(menu "Restart" " Hypridle\n Hyprsunset\n Swayosd\n Walker\n Waybar") in
|
|
*Hypridle*) nomarchy-restart-hypridle ;;
|
|
*Hyprsunset*) nomarchy-restart-hyprsunset ;;
|
|
*Swayosd*) nomarchy-restart-swayosd ;;
|
|
*Walker*) nomarchy-restart-walker ;;
|
|
*Waybar*) nomarchy-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 nomarchy-refresh-hyprland ;;
|
|
*Hypridle*) present_terminal nomarchy-refresh-hypridle ;;
|
|
*Hyprlock*) present_terminal nomarchy-refresh-hyprlock ;;
|
|
*Hyprsunset*) present_terminal nomarchy-refresh-hyprsunset ;;
|
|
*Plymouth*) present_terminal nomarchy-refresh-plymouth ;;
|
|
*Swayosd*) present_terminal nomarchy-refresh-swayosd ;;
|
|
*Tmux*) present_terminal nomarchy-refresh-tmux ;;
|
|
*Walker*) present_terminal nomarchy-refresh-walker ;;
|
|
*Waybar*) present_terminal nomarchy-refresh-waybar ;;
|
|
*) show_update_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_update_hardware_menu() {
|
|
case $(menu "Restart" " Audio\n Wi-Fi\n Bluetooth") in
|
|
*Audio*) present_terminal nomarchy-restart-pipewire ;;
|
|
*Wi-Fi*) present_terminal nomarchy-restart-wifi ;;
|
|
*Bluetooth*) present_terminal nomarchy-restart-bluetooth ;;
|
|
*) show_update_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_update_password_menu() {
|
|
case $(menu "Update Password" " Drive Encryption\n User") in
|
|
*Drive*) present_terminal nomarchy-drive-set-password ;;
|
|
*User*) present_terminal passwd ;;
|
|
*) show_update_menu ;;
|
|
esac
|
|
}
|
|
|
|
show_about() {
|
|
nomarchy-launch-about
|
|
}
|
|
|
|
show_system_menu() {
|
|
local options=" Screensaver\n Lock"
|
|
[[ ! -f ~/.local/state/nomarchy/toggles/suspend-off ]] && options="$options\n Suspend"
|
|
nomarchy-hibernation-available && options="$options\n Hibernate"
|
|
options="$options\n Logout\n Restart\n Shutdown"
|
|
|
|
case $(menu "System" "$options") in
|
|
*Screensaver*) nomarchy-launch-screensaver force ;;
|
|
*Lock*) nomarchy-lock-screen ;;
|
|
*Suspend*) systemctl suspend ;;
|
|
*Hibernate*) systemctl hibernate ;;
|
|
*Logout*) nomarchy-system-logout ;;
|
|
*Restart*) nomarchy-system-reboot ;;
|
|
*Shutdown*) nomarchy-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 ;;
|
|
*share*) show_share_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/nomarchy/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
|