feat(audit): address batch 1 of missing scripts and enable fwupd

- Move 18 Hyprland/desktop scripts from features/desktop/scripts/ to packaged directories
- Add nomarchy.hardware.fwupd option (default false) and enable service
- Implement nomarchy-update-firmware wrapper for fwupdmgr
- Add hyprland, swayosd, and fwupd to nomarchy-system-scripts dependencies
- Update docs/SCRIPTS.md with 'kept' status for ported scripts
This commit is contained in:
Bernardo Magri
2026-04-25 22:34:04 +01:00
parent 983ade0f55
commit 0728da4374
23 changed files with 90 additions and 67 deletions

View File

@@ -1,15 +0,0 @@
#!/bin/bash
# Display brightness level using SwayOSD on the current monitor.
# Usage: nomarchy-swayosd-brightness <percent>
percent="$1"
progress="$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')"
[[ $progress == "0.00" ]] && progress="0.01"
swayosd-client \
--monitor "$(hyprctl monitors -j | jq -r '.[]|select(.focused==true).name')" \
--custom-icon display-brightness \
--custom-progress "$progress" \
--custom-progress-text "${percent}%"

View File

@@ -1,15 +0,0 @@
#!/bin/bash
# Display keyboard brightness level using SwayOSD on the current monitor.
# Usage: nomarchy-swayosd-kbd-brightness <percent>
percent="$1"
progress="$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')"
[[ $progress == "0.00" ]] && progress="0.01"
swayosd-client \
--monitor "$(hyprctl monitors -j | jq -r '.[]|select(.focused==true).name')" \
--custom-icon keyboard-brightness \
--custom-progress "$progress" \
--custom-progress-text "${percent}%"

View File

@@ -1,26 +0,0 @@
#!/usr/bin/env bash
# Toggles the waybar top bar.
# Hybrid: updates state.json and provides instant feedback.
STATE_DIR="$HOME/.config/nomarchy"
STATE_FILE="$STATE_DIR/state.json"
mkdir -p "$STATE_DIR"
# Initialize if doesn't exist
[[ ! -f $STATE_FILE ]] && echo "{}" > "$STATE_FILE"
if [[ $NOMARCHY_TOGGLE_WAYBAR == "false" ]]; then
NEW_VALUE="true"
uwsm-app -- waybar >/dev/null 2>&1 &
notify-send -u low " Top bar enabled"
else
NEW_VALUE="false"
pkill -x waybar
notify-send -u low " Top bar disabled"
fi
TMP_JSON=$(mktemp)
jq --argjson val "$NEW_VALUE" '.waybar = $val' "$STATE_FILE" > "$TMP_JSON" && mv "$TMP_JSON" "$STATE_FILE"
echo "Waybar state set to $NEW_VALUE. Environment will be fully updated on next rebuild."

28
features/scripts/utils/nomarchy-toggle-waybar Normal file → Executable file
View File

@@ -1,10 +1,26 @@
#!/bin/bash
#!/usr/bin/env bash
# nomarchy-toggle-waybar: Toggle the Waybar status bar on and off.
# Toggles the waybar top bar.
# Hybrid: updates state.json and provides instant feedback.
if pgrep -x waybar > /dev/null; then
pkill waybar
STATE_DIR="$HOME/.config/nomarchy"
STATE_FILE="$STATE_DIR/state.json"
mkdir -p "$STATE_DIR"
# Initialize if doesn't exist
[[ ! -f $STATE_FILE ]] && echo "{}" > "$STATE_FILE"
if [[ $NOMARCHY_TOGGLE_WAYBAR == "false" ]]; then
NEW_VALUE="true"
uwsm-app -- waybar >/dev/null 2>&1 &
notify-send -u low " Top bar enabled"
else
# Start waybar in the background using uwsm
uwsm-app -- waybar &
NEW_VALUE="false"
pkill -x waybar
notify-send -u low " Top bar disabled"
fi
TMP_JSON=$(mktemp)
jq --argjson val "$NEW_VALUE" '.waybar = $val' "$STATE_FILE" > "$TMP_JSON" && mv "$TMP_JSON" "$STATE_FILE"
echo "Waybar state set to $NEW_VALUE. Environment will be fully updated on next rebuild."

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Nomarchy Firmware Update Script
# Wraps fwupdmgr to update hardware firmware.
set -e
echo "Checking for firmware updates..."
if ! fwupdmgr get-updates; then
echo "No updates available or fwupd service not running."
exit 0
fi
if gum confirm "Apply firmware updates? (Requires a reboot to finalize some updates)"; then
fwupdmgr update
echo "Firmware update complete. Please reboot if prompted."
else
echo "Update cancelled."
fi