Compare commits
3 Commits
44dee82f35
...
ef78e32394
| Author | SHA1 | Date | |
|---|---|---|---|
| ef78e32394 | |||
| f5d94e8bc0 | |||
| 8f248d2a7a |
@ -49,19 +49,17 @@ value="$(start)"
|
||||
# Split input.
|
||||
# grab upto first space.
|
||||
choice=${value%%\ *}
|
||||
# graph remainder, minus space.
|
||||
input=${value:$((${#choice}+1))}
|
||||
|
||||
##
|
||||
# Cancelled? bail out
|
||||
##
|
||||
if test -z ${choice}
|
||||
if test -z "${choice}"
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
# check if choice exists
|
||||
if test ${COMMANDS[$choice]+isset}
|
||||
if test "${COMMANDS[$choice]+isset}"
|
||||
then
|
||||
# Execute the choice
|
||||
${COMMANDS[$choice]}
|
||||
|
||||
@ -2,11 +2,9 @@
|
||||
# ABOUTME: Waybar-Modul das den CPU-Governor als JSON ausgibt.
|
||||
# ABOUTME: Wird von der Waybar custom/cpugov Config referenziert.
|
||||
|
||||
while :
|
||||
do
|
||||
CPU_GOV=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
|
||||
CPU_GOV=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
|
||||
|
||||
case $CPU_GOV in
|
||||
case $CPU_GOV in
|
||||
performance)
|
||||
CPU_GOV_SHORT=
|
||||
;;
|
||||
@ -31,18 +29,13 @@ do
|
||||
*)
|
||||
CPU_GOV_SHORT="?"
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
CPU_GOV_FULL="${CPU_GOV^}"
|
||||
CPU_GOV_FULL="${CPU_GOV^}"
|
||||
|
||||
s="text|alt|tooltip|class
|
||||
$CPU_GOV_SHORT|$CPU_GOV_FULL|CPU Mode: $CPU_GOV_FULL|cpugov"
|
||||
|
||||
jq --unbuffered --compact-output -Rn '
|
||||
( input | split("|") ) as $keys |
|
||||
( inputs | split("|") ) as $vals |
|
||||
[[$keys, $vals] | transpose[] | {key:.[0],value:.[1]}] | from_entries
|
||||
' <<<"$s"
|
||||
|
||||
sleep 5
|
||||
done
|
||||
jq --compact-output -n \
|
||||
--arg text "$CPU_GOV_SHORT" \
|
||||
--arg alt "$CPU_GOV_FULL" \
|
||||
--arg tooltip "CPU Mode: $CPU_GOV_FULL" \
|
||||
--arg class "cpugov" \
|
||||
'{text: $text, alt: $alt, tooltip: $tooltip, class: $class}'
|
||||
|
||||
48
defaults/bin/moonarch-waybar-hidpp
Executable file
48
defaults/bin/moonarch-waybar-hidpp
Executable file
@ -0,0 +1,48 @@
|
||||
#!/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
|
||||
@ -15,23 +15,19 @@
|
||||
// "group/net",
|
||||
// "group/sound",
|
||||
// "backlight",
|
||||
// "custom/keyboard",
|
||||
// "battery",
|
||||
// "battery#keyboard",
|
||||
// "group/indicators"
|
||||
// ],
|
||||
|
||||
// Beispiel: Logitech-Tastatur-Akku anzeigen
|
||||
// (hidpp_battery_X ggf. anpassen — siehe /sys/class/power_supply/)
|
||||
// Beispiel: HID++ Geräte-Akku anzeigen (z.B. Logitech Tastatur)
|
||||
// moonarch-waybar-hidpp findet den richtigen hidpp_battery_* Eintrag dynamisch
|
||||
//
|
||||
// "battery#keyboard": {
|
||||
// "bat": "hidpp_battery_4",
|
||||
// "custom/keyboard": {
|
||||
// "exec": "moonarch-waybar-hidpp 'G515 LS TKL'",
|
||||
// "return-type": "json",
|
||||
// "interval": 120,
|
||||
// "states": {
|
||||
// "warning": 35,
|
||||
// "critical": 20
|
||||
// },
|
||||
// "format": "{capacity}% ",
|
||||
// "format-charging": "{capacity}% ",
|
||||
// "tooltip-format": "Tastatur: {capacity}%"
|
||||
// "format": "{}",
|
||||
// "exec-on-event": false
|
||||
// }
|
||||
}
|
||||
|
||||
@ -321,7 +321,7 @@
|
||||
"custom/cpugov": {
|
||||
"exec": "moonarch-waybar-cpugov",
|
||||
"return-type": "json",
|
||||
"restart-interval": 10,
|
||||
"interval": 5,
|
||||
"on-click": "moonarch-cpugov"
|
||||
},
|
||||
"custom/gpu-usage": {
|
||||
|
||||
@ -70,6 +70,24 @@ else
|
||||
exit 1
|
||||
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.) ---
|
||||
|
||||
log "Installiere Themes..."
|
||||
@ -136,30 +154,6 @@ if [[ ! -f "$HOME/.zshrc" ]]; then
|
||||
echo "source /etc/zsh/zshrc.moonarch" >> "$HOME/.zshrc"
|
||||
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 ---
|
||||
|
||||
log "Konfiguriere moonlock User-Service..."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user