fix(system): enable uwsm and fix session detection to allow VM login

- Enable programs.uwsm for session management.
- Improve SDDM theme session detection logic to be case-insensitive and more robust.
- Perform a global cleanup of 'Nnomarchy' and 'org.nnomarchy' typos across all scripts and configurations.
This commit is contained in:
Bernardo Magri
2026-04-05 11:18:41 +01:00
parent 7f086f07bf
commit 8a72a09bd8
105 changed files with 320 additions and 319 deletions

View File

@@ -11,10 +11,10 @@ Rectangle {
property int sessionIndex: { property int sessionIndex: {
for (var i = 0; i < sessionModel.rowCount(); i++) { for (var i = 0; i < sessionModel.rowCount(); i++) {
var name = (sessionModel.data(sessionModel.index(i, 0), Qt.DisplayRole) || "").toString() var name = (sessionModel.data(sessionModel.index(i, 0), Qt.DisplayRole) || "").toString()
if (name.indexOf("uwsm") !== -1) if (name.toLowerCase().indexOf("uwsm") !== -1)
return i return i
} }
return sessionModel.lastIndex return Math.max(0, sessionModel.lastIndex)
} }
Connections { Connections {

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Returns the name of the current monospace font being used by extracting it from the Waybar stylesheet. # Returns the name of the current monospace font being used by extracting it from the Waybar stylesheet.
# This can be changed using nnomarchy-font-set. # This can be changed using nomarchy-font-set.
grep -oP 'font-family:\s*["'\'']?\K[^;"'\'']+' ~/.config/waybar/style.css | head -n1 grep -oP 'font-family:\s*["'\'']?\K[^;"'\'']+' ~/.config/waybar/style.css | head -n1

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Returns a list of all the monospace fonts available on the system that can be set using nnomarchy-font-set. # Returns a list of all the monospace fonts available on the system that can be set using nomarchy-font-set.
fc-list :spacing=100 -f "%{family[0]}\n" | grep -v -i -E 'emoji|signwriting|nnomarchy' | sort -u fc-list :spacing=100 -f "%{family[0]}\n" | grep -v -i -E 'emoji|signwriting|nomarchy' | sort -u

View File

@@ -1,12 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Set the system-wide monospace font that should be used by the terminal, hyprlock, waybar, swayosd, etc. # Set the system-wide monospace font that should be used by the terminal, hyprlock, waybar, swayosd, etc.
# Declarative version for Nnomarchy NixOS. # Declarative version for Nomarchy NixOS.
font_name="$1" font_name="$1"
if [[ -z $font_name ]]; then if [[ -z $font_name ]]; then
echo "Usage: nnomarchy-font-set <font-name>" echo "Usage: nomarchy-font-set <font-name>"
exit 1 exit 1
fi fi
@@ -31,7 +31,7 @@ if fc-list | grep -iq "$font_name"; then
notify-send -u low " You must restart Ghostty to see font change" notify-send -u low " You must restart Ghostty to see font change"
fi fi
nnomarchy-hook font-set "$font_name" nomarchy-hook font-set "$font_name"
else else
echo "Font '$font_name' not found." echo "Font '$font_name' not found."
exit 1 exit 1

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
CURRENT_THEME_NAME=$(cat "$HOME/.config/nnomarchy/current/theme.name") CURRENT_THEME_NAME=$(cat "$HOME/.config/nomarchy/current/theme.name")
THEME_USER_BACKGROUNDS="$HOME/.config/nnomarchy/backgrounds/$CURRENT_THEME_NAME" THEME_USER_BACKGROUNDS="$HOME/.config/nomarchy/backgrounds/$CURRENT_THEME_NAME"
mkdir -p "$THEME_USER_BACKGROUNDS" mkdir -p "$THEME_USER_BACKGROUNDS"
nautilus "$THEME_USER_BACKGROUNDS" nautilus "$THEME_USER_BACKGROUNDS"

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Cycles through the background images available for the current theme. # Cycles through the background images available for the current theme.
# Declarative + Hybrid (instant swww) for Nnomarchy NixOS. # Declarative + Hybrid (instant swww) for Nomarchy NixOS.
STATE_DIR="$HOME/.config/home-manager" STATE_DIR="$HOME/.config/home-manager"
STATE_FILE="$STATE_DIR/state.json" STATE_FILE="$STATE_DIR/state.json"
@@ -11,10 +11,10 @@ mkdir -p "$STATE_DIR"
THEME_NAME=$(jq -r '.theme // "nord"' "$STATE_FILE") THEME_NAME=$(jq -r '.theme // "nord"' "$STATE_FILE")
# Resolve themes directory (Built-in from Nix store via Home Manager, or user extra) # Resolve themes directory (Built-in from Nix store via Home Manager, or user extra)
if [ -d "$HOME/.config/nnomarchy/themes/$THEME_NAME" ]; then if [ -d "$HOME/.config/nomarchy/themes/$THEME_NAME" ]; then
THEMES_DIR="$HOME/.config/nnomarchy/themes" THEMES_DIR="$HOME/.config/nomarchy/themes"
else else
THEMES_DIR="$HOME/.local/share/nnomarchy/themes" THEMES_DIR="$HOME/.local/share/nomarchy/themes"
fi fi
BG_DIR="$THEMES_DIR/$THEME_NAME/backgrounds" BG_DIR="$THEMES_DIR/$THEME_NAME/backgrounds"

View File

@@ -3,12 +3,12 @@
# Sets the specified image as the current background # Sets the specified image as the current background
if [[ -z $1 ]]; then if [[ -z $1 ]]; then
echo "Usage: nnomarchy-theme-bg-set <path-to-image>" >&2 echo "Usage: nomarchy-theme-bg-set <path-to-image>" >&2
exit 1 exit 1
fi fi
BACKGROUND="$1" BACKGROUND="$1"
CURRENT_BACKGROUND_LINK="$HOME/.config/nnomarchy/current/background" CURRENT_BACKGROUND_LINK="$HOME/.config/nomarchy/current/background"
# Create symlink to the new background # Create symlink to the new background
ln -nsf "$BACKGROUND" "$CURRENT_BACKGROUND_LINK" ln -nsf "$BACKGROUND" "$CURRENT_BACKGROUND_LINK"

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
THEME_NAME_PATH="$HOME/.config/nnomarchy/current/theme.name" THEME_NAME_PATH="$HOME/.config/nomarchy/current/theme.name"
if [[ -f $THEME_NAME_PATH ]]; then if [[ -f $THEME_NAME_PATH ]]; then
cat $THEME_NAME_PATH | sed -E 's/(^|-)([a-z])/\1\u\2/g; s/-/ /g' cat $THEME_NAME_PATH | sed -E 's/(^|-)([a-z])/\1\u\2/g; s/-/ /g'

View File

@@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
# nnomarchy-theme-install: Install a new theme from a git repo for Nnomarchy # nomarchy-theme-install: Install a new theme from a git repo for Nomarchy
# Usage: nnomarchy-theme-install <git-repo-url> # Usage: nomarchy-theme-install <git-repo-url>
if [[ -z $1 ]]; then if [[ -z $1 ]]; then
echo -e "\e[32mSee https://manuals.omamix.org/2/the-nnomarchy-manual/90/extra-themes\n\e[0m" echo -e "\e[32mSee https://manuals.omamix.org/2/the-nomarchy-manual/90/extra-themes\n\e[0m"
REPO_URL=$(gum input --placeholder="Git repo URL for theme" --header="") REPO_URL=$(gum input --placeholder="Git repo URL for theme" --header="")
else else
REPO_URL="$1" REPO_URL="$1"
@@ -14,8 +14,8 @@ if [[ -z $REPO_URL ]]; then
exit 1 exit 1
fi fi
THEMES_DIR="$HOME/.config/nnomarchy/themes" THEMES_DIR="$HOME/.config/nomarchy/themes"
THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^nnomarchy-//; s/-theme$//') THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^nomarchy-//; s/-theme$//')
THEME_PATH="$THEMES_DIR/$THEME_NAME" THEME_PATH="$THEMES_DIR/$THEME_NAME"
# Remove existing theme if present # Remove existing theme if present
@@ -23,11 +23,11 @@ if [[ -d $THEME_PATH ]]; then
rm -rf "$THEME_PATH" rm -rf "$THEME_PATH"
fi fi
# Clone the repo directly to ~/.config/nnomarchy/themes # Clone the repo directly to ~/.config/nomarchy/themes
if ! git clone "$REPO_URL" "$THEME_PATH"; then if ! git clone "$REPO_URL" "$THEME_PATH"; then
echo "Error: Failed to clone theme repo." echo "Error: Failed to clone theme repo."
exit 1 exit 1
fi fi
# Apply the new theme with nnomarchy-theme-set # Apply the new theme with nomarchy-theme-set
nnomarchy-theme-set $THEME_NAME nomarchy-theme-set $THEME_NAME

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
{ {
find ~/.config/nnomarchy/themes/ -mindepth 1 -maxdepth 1 \( -type d -o -type l \) -printf '%f\n' find ~/.config/nomarchy/themes/ -mindepth 1 -maxdepth 1 \( -type d -o -type l \) -printf '%f\n'
find "$NOMARCHY_PATH/assets/themes/" -mindepth 1 -maxdepth 1 -type d -printf '%f\n' find "$NOMARCHY_PATH/assets/themes/" -mindepth 1 -maxdepth 1 -type d -printf '%f\n'
} | sort -u | while read -r name; do } | sort -u | while read -r name; do
echo "$name" | sed -E 's/(^|-)([a-z])/\1\u\2/g; s/-/ /g' echo "$name" | sed -E 's/(^|-)([a-z])/\1\u\2/g; s/-/ /g'

View File

@@ -2,8 +2,8 @@
# Refresh the current theme from its templates. # Refresh the current theme from its templates.
THEME_NAME_PATH="$HOME/.config/nnomarchy/current/theme.name" THEME_NAME_PATH="$HOME/.config/nomarchy/current/theme.name"
if [[ -f $THEME_NAME_PATH ]]; then if [[ -f $THEME_NAME_PATH ]]; then
nnomarchy-theme-set "$(cat $THEME_NAME_PATH)" nomarchy-theme-set "$(cat $THEME_NAME_PATH)"
fi fi

View File

@@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
# nnomarchy-theme-remove: Remove a theme from Nnomarchy by name # nomarchy-theme-remove: Remove a theme from Nomarchy by name
# Usage: nnomarchy-theme-remove <theme-name> # Usage: nomarchy-theme-remove <theme-name>
if [[ -z $1 ]]; then if [[ -z $1 ]]; then
mapfile -t extra_themes < <(find ~/.config/nnomarchy/themes -mindepth 1 -maxdepth 1 -type d ! -xtype l -printf '%f\n') mapfile -t extra_themes < <(find ~/.config/nomarchy/themes -mindepth 1 -maxdepth 1 -type d ! -xtype l -printf '%f\n')
if (( ${#extra_themes[@]} > 0 )); then if (( ${#extra_themes[@]} > 0 )); then
THEME_NAME=$(printf '%s\n' "${extra_themes[@]}" | sort | gum choose --header="Remove extra theme") THEME_NAME=$(printf '%s\n' "${extra_themes[@]}" | sort | gum choose --header="Remove extra theme")
@@ -16,8 +16,8 @@ else
THEME_NAME="$1" THEME_NAME="$1"
fi fi
THEMES_DIR="$HOME/.config/nnomarchy/themes" THEMES_DIR="$HOME/.config/nomarchy/themes"
CURRENT_DIR="$HOME/.config/nnomarchy/current" CURRENT_DIR="$HOME/.config/nomarchy/current"
THEME_PATH="$THEMES_DIR/$THEME_NAME" THEME_PATH="$THEMES_DIR/$THEME_NAME"
# Ensure a theme was set # Ensure a theme was set

View File

@@ -1,12 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Set the system theme declaratively. # Set the system theme declaratively.
# Usage: nnomarchy-theme-set <theme-name> # Usage: nomarchy-theme-set <theme-name>
THEME_NAME="$1" THEME_NAME="$1"
if [[ -z $THEME_NAME ]]; then if [[ -z $THEME_NAME ]]; then
echo "Usage: nnomarchy-theme-set <theme-name>" echo "Usage: nomarchy-theme-set <theme-name>"
exit 1 exit 1
fi fi
@@ -14,10 +14,10 @@ STATE_DIR="$HOME/.config/home-manager"
STATE_FILE="$STATE_DIR/state.json" STATE_FILE="$STATE_DIR/state.json"
# Resolve themes directory (Built-in from Nix store via Home Manager, or user extra) # Resolve themes directory (Built-in from Nix store via Home Manager, or user extra)
if [ -d "$HOME/.config/nnomarchy/themes/$THEME_NAME" ]; then if [ -d "$HOME/.config/nomarchy/themes/$THEME_NAME" ]; then
THEMES_DIR="$HOME/.config/nnomarchy/themes" THEMES_DIR="$HOME/.config/nomarchy/themes"
else else
THEMES_DIR="$HOME/.local/share/nnomarchy/themes" THEMES_DIR="$HOME/.local/share/nomarchy/themes"
fi fi
mkdir -p "$STATE_DIR" mkdir -p "$STATE_DIR"
@@ -26,7 +26,7 @@ mkdir -p "$STATE_DIR"
if [ ! -d "$THEMES_DIR/$THEME_NAME" ] && ! [[ "$THEME_NAME" == "nord" ]]; then if [ ! -d "$THEMES_DIR/$THEME_NAME" ] && ! [[ "$THEME_NAME" == "nord" ]]; then
echo "Theme '$THEME_NAME' not found in $THEMES_DIR" echo "Theme '$THEME_NAME' not found in $THEMES_DIR"
# Check if it exists in the palettes file # Check if it exists in the palettes file
# (Assuming nnomarchy-palettes.nix is imported in Nix) # (Assuming nomarchy-palettes.nix is imported in Nix)
fi fi
TMP_JSON=$(mktemp) TMP_JSON=$(mktemp)
@@ -49,9 +49,9 @@ if [ -d "$BG_DIR" ]; then
fi fi
echo "Theme set to $THEME_NAME. Applying changes with env-update..." echo "Theme set to $THEME_NAME. Applying changes with env-update..."
rm -rf "$HOME/.config/nnomarchy/current/theme" rm -rf "$HOME/.config/nomarchy/current/theme"
env-update env-update
nnomarchy-theme-set-templates nomarchy-theme-set-templates
nnomarchy-hook theme-set "$THEME_NAME" nomarchy-hook theme-set "$THEME_NAME"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
nnomarchy-theme-set-keyboard-asus-rog nomarchy-theme-set-keyboard-asus-rog
nnomarchy-theme-set-keyboard-f16 nomarchy-theme-set-keyboard-f16

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
ASUSCTL_THEME=~/.config/nnomarchy/current/theme/keyboard.rgb ASUSCTL_THEME=~/.config/nomarchy/current/theme/keyboard.rgb
if nnomarchy-cmd-present asusctl; then if nomarchy-cmd-present asusctl; then
asusctl aura effect static -c $(sed 's/^#//' $ASUSCTL_THEME) asusctl aura effect static -c $(sed 's/^#//' $ASUSCTL_THEME)
fi fi

View File

@@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
FRAMEWORK16_THEME=~/.config/nnomarchy/current/theme/keyboard.rgb FRAMEWORK16_THEME=~/.config/nomarchy/current/theme/keyboard.rgb
if nnomarchy-cmd-present qmk_hid && [[ -f $FRAMEWORK16_THEME ]]; then if nomarchy-cmd-present qmk_hid && [[ -f $FRAMEWORK16_THEME ]]; then
hex=$(cat "$FRAMEWORK16_THEME") hex=$(cat "$FRAMEWORK16_THEME")
hex="${hex#\#}" hex="${hex#\#}"

View File

@@ -1,25 +1,25 @@
#!/bin/bash #!/bin/bash
# Sync Nnomarchy theme to all Obsidian vaults # Sync Nomarchy theme to all Obsidian vaults
CURRENT_THEME_DIR="$HOME/.config/nnomarchy/current/theme" CURRENT_THEME_DIR="$HOME/.config/nomarchy/current/theme"
[[ -f $CURRENT_THEME_DIR/obsidian.css ]] || exit 0 [[ -f $CURRENT_THEME_DIR/obsidian.css ]] || exit 0
jq -r '.vaults | values[].path' ~/.config/obsidian/obsidian.json 2>/dev/null | while read -r vault_path; do jq -r '.vaults | values[].path' ~/.config/obsidian/obsidian.json 2>/dev/null | while read -r vault_path; do
[[ -d $vault_path/.obsidian ]] || continue [[ -d $vault_path/.obsidian ]] || continue
theme_dir="$vault_path/.obsidian/themes/Nnomarchy" theme_dir="$vault_path/.obsidian/themes/Nomarchy"
mkdir -p "$theme_dir" mkdir -p "$theme_dir"
[[ -f $theme_dir/manifest.json ]] || cat >"$theme_dir/manifest.json" <<'EOF' [[ -f $theme_dir/manifest.json ]] || cat >"$theme_dir/manifest.json" <<'EOF'
{ {
"name": "Nnomarchy", "name": "Nomarchy",
"version": "1.0.0", "version": "1.0.0",
"minAppVersion": "0.16.0", "minAppVersion": "0.16.0",
"description": "Automatically syncs with your current Nnomarchy system theme colors and fonts", "description": "Automatically syncs with your current Nomarchy system theme colors and fonts",
"author": "Nnomarchy", "author": "Nomarchy",
"authorUrl": "https://nnomarchy.org" "authorUrl": "https://nomarchy.org"
} }
EOF EOF

View File

@@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
TEMPLATES_DIR="$NOMARCHY_PATH/assets/themed" TEMPLATES_DIR="$NOMARCHY_PATH/assets/themed"
USER_TEMPLATES_DIR="$HOME/.config/nnomarchy/themed" USER_TEMPLATES_DIR="$HOME/.config/nomarchy/themed"
NEXT_THEME_DIR="$HOME/.config/nnomarchy/current/theme" NEXT_THEME_DIR="$HOME/.config/nomarchy/current/theme"
COLORS_FILE="$NEXT_THEME_DIR/colors.toml" COLORS_FILE="$NEXT_THEME_DIR/colors.toml"
# Convert hex color to decimal RGB (e.g., "#1e1e2e" -> "30,30,46") # Convert hex color to decimal RGB (e.g., "#1e1e2e" -> "30,30,46")

View File

@@ -1,14 +1,14 @@
#!/bin/bash #!/bin/bash
# Sync Nnomarchy theme to VS Code, VSCodium, and Cursor # Sync Nomarchy theme to VS Code, VSCodium, and Cursor
VS_CODE_THEME="$HOME/.config/nnomarchy/current/theme/vscode.json" VS_CODE_THEME="$HOME/.config/nomarchy/current/theme/vscode.json"
set_theme() { set_theme() {
local editor_cmd="$1" local editor_cmd="$1"
local settings_path="$2" local settings_path="$2"
nnomarchy-cmd-present "$editor_cmd" && [[ $NNOMARCHY_TOGGLE_SKIP_VSCODE_THEME != "true" ]] || return 0 nomarchy-cmd-present "$editor_cmd" && [[ $NNOMARCHY_TOGGLE_SKIP_VSCODE_THEME != "true" ]] || return 0
if [[ -f $VS_CODE_THEME ]]; then if [[ -f $VS_CODE_THEME ]]; then
theme_name=$(jq -r '.name' "$VS_CODE_THEME") theme_name=$(jq -r '.name' "$VS_CODE_THEME")

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
for dir in ~/.config/nnomarchy/themes/*/; do for dir in ~/.config/nomarchy/themes/*/; do
if [[ -d $dir ]] && [[ ! -L ${dir%/} ]] && [[ -d $dir/.git ]]; then if [[ -d $dir ]] && [[ ! -L ${dir%/} ]] && [[ -d $dir/.git ]]; then
echo "Updating: $(basename "$dir")" echo "Updating: $(basename "$dir")"
git -C "$dir" pull git -C "$dir" pull

View File

@@ -2,4 +2,4 @@
# Launch the fastfetch TUI that gives information about the current system. # Launch the fastfetch TUI that gives information about the current system.
exec nnomarchy-launch-or-focus-tui "bash -c 'fastfetch; read -n 1 -s'" exec nomarchy-launch-or-focus-tui "bash -c 'fastfetch; read -n 1 -s'"

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Launch the Nnomarchy audio controls TUI (provided by wiremix). # Launch the Nomarchy audio controls TUI (provided by wiremix).
nnomarchy-launch-or-focus-tui wiremix nomarchy-launch-or-focus-tui wiremix

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Launch the Nnomarchy bluetooth controls TUI (provided by bluetui). # Launch the Nomarchy bluetooth controls TUI (provided by bluetui).
# Also attempts to unblock bluetooth service if rfkill had blocked it. # Also attempts to unblock bluetooth service if rfkill had blocked it.
rfkill unblock bluetooth rfkill unblock bluetooth
exec nnomarchy-launch-or-focus-tui bluetui exec nomarchy-launch-or-focus-tui bluetui

View File

@@ -3,11 +3,11 @@
# Launch the default editor as determined by $EDITOR (set via ~/.config/uwsm/default) (or nvim if missing). # Launch the default editor as determined by $EDITOR (set via ~/.config/uwsm/default) (or nvim if missing).
# Starts suitable editors in a terminal window and otherwise as a regular application. # Starts suitable editors in a terminal window and otherwise as a regular application.
nnomarchy-cmd-present "$EDITOR" || EDITOR=nvim nomarchy-cmd-present "$EDITOR" || EDITOR=nvim
case "$EDITOR" in case "$EDITOR" in
nvim | vim | nano | micro | hx | helix | fresh) nvim | vim | nano | micro | hx | helix | fresh)
exec nnomarchy-launch-tui "$EDITOR" "$@" exec nomarchy-launch-tui "$EDITOR" "$@"
;; ;;
*) *)
exec setsid uwsm-app -- "$EDITOR" "$@" exec setsid uwsm-app -- "$EDITOR" "$@"

View File

@@ -4,7 +4,7 @@
# Use by some default bindings, like the one for Spotify, to ensure there is only one instance of the application open. # Use by some default bindings, like the one for Spotify, to ensure there is only one instance of the application open.
if (($# == 0)); then if (($# == 0)); then
echo "Usage: nnomarchy-launch-or-focus [window-pattern] [launch-command]" echo "Usage: nomarchy-launch-or-focus [window-pattern] [launch-command]"
exit 1 exit 1
fi fi

View File

@@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
# Launch or focus on a given TUI identified by the passed in as the command. # Launch or focus on a given TUI identified by the passed in as the command.
# Use by commands like nnomarchy-launch-wifi to ensure there is only one wifi configuration screen open. # Use by commands like nomarchy-launch-wifi to ensure there is only one wifi configuration screen open.
APP_ID="org.nnomarchy.$(basename "$1")" APP_ID="org.nomarchy.$(basename "$1")"
LAUNCH_COMMAND="nnomarchy-launch-tui $@" LAUNCH_COMMAND="nomarchy-launch-tui $@"
exec nnomarchy-launch-or-focus "$APP_ID" "$LAUNCH_COMMAND" exec nomarchy-launch-or-focus "$APP_ID" "$LAUNCH_COMMAND"

View File

@@ -4,12 +4,12 @@
# Use by some default bindings, like the one for WhatsApp, to ensure there is only one instance of the application open. # Use by some default bindings, like the one for WhatsApp, to ensure there is only one instance of the application open.
if (($# == 0)); then if (($# == 0)); then
echo "Usage: nnomarchy-launch-or-focus-webapp [window-pattern] [url-and-flags...]" echo "Usage: nomarchy-launch-or-focus-webapp [window-pattern] [url-and-flags...]"
exit 1 exit 1
fi fi
WINDOW_PATTERN="$1" WINDOW_PATTERN="$1"
shift shift
LAUNCH_COMMAND="nnomarchy-launch-webapp $@" LAUNCH_COMMAND="nomarchy-launch-webapp $@"
exec nnomarchy-launch-or-focus "$WINDOW_PATTERN" "$LAUNCH_COMMAND" exec nomarchy-launch-or-focus "$WINDOW_PATTERN" "$LAUNCH_COMMAND"

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Launch the Nnomarchy screensaver in the default terminal on the system with the correct font configuration. # Launch the Nomarchy screensaver in the default terminal on the system with the correct font configuration.
# Exit early if we don't have the tte show # Exit early if we don't have the tte show
if ! command -v tte &>/dev/null; then if ! command -v tte &>/dev/null; then
@@ -8,7 +8,7 @@ if ! command -v tte &>/dev/null; then
fi fi
# Exit early if screensave is already running # Exit early if screensave is already running
pgrep -f org.nnomarchy.screensaver && exit 0 pgrep -f org.nomarchy.screensaver && exit 0
# Allow screensaver to be turned off but also force started # Allow screensaver to be turned off but also force started
# Skip if screensaver is disabled in configuration # Skip if screensaver is disabled in configuration
@@ -29,23 +29,23 @@ for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
case $terminal in case $terminal in
*Alacritty*) *Alacritty*)
hyprctl dispatch exec -- \ hyprctl dispatch exec -- \
alacritty --class=org.nnomarchy.screensaver \ alacritty --class=org.nomarchy.screensaver \
--config-file ~/.local/share/nnomarchy/default/alacritty/screensaver.toml \ --config-file ~/.local/share/nomarchy/default/alacritty/screensaver.toml \
-e nnomarchy-cmd-screensaver -e nomarchy-cmd-screensaver
;; ;;
*ghostty*) *ghostty*)
hyprctl dispatch exec -- \ hyprctl dispatch exec -- \
ghostty --class=org.nnomarchy.screensaver \ ghostty --class=org.nomarchy.screensaver \
--config-file=~/.local/share/nnomarchy/default/ghostty/screensaver \ --config-file=~/.local/share/nomarchy/default/ghostty/screensaver \
--font-size=18 \ --font-size=18 \
-e nnomarchy-cmd-screensaver -e nomarchy-cmd-screensaver
;; ;;
*kitty*) *kitty*)
hyprctl dispatch exec -- \ hyprctl dispatch exec -- \
kitty --class=org.nnomarchy.screensaver \ kitty --class=org.nomarchy.screensaver \
--override font_size=18 \ --override font_size=18 \
--override window_padding_width=0 \ --override window_padding_width=0 \
-e nnomarchy-cmd-screensaver -e nomarchy-cmd-screensaver
;; ;;
*) *)
notify-send -u low "✋ Screensaver only runs in Alacritty, Ghostty, or Kitty" notify-send -u low "✋ Screensaver only runs in Alacritty, Ghostty, or Kitty"

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Launch the TUI command passed in as an argument in the default terminal with an org.nnomarchy.COMMAND app id for styling. # Launch the TUI command passed in as an argument in the default terminal with an org.nomarchy.COMMAND app id for styling.
exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.nnomarchy.$(basename $1) -e "$1" "${@:2}" exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.nomarchy.$(basename $1) -e "$1" "${@:2}"

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Launch the Nnomarchy wifi controls (provided by the Impala TUI). # Launch the Nomarchy wifi controls (provided by the Impala TUI).
# Attempts to unblock the wifi service first in case it should be been blocked. # Attempts to unblock the wifi service first in case it should be been blocked.
rfkill unblock wifi rfkill unblock wifi
nnomarchy-launch-or-focus-tui impala nomarchy-launch-or-focus-tui impala

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Restart an application by killing it and relaunching via uwsm. # Restart an application by killing it and relaunching via uwsm.
# Usage: nnomarchy-restart-app <application-name> [application-args...] # Usage: nomarchy-restart-app <application-name> [application-args...]
pkill -x $1 pkill -x $1
setsid uwsm-app -- "$@" >/dev/null 2>&1 & setsid uwsm-app -- "$@" >/dev/null 2>&1 &

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Reload btop configuration (used by the Nnomarchy theme switching). # Reload btop configuration (used by the Nomarchy theme switching).
pkill -SIGUSR2 btop pkill -SIGUSR2 btop

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Reload opencode configuration (used by the Nnomarchy theme switching). # Reload opencode configuration (used by the Nomarchy theme switching).
if pgrep -x opencode >/dev/null; then if pgrep -x opencode >/dev/null; then
killall -SIGUSR2 opencode killall -SIGUSR2 opencode

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Remove all TUIs installed via nnomarchy-tui-install. # Remove all TUIs installed via nomarchy-tui-install.
# Identifies TUIs by their Exec pattern (xdg-terminal-exec --app-id=TUI.). # Identifies TUIs by their Exec pattern (xdg-terminal-exec --app-id=TUI.).
set -e set -e

