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

@@ -2,4 +2,4 @@
# 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
# 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
# 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.
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).
# 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
nvim | vim | nano | micro | hx | helix | fresh)
exec nnomarchy-launch-tui "$EDITOR" "$@"
exec nomarchy-launch-tui "$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.
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
fi

View File

@@ -1,9 +1,9 @@
#!/bin/bash
# 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")"
LAUNCH_COMMAND="nnomarchy-launch-tui $@"
APP_ID="org.nomarchy.$(basename "$1")"
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.
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
fi
WINDOW_PATTERN="$1"
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
# 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
if ! command -v tte &>/dev/null; then
@@ -8,7 +8,7 @@ if ! command -v tte &>/dev/null; then
fi
# 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
# Skip if screensaver is disabled in configuration
@@ -29,23 +29,23 @@ for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
case $terminal in
*Alacritty*)
hyprctl dispatch exec -- \
alacritty --class=org.nnomarchy.screensaver \
--config-file ~/.local/share/nnomarchy/default/alacritty/screensaver.toml \
-e nnomarchy-cmd-screensaver
alacritty --class=org.nomarchy.screensaver \
--config-file ~/.local/share/nomarchy/default/alacritty/screensaver.toml \
-e nomarchy-cmd-screensaver
;;
*ghostty*)
hyprctl dispatch exec -- \
ghostty --class=org.nnomarchy.screensaver \
--config-file=~/.local/share/nnomarchy/default/ghostty/screensaver \
ghostty --class=org.nomarchy.screensaver \
--config-file=~/.local/share/nomarchy/default/ghostty/screensaver \
--font-size=18 \
-e nnomarchy-cmd-screensaver
-e nomarchy-cmd-screensaver
;;
*kitty*)
hyprctl dispatch exec -- \
kitty --class=org.nnomarchy.screensaver \
kitty --class=org.nomarchy.screensaver \
--override font_size=18 \
--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"

View File

@@ -1,5 +1,5 @@
#!/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
# 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.
rfkill unblock wifi
nnomarchy-launch-or-focus-tui impala
nomarchy-launch-or-focus-tui impala

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# 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
setsid uwsm-app -- "$@" >/dev/null 2>&1 &

View File

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

View File

@@ -1,6 +1,6 @@
#!/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
killall -SIGUSR2 opencode

View File

@@ -1,6 +1,6 @@
#!/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.).
set -e

View File

@@ -3,4 +3,4 @@ set -e
# 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.
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
mkdir -p ~/.config/voxtype
cp ~/.config/nomarchy/default/voxtype/config.toml ~/.config/voxtype/
voxtype setup --download --no-post-install
if nnomarchy-hw-vulkan; then
if nomarchy-hw-vulkan; then
voxtype setup gpu --enable || true
fi
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
fi

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
#!/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
echo "$line" | jq -c '. + {alt: .class}'
done

View File

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

View File

@@ -60,7 +60,7 @@ else
fi
# 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
DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop"

View File

@@ -8,7 +8,7 @@ DESKTOP_DIR="$HOME/.local/share/applications/"
if (( $# == 0 )); then
# Find all web apps
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}")")
fi
done < <(find "$DESKTOP_DIR" -name '*.desktop' -print0)

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# Remove all web apps installed via nnomarchy-webapp-install.
# Identifies web apps by their Exec pattern (nnomarchy-launch-webapp or nnomarchy-webapp-handler).
# Remove all web apps installed via nomarchy-webapp-install.
# Identifies web apps by their Exec pattern (nomarchy-launch-webapp or nomarchy-webapp-handler).
set -e
@@ -12,7 +12,7 @@ echo "Scanning for web apps in $APP_DIR..."
webapp_desktop_files=()
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")
fi
done < <(find "$APP_DIR" -maxdepth 1 -name "*.desktop" -print0 2>/dev/null)

View File

