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

@@ -1,6 +1,6 @@
#!/bin/bash
# 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

View File

@@ -1,5 +1,5 @@
#!/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
# 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"
if [[ -z $font_name ]]; then
echo "Usage: nnomarchy-font-set <font-name>"
echo "Usage: nomarchy-font-set <font-name>"
exit 1
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"
fi
nnomarchy-hook font-set "$font_name"
nomarchy-hook font-set "$font_name"
else
echo "Font '$font_name' not found."
exit 1

View File

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

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# 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_FILE="$STATE_DIR/state.json"
@@ -11,10 +11,10 @@ mkdir -p "$STATE_DIR"
THEME_NAME=$(jq -r '.theme // "nord"' "$STATE_FILE")
# Resolve themes directory (Built-in from Nix store via Home Manager, or user extra)
if [ -d "$HOME/.config/nnomarchy/themes/$THEME_NAME" ]; then
THEMES_DIR="$HOME/.config/nnomarchy/themes"
if [ -d "$HOME/.config/nomarchy/themes/$THEME_NAME" ]; then
THEMES_DIR="$HOME/.config/nomarchy/themes"
else
THEMES_DIR="$HOME/.local/share/nnomarchy/themes"
THEMES_DIR="$HOME/.local/share/nomarchy/themes"
fi
BG_DIR="$THEMES_DIR/$THEME_NAME/backgrounds"

View File

@@ -3,12 +3,12 @@
# Sets the specified image as the current background
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
fi
BACKGROUND="$1"
CURRENT_BACKGROUND_LINK="$HOME/.config/nnomarchy/current/background"
CURRENT_BACKGROUND_LINK="$HOME/.config/nomarchy/current/background"
# Create symlink to the new background
ln -nsf "$BACKGROUND" "$CURRENT_BACKGROUND_LINK"

View File

@@ -1,6 +1,6 @@
#!/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
cat $THEME_NAME_PATH | sed -E 's/(^|-)([a-z])/\1\u\2/g; s/-/ /g'

View File

@@ -1,10 +1,10 @@
#!/bin/bash
# nnomarchy-theme-install: Install a new theme from a git repo for Nnomarchy
# Usage: nnomarchy-theme-install <git-repo-url>
# nomarchy-theme-install: Install a new theme from a git repo for Nomarchy
# Usage: nomarchy-theme-install <git-repo-url>
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="")
else
REPO_URL="$1"
@@ -14,8 +14,8 @@ if [[ -z $REPO_URL ]]; then
exit 1
fi
THEMES_DIR="$HOME/.config/nnomarchy/themes"
THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^nnomarchy-//; s/-theme$//')
THEMES_DIR="$HOME/.config/nomarchy/themes"
THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^nomarchy-//; s/-theme$//')
THEME_PATH="$THEMES_DIR/$THEME_NAME"
# Remove existing theme if present
@@ -23,11 +23,11 @@ if [[ -d $THEME_PATH ]]; then
rm -rf "$THEME_PATH"
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
echo "Error: Failed to clone theme repo."
exit 1
fi
# Apply the new theme with nnomarchy-theme-set
nnomarchy-theme-set $THEME_NAME
# Apply the new theme with nomarchy-theme-set
nomarchy-theme-set $THEME_NAME

View File

@@ -1,7 +1,7 @@
#!/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'
} | sort -u | while read -r name; do
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.
THEME_NAME_PATH="$HOME/.config/nnomarchy/current/theme.name"
THEME_NAME_PATH="$HOME/.config/nomarchy/current/theme.name"
if [[ -f $THEME_NAME_PATH ]]; then
nnomarchy-theme-set "$(cat $THEME_NAME_PATH)"
nomarchy-theme-set "$(cat $THEME_NAME_PATH)"
fi

View File

@@ -1,10 +1,10 @@
#!/bin/bash
# nnomarchy-theme-remove: Remove a theme from Nnomarchy by name
# Usage: nnomarchy-theme-remove <theme-name>
# nomarchy-theme-remove: Remove a theme from Nomarchy by name
# Usage: nomarchy-theme-remove <theme-name>
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
THEME_NAME=$(printf '%s\n' "${extra_themes[@]}" | sort | gum choose --header="Remove extra theme")
@@ -16,8 +16,8 @@ else
THEME_NAME="$1"
fi
THEMES_DIR="$HOME/.config/nnomarchy/themes"
CURRENT_DIR="$HOME/.config/nnomarchy/current"
THEMES_DIR="$HOME/.config/nomarchy/themes"
CURRENT_DIR="$HOME/.config/nomarchy/current"
THEME_PATH="$THEMES_DIR/$THEME_NAME"
# Ensure a theme was set

View File

@@ -1,12 +1,12 @@
#!/usr/bin/env bash
# Set the system theme declaratively.
# Usage: nnomarchy-theme-set <theme-name>
# Usage: nomarchy-theme-set <theme-name>
THEME_NAME="$1"
if [[ -z $THEME_NAME ]]; then
echo "Usage: nnomarchy-theme-set <theme-name>"
echo "Usage: nomarchy-theme-set <theme-name>"
exit 1
fi
@@ -14,10 +14,10 @@ STATE_DIR="$HOME/.config/home-manager"
STATE_FILE="$STATE_DIR/state.json"
# Resolve themes directory (Built-in from Nix store via Home Manager, or user extra)
if [ -d "$HOME/.config/nnomarchy/themes/$THEME_NAME" ]; then
THEMES_DIR="$HOME/.config/nnomarchy/themes"
if [ -d "$HOME/.config/nomarchy/themes/$THEME_NAME" ]; then
THEMES_DIR="$HOME/.config/nomarchy/themes"
else
THEMES_DIR="$HOME/.local/share/nnomarchy/themes"
THEMES_DIR="$HOME/.local/share/nomarchy/themes"
fi
mkdir -p "$STATE_DIR"
@@ -26,7 +26,7 @@ mkdir -p "$STATE_DIR"
if [ ! -d "$THEMES_DIR/$THEME_NAME" ] && ! [[ "$THEME_NAME" == "nord" ]]; then
echo "Theme '$THEME_NAME' not found in $THEMES_DIR"
# 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
TMP_JSON=$(mktemp)
@@ -49,9 +49,9 @@ if [ -d "$BG_DIR" ]; then
fi
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
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
nnomarchy-theme-set-keyboard-asus-rog
nnomarchy-theme-set-keyboard-f16
nomarchy-theme-set-keyboard-asus-rog
nomarchy-theme-set-keyboard-f16

View File

@@ -1,7 +1,7 @@
#!/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)
fi

View File

@@ -1,8 +1,8 @@
#!/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="${hex#\#}"

View File

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

View File

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

View File

@@ -1,14 +1,14 @@
#!/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() {
local editor_cmd="$1"
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
theme_name=$(jq -r '.name' "$VS_CODE_THEME")

View File

@@ -1,6 +1,6 @@
#!/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
echo "Updating: $(basename "$dir")"
git -C "$dir" pull