Compare commits

..

No commits in common. "ef78e323945c00003b263140478e09e1ac298bf4" and "44dee82f35aa839daea71e422d0312e36199966c" have entirely different histories.

6 changed files with 82 additions and 111 deletions

View File

@ -49,17 +49,19 @@ value="$(start)"
# Split input. # Split input.
# grab upto first space. # grab upto first space.
choice=${value%%\ *} choice=${value%%\ *}
# graph remainder, minus space.
input=${value:$((${#choice}+1))}
## ##
# Cancelled? bail out # Cancelled? bail out
## ##
if test -z "${choice}" if test -z ${choice}
then then
exit exit
fi fi
# check if choice exists # check if choice exists
if test "${COMMANDS[$choice]+isset}" if test ${COMMANDS[$choice]+isset}
then then
# Execute the choice # Execute the choice
${COMMANDS[$choice]} ${COMMANDS[$choice]}

View File

@ -2,9 +2,11 @@
# ABOUTME: Waybar-Modul das den CPU-Governor als JSON ausgibt. # ABOUTME: Waybar-Modul das den CPU-Governor als JSON ausgibt.
# ABOUTME: Wird von der Waybar custom/cpugov Config referenziert. # ABOUTME: Wird von der Waybar custom/cpugov Config referenziert.
CPU_GOV=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) while :
do
CPU_GOV=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
case $CPU_GOV in case $CPU_GOV in
performance) performance)
CPU_GOV_SHORT=󰓅 CPU_GOV_SHORT=󰓅
;; ;;
@ -29,13 +31,18 @@ case $CPU_GOV in
*) *)
CPU_GOV_SHORT="?" CPU_GOV_SHORT="?"
;; ;;
esac esac
CPU_GOV_FULL="${CPU_GOV^}" CPU_GOV_FULL="${CPU_GOV^}"
jq --compact-output -n \ s="text|alt|tooltip|class
--arg text "$CPU_GOV_SHORT" \ $CPU_GOV_SHORT|$CPU_GOV_FULL|CPU Mode: $CPU_GOV_FULL|cpugov"
--arg alt "$CPU_GOV_FULL" \
--arg tooltip "CPU Mode: $CPU_GOV_FULL" \ jq --unbuffered --compact-output -Rn '
--arg class "cpugov" \ ( input | split("|") ) as $keys |
'{text: $text, alt: $alt, tooltip: $tooltip, class: $class}' ( inputs | split("|") ) as $vals |
[[$keys, $vals] | transpose[] | {key:.[0],value:.[1]}] | from_entries
' <<<"$s"
sleep 5
done

View File

@ -1,48 +0,0 @@
#!/usr/bin/bash
# ABOUTME: Waybar-Modul das den Batteriestatus eines HID++ Geräts als JSON ausgibt.
# ABOUTME: Findet den richtigen hidpp_battery_* Eintrag dynamisch per MODEL_NAME (Argument).
if [ -z "$1" ]; then
echo "Usage: moonarch-waybar-hidpp <model_name>" >&2
exit 1
fi
MODEL="$1"
for dev in /sys/class/power_supply/hidpp_battery_*; do
[ -d "$dev" ] || continue
name=$(cat "$dev/model_name" 2>/dev/null)
if [ "$name" = "$MODEL" ]; then
capacity=$(cat "$dev/capacity" 2>/dev/null)
status=$(cat "$dev/status" 2>/dev/null)
if [ -z "$capacity" ]; then
exit 0
fi
class="normal"
if [ "$capacity" -le 20 ]; then
class="critical"
elif [ "$capacity" -le 35 ]; then
class="warning"
fi
if [ "$status" = "Charging" ]; then
text="${capacity}% 󰌌"
else
text="${capacity}% 󰌌"
fi
tooltip="${name}: ${capacity}% (${status})"
jq --compact-output -n \
--arg text "$text" \
--arg tooltip "$tooltip" \
--arg class "$class" \
--argjson percentage "$capacity" \
'{text: $text, tooltip: $tooltip, class: $class, percentage: $percentage}'
exit 0
fi
done
# Gerät nicht gefunden — keine Ausgabe, Waybar versteckt das Modul

View File