View File

@@ -3,4 +3,4 @@ set -e
# Used by Voxtype waybar module to open config on right click # Used by Voxtype waybar module to open config on right click
exec nnomarchy-launch-editor ~/.config/voxtype/config.toml exec nomarchy-launch-editor ~/.config/voxtype/config.toml

View File

@@ -4,18 +4,18 @@ set -e
# Install voxtype and configure it for use. # Install voxtype and configure it for use.
if gum confirm "Install Voxtype + AI model (~150MB) to enable dictation?"; then if gum confirm "Install Voxtype + AI model (~150MB) to enable dictation?"; then
nnomarchy-pkg-add wtype voxtype-bin nomarchy-pkg-add wtype voxtype-bin
# Setup voxtype # Setup voxtype
mkdir -p ~/.config/voxtype mkdir -p ~/.config/voxtype
cp ~/.config/nomarchy/default/voxtype/config.toml ~/.config/voxtype/ cp ~/.config/nomarchy/default/voxtype/config.toml ~/.config/voxtype/
voxtype setup --download --no-post-install voxtype setup --download --no-post-install
if nnomarchy-hw-vulkan; then if nomarchy-hw-vulkan; then
voxtype setup gpu --enable || true voxtype setup gpu --enable || true
fi fi
voxtype setup systemd voxtype setup systemd
nnomarchy-restart-waybar nomarchy-restart-waybar
notify-send " Voxtype Dictation Ready" "Press Super + Ctrl + X to toggle dictation.\nEdit ~/.config/voxtype/config.toml for options." -t 10000 notify-send " Voxtype Dictation Ready" "Press Super + Ctrl + X to toggle dictation.\nEdit ~/.config/voxtype/config.toml for options." -t 10000
fi fi

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
set -e set -e
nnomarchy-launch-floating-terminal-with-presentation "voxtype setup model" nomarchy-launch-floating-terminal-with-presentation "voxtype setup model"
nnomarchy-restart-waybar nomarchy-restart-waybar

