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:
28
features/scripts/utils/nomarchy-toggle-waybar
Normal file → Executable file
28
features/scripts/utils/nomarchy-toggle-waybar
Normal file → Executable 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."
|
||||
|
||||
Reference in New Issue
Block a user