feat(system): comprehensive branding, styling, and system feature update
- Relocate themes to assets/themes/ and update all references. - Implement custom SDDM theme and Plymouth theme enhancements. - Add themed templates for Alacritty, Hyprland, Waybar, and other apps. - Introduce Makima key remapper module and configuration. - Add Voxtype and Walker configurations. - Implement systemd power management and timeout optimizations. - Add Nautilus-python extensions for LocalSend. - Update branding assets and ASCII art integration.
This commit is contained in:
379
bin/utils/nomarchy-menu
Executable file
379
bin/utils/nomarchy-menu
Executable file
@@ -0,0 +1,379 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Launch the Nnomarchy Menu or takes a parameter to jump straight to a submenu.
|
||||
|
||||
export PATH="$HOME/.local/share/nnomarchy/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" | nnomarchy-launch-walker --dmenu --width 295 --minheight 1 --maxheight 630 -p "$prompt…" "${args[@]}" 2>/dev/null
|
||||
}
|
||||
|
||||
terminal() {
|
||||
xdg-terminal-exec --app-id=org.nnomarchy.terminal "$@"
|
||||
}
|
||||
|
||||
present_terminal() {
|
||||
nnomarchy-launch-floating-terminal-with-presentation $1
|
||||
}
|
||||
|
||||
open_in_editor() {
|
||||
notify-send -u low "Editing config file" "$1"
|
||||
nnomarchy-launch-editor "$1"
|
||||
}
|
||||
|
||||
show_learn_menu() {
|
||||
case $(menu "Learn" " Keybindings\n Nnomarchy\n Hyprland\n Arch\n Neovim\n Bash") in
|
||||
*Keybindings*) nnomarchy-menu-keybindings ;;
|
||||
*Nnomarchy*) nnomarchy-launch-webapp "https://learn.omacom.io/2/the-nnomarchy-manual" ;;
|
||||
*Hyprland*) nnomarchy-launch-webapp "https://wiki.hypr.land/" ;;
|
||||
*Arch*) nnomarchy-launch-webapp "https://wiki.archlinux.org/title/Main_page" ;;
|
||||
*Bash*) nnomarchy-launch-webapp "https://devhints.io/bash" ;;
|
||||
*Neovim*) nnomarchy-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*) nnomarchy-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() {
|
||||
nnomarchy-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") nnomarchy-cmd-screenrecord ;;
|
||||
*"With desktop audio") nnomarchy-cmd-screenrecord --with-desktop-audio ;;
|
||||
*"With desktop + microphone audio") nnomarchy-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
|
||||
}
|
||||
nnomarchy-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*) nnomarchy-cmd-share clipboard ;;
|
||||
*File*) terminal bash -c "nnomarchy-cmd-share file" ;;
|
||||
*Folder*) terminal bash -c "nnomarchy-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*) nnomarchy-toggle-screensaver ;;
|
||||
*Nightlight*) nnomarchy-toggle-nightlight ;;
|
||||
*Idle*) nnomarchy-toggle-idle ;;
|
||||
*Bar*) nnomarchy-toggle-waybar ;;
|
||||
*Layout*) nnomarchy-hyprland-workspace-layout-toggle ;;
|
||||
*Ratio*) nnomarchy-hyprland-window-single-square-aspect-toggle ;;
|
||||
*Gaps*) nnomarchy-hyprland-window-gaps-toggle ;;
|
||||
*Scaling*) nnomarchy-hyprland-monitor-scaling-cycle ;;
|
||||
*) back_to show_trigger_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_hardware_menu() {
|
||||
case $(menu "Toggle" " Hybrid GPU") in
|
||||
*"Hybrid GPU"*) present_terminal nnomarchy-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/nnomarchy/branding/screensaver.txt ;;
|
||||
*About*) open_in_editor ~/.config/nnomarchy/branding/about.txt ;;
|
||||
*) show_main_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_theme_menu() {
|
||||
nnomarchy-launch-walker -m menus:nnomarchythemes --width 800 --minheight 400
|
||||
}
|
||||
|
||||
show_background_menu() {
|
||||
nnomarchy-launch-walker -m menus:nnomarchyBackgroundSelector --width 800 --minheight 400
|
||||
}
|
||||
|
||||
show_font_menu() {
|
||||
theme=$(menu "Font" "$(nnomarchy-font-list)" "--width 350" "$(nnomarchy-font-current)")
|
||||
if [[ $theme == "CNCLD" || -z $theme ]]; then
|
||||
back_to show_style_menu
|
||||
else
|
||||
nnomarchy-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*) nnomarchy-launch-audio ;;
|
||||
*Wifi*) nnomarchy-launch-wifi ;;
|
||||
*Bluetooth*) nnomarchy-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*) nnomarchy-setup-makima && open_in_editor "$HOME/.config/makima/AT Translated Set 2 keyboard.toml" && nnomarchy-restart-makima ;;
|
||||
*DNS*) present_terminal nnomarchy-setup-dns ;;
|
||||
*Security*) show_setup_security_menu ;;
|
||||
*Config*) show_setup_config_menu ;;
|
||||
*) show_main_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_setup_power_menu() {
|
||||
profile=$(menu "Power Profile" "$(nnomarchy-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 nnomarchy-setup-fingerprint ;;
|
||||
*Fido2*) present_terminal nnomarchy-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 && nnomarchy-restart-hypridle ;;
|
||||
*Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;;
|
||||
*Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && nnomarchy-restart-hyprsunset ;;
|
||||
*Swayosd*) open_in_editor ~/.config/swayosd/config.toml && nnomarchy-restart-swayosd ;;
|
||||
*Walker*) open_in_editor ~/.config/walker/config.toml && nnomarchy-restart-walker ;;
|
||||
*Waybar*) open_in_editor ~/.config/waybar/config.jsonc && nnomarchy-restart-waybar ;;
|
||||
*XCompose*) open_in_editor ~/.XCompose && nnomarchy-restart-xcompose ;;
|
||||
*) show_setup_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_setup_system_menu() {
|
||||
local options=""
|
||||
|
||||
if [[ $NNOMARCHY_TOGGLE_SUSPEND == "false" ]]; then
|
||||
options="$options Enable Suspend"
|
||||
else
|
||||
options="$options Disable Suspend"
|
||||
fi
|
||||
|
||||
if nnomarchy-hibernation-available; then
|
||||
options="$options\n Disable Hibernate"
|
||||
else
|
||||
options="$options\n Enable Hibernate"
|
||||
fi
|
||||
|
||||
case $(menu "System" "$options") in
|
||||
*Suspend*) nnomarchy-toggle-suspend ;;
|
||||
*"Enable Hibernate"*) present_terminal nnomarchy-hibernation-setup ;;
|
||||
*"Disable Hibernate"*) present_terminal nnomarchy-hibernation-remove ;;
|
||||
*) show_setup_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
|
||||
show_update_menu() {
|
||||
case $(menu "Update" " Nnomarchy\n Extra Themes\n Process\n Hardware\n Firmware\n Password\n Timezone\n Time") in
|
||||
*Nnomarchy*) present_terminal nnomarchy-update ;;
|
||||
*Themes*) present_terminal nnomarchy-theme-update ;;
|
||||
*Process*) show_update_process_menu ;;
|
||||
*Hardware*) show_update_hardware_menu ;;
|
||||
*Firmware*) present_terminal nnomarchy-update-firmware ;;
|
||||
*Timezone*) present_terminal nnomarchy-tz-select ;;
|
||||
*Time*) present_terminal nnomarchy-update-time ;;
|
||||
*Password*) show_update_password_menu ;;
|
||||
*) show_main_menu ;;
|
||||
esac
|
||||
}
|
||||
show_update_process_menu() {
|
||||
case $(menu "Restart" " Hypridle\n Hyprsunset\n Swayosd\n Walker\n Waybar") in
|
||||
*Hypridle*) nnomarchy-restart-hypridle ;;
|
||||
*Hyprsunset*) nnomarchy-restart-hyprsunset ;;
|
||||
*Swayosd*) nnomarchy-restart-swayosd ;;
|
||||
*Walker*) nnomarchy-restart-walker ;;
|
||||
*Waybar*) nnomarchy-restart-waybar ;;
|
||||
*) show_update_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
|
||||
show_update_hardware_menu() {
|
||||
case $(menu "Restart" " Audio\n Wi-Fi\n Bluetooth") in
|
||||
*Audio*) present_terminal nnomarchy-restart-pipewire ;;
|
||||
*Wi-Fi*) present_terminal nnomarchy-restart-wifi ;;
|
||||
*Bluetooth*) present_terminal nnomarchy-restart-bluetooth ;;
|
||||
*) show_update_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_update_password_menu() {
|
||||
case $(menu "Update Password" " Drive Encryption\n User") in
|
||||
*Drive*) present_terminal nnomarchy-drive-set-password ;;
|
||||
*User*) present_terminal passwd ;;
|
||||
*) show_update_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_about() {
|
||||
nnomarchy-launch-about
|
||||
}
|
||||
|
||||
show_system_menu() {
|
||||
local options=" Screensaver\n Lock"
|
||||
[[ $NNOMARCHY_TOGGLE_SUSPEND != "false" ]] && options="$options\n Suspend"
|
||||
nnomarchy-hibernation-available && options="$options\n Hibernate"
|
||||
options="$options\n Logout\n Restart\n Shutdown"
|
||||
|
||||
case $(menu "System" "$options") in
|
||||
*Screensaver*) nnomarchy-launch-screensaver force ;;
|
||||
*Lock*) nnomarchy-lock-screen ;;
|
||||
*Suspend*) systemctl suspend ;;
|
||||
*Hibernate*) systemctl hibernate ;;
|
||||
*Logout*) nnomarchy-system-logout ;;
|
||||
*Restart*) nnomarchy-system-reboot ;;
|
||||
*Shutdown*) nnomarchy-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 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 ;;
|
||||
*update*) show_update_menu ;;
|
||||
*about*) show_about ;;
|
||||
*system*) show_system_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Allow user extensions and overrides
|
||||
USER_EXTENSIONS="$HOME/.config/nnomarchy/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
|
||||
Reference in New Issue
Block a user