View File

@@ -3,7 +3,7 @@ set -e
# Remove voxtype and its configurations. # Remove voxtype and its configurations.
if nnomarchy-cmd-present voxtype; then if nomarchy-cmd-present voxtype; then
echo "Uninstall Voxtype to remove dictation." echo "Uninstall Voxtype to remove dictation."
# Remove services # Remove services
@@ -12,7 +12,7 @@ if nnomarchy-cmd-present voxtype; then
systemctl --user daemon-reload systemctl --user daemon-reload
# Remove packages and configs # Remove packages and configs
nnomarchy-pkg-drop wtype voxtype-bin nomarchy-pkg-drop wtype voxtype-bin
rm -rf ~/.config/voxtype rm -rf ~/.config/voxtype
rm -rf ~/.local/share/voxtype rm -rf ~/.local/share/voxtype
else else

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
if nnomarchy-cmd-present voxtype; then if nomarchy-cmd-present voxtype; then
voxtype status --follow --extended --format json | while read -r line; do voxtype status --follow --extended --format json | while read -r line; do
echo "$line" | jq -c '. + {alt: .class}' echo "$line" | jq -c '. + {alt: .class}'
done done

View File

@@ -8,4 +8,4 @@ if [[ $url =~ ^mailto: ]]; then
web_url="https://app.hey.com/messages/new?to=$email" web_url="https://app.hey.com/messages/new?to=$email"
fi fi
exec nnomarchy-launch-webapp "$web_url" exec nomarchy-launch-webapp "$web_url"

View File