@ -15,19 +15,23 @@
// "group/net", // "group/net",
// "group/sound", // "group/sound",
// "backlight", // "backlight",
// "custom/keyboard",
// "battery", // "battery",
// "battery#keyboard",
// "group/indicators" // "group/indicators"
// ], // ],
// Beispiel: HID++ Geräte-Akku anzeigen (z.B. Logitech Tastatur) // Beispiel: Logitech-Tastatur-Akku anzeigen
// moonarch-waybar-hidpp findet den richtigen hidpp_battery_* Eintrag dynamisch // (hidpp_battery_X ggf. anpassen — siehe /sys/class/power_supply/)
// //
// "custom/keyboard": { // "battery#keyboard": {
// "exec": "moonarch-waybar-hidpp 'G515 LS TKL'", // "bat": "hidpp_battery_4",
// "return-type": "json",
// "interval": 120, // "interval": 120,
// "format": "{}", // "states": {
// "exec-on-event": false // "warning": 35,
// "critical": 20
// },
// "format": "{capacity}% 󰌌",
// "format-charging": "{capacity}% 󰌌",
// "tooltip-format": "Tastatur: {capacity}%"
// } // }
} }

View File

@ -321,7 +321,7 @@
"custom/cpugov": { "custom/cpugov": {
"exec": "moonarch-waybar-cpugov", "exec": "moonarch-waybar-cpugov",
"return-type": "json", "return-type": "json",
"interval": 5, "restart-interval": 10,
"on-click": "moonarch-cpugov" "on-click": "moonarch-cpugov"
}, },
"custom/gpu-usage": { "custom/gpu-usage": {

View File

@ -70,24 +70,6 @@ else
exit 1 exit 1
fi fi
# --- Moonarch custom paru repo einrichten ---
log "Richte Moonarch paru-Repo ein..."
PARU_CONF="$HOME/.config/paru/paru.conf"
mkdir -p "$(dirname "$PARU_CONF")"
if ! grep -q '\[moonarch\]' "$PARU_CONF" 2>/dev/null; then
cat >> "$PARU_CONF" <<'EOCONF'
[moonarch]
Url = https://gitea.moonarch.de/nevaforget/moonarch-pkgbuilds.git
EOCONF
log " + Moonarch-Repo zu paru.conf hinzugefuegt."
else
log " ~ Moonarch-Repo bereits in paru.conf."
fi
paru -Sy --pkgbuilds --noconfirm
paru -S --needed --noconfirm moonset-git moonlock-git moongreet-git
# --- Themes installieren (Cursor etc.) --- # --- Themes installieren (Cursor etc.) ---
log "Installiere Themes..." log "Installiere Themes..."
@ -154,6 +136,30 @@ if [[ ! -f "$HOME/.zshrc" ]]; then
echo "source /etc/zsh/zshrc.moonarch" >> "$HOME/.zshrc" echo "source /etc/zsh/zshrc.moonarch" >> "$HOME/.zshrc"
fi fi
# --- moongreet installieren (Greeter aus Gitea) ---
if ! command -v moongreet &>/dev/null; then
log "Installiere moongreet..."
MOONGREET_TMPDIR=$(mktemp -d)
git clone https://gitea.moonarch.de/nevaforget/greetd-moongreet.git "$MOONGREET_TMPDIR/moongreet"
(cd "$MOONGREET_TMPDIR/moongreet/pkg" && makepkg -si --noconfirm)
rm -rf "$MOONGREET_TMPDIR"
else
log "moongreet bereits installiert."
fi
# --- moonset installieren (Power Menu aus Gitea) ---
if ! command -v moonset &>/dev/null; then
log "Installiere moonset..."
MOONSET_TMPDIR=$(mktemp -d)
git clone https://gitea.moonarch.de/nevaforget/moonset.git "$MOONSET_TMPDIR/moonset"
(cd "$MOONSET_TMPDIR/moonset" && uv pip install --system .)
rm -rf "$MOONSET_TMPDIR"
else
log "moonset bereits installiert."
fi
# --- moonlock systemd user service --- # --- moonlock systemd user service ---
log "Konfiguriere moonlock User-Service..." log "Konfiguriere moonlock User-Service..."