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:
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 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))
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
# Designed to be run by systemd timer every 30 seconds and alerts if battery is low
|
||||
|
||||
BATTERY_THRESHOLD=10
|
||||
NOTIFICATION_FLAG="/run/user/$UID/nnomarchy_battery_notified"
|
||||
BATTERY_LEVEL=$(nnomarchy-battery-remaining)
|
||||
NOTIFICATION_FLAG="/run/user/$UID/nomarchy_battery_notified"
|
||||
BATTERY_LEVEL=$(nomarchy-battery-remaining)
|
||||
BATTERY_STATE=$(upower -i $(upower -e | grep 'BAT') | grep -E "state" | awk '{print $2}')
|
||||
|
||||
send_notification() {
|
||||
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
|
||||
|
||||
@@ -18,8 +18,8 @@ power_rate=$(echo "$battery_info" | awk '/energy-rate/ {
|
||||
}')
|
||||
|
||||
state=$(echo "$battery_info" | awk '/state/ { print $2; exit }')
|
||||
time_remaining=$(nnomarchy-battery-remaining-time)
|
||||
capacity=$(nnomarchy-battery-capacity)
|
||||
time_remaining=$(nomarchy-battery-remaining-time)
|
||||
capacity=$(nomarchy-battery-capacity)
|
||||
|
||||
if [[ $state == "charging" ]]; then
|
||||
echo " Battery ${percentage}% · ${time_remaining} to full · ${power_rate}W / ${capacity}Wh"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Adjust brightness on the most likely display device.
|
||||
# Usage: nnomarchy-brightness-display <step>
|
||||
# Usage: nomarchy-brightness-display <step>
|
||||
|
||||
step="${1:-+5%}"
|
||||
|
||||
@@ -18,4 +18,4 @@ done
|
||||
brightnessctl -d "$device" set "$step" >/dev/null
|
||||
|
||||
# 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 '%')"
|
||||
|
||||
@@ -8,5 +8,5 @@ else
|
||||
device="$(sudo asdcontrol --detect /dev/usb/hiddev* | grep ^/dev/usb/hiddev | cut -d: -f1)"
|
||||
sudo asdcontrol "$device" -- "$1" >/dev/null
|
||||
value="$(sudo asdcontrol "$device" | awk -F= '/BRIGHTNESS=/{print $2+0}')"
|
||||
nnomarchy-swayosd-brightness "$(( value * 100 / 60000 ))"
|
||||
nomarchy-swayosd-brightness "$(( value * 100 / 60000 ))"
|
||||
fi
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Adjust keyboard backlight brightness using available steps.
|
||||
# Usage: nnomarchy-brightness-keyboard <up|down|cycle>
|
||||
# Usage: nomarchy-brightness-keyboard <up|down|cycle>
|
||||
|
||||
direction="${1:-up}"
|
||||
|
||||
@@ -39,4 +39,4 @@ brightnessctl -d "$device" set "$new_brightness" >/dev/null
|
||||
|
||||
# Use SwayOSD to display the new brightness setting.
|
||||
percent=$((new_brightness * 100 / max_brightness))
|
||||
nnomarchy-swayosd-kbd-brightness "$percent"
|
||||
nomarchy-swayosd-kbd-brightness "$percent"
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
# Detect whether the computer is a Framework Laptop 16.
|
||||
|
||||
[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Framework" ]] &&
|
||||
nnomarchy-hw-match "Laptop 16"
|
||||
nomarchy-hw-match "Laptop 16"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 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
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
# Detect whether the computer is a Microsoft Surface device.
|
||||
|
||||
[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Microsoft Corporation" ]] &&
|
||||
nnomarchy-hw-match "Surface"
|
||||
nomarchy-hw-match "Surface"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 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 |
|
||||
awk '/^\s*[* ]\s*[a-zA-Z0-9\-]+:$/ { gsub(/^[*[:space:]]+|:$/,""); print }' |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 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"
|
||||
|
||||
@@ -30,14 +30,14 @@ case "$gpu_mode" in
|
||||
if gum confirm "Switch to Hybrid mode (enables dGPU) and reboot?"; then
|
||||
supergfxctl -m Hybrid
|
||||
echo "Switching to Hybrid mode..."
|
||||
nnomarchy-system-reboot
|
||||
nomarchy-system-reboot
|
||||
fi
|
||||
;;
|
||||
"Hybrid")
|
||||
if gum confirm "Switch to Integrated mode (disables dGPU) and reboot?"; then
|
||||
supergfxctl -m Integrated
|
||||
echo "Switching to Integrated mode..."
|
||||
nnomarchy-system-reboot
|
||||
nomarchy-system-reboot
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Toggles wifi power saving declaratively.
|
||||
# Usage: nnomarchy-wifi-powersave <on|off>
|
||||
# Usage: nomarchy-wifi-powersave <on|off>
|
||||
|
||||
STATE_FILE="/etc/nixos/state.json"
|
||||
|
||||
case "$1" in
|
||||
on) value="true" ;;
|
||||
off) value="false" ;;
|
||||
*) echo "Usage: nnomarchy-wifi-powersave <on|off>"; exit 1 ;;
|
||||
*) echo "Usage: nomarchy-wifi-powersave <on|off>"; exit 1 ;;
|
||||
esac
|
||||
|
||||
sudo jq ".wifi.powersave = $value" "$STATE_FILE" > /tmp/state.json && sudo mv /tmp/state.json "$STATE_FILE"
|
||||
|
||||
Reference in New Issue
Block a user