@@ -17,4 +17,4 @@ if [[ $url =~ ^zoom(mtg|us):// ]]; then
fi fi
fi fi
exec nnomarchy-launch-webapp "$web_url" exec nomarchy-launch-webapp "$web_url"

View File

@@ -60,7 +60,7 @@ else
fi fi
# Use custom exec if provided, otherwise default behavior # Use custom exec if provided, otherwise default behavior
EXEC_COMMAND="${CUSTOM_EXEC:-nnomarchy-launch-webapp $APP_URL}" EXEC_COMMAND="${CUSTOM_EXEC:-nomarchy-launch-webapp $APP_URL}"
# Create application .desktop file # Create application .desktop file
DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop" DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop"

View File

@@ -8,7 +8,7 @@ DESKTOP_DIR="$HOME/.local/share/applications/"
if (( $# == 0 )); then if (( $# == 0 )); then
# Find all web apps # Find all web apps
while IFS= read -r -d '' file; do while IFS= read -r -d '' file; do
if grep -q '^Exec=.*\(nnomarchy-launch-webapp\|nnomarchy-webapp-handler\).*' "$file"; then if grep -q '^Exec=.*\(nomarchy-launch-webapp\|nomarchy-webapp-handler\).*' "$file"; then
WEB_APPS+=("$(basename "${file%.desktop}")") WEB_APPS+=("$(basename "${file%.desktop}")")
fi fi
done < <(find "$DESKTOP_DIR" -name '*.desktop' -print0) done < <(find "$DESKTOP_DIR" -name '*.desktop' -print0)

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Remove all web apps installed via nnomarchy-webapp-install. # Remove all web apps installed via nomarchy-webapp-install.
# Identifies web apps by their Exec pattern (nnomarchy-launch-webapp or nnomarchy-webapp-handler). # Identifies web apps by their Exec pattern (nomarchy-launch-webapp or nomarchy-webapp-handler).
set -e set -e
@@ -12,7 +12,7 @@ echo "Scanning for web apps in $APP_DIR..."
webapp_desktop_files=() webapp_desktop_files=()
while IFS= read -r -d '' file; do while IFS= read -r -d '' file; do
if grep -q "Exec=nnomarchy-launch-webapp\|Exec=nnomarchy-webapp-handler" "$file" 2>/dev/null; then if grep -q "Exec=nomarchy-launch-webapp\|Exec=nomarchy-webapp-handler" "$file" 2>/dev/null; then
webapp_desktop_files+=("$file") webapp_desktop_files+=("$file")
fi fi
done < <(find "$APP_DIR" -maxdepth 1 -name "*.desktop" -print0 2>/dev/null) done < <(find "$APP_DIR" -maxdepth 1 -name "*.desktop" -print0 2>/dev/null)

View File

@@ -35,7 +35,7 @@ install_windows() {
check_prerequisites check_prerequisites
nnomarchy-pkg-add freerdp openbsd-netcat gum nomarchy-pkg-add freerdp openbsd-netcat gum
mkdir -p "$HOME/.windows" mkdir -p "$HOME/.windows"
mkdir -p "$HOME/.config/windows" mkdir -p "$HOME/.config/windows"
@@ -50,7 +50,7 @@ install_windows() {
[Desktop Entry] [Desktop Entry]
Name=Windows Name=Windows
Comment=Start Windows VM via Docker and connect with RDP Comment=Start Windows VM via Docker and connect with RDP
Exec=uwsm app -- nnomarchy-windows-vm launch Exec=uwsm app -- nomarchy-windows-vm launch
Icon=$HOME/.local/share/applications/icons/windows.png Icon=$HOME/.local/share/applications/icons/windows.png
Terminal=false Terminal=false
Type=Application Type=Application
@@ -177,7 +177,7 @@ EOF
services: services:
windows: windows:
image: dockurr/windows image: dockurr/windows
container_name: nnomarchy-windows container_name: nomarchy-windows
environment: environment:
VERSION: "11" VERSION: "11"
RAM_SIZE: "$SELECTED_RAM" RAM_SIZE: "$SELECTED_RAM"
@@ -236,7 +236,7 @@ EOF
echo "" echo ""
echo "Once finished, launch 'Windows' via Super + Space" echo "Once finished, launch 'Windows' via Super + Space"
echo "" echo ""
echo "To stop the VM: nnomarchy-windows-vm stop" echo "To stop the VM: nomarchy-windows-vm stop"
echo "To change resources: ~/.config/windows/docker-compose.yml" echo "To change resources: ~/.config/windows/docker-compose.yml"
echo "" echo ""
} }
@@ -269,7 +269,7 @@ launch_windows() {
# Check if config exists # Check if config exists
if [[ ! -f $COMPOSE_FILE ]]; then if [[ ! -f $COMPOSE_FILE ]]; then
echo "Windows VM not configured. Please run: nnomarchy-windows-vm install" echo "Windows VM not configured. Please run: nomarchy-windows-vm install"
exit 1 exit 1
fi fi
@@ -282,7 +282,7 @@ launch_windows() {
[[ -z $WIN_PASS ]] && WIN_PASS="admin" [[ -z $WIN_PASS ]] && WIN_PASS="admin"
# Check if container is already running # Check if container is already running
CONTAINER_STATUS=$(docker inspect --format='{{.State.Status}}' nnomarchy-windows 2>/dev/null) CONTAINER_STATUS=$(docker inspect --format='{{.State.Status}}' nomarchy-windows 2>/dev/null)
if [[ $CONTAINER_STATUS != "running" ]]; then if [[ $CONTAINER_STATUS != "running" ]]; then
echo "Starting Windows VM..." echo "Starting Windows VM..."
@@ -292,21 +292,21 @@ launch_windows() {
if ! docker-compose -f "$COMPOSE_FILE" up -d 2>&1; then if ! docker-compose -f "$COMPOSE_FILE" up -d 2>&1; then
echo "❌ Failed to start Windows VM!" echo "❌ Failed to start Windows VM!"
echo " Try checking: nnomarchy-windows-vm status" echo " Try checking: nomarchy-windows-vm status"
echo " View logs: docker logs nnomarchy-windows" echo " View logs: docker logs nomarchy-windows"
notify-send -u critical "Windows VM" "Failed to start Windows VM" notify-send -u critical "Windows VM" "Failed to start Windows VM"
exit 1 exit 1
fi fi
echo "Waiting for Windows VM to start..." echo "Waiting for Windows VM to start..."
WAIT_COUNT=0 WAIT_COUNT=0
until docker logs nnomarchy-windows 2>&1 | grep -qi "windows started successfully"; do until docker logs nomarchy-windows 2>&1 | grep -qi "windows started successfully"; do
sleep 2 sleep 2
WAIT_COUNT=$((WAIT_COUNT + 1)) WAIT_COUNT=$((WAIT_COUNT + 1))
if (( WAIT_COUNT > 60 )); then # 2 minutes timeout if (( WAIT_COUNT > 60 )); then # 2 minutes timeout
echo "" echo ""
echo "❌ Timeout: Windows VM failed to start within 2 minutes" echo "❌ Timeout: Windows VM failed to start within 2 minutes"
echo " Check logs: docker logs nnomarchy-windows" echo " Check logs: docker logs nomarchy-windows"
exit 1 exit 1
fi fi
done done
@@ -315,7 +315,7 @@ launch_windows() {
# Build the connection info # Build the connection info
if [[ $KEEP_ALIVE = "true" ]]; then if [[ $KEEP_ALIVE = "true" ]]; then
LIFECYCLE="VM will keep running after RDP closes LIFECYCLE="VM will keep running after RDP closes
To stop: nnomarchy-windows-vm stop" To stop: nomarchy-windows-vm stop"
else else
LIFECYCLE="VM will auto-stop when RDP closes" LIFECYCLE="VM will auto-stop when RDP closes"
fi fi
@@ -342,7 +342,7 @@ To stop: nnomarchy-windows-vm stop"
# If scale is less than 130%, don't set any scale (use default 100) # If scale is less than 130%, don't set any scale (use default 100)
# Connect with RDP in fullscreen (auto-detects resolution) # Connect with RDP in fullscreen (auto-detects resolution)
xfreerdp3 /u:"$WIN_USER" /p:"$WIN_PASS" /v:127.0.0.1:3389 -grab-keyboard /sound /microphone /clipboard /cert:ignore /title:"Windows VM - Nnomarchy" /dynamic-resolution /gfx:AVC444 /floatbar:sticky:off,default:visible,show:fullscreen $RDP_SCALE xfreerdp3 /u:"$WIN_USER" /p:"$WIN_PASS" /v:127.0.0.1:3389 -grab-keyboard /sound /microphone /clipboard /cert:ignore /title:"Windows VM - Nomarchy" /dynamic-resolution /gfx:AVC444 /floatbar:sticky:off,default:visible,show:fullscreen $RDP_SCALE
# After RDP closes, stop the container unless --keep-alive was specified # After RDP closes, stop the container unless --keep-alive was specified
if [[ $KEEP_ALIVE = "false" ]]; then if [[ $KEEP_ALIVE = "false" ]]; then
@@ -353,7 +353,7 @@ To stop: nnomarchy-windows-vm stop"
else else
echo "" echo ""
echo "RDP session closed. Windows VM is still running." echo "RDP session closed. Windows VM is still running."
echo "To stop it: nnomarchy-windows-vm stop" echo "To stop it: nomarchy-windows-vm stop"
fi fi
} }
@@ -371,15 +371,15 @@ stop_windows() {
status_windows() { status_windows() {
if [[ ! -f $COMPOSE_FILE ]]; then if [[ ! -f $COMPOSE_FILE ]]; then
echo "Windows VM not configured." echo "Windows VM not configured."
echo "To set up: nnomarchy-windows-vm install" echo "To set up: nomarchy-windows-vm install"
exit 1 exit 1
fi fi
CONTAINER_STATUS=$(docker inspect --format='{{.State.Status}}' nnomarchy-windows 2>/dev/null) CONTAINER_STATUS=$(docker inspect --format='{{.State.Status}}' nomarchy-windows 2>/dev/null)
if [[ -z $CONTAINER_STATUS ]]; then if [[ -z $CONTAINER_STATUS ]]; then
echo "Windows VM container not found." echo "Windows VM container not found."
echo "To start: nnomarchy-windows-vm launch" echo "To start: nomarchy-windows-vm launch"
elif [[ $CONTAINER_STATUS = "running" ]]; then elif [[ $CONTAINER_STATUS = "running" ]]; then
gum style \ gum style \
--border normal \ --border normal \
@@ -391,16 +391,16 @@ status_windows() {
"Web interface: http://127.0.0.1:8006" \ "Web interface: http://127.0.0.1:8006" \
"RDP available: port 3389" \ "RDP available: port 3389" \
"" \ "" \
"To connect: nnomarchy-windows-vm launch" \ "To connect: nomarchy-windows-vm launch" \
"To stop: nnomarchy-windows-vm stop" "To stop: nomarchy-windows-vm stop"
else else
echo "Windows VM is stopped (status: $CONTAINER_STATUS)" echo "Windows VM is stopped (status: $CONTAINER_STATUS)"
echo "To start: nnomarchy-windows-vm launch" echo "To start: nomarchy-windows-vm launch"
fi fi
} }
show_usage() { show_usage() {
echo "Usage: nnomarchy-windows-vm [command] [options]" echo "Usage: nomarchy-windows-vm [command] [options]"
echo "" echo ""
echo "Commands:" echo "Commands:"
echo " install Install and configure Windows VM" echo " install Install and configure Windows VM"
@@ -413,10 +413,10 @@ show_usage() {
echo " help Show this help message" echo " help Show this help message"
echo "" echo ""
echo "Examples:" echo "Examples:"
echo " nnomarchy-windows-vm install # Set up Windows VM for first time" echo " nomarchy-windows-vm install # Set up Windows VM for first time"
echo " nnomarchy-windows-vm launch # Connect to VM (auto-stop on exit)" echo " nomarchy-windows-vm launch # Connect to VM (auto-stop on exit)"
echo " nnomarchy-windows-vm launch -k # Connect to VM (keep running)" echo " nomarchy-windows-vm launch -k # Connect to VM (keep running)"
echo " nnomarchy-windows-vm stop # Shut down the VM" echo " nomarchy-windows-vm stop # Shut down the VM"
} }
# Main command dispatcher # Main command dispatcher

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Returns the battery full capacity in Wh (rounded to whole number). # Returns the battery full capacity in Wh (rounded to whole number).
# Used by nnomarchy-battery-status for displaying battery capacity. # Used by nomarchy-battery-status for displaying battery capacity.
battery_info=$(upower -i $(upower -e | grep BAT)) battery_info=$(upower -i $(upower -e | grep BAT))

View File

@@ -3,13 +3,13 @@
# Designed to be run by systemd timer every 30 seconds and alerts if battery is low # Designed to be run by systemd timer every 30 seconds and alerts if battery is low
BATTERY_THRESHOLD=10 BATTERY_THRESHOLD=10
NOTIFICATION_FLAG="/run/user/$UID/nnomarchy_battery_notified" NOTIFICATION_FLAG="/run/user/$UID/nomarchy_battery_notified"
BATTERY_LEVEL=$(nnomarchy-battery-remaining) BATTERY_LEVEL=$(nomarchy-battery-remaining)
BATTERY_STATE=$(upower -i $(upower -e | grep 'BAT') | grep -E "state" | awk '{print $2}') BATTERY_STATE=$(upower -i $(upower -e | grep 'BAT') | grep -E "state" | awk '{print $2}')
send_notification() { send_notification() {
notify-send -u critical "󱐋 Time to recharge!" "Battery is down to ${1}%" -i battery-caution -t 30000 notify-send -u critical "󱐋 Time to recharge!" "Battery is down to ${1}%" -i battery-caution -t 30000
nnomarchy-hook battery-low "$1" nomarchy-hook battery-low "$1"
} }
if [[ -n $BATTERY_LEVEL && $BATTERY_LEVEL =~ ^[0-9]+$ ]]; then if [[ -n $BATTERY_LEVEL && $BATTERY_LEVEL =~ ^[0-9]+$ ]]; then

View File

@@ -18,8 +18,8 @@ power_rate=$(echo "$battery_info" | awk '/energy-rate/ {
}') }')
state=$(echo "$battery_info" | awk '/state/ { print $2; exit }') state=$(echo "$battery_info" | awk '/state/ { print $2; exit }')
time_remaining=$(nnomarchy-battery-remaining-time) time_remaining=$(nomarchy-battery-remaining-time)
capacity=$(nnomarchy-battery-capacity) capacity=$(nomarchy-battery-capacity)
if [[ $state == "charging" ]]; then if [[ $state == "charging" ]]; then
echo "󰁹 Battery ${percentage}% · ${time_remaining} to full ·  ${power_rate}W / ${capacity}Wh" echo "󰁹 Battery ${percentage}% · ${time_remaining} to full ·  ${power_rate}W / ${capacity}Wh"

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Adjust brightness on the most likely display device. # Adjust brightness on the most likely display device.
# Usage: nnomarchy-brightness-display <step> # Usage: nomarchy-brightness-display <step>
step="${1:-+5%}" step="${1:-+5%}"
@@ -18,4 +18,4 @@ done
brightnessctl -d "$device" set "$step" >/dev/null brightnessctl -d "$device" set "$step" >/dev/null
# Use SwayOSD to display the new brightness setting. # Use SwayOSD to display the new brightness setting.
nnomarchy-swayosd-brightness "$(brightnessctl -d "$device" -m | cut -d',' -f4 | tr -d '%')" nomarchy-swayosd-brightness "$(brightnessctl -d "$device" -m | cut -d',' -f4 | tr -d '%')"

View File

@@ -8,5 +8,5 @@ else
device="$(sudo asdcontrol --detect /dev/usb/hiddev* | grep ^/dev/usb/hiddev | cut -d: -f1)" device="$(sudo asdcontrol --detect /dev/usb/hiddev* | grep ^/dev/usb/hiddev | cut -d: -f1)"
sudo asdcontrol "$device" -- "$1" >/dev/null sudo asdcontrol "$device" -- "$1" >/dev/null
value="$(sudo asdcontrol "$device" | awk -F= '/BRIGHTNESS=/{print $2+0}')" value="$(sudo asdcontrol "$device" | awk -F= '/BRIGHTNESS=/{print $2+0}')"
nnomarchy-swayosd-brightness "$(( value * 100 / 60000 ))" nomarchy-swayosd-brightness "$(( value * 100 / 60000 ))"
fi fi

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Adjust keyboard backlight brightness using available steps. # Adjust keyboard backlight brightness using available steps.
# Usage: nnomarchy-brightness-keyboard <up|down|cycle> # Usage: nomarchy-brightness-keyboard <up|down|cycle>
direction="${1:-up}" direction="${1:-up}"
@@ -39,4 +39,4 @@ brightnessctl -d "$device" set "$new_brightness" >/dev/null
# Use SwayOSD to display the new brightness setting. # Use SwayOSD to display the new brightness setting.
percent=$((new_brightness * 100 / max_brightness)) percent=$((new_brightness * 100 / max_brightness))
nnomarchy-swayosd-kbd-brightness "$percent" nomarchy-swayosd-kbd-brightness "$percent"

View File

@@ -3,4 +3,4 @@
# Detect whether the computer is a Framework Laptop 16. # Detect whether the computer is a Framework Laptop 16.
[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Framework" ]] && [[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Framework" ]] &&
nnomarchy-hw-match "Laptop 16" nomarchy-hw-match "Laptop 16"

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Match against the computer's DMI product name (case-insensitive). # Match against the computer's DMI product name (case-insensitive).
# Usage: nnomarchy-hw-match "XPS" # Usage: nomarchy-hw-match "XPS"
grep -qi "$1" /sys/class/dmi/id/product_name 2>/dev/null grep -qi "$1" /sys/class/dmi/id/product_name 2>/dev/null

View File

@@ -3,4 +3,4 @@
# Detect whether the computer is a Microsoft Surface device. # Detect whether the computer is a Microsoft Surface device.
[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Microsoft Corporation" ]] && [[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Microsoft Corporation" ]] &&
nnomarchy-hw-match "Surface" nomarchy-hw-match "Surface"

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Returns a list of all the available power profiles on the system. # Returns a list of all the available power profiles on the system.
# Used by the Nnomarchy Menu under Setup > Power Profile. # Used by the Nomarchy Menu under Setup > Power Profile.
powerprofilesctl list | powerprofilesctl list |
awk '/^\s*[* ]\s*[a-zA-Z0-9\-]+:$/ { gsub(/^[*[:space:]]+|:$/,""); print }' | awk '/^\s*[* ]\s*[a-zA-Z0-9\-]+:$/ { gsub(/^[*[:space:]]+|:$/,""); print }' |

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Restart makima - key remapping service for remapping Copilot key to Nnomarchy Menu # Restart makima - key remapping service for remapping Copilot key to Nomarchy Menu
sudo systemctl restart makima sudo systemctl restart makima

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Toggle dedicated vs integrated GPU mode via supergfxd (for hybrid gpu laptops, like Asus G14). # Toggle dedicated vs integrated GPU mode via supergfxd (for hybrid gpu laptops, like Asus G14).
# Declarative enablement + Runtime mode switching for Nnomarchy NixOS. # Declarative enablement + Runtime mode switching for Nomarchy NixOS.
STATE_FILE="/etc/nixos/state.json" STATE_FILE="/etc/nixos/state.json"
@@ -30,14 +30,14 @@ case "$gpu_mode" in
if gum confirm "Switch to Hybrid mode (enables dGPU) and reboot?"; then if gum confirm "Switch to Hybrid mode (enables dGPU) and reboot?"; then
supergfxctl -m Hybrid supergfxctl -m Hybrid
echo "Switching to Hybrid mode..." echo "Switching to Hybrid mode..."
nnomarchy-system-reboot nomarchy-system-reboot
fi fi
;; ;;
"Hybrid") "Hybrid")
if gum confirm "Switch to Integrated mode (disables dGPU) and reboot?"; then if gum confirm "Switch to Integrated mode (disables dGPU) and reboot?"; then
supergfxctl -m Integrated supergfxctl -m Integrated
echo "Switching to Integrated mode..." echo "Switching to Integrated mode..."
nnomarchy-system-reboot nomarchy-system-reboot
fi fi
;; ;;
*) *)

View File

@@ -1,14 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Toggles wifi power saving declaratively. # Toggles wifi power saving declaratively.
# Usage: nnomarchy-wifi-powersave <on|off> # Usage: nomarchy-wifi-powersave <on|off>
STATE_FILE="/etc/nixos/state.json" STATE_FILE="/etc/nixos/state.json"
case "$1" in case "$1" in
on) value="true" ;; on) value="true" ;;
off) value="false" ;; off) value="false" ;;
*) echo "Usage: nnomarchy-wifi-powersave <on|off>"; exit 1 ;; *) echo "Usage: nomarchy-wifi-powersave <on|off>"; exit 1 ;;
esac esac
sudo jq ".wifi.powersave = $value" "$STATE_FILE" > /tmp/state.json && sudo mv /tmp/state.json "$STATE_FILE" sudo jq ".wifi.powersave = $value" "$STATE_FILE" > /tmp/state.json && sudo mv /tmp/state.json "$STATE_FILE"