@@ -35,7 +35,7 @@ install_windows() {
check_prerequisites
nnomarchy-pkg-add freerdp openbsd-netcat gum
nomarchy-pkg-add freerdp openbsd-netcat gum
mkdir -p "$HOME/.windows"
mkdir -p "$HOME/.config/windows"
@@ -50,7 +50,7 @@ install_windows() {
[Desktop Entry]
Name=Windows
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
Terminal=false
Type=Application
@@ -177,7 +177,7 @@ EOF
services:
windows:
image: dockurr/windows
container_name: nnomarchy-windows
container_name: nomarchy-windows
environment:
VERSION: "11"
RAM_SIZE: "$SELECTED_RAM"
@@ -236,7 +236,7 @@ EOF
echo ""
echo "Once finished, launch 'Windows' via Super + Space"
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 ""
}
@@ -269,7 +269,7 @@ launch_windows() {
# Check if config exists
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
fi
@@ -282,7 +282,7 @@ launch_windows() {
[[ -z $WIN_PASS ]] && WIN_PASS="admin"
# 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
echo "Starting Windows VM..."
@@ -292,21 +292,21 @@ launch_windows() {
if ! docker-compose -f "$COMPOSE_FILE" up -d 2>&1; then
echo "❌ Failed to start Windows VM!"
echo " Try checking: nnomarchy-windows-vm status"
echo " View logs: docker logs nnomarchy-windows"
echo " Try checking: nomarchy-windows-vm status"
echo " View logs: docker logs nomarchy-windows"
notify-send -u critical "Windows VM" "Failed to start Windows VM"
exit 1
fi
echo "Waiting for Windows VM to start..."
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
WAIT_COUNT=$((WAIT_COUNT + 1))
if (( WAIT_COUNT > 60 )); then # 2 minutes timeout
echo ""
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
fi
done
@@ -315,7 +315,7 @@ launch_windows() {
# Build the connection info
if [[ $KEEP_ALIVE = "true" ]]; then
LIFECYCLE="VM will keep running after RDP closes
To stop: nnomarchy-windows-vm stop"
To stop: nomarchy-windows-vm stop"
else
LIFECYCLE="VM will auto-stop when RDP closes"
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)
# 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
if [[ $KEEP_ALIVE = "false" ]]; then
@@ -353,7 +353,7 @@ To stop: nnomarchy-windows-vm stop"
else
echo ""
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
}
@@ -371,15 +371,15 @@ stop_windows() {
status_windows() {
if [[ ! -f $COMPOSE_FILE ]]; then
echo "Windows VM not configured."
echo "To set up: nnomarchy-windows-vm install"
echo "To set up: nomarchy-windows-vm install"
exit 1
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
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
gum style \
--border normal \
@@ -391,16 +391,16 @@ status_windows() {
"Web interface: http://127.0.0.1:8006" \
"RDP available: port 3389" \
"" \
"To connect: nnomarchy-windows-vm launch" \
"To stop: nnomarchy-windows-vm stop"
"To connect: nomarchy-windows-vm launch" \
"To stop: nomarchy-windows-vm stop"
else
echo "Windows VM is stopped (status: $CONTAINER_STATUS)"
echo "To start: nnomarchy-windows-vm launch"
echo "To start: nomarchy-windows-vm launch"
fi
}
show_usage() {
echo "Usage: nnomarchy-windows-vm [command] [options]"
echo "Usage: nomarchy-windows-vm [command] [options]"
echo ""
echo "Commands:"
echo " install Install and configure Windows VM"
@@ -413,10 +413,10 @@ show_usage() {
echo " help Show this help message"
echo ""
echo "Examples:"
echo " nnomarchy-windows-vm install # Set up Windows VM for first time"
echo " nnomarchy-windows-vm launch # Connect to VM (auto-stop on exit)"
echo " nnomarchy-windows-vm launch -k # Connect to VM (keep running)"
echo " nnomarchy-windows-vm stop # Shut down the VM"
echo " nomarchy-windows-vm install # Set up Windows VM for first time"
echo " nomarchy-windows-vm launch # Connect to VM (auto-stop on exit)"
echo " nomarchy-windows-vm launch -k # Connect to VM (keep running)"
echo " nomarchy-windows-vm stop # Shut down the VM"
}
# Main command dispatcher