View File

@@ -11,7 +11,7 @@ SWAPSIZE=$(( 1024 * ${SWAPSIZE_KB:-0} ))
HIBERNATION_IMAGE_SIZE=$(cat /sys/power/image_size) HIBERNATION_IMAGE_SIZE=$(cat /sys/power/image_size)
if (( SWAPSIZE > HIBERNATION_IMAGE_SIZE )) && [[ -f /etc/mkinitcpio.conf.d/nnomarchy_resume.conf ]]; then if (( SWAPSIZE > HIBERNATION_IMAGE_SIZE )) && [[ -f /etc/mkinitcpio.conf.d/nomarchy_resume.conf ]]; then
exit 0 exit 0
else else
exit 1 exit 1

View File

@@ -3,7 +3,7 @@
# Removes hibernation setup: disables swap, removes swapfile, removes fstab entry, # Removes hibernation setup: disables swap, removes swapfile, removes fstab entry,
# removes resume hook, and removes suspend-then-hibernate configuration. # removes resume hook, and removes suspend-then-hibernate configuration.
MKINITCPIO_CONF="/etc/mkinitcpio.conf.d/nnomarchy_resume.conf" MKINITCPIO_CONF="/etc/mkinitcpio.conf.d/nomarchy_resume.conf"
# Check if hibernation is configured # Check if hibernation is configured
if [[ ! -f $MKINITCPIO_CONF ]] || ! grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then if [[ ! -f $MKINITCPIO_CONF ]] || ! grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then

View File

@@ -13,7 +13,7 @@ if ! command -v limine-mkinitcpio &>/dev/null; then
exit 0 exit 0
fi fi
MKINITCPIO_CONF="/etc/mkinitcpio.conf.d/nnomarchy_resume.conf" MKINITCPIO_CONF="/etc/mkinitcpio.conf.d/nomarchy_resume.conf"
# Check if hibernation is already configured # Check if hibernation is already configured
if [[ -f $MKINITCPIO_CONF ]] && grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then if [[ -f $MKINITCPIO_CONF ]] && grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then
@@ -95,5 +95,5 @@ sudo limine-update
echo echo
if [[ $1 != "--force" ]] && gum confirm "Reboot to enable hibernation?"; then if [[ $1 != "--force" ]] && gum confirm "Reboot to enable hibernation?"; then
nnomarchy-system-reboot nomarchy-system-reboot
fi fi

View File

@@ -3,7 +3,7 @@
PKG_NAME="$1" PKG_NAME="$1"
if [ -z "$PKG_NAME" ]; then if [ -z "$PKG_NAME" ]; then
echo "Usage: nnomarchy-pkg-add <package-name>" echo "Usage: nomarchy-pkg-add <package-name>"
exit 1 exit 1
fi fi

View File

@@ -3,14 +3,14 @@
PKG_NAME="$1" PKG_NAME="$1"
if [ -z "$PKG_NAME" ]; then if [ -z "$PKG_NAME" ]; then
echo "Usage: nnomarchy-pkg-remove <package-name>" echo "Usage: nomarchy-pkg-remove <package-name>"
exit 1 exit 1
fi fi
STATE_FILE="$HOME/.config/home-manager/user-packages.json" STATE_FILE="$HOME/.config/home-manager/user-packages.json"
if [ ! -f "$STATE_FILE" ]; then if [ ! -f "$STATE_FILE" ]; then
echo "No packages managed by nnomarchy-pkg yet." echo "No packages managed by nomarchy-pkg yet."
exit 0 exit 0
fi fi

View File

@@ -2,4 +2,4 @@
# Restart the XCompose input method service (fcitx5) to apply new compose key settings. # Restart the XCompose input method service (fcitx5) to apply new compose key settings.
nnomarchy-restart-app fcitx5 --disable notificationitem nomarchy-restart-app fcitx5 --disable notificationitem

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Configure DNS declaratively for Nnomarchy NixOS. # Configure DNS declaratively for Nomarchy NixOS.
# Hybrid: updates /etc/nixos/state.json and runs sys-update. # Hybrid: updates /etc/nixos/state.json and runs sys-update.
STATE_FILE="/etc/nixos/state.json" STATE_FILE="/etc/nixos/state.json"

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Configure FIDO2 support declaratively for Nnomarchy NixOS. # Configure FIDO2 support declaratively for Nomarchy NixOS.
STATE_FILE="/etc/nixos/state.json" STATE_FILE="/etc/nixos/state.json"

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Configure fingerprint support declaratively for Nnomarchy NixOS. # Configure fingerprint support declaratively for Nomarchy NixOS.
STATE_FILE="/etc/nixos/state.json" STATE_FILE="/etc/nixos/state.json"

View File

@@ -2,7 +2,7 @@
# Prompt for sudo once and keep the credential alive in the background. # Prompt for sudo once and keep the credential alive in the background.
# Source this script so the trap applies to the calling shell: # Source this script so the trap applies to the calling shell:
# source nnomarchy-sudo-keepalive # source nomarchy-sudo-keepalive
sudo -v sudo -v
while true; do sudo -n true; sleep 60; done 2>/dev/null & while true; do sudo -n true; sleep 60; done 2>/dev/null &

View File

@@ -4,8 +4,8 @@
# First run: enables passwordless sudo for 15 minutes (after confirmation). # First run: enables passwordless sudo for 15 minutes (after confirmation).
# Second run: disables it early. # Second run: disables it early.
NOPASSWD_FILE="/etc/sudoers.d/99-nnomarchy-nopasswd-${USER}" NOPASSWD_FILE="/etc/sudoers.d/99-nomarchy-nopasswd-${USER}"
TIMER_NAME="nnomarchy-nopasswd-expire-${USER}" TIMER_NAME="nomarchy-nopasswd-expire-${USER}"
# Safety: if the file exists but the timer doesn't (e.g. after reboot), clean up # Safety: if the file exists but the timer doesn't (e.g. after reboot), clean up
if sudo test -f "$NOPASSWD_FILE" && ! systemctl is-active "${TIMER_NAME}.timer" &>/dev/null; then if sudo test -f "$NOPASSWD_FILE" && ! systemctl is-active "${TIMER_NAME}.timer" &>/dev/null; then
@@ -36,7 +36,7 @@ else
sudo systemd-run --on-active=15m --timer-property=AccuracySec=1s --unit="$TIMER_NAME" \ sudo systemd-run --on-active=15m --timer-property=AccuracySec=1s --unit="$TIMER_NAME" \
rm "$NOPASSWD_FILE" rm "$NOPASSWD_FILE"
echo "Passwordless sudo has been ENABLED. It will automatically disable in 15 minutes." echo "Passwordless sudo has been ENABLED. It will automatically disable in 15 minutes."
echo "Note: if you restart before then, run nnomarchy-sudo-passwordless-toggle again to disable it." echo "Note: if you restart before then, run nomarchy-sudo-passwordless-toggle again to disable it."
else else
echo "Aborted. No changes made." echo "Aborted. No changes made."
fi fi

View File

@@ -7,5 +7,5 @@
nohup bash -c "sleep 2 && uwsm stop" >/dev/null 2>&1 & nohup bash -c "sleep 2 && uwsm stop" >/dev/null 2>&1 &
# Now close all windows # Now close all windows
nnomarchy-hyprland-window-close-all nomarchy-hyprland-window-close-all
sleep 1 # Allow apps like Chrome to shutdown correctly sleep 1 # Allow apps like Chrome to shutdown correctly

View File

@@ -3,11 +3,11 @@
# Reboot command that first closes all application windows (thus giving them a chance to save state). # Reboot command that first closes all application windows (thus giving them a chance to save state).
# This is particularly helpful for applications like Chromium that otherwise won't shutdown cleanly. # This is particularly helpful for applications like Chromium that otherwise won't shutdown cleanly.
nnomarchy-state clear re*-required nomarchy-state clear re*-required
# Schedule the reboot to happen after closing windows (detached from terminal) # Schedule the reboot to happen after closing windows (detached from terminal)
nohup bash -c "sleep 2 && systemctl reboot --no-wall" >/dev/null 2>&1 & nohup bash -c "sleep 2 && systemctl reboot --no-wall" >/dev/null 2>&1 &
# Now close all windows # Now close all windows
nnomarchy-hyprland-window-close-all nomarchy-hyprland-window-close-all
sleep 1 # Allow apps like Chrome to shutdown correctly sleep 1 # Allow apps like Chrome to shutdown correctly

View File

@@ -3,11 +3,11 @@
# Shutdown command that first closes all application windows (thus giving them a chance to save state). # Shutdown command that first closes all application windows (thus giving them a chance to save state).
# This is particularly helpful for applications like Chromium that otherwise won't shutdown cleanly. # This is particularly helpful for applications like Chromium that otherwise won't shutdown cleanly.
nnomarchy-state clear re*-required nomarchy-state clear re*-required
# Schedule the shutdown to happen after closing windows (detached from terminal) # Schedule the shutdown to happen after closing windows (detached from terminal)
nohup bash -c "sleep 2 && systemctl poweroff --no-wall" >/dev/null 2>&1 & nohup bash -c "sleep 2 && systemctl poweroff --no-wall" >/dev/null 2>&1 &
# Now close all windows # Now close all windows
nnomarchy-hyprland-window-close-all nomarchy-hyprland-window-close-all
sleep 1 # Allow apps like Chrome to shutdown correctly sleep 1 # Allow apps like Chrome to shutdown correctly

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Select system timezone declaratively for Nnomarchy NixOS. # Select system timezone declaratively for Nomarchy NixOS.
STATE_FILE="/etc/nixos/state.json" STATE_FILE="/etc/nixos/state.json"

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Nnomarchy Update Script # Nomarchy Update Script
# 1. Updates the flake inputs in /etc/nixos # 1. Updates the flake inputs in /etc/nixos
# 2. Applies system-wide NixOS changes # 2. Applies system-wide NixOS changes
# 3. Applies user-level Home Manager changes # 3. Applies user-level Home Manager changes
@@ -10,11 +10,11 @@ set -e
REPO_DIR="/etc/nixos" REPO_DIR="/etc/nixos"
if [ ! -d "$REPO_DIR" ]; then if [ ! -d "$REPO_DIR" ]; then
echo "Error: $REPO_DIR not found. Are you running on a Nnomarchy system?" echo "Error: $REPO_DIR not found. Are you running on a Nomarchy system?"
exit 1 exit 1
fi fi
echo "--- Starting Nnomarchy Update ---" echo "--- Starting Nomarchy Update ---"
# 1. Update Flake Lock # 1. Update Flake Lock
echo "Updating flake inputs..." echo "Updating flake inputs..."
@@ -35,4 +35,4 @@ if [ -d "$REPO_DIR/.git" ]; then
sudo git -C "$REPO_DIR" commit -m "chore: update system (flake.lock)" || echo "No lockfile changes to commit." sudo git -C "$REPO_DIR" commit -m "chore: update system (flake.lock)" || echo "No lockfile changes to commit."
fi fi
echo "--- Nnomarchy Update Complete ---" echo "--- Nomarchy Update Complete ---"

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Build the Nnomarchy Installer ISO declaratively using the flake. # Build the Nomarchy Installer ISO declaratively using the flake.
echo "Building Nnomarchy Installer ISO..." echo "Building Nomarchy Installer ISO..."
# The output will be a symlink named 'result' in the current directory # The output will be a symlink named 'result' in the current directory
nix build .#nixosConfigurations.installerIso.config.system.build.isoImage nix build .#nixosConfigurations.installerIso.config.system.build.isoImage

View File

@@ -19,7 +19,7 @@ WEBCAM="false"
WEBCAM_DEVICE="" WEBCAM_DEVICE=""
RESOLUTION="" RESOLUTION=""
STOP_RECORDING="false" STOP_RECORDING="false"
RECORDING_FILE="/tmp/nnomarchy-screenrecord-filename" RECORDING_FILE="/tmp/nomarchy-screenrecord-filename"
for arg in "$@"; do for arg in "$@"; do
case "$arg" in case "$arg" in

View File

@@ -3,7 +3,7 @@
# Share clipboard, file, or folder using LocalSend. Bound to Super + Ctrl + S by default. # Share clipboard, file, or folder using LocalSend. Bound to Super + Ctrl + S by default.
if (($# == 0)); then if (($# == 0)); then
echo "Usage: nnomarchy-cmd-share [clipboard|file|folder]" echo "Usage: nomarchy-cmd-share [clipboard|file|folder]"
exit 1 exit 1
fi fi

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Add an EFI boot entry for the Nnomarchy UKI, allowing the system to boot directly # Add an EFI boot entry for the Nomarchy UKI, allowing the system to boot directly
# without a bootloader like Limine. Requires UEFI firmware and a built UKI. # without a bootloader like Limine. Requires UEFI firmware and a built UKI.
if [[ ! -d /sys/firmware/efi ]]; then if [[ ! -d /sys/firmware/efi ]]; then
@@ -23,10 +23,10 @@ if cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "Apple"; then
exit 1 exit 1
fi fi
uki_file=$(find /boot/EFI/Linux/ -name "nnomarchy*.efi" -printf "%f\n" 2>/dev/null | head -1) uki_file=$(find /boot/EFI/Linux/ -name "nomarchy*.efi" -printf "%f\n" 2>/dev/null | head -1)
if [[ -z $uki_file ]]; then if [[ -z $uki_file ]]; then
echo "Error: No Nnomarchy UKI found in /boot/EFI/Linux/" >&2 echo "Error: No Nomarchy UKI found in /boot/EFI/Linux/" >&2
exit 1 exit 1
fi fi
@@ -40,6 +40,6 @@ if gum confirm "Setup direct boot (so snapshot booting must be done via bios)?";
sudo efibootmgr --create \ sudo efibootmgr --create \
--disk "$disk" \ --disk "$disk" \
--part "$part" \ --part "$part" \
--label "Nnomarchy" \ --label "Nomarchy" \
--loader "\\EFI\\Linux\\$uki_file" --loader "\\EFI\\Linux\\$uki_file"
fi fi

View File

@@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
# Returns drive information about a given volumne, like /dev/nvme0, which is used by nnomarchy-drive-select. # Returns drive information about a given volumne, like /dev/nvme0, which is used by nomarchy-drive-select.
if (($# == 0)); then if (($# == 0)); then
echo "Usage: nnomarchy-drive-info [/dev/drive]" echo "Usage: nomarchy-drive-info [/dev/drive]"
exit 1 exit 1
else else
drive="$1" drive="$1"

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Select a drive from a list with info that includes space and brand. Used by nnomarchy-drive-set-password. # Select a drive from a list with info that includes space and brand. Used by nomarchy-drive-set-password.
if (($# == 0)); then if (($# == 0)); then
drives=$(lsblk -dpno NAME | grep -E '/dev/(sd|hd|vd|nvme|mmcblk|xv)') drives=$(lsblk -dpno NAME | grep -E '/dev/(sd|hd|vd|nvme|mmcblk|xv)')
@@ -11,7 +11,7 @@ fi
drives_with_info="" drives_with_info=""
while IFS= read -r drive; do while IFS= read -r drive; do
[[ -n $drive ]] || continue [[ -n $drive ]] || continue
drives_with_info+="$(nnomarchy-drive-info "$drive")"$'\n' drives_with_info+="$(nomarchy-drive-info "$drive")"$'\n'
done <<<"$drives" done <<<"$drives"
selected_drive="$(printf "%s" "$drives_with_info" | gum choose --header "Select drive")" || exit 1 selected_drive="$(printf "%s" "$drives_with_info" | gum choose --header "Select drive")" || exit 1

View File

@@ -8,7 +8,7 @@ if [[ -n $encrypted_drives ]]; then
if (( $(wc -l <<<encrypted_drives) == 1 )); then if (( $(wc -l <<<encrypted_drives) == 1 )); then
drive_to_change="$encrypted_drives" drive_to_change="$encrypted_drives"
else else
drive_to_change="$(nnomarchy-drive-select "$encrypted_drives")" drive_to_change="$(nomarchy-drive-select "$encrypted_drives")"
fi fi
if [[ -n $drive_to_change ]]; then if [[ -n $drive_to_change ]]; then

View File

@@ -1,16 +1,16 @@
#!/bin/bash #!/bin/bash
# Run a named hook, like post-update (available in ~/.config/nnomarchy/hooks/post-update). # Run a named hook, like post-update (available in ~/.config/nomarchy/hooks/post-update).
set -e set -e
if (( $# < 1 )); then if (( $# < 1 )); then
echo "Usage: nnomarchy-hook [name] [args...]" echo "Usage: nomarchy-hook [name] [args...]"
exit 1 exit 1
fi fi
HOOK=$1 HOOK=$1
HOOK_PATH="$HOME/.config/nnomarchy/hooks/$1" HOOK_PATH="$HOME/.config/nomarchy/hooks/$1"
shift shift
if [[ -f $HOOK_PATH ]]; then if [[ -f $HOOK_PATH ]]; then

View File

@@ -14,4 +14,4 @@ if pgrep -x "1password" >/dev/null; then
fi fi
# Avoid running screensaver when locked # Avoid running screensaver when locked
pkill -f org.nnomarchy.screensaver pkill -f org.nomarchy.screensaver

View File

@@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
# Launch the Nnomarchy Menu or takes a parameter to jump straight to a submenu. # Launch the Nomarchy Menu or takes a parameter to jump straight to a submenu.
export PATH="$HOME/.local/share/nnomarchy/bin:$PATH" export PATH="$HOME/.local/share/nomarchy/bin:$PATH"
# Set to true when going directly to a submenu, so we can exit directly # Set to true when going directly to a submenu, so we can exit directly
BACK_TO_EXIT=false BACK_TO_EXIT=false
@@ -42,30 +42,30 @@ menu() {
fi fi
fi fi
echo -e "$options" | nnomarchy-launch-walker --dmenu --width 295 --minheight 1 --maxheight 630 -p "$prompt…" "${args[@]}" 2>/dev/null echo -e "$options" | nomarchy-launch-walker --dmenu --width 295 --minheight 1 --maxheight 630 -p "$prompt…" "${args[@]}" 2>/dev/null
} }
terminal() { terminal() {
xdg-terminal-exec --app-id=org.nnomarchy.terminal "$@" xdg-terminal-exec --app-id=org.nomarchy.terminal "$@"
} }
present_terminal() { present_terminal() {
nnomarchy-launch-floating-terminal-with-presentation $1 nomarchy-launch-floating-terminal-with-presentation $1
} }
open_in_editor() { open_in_editor() {
notify-send -u low "Editing config file" "$1" notify-send -u low "Editing config file" "$1"
nnomarchy-launch-editor "$1" nomarchy-launch-editor "$1"
} }
show_learn_menu() { show_learn_menu() {
case $(menu "Learn" " Keybindings\n Nnomarchy\n Hyprland\n󰣇 Arch\n Neovim\n󱆃 Bash") in case $(menu "Learn" " Keybindings\n Nomarchy\n Hyprland\n󰣇 Arch\n Neovim\n󱆃 Bash") in
*Keybindings*) nnomarchy-menu-keybindings ;; *Keybindings*) nomarchy-menu-keybindings ;;
*Nnomarchy*) nnomarchy-launch-webapp "https://learn.omacom.io/2/the-nnomarchy-manual" ;; *Nomarchy*) nomarchy-launch-webapp "https://learn.omacom.io/2/the-nomarchy-manual" ;;
*Hyprland*) nnomarchy-launch-webapp "https://wiki.hypr.land/" ;; *Hyprland*) nomarchy-launch-webapp "https://wiki.hypr.land/" ;;
*Arch*) nnomarchy-launch-webapp "https://wiki.archlinux.org/title/Main_page" ;; *Arch*) nomarchy-launch-webapp "https://wiki.archlinux.org/title/Main_page" ;;
*Bash*) nnomarchy-launch-webapp "https://devhints.io/bash" ;; *Bash*) nomarchy-launch-webapp "https://devhints.io/bash" ;;
*Neovim*) nnomarchy-launch-webapp "https://www.lazyvim.org/keymaps" ;; *Neovim*) nomarchy-launch-webapp "https://www.lazyvim.org/keymaps" ;;
*) show_main_menu ;; *) show_main_menu ;;
esac esac
} }
@@ -82,7 +82,7 @@ show_trigger_menu() {
show_capture_menu() { show_capture_menu() {
case $(menu "Capture" " Screenshot\n Screenrecord\n󰃉 Color") in case $(menu "Capture" " Screenshot\n Screenrecord\n󰃉 Color") in
*Screenshot*) nnomarchy-cmd-screenshot ;; *Screenshot*) nomarchy-cmd-screenshot ;;
*Screenrecord*) show_screenrecord_menu ;; *Screenrecord*) show_screenrecord_menu ;;
*Color*) pkill hyprpicker || hyprpicker -a ;; *Color*) pkill hyprpicker || hyprpicker -a ;;
*) back_to show_trigger_menu ;; *) back_to show_trigger_menu ;;
@@ -117,18 +117,18 @@ show_webcam_select_menu() {
} }
show_screenrecord_menu() { show_screenrecord_menu() {
nnomarchy-cmd-screenrecord --stop-recording && exit 0 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 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 no audio") nomarchy-cmd-screenrecord ;;
*"With desktop audio") nnomarchy-cmd-screenrecord --with-desktop-audio ;; *"With desktop audio") nomarchy-cmd-screenrecord --with-desktop-audio ;;
*"With desktop + microphone audio") nnomarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio ;; *"With desktop + microphone audio") nomarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio ;;
*"With desktop + microphone audio + webcam") *"With desktop + microphone audio + webcam")
local device=$(show_webcam_select_menu) || { local device=$(show_webcam_select_menu) || {
back_to show_capture_menu back_to show_capture_menu
return return
} }
nnomarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio --with-webcam --webcam-device="$device" nomarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio --with-webcam --webcam-device="$device"
;; ;;
*) back_to show_capture_menu ;; *) back_to show_capture_menu ;;
esac esac
@@ -136,9 +136,9 @@ show_screenrecord_menu() {
show_share_menu() { show_share_menu() {
case $(menu "Share" " Clipboard\n File \n Folder") in case $(menu "Share" " Clipboard\n File \n Folder") in
*Clipboard*) nnomarchy-cmd-share clipboard ;; *Clipboard*) nomarchy-cmd-share clipboard ;;
*File*) terminal bash -c "nnomarchy-cmd-share file" ;; *File*) terminal bash -c "nomarchy-cmd-share file" ;;
*Folder*) terminal bash -c "nnomarchy-cmd-share folder" ;; *Folder*) terminal bash -c "nomarchy-cmd-share folder" ;;
*) back_to show_trigger_menu ;; *) back_to show_trigger_menu ;;
esac esac
} }
@@ -146,21 +146,21 @@ show_share_menu() {
show_toggle_menu() { 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 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 ;; *Screensaver*) nomarchy-toggle-screensaver ;;
*Nightlight*) nnomarchy-toggle-nightlight ;; *Nightlight*) nomarchy-toggle-nightlight ;;
*Idle*) nnomarchy-toggle-idle ;; *Idle*) nomarchy-toggle-idle ;;
*Bar*) nnomarchy-toggle-waybar ;; *Bar*) nomarchy-toggle-waybar ;;
*Layout*) nnomarchy-hyprland-workspace-layout-toggle ;; *Layout*) nomarchy-hyprland-workspace-layout-toggle ;;
*Ratio*) nnomarchy-hyprland-window-single-square-aspect-toggle ;; *Ratio*) nomarchy-hyprland-window-single-square-aspect-toggle ;;
*Gaps*) nnomarchy-hyprland-window-gaps-toggle ;; *Gaps*) nomarchy-hyprland-window-gaps-toggle ;;
*Scaling*) nnomarchy-hyprland-monitor-scaling-cycle ;; *Scaling*) nomarchy-hyprland-monitor-scaling-cycle ;;
*) back_to show_trigger_menu ;; *) back_to show_trigger_menu ;;
esac esac
} }
show_hardware_menu() { show_hardware_menu() {
case $(menu "Toggle" " Hybrid GPU") in case $(menu "Toggle" " Hybrid GPU") in
*"Hybrid GPU"*) present_terminal nnomarchy-toggle-hybrid-gpu ;; *"Hybrid GPU"*) present_terminal nomarchy-toggle-hybrid-gpu ;;
*) show_trigger_menu ;; *) show_trigger_menu ;;
esac esac
} }
@@ -171,26 +171,26 @@ show_style_menu() {
*Font*) show_font_menu ;; *Font*) show_font_menu ;;
*Background*) show_background_menu ;; *Background*) show_background_menu ;;
*Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;; *Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;;
*Screensaver*) open_in_editor ~/.config/nnomarchy/branding/screensaver.txt ;; *Screensaver*) open_in_editor ~/.config/nomarchy/branding/screensaver.txt ;;
*About*) open_in_editor ~/.config/nnomarchy/branding/about.txt ;; *About*) open_in_editor ~/.config/nomarchy/branding/about.txt ;;
*) show_main_menu ;; *) show_main_menu ;;
esac esac
} }
show_theme_menu() { show_theme_menu() {
nnomarchy-launch-walker -m menus:nnomarchythemes --width 800 --minheight 400 nomarchy-launch-walker -m menus:nomarchythemes --width 800 --minheight 400
} }
show_background_menu() { show_background_menu() {
nnomarchy-launch-walker -m menus:nnomarchyBackgroundSelector --width 800 --minheight 400 nomarchy-launch-walker -m menus:nomarchyBackgroundSelector --width 800 --minheight 400
} }
show_font_menu() { show_font_menu() {
theme=$(menu "Font" "$(nnomarchy-font-list)" "--width 350" "$(nnomarchy-font-current)") theme=$(menu "Font" "$(nomarchy-font-list)" "--width 350" "$(nomarchy-font-current)")
if [[ $theme == "CNCLD" || -z $theme ]]; then if [[ $theme == "CNCLD" || -z $theme ]]; then
back_to show_style_menu back_to show_style_menu
else else
nnomarchy-font-set "$theme" nomarchy-font-set "$theme"
fi fi
} }
@@ -202,16 +202,16 @@ show_setup_menu() {
options="$options\n󰱔 DNS\n Security\n Config" options="$options\n󰱔 DNS\n Security\n Config"
case $(menu "Setup" "$options") in case $(menu "Setup" "$options") in
*Audio*) nnomarchy-launch-audio ;; *Audio*) nomarchy-launch-audio ;;
*Wifi*) nnomarchy-launch-wifi ;; *Wifi*) nomarchy-launch-wifi ;;
*Bluetooth*) nnomarchy-launch-bluetooth ;; *Bluetooth*) nomarchy-launch-bluetooth ;;
*Power*) show_setup_power_menu ;; *Power*) show_setup_power_menu ;;
*System*) show_setup_system_menu ;; *System*) show_setup_system_menu ;;
*Monitors*) open_in_editor ~/.config/hypr/monitors.conf ;; *Monitors*) open_in_editor ~/.config/hypr/monitors.conf ;;
*Keybindings*) open_in_editor ~/.config/hypr/bindings.conf ;; *Keybindings*) open_in_editor ~/.config/hypr/bindings.conf ;;
*Input*) open_in_editor ~/.config/hypr/input.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 ;; *Key\ Remapping*) nomarchy-setup-makima && open_in_editor "$HOME/.config/makima/AT Translated Set 2 keyboard.toml" && nomarchy-restart-makima ;;
*DNS*) present_terminal nnomarchy-setup-dns ;; *DNS*) present_terminal nomarchy-setup-dns ;;
*Security*) show_setup_security_menu ;; *Security*) show_setup_security_menu ;;
*Config*) show_setup_config_menu ;; *Config*) show_setup_config_menu ;;
*) show_main_menu ;; *) show_main_menu ;;
@@ -219,7 +219,7 @@ show_setup_menu() {
} }
show_setup_power_menu() { show_setup_power_menu() {
profile=$(menu "Power Profile" "$(nnomarchy-powerprofiles-list)" "" "$(powerprofilesctl get)") profile=$(menu "Power Profile" "$(nomarchy-powerprofiles-list)" "" "$(powerprofilesctl get)")
if [[ $profile == "CNCLD" || -z $profile ]]; then if [[ $profile == "CNCLD" || -z $profile ]]; then
back_to show_setup_menu back_to show_setup_menu
@@ -230,8 +230,8 @@ show_setup_power_menu() {
show_setup_security_menu() { show_setup_security_menu() {
case $(menu "Setup" "󰈷 Fingerprint\n Fido2") in case $(menu "Setup" "󰈷 Fingerprint\n Fido2") in
*Fingerprint*) present_terminal nnomarchy-setup-fingerprint ;; *Fingerprint*) present_terminal nomarchy-setup-fingerprint ;;
*Fido2*) present_terminal nnomarchy-setup-fido2 ;; *Fido2*) present_terminal nomarchy-setup-fido2 ;;
*) show_setup_menu ;; *) show_setup_menu ;;
esac esac
} }
@@ -240,13 +240,13 @@ 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 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 ;; *Defaults*) open_in_editor ~/.config/uwsm/default ;;
*Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;; *Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;;
*Hypridle*) open_in_editor ~/.config/hypr/hypridle.conf && nnomarchy-restart-hypridle ;; *Hypridle*) open_in_editor ~/.config/hypr/hypridle.conf && nomarchy-restart-hypridle ;;
*Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;; *Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;;
*Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && nnomarchy-restart-hyprsunset ;; *Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && nomarchy-restart-hyprsunset ;;
*Swayosd*) open_in_editor ~/.config/swayosd/config.toml && nnomarchy-restart-swayosd ;; *Swayosd*) open_in_editor ~/.config/swayosd/config.toml && nomarchy-restart-swayosd ;;
*Walker*) open_in_editor ~/.config/walker/config.toml && nnomarchy-restart-walker ;; *Walker*) open_in_editor ~/.config/walker/config.toml && nomarchy-restart-walker ;;
*Waybar*) open_in_editor ~/.config/waybar/config.jsonc && nnomarchy-restart-waybar ;; *Waybar*) open_in_editor ~/.config/waybar/config.jsonc && nomarchy-restart-waybar ;;
*XCompose*) open_in_editor ~/.XCompose && nnomarchy-restart-xcompose ;; *XCompose*) open_in_editor ~/.XCompose && nomarchy-restart-xcompose ;;
*) show_setup_menu ;; *) show_setup_menu ;;
esac esac
} }
@@ -260,16 +260,16 @@ show_setup_system_menu() {
options="$options󰒲 Disable Suspend" options="$options󰒲 Disable Suspend"
fi fi
if nnomarchy-hibernation-available; then if nomarchy-hibernation-available; then
options="$options\n󰤁 Disable Hibernate" options="$options\n󰤁 Disable Hibernate"
else else
options="$options\n󰤁 Enable Hibernate" options="$options\n󰤁 Enable Hibernate"
fi fi
case $(menu "System" "$options") in case $(menu "System" "$options") in
*Suspend*) nnomarchy-toggle-suspend ;; *Suspend*) nomarchy-toggle-suspend ;;
*"Enable Hibernate"*) present_terminal nnomarchy-hibernation-setup ;; *"Enable Hibernate"*) present_terminal nomarchy-hibernation-setup ;;
*"Disable Hibernate"*) present_terminal nnomarchy-hibernation-remove ;; *"Disable Hibernate"*) present_terminal nomarchy-hibernation-remove ;;
*) show_setup_menu ;; *) show_setup_menu ;;
esac esac
} }
@@ -277,25 +277,25 @@ show_setup_system_menu() {
show_update_menu() { show_update_menu() {
case $(menu "Update" "  Nnomarchy\n󰸌 Extra Themes\n Process\n󰇅 Hardware\n Firmware\n Password\n Timezone\n Time") in case $(menu "Update" "  Nomarchy\n󰸌 Extra Themes\n Process\n󰇅 Hardware\n Firmware\n Password\n Timezone\n Time") in
*Nnomarchy*) present_terminal nnomarchy-update ;; *Nomarchy*) present_terminal nomarchy-update ;;
*Themes*) present_terminal nnomarchy-theme-update ;; *Themes*) present_terminal nomarchy-theme-update ;;
*Process*) show_update_process_menu ;; *Process*) show_update_process_menu ;;
*Hardware*) show_update_hardware_menu ;; *Hardware*) show_update_hardware_menu ;;
*Firmware*) present_terminal nnomarchy-update-firmware ;; *Firmware*) present_terminal nomarchy-update-firmware ;;
*Timezone*) present_terminal nnomarchy-tz-select ;; *Timezone*) present_terminal nomarchy-tz-select ;;
*Time*) present_terminal nnomarchy-update-time ;; *Time*) present_terminal nomarchy-update-time ;;
*Password*) show_update_password_menu ;; *Password*) show_update_password_menu ;;
*) show_main_menu ;; *) show_main_menu ;;
esac esac
} }
show_update_process_menu() { show_update_process_menu() {
case $(menu "Restart" " Hypridle\n Hyprsunset\n Swayosd\n󰌧 Walker\n󰍜 Waybar") in case $(menu "Restart" " Hypridle\n Hyprsunset\n Swayosd\n󰌧 Walker\n󰍜 Waybar") in
*Hypridle*) nnomarchy-restart-hypridle ;; *Hypridle*) nomarchy-restart-hypridle ;;
*Hyprsunset*) nnomarchy-restart-hyprsunset ;; *Hyprsunset*) nomarchy-restart-hyprsunset ;;
*Swayosd*) nnomarchy-restart-swayosd ;; *Swayosd*) nomarchy-restart-swayosd ;;
*Walker*) nnomarchy-restart-walker ;; *Walker*) nomarchy-restart-walker ;;
*Waybar*) nnomarchy-restart-waybar ;; *Waybar*) nomarchy-restart-waybar ;;
*) show_update_menu ;; *) show_update_menu ;;
esac esac
} }
@@ -304,39 +304,39 @@ show_update_process_menu() {
show_update_hardware_menu() { show_update_hardware_menu() {
case $(menu "Restart" " Audio\n󱚾 Wi-Fi\n󰂯 Bluetooth") in case $(menu "Restart" " Audio\n󱚾 Wi-Fi\n󰂯 Bluetooth") in
*Audio*) present_terminal nnomarchy-restart-pipewire ;; *Audio*) present_terminal nomarchy-restart-pipewire ;;
*Wi-Fi*) present_terminal nnomarchy-restart-wifi ;; *Wi-Fi*) present_terminal nomarchy-restart-wifi ;;
*Bluetooth*) present_terminal nnomarchy-restart-bluetooth ;; *Bluetooth*) present_terminal nomarchy-restart-bluetooth ;;
*) show_update_menu ;; *) show_update_menu ;;
esac esac
} }
show_update_password_menu() { show_update_password_menu() {
case $(menu "Update Password" " Drive Encryption\n User") in case $(menu "Update Password" " Drive Encryption\n User") in
*Drive*) present_terminal nnomarchy-drive-set-password ;; *Drive*) present_terminal nomarchy-drive-set-password ;;
*User*) present_terminal passwd ;; *User*) present_terminal passwd ;;
*) show_update_menu ;; *) show_update_menu ;;
esac esac
} }
show_about() { show_about() {
nnomarchy-launch-about nomarchy-launch-about
} }
show_system_menu() { show_system_menu() {
local options="󱄄 Screensaver\n Lock" local options="󱄄 Screensaver\n Lock"
[[ $NNOMARCHY_TOGGLE_SUSPEND != "false" ]] && options="$options\n󰒲 Suspend" [[ $NNOMARCHY_TOGGLE_SUSPEND != "false" ]] && options="$options\n󰒲 Suspend"
nnomarchy-hibernation-available && options="$options\n󰤁 Hibernate" nomarchy-hibernation-available && options="$options\n󰤁 Hibernate"
options="$options\n󰍃 Logout\n󰜉 Restart\n󰐥 Shutdown" options="$options\n󰍃 Logout\n󰜉 Restart\n󰐥 Shutdown"
case $(menu "System" "$options") in case $(menu "System" "$options") in
*Screensaver*) nnomarchy-launch-screensaver force ;; *Screensaver*) nomarchy-launch-screensaver force ;;
*Lock*) nnomarchy-lock-screen ;; *Lock*) nomarchy-lock-screen ;;
*Suspend*) systemctl suspend ;; *Suspend*) systemctl suspend ;;
*Hibernate*) systemctl hibernate ;; *Hibernate*) systemctl hibernate ;;
*Logout*) nnomarchy-system-logout ;; *Logout*) nomarchy-system-logout ;;
*Restart*) nnomarchy-system-reboot ;; *Restart*) nomarchy-system-reboot ;;
*Shutdown*) nnomarchy-system-shutdown ;; *Shutdown*) nomarchy-system-shutdown ;;
*) back_to show_main_menu ;; *) back_to show_main_menu ;;
esac esac
} }
@@ -366,7 +366,7 @@ go_to_menu() {
} }
# Allow user extensions and overrides # Allow user extensions and overrides
USER_EXTENSIONS="$HOME/.config/nnomarchy/extensions/menu.sh" USER_EXTENSIONS="$HOME/.config/nomarchy/extensions/menu.sh"
[[ -f $USER_EXTENSIONS ]] && source "$USER_EXTENSIONS" [[ -f $USER_EXTENSIONS ]] && source "$USER_EXTENSIONS"
toggle_existing_menu toggle_existing_menu

View File

@@ -79,7 +79,7 @@ parse_keycodes() {
# Fetch dynamic keybindings from Hyprland # Fetch dynamic keybindings from Hyprland
# #
# Also do some pre-processing: # Also do some pre-processing:
# - Remove standard Nnomarchy bin path prefix # - Remove standard Nomarchy bin path prefix
# - Remove uwsm prefix # - Remove uwsm prefix
# - Map numeric modifier key mask to a textual rendition # - Map numeric modifier key mask to a textual rendition
# - Output comma-separated values that the parser can understand # - Output comma-separated values that the parser can understand
@@ -88,7 +88,7 @@ dynamic_bindings() {
jq -r '.[] | {modmask, key, keycode, description, dispatcher, arg} | "\(.modmask),\(.key)@\(.keycode),\(.description),\(.dispatcher),\(.arg)"' | jq -r '.[] | {modmask, key, keycode, description, dispatcher, arg} | "\(.modmask),\(.key)@\(.keycode),\(.description),\(.dispatcher),\(.arg)"' |
sed -r \ sed -r \
-e 's/null//' \ -e 's/null//' \
-e 's,~/.local/share/nnomarchy/bin/,,' \ -e 's,~/.local/share/nomarchy/bin/,,' \
-e 's,uwsm app -- ,,' \ -e 's,uwsm app -- ,,' \
-e 's,uwsm-app -- ,,' \ -e 's,uwsm-app -- ,,' \
-e 's/@0//' \ -e 's/@0//' \
@@ -172,7 +172,7 @@ prioritize_entries() {
if (match(line, /Browser/) && !match(line, /Browser[[:space:]]*\(/) && !match(line, /SUPER SHIFT.*\+.*B.*→.*Browser/)) prio = 2 if (match(line, /Browser/) && !match(line, /Browser[[:space:]]*\(/) && !match(line, /SUPER SHIFT.*\+.*B.*→.*Browser/)) prio = 2
if (match(line, /File manager/) && !match(line, /File manager \(cwd\)/)) prio = 3 if (match(line, /File manager/) && !match(line, /File manager \(cwd\)/)) prio = 3
if (match(line, /Launch apps/)) prio = 4 if (match(line, /Launch apps/)) prio = 4
if (match(line, /Nnomarchy menu/)) prio = 5 if (match(line, /Nomarchy menu/)) prio = 5
if (match(line, /System menu/)) prio = 6 if (match(line, /System menu/)) prio = 6
if (match(line, /Theme menu/)) prio = 7 if (match(line, /Theme menu/)) prio = 7
if (match(line, /Full screen/)) prio = 8 if (match(line, /Full screen/)) prio = 8

View File

@@ -3,7 +3,7 @@
# Dismiss a mako notification on the basis of its summary. Used by the first-run notifications to dismiss them after clicking for action. # Dismiss a mako notification on the basis of its summary. Used by the first-run notifications to dismiss them after clicking for action.
if (($# == 0)); then if (($# == 0)); then
echo "Usage: nnomarchy-notification-dismiss <summary>" echo "Usage: nomarchy-notification-dismiss <summary>"
exit 1 exit 1
fi fi

View File

@@ -1,13 +1,13 @@
#!/bin/bash #!/bin/bash
# Install an npx wrapper for a given npm package. # Install an npx wrapper for a given npm package.
# Usage: nnomarchy-npx-install <package> [command-name] # Usage: nomarchy-npx-install <package> [command-name]
# #
# If command-name is omitted, it defaults to the package name. # If command-name is omitted, it defaults to the package name.
# Example: nnomarchy-npx-install opencode-ai opencode # Example: nomarchy-npx-install opencode-ai opencode
if [[ -z $1 ]]; then if [[ -z $1 ]]; then
echo "Usage: nnomarchy-npx-install <package> [command-name]" echo "Usage: nomarchy-npx-install <package> [command-name]"
exit 1 exit 1
fi fi

View File

@@ -1,21 +1,21 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Nnomarchy on-boot initialization script. # Nomarchy on-boot initialization script.
# Automatically detects the hardware, applies necessary runtime tweaks, # Automatically detects the hardware, applies necessary runtime tweaks,
# and sets the correct screen resolution/scaling. # and sets the correct screen resolution/scaling.
# 1. Automatically configure optimal screen resolution and scaling # 1. Automatically configure optimal screen resolution and scaling
nnomarchy-hyprland-monitor-scaling-cycle >/dev/null 2>&1 nomarchy-hyprland-monitor-scaling-cycle >/dev/null 2>&1
# 2. Hardware-specific runtime tweaks # 2. Hardware-specific runtime tweaks
if nnomarchy-hw-match "Laptop 16"; then if nomarchy-hw-match "Laptop 16"; then
# Framework 16 specific tweaks # Framework 16 specific tweaks
nnomarchy-theme-set-keyboard-f16 >/dev/null 2>&1 nomarchy-theme-set-keyboard-f16 >/dev/null 2>&1
fi fi
if nnomarchy-hw-asus-rog; then if nomarchy-hw-asus-rog; then
# Asus ROG specific tweaks # Asus ROG specific tweaks
nnomarchy-theme-set-keyboard-asus-rog >/dev/null 2>&1 nomarchy-theme-set-keyboard-asus-rog >/dev/null 2>&1
fi fi
# 3. Declarative hardware configuration check (nixos-hardware) # 3. Declarative hardware configuration check (nixos-hardware)

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Overwrite the user config for fastfetch with the Nnomarchy default. # Overwrite the user config for fastfetch with the Nomarchy default.
nnomarchy-refresh-config fastfetch/config.jsonc nomarchy-refresh-config fastfetch/config.jsonc

View File

@@ -3,20 +3,20 @@
set -e set -e
COMMAND="$1" COMMAND="$1"
NOMARCHY_PATH=${NOMARCHY_PATH:-$HOME/.local/share/nnomarchy} NOMARCHY_PATH=${NOMARCHY_PATH:-$HOME/.local/share/nomarchy}
if [[ -z $COMMAND ]]; then if [[ -z $COMMAND ]]; then
echo "Usage: nnomarchy-snapshot <create|restore>" >&2 echo "Usage: nomarchy-snapshot <create|restore>" >&2
exit 1 exit 1
fi fi
if ! command -v snapper &>/dev/null; then if ! command -v snapper &>/dev/null; then
exit 127 # nnomarchy-update can use this to just ignore if snapper is not available exit 127 # nomarchy-update can use this to just ignore if snapper is not available
fi fi
case "$COMMAND" in case "$COMMAND" in
create) create)
DESC="$(nnomarchy-version)" DESC="$(nomarchy-version)"
echo -e "\e[32mCreate system snapshot\e[0m" echo -e "\e[32mCreate system snapshot\e[0m"

View File

@@ -1,24 +1,24 @@
#!/bin/bash #!/bin/bash
# Manage persistent runtime state files for Nnomarchy indicators. # Manage persistent runtime state files for Nomarchy indicators.
# Usage: nnomarchy-state <set|clear> <state-name-or-pattern> # Usage: nomarchy-state <set|clear> <state-name-or-pattern>
# Used to track whether things like reboot, restart, etc are required. # Used to track whether things like reboot, restart, etc are required.
# DO NOT use this for configuration toggles (suspend, screensaver, etc). # DO NOT use this for configuration toggles (suspend, screensaver, etc).
# Use declarative Nnomarchy NixOS home-manager options for those instead. # Use declarative Nomarchy NixOS home-manager options for those instead.
STATE_DIR="$HOME/.local/state/nnomarchy" STATE_DIR="$HOME/.local/state/nomarchy"
mkdir -p "$STATE_DIR" mkdir -p "$STATE_DIR"
COMMAND="$1" COMMAND="$1"
STATE_NAME="$2" STATE_NAME="$2"
if [[ -z $COMMAND ]]; then if [[ -z $COMMAND ]]; then
echo "Usage: nnomarchy-state <set|clear> <state-name-or-pattern>" echo "Usage: nomarchy-state <set|clear> <state-name-or-pattern>"
exit 1 exit 1
fi fi
if [[ -z $STATE_NAME ]]; then if [[ -z $STATE_NAME ]]; then
echo "Usage: nnomarchy-state $COMMAND <state-name>" echo "Usage: nomarchy-state $COMMAND <state-name>"
exit 1 exit 1
fi fi

View File

@@ -1,11 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# nnomarchy-sync: Automate backing up and restoring Nnomarchy declarative configurations and dynamic state. # nomarchy-sync: Automate backing up and restoring Nomarchy declarative configurations and dynamic state.
set -e set -e
if [[ -z $1 ]]; then if [[ -z $1 ]]; then
echo "Usage: nnomarchy-sync <push|pull> [repo-url]" echo "Usage: nomarchy-sync <push|pull> [repo-url]"
echo " push: Backup current state to the configured repository." echo " push: Backup current state to the configured repository."
echo " pull: Restore state from the configured repository and apply updates." echo " pull: Restore state from the configured repository and apply updates."
exit 1 exit 1
@@ -18,7 +18,7 @@ STATE_DIR="$HOME/.config/home-manager"
CONFIG_DIR="/etc/nixos" CONFIG_DIR="/etc/nixos"
# Identify the target repo directory (we use a local dot-folder to stage things) # Identify the target repo directory (we use a local dot-folder to stage things)
SYNC_DIR="$HOME/.local/share/nnomarchy-sync" SYNC_DIR="$HOME/.local/share/nomarchy-sync"
mkdir -p "$SYNC_DIR" mkdir -p "$SYNC_DIR"
cd "$SYNC_DIR" cd "$SYNC_DIR"
@@ -26,14 +26,14 @@ cd "$SYNC_DIR"
if [ ! -d ".git" ]; then if [ ! -d ".git" ]; then
if [[ -z $REPO_URL ]]; then if [[ -z $REPO_URL ]]; then
echo "Error: No Git repository configured. Please provide a repo-url for the first run:" echo "Error: No Git repository configured. Please provide a repo-url for the first run:"
echo "Example: nnomarchy-sync push git@github.com:username/nnomarchy-backup.git" echo "Example: nomarchy-sync push git@github.com:username/nomarchy-backup.git"
exit 1 exit 1
fi fi
git init git init
git remote add origin "$REPO_URL" git remote add origin "$REPO_URL"
# Basic configuration for automated commits # Basic configuration for automated commits
git config user.name "Nnomarchy Sync" git config user.name "Nomarchy Sync"
git config user.email "sync@nnomarchy.local" git config user.email "sync@nomarchy.local"
fi fi
if [[ "$COMMAND" == "push" ]]; then if [[ "$COMMAND" == "push" ]]; then

View File

@@ -3,7 +3,7 @@
# Toggle to pop-out a tile to stay fixed on a display basis. # Toggle to pop-out a tile to stay fixed on a display basis.
# Usage: # Usage:
# nnomarchy-hyprland-window-pop [width height [x y]] # nomarchy-hyprland-window-pop [width height [x y]]
# #
# Arguments: # Arguments:
# width Optional. Width of the floating window. Default: 1300 # width Optional. Width of the floating window. Default: 1300

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Reload hyprland configuration (used by the Nnomarchy theme switching). # Reload hyprland configuration (used by the Nomarchy theme switching).
hyprctl reload >/dev/null hyprctl reload >/dev/null

View File

@@ -2,4 +2,4 @@
# Restart the hypridle service (used for idle detection and auto-lock). # Restart the hypridle service (used for idle detection and auto-lock).
nnomarchy-restart-app hypridle nomarchy-restart-app hypridle

View File

@@ -2,4 +2,4 @@
# Restart the hyprsunset service (used for blue light filtering/night light). # Restart the hyprsunset service (used for blue light filtering/night light).
nnomarchy-restart-app hyprsunset nomarchy-restart-app hyprsunset

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Reload mako configuration (used by the Nnomarchy theme switching). # Reload mako configuration (used by the Nomarchy theme switching).
makoctl reload makoctl reload

View File

@@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
nnomarchy-restart-app swayosd-server nomarchy-restart-app swayosd-server

View File

@@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
nnomarchy-restart-app waybar nomarchy-restart-app waybar

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Display brightness level using SwayOSD on the current monitor. # Display brightness level using SwayOSD on the current monitor.
# Usage: nnomarchy-swayosd-brightness <percent> # Usage: nomarchy-swayosd-brightness <percent>
percent="$1" percent="$1"

Some files were not shown because too many files have changed in this diff Show More