diff --git a/.gitea/workflows/update-pkgver.yaml b/.gitea/workflows/update-pkgver.yaml index a9afbc8..0ccf5a2 100644 --- a/.gitea/workflows/update-pkgver.yaml +++ b/.gitea/workflows/update-pkgver.yaml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout source repo run: | - git clone --bare http://gitea:3000/nevaforget/moonarch.git source.git + git clone --bare https://gitea.moonarch.de/nevaforget/moonarch.git source.git cd source.git PKGVER=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)") echo "New pkgver: $PKGVER" @@ -23,7 +23,7 @@ jobs: - name: Update PKGBUILD run: | PKGVER=$(cat /tmp/pkgver) - git clone http://gitea:3000/nevaforget/moonarch-pkgbuilds.git pkgbuilds + git clone https://gitea.moonarch.de/nevaforget/moonarch-pkgbuilds.git pkgbuilds cd pkgbuilds OLD_VER=$(grep '^pkgver=' moonarch-git/PKGBUILD | cut -d= -f2) diff --git a/ci/act-runner/Dockerfile b/ci/act-runner/Dockerfile index 34698e0..721283a 100644 --- a/ci/act-runner/Dockerfile +++ b/ci/act-runner/Dockerfile @@ -1,6 +1,6 @@ FROM archlinux:base-devel RUN pacman -Sy --noconfirm git curl && pacman -Scc --noconfirm -RUN useradd -m builder && echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +RUN useradd -m builder && echo "builder ALL=(ALL) NOPASSWD: /usr/bin/pacman" >> /etc/sudoers ADD https://gitea.com/gitea/act_runner/releases/download/v0.3.1/act_runner-0.3.1-linux-amd64 /usr/local/bin/act_runner RUN chmod +x /usr/local/bin/act_runner COPY --from=gitea/act_runner:latest /usr/local/bin/run.sh /usr/local/bin/run.sh diff --git a/defaults/bin/moonarch-btnote b/defaults/bin/moonarch-btnote index b02f9f7..8e4974c 100755 --- a/defaults/bin/moonarch-btnote +++ b/defaults/bin/moonarch-btnote @@ -8,9 +8,8 @@ ICON="battery-empty" while IFS= read -r d; do [ -z "$d" ] && continue DEVICE_DATA=$(upower -i "$d") - PERCENTAGE=$(echo "$DEVICE_DATA" | grep -Po '(?<=(percentage: )).*(?= icon)') - PER_INT=$(echo "${PERCENTAGE//%}") - DEVICE_NAME=$(echo "$DEVICE_DATA" | grep -Po '(?<=(model: )).*(?= serial)') + PER_INT=$(echo "$DEVICE_DATA" | grep -oP 'percentage:\s+\K[0-9]+') + DEVICE_NAME=$(echo "$DEVICE_DATA" | grep -oP 'model:\s+\K.+') if [ -n "$DEVICE_NAME" ] && [ -n "$PER_INT" ] && [ "$PER_INT" -lt "$NOTIFY_AT_PERCENTAGE" ]; then notify-send -t 5000 -e "Low battery $DEVICE_NAME $PER_INT%" -i "$ICON" \ diff --git a/defaults/bin/moonarch-waybar-gpustat b/defaults/bin/moonarch-waybar-gpustat index 2c6715b..2c0ff56 100755 --- a/defaults/bin/moonarch-waybar-gpustat +++ b/defaults/bin/moonarch-waybar-gpustat @@ -2,38 +2,32 @@ # ABOUTME: Waybar-Modul das die GPU-Auslastung als JSON ausgibt. # ABOUTME: Wird von der Waybar custom/gpu-usage Config referenziert. -while : -do - GPU_STAT=$(cat /sys/class/hwmon/hwmon*/device/gpu_busy_percent 2>/dev/null | head -1 || echo "0") - GPU_STAT="${GPU_STAT:-0}" +GPU_STAT=$(cat /sys/class/hwmon/hwmon*/device/gpu_busy_percent 2>/dev/null | head -1 || echo "0") +GPU_STAT="${GPU_STAT:-0}" +ICON="" + +if [ "$GPU_STAT" -lt 10 ]; then ICON="" +elif [ "$GPU_STAT" -lt 20 ]; then + ICON="" +elif [ "$GPU_STAT" -lt 40 ]; then + ICON="" +elif [ "$GPU_STAT" -lt 50 ]; then + ICON="" +elif [ "$GPU_STAT" -lt 60 ]; then + ICON="" +elif [ "$GPU_STAT" -lt 70 ]; then + ICON="" +elif [ "$GPU_STAT" -lt 80 ]; then + ICON="" +elif [ "$GPU_STAT" -lt 100 ]; then + ICON="" +fi - if [ "$GPU_STAT" -lt 10 ]; then - ICON="" - elif [ "$GPU_STAT" -lt 20 ]; then - ICON="" - elif [ "$GPU_STAT" -lt 40 ]; then - ICON="" - elif [ "$GPU_STAT" -lt 50 ]; then - ICON="" - elif [ "$GPU_STAT" -lt 60 ]; then - ICON="" - elif [ "$GPU_STAT" -lt 70 ]; then - ICON="" - elif [ "$GPU_STAT" -lt 80 ]; then - ICON="" - elif [ "$GPU_STAT" -lt 100 ]; then - ICON="" - fi - - s="text|alt|tooltip|class|percentage -GPU $ICON|GPU $ICON $GPU_STAT%|GPU $ICON $GPU_STAT%|gpustat|$GPU_STAT" - - 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 --unbuffered --compact-output -n \ + --arg text "GPU $ICON" \ + --arg alt "GPU $ICON $GPU_STAT%" \ + --arg tooltip "GPU $ICON $GPU_STAT%" \ + --arg class "gpustat" \ + --argjson percentage "$GPU_STAT" \ + '{text: $text, alt: $alt, tooltip: $tooltip, class: $class, percentage: $percentage}' diff --git a/packages/aur.txt b/packages/aur.txt index 823cc15..30902a5 100644 --- a/packages/aur.txt +++ b/packages/aur.txt @@ -31,3 +31,4 @@ waterfox-bin # System & Tools auto-cpufreq +stasis diff --git a/scripts/transform.sh b/scripts/transform.sh index 2e3ef96..caeb0fc 100755 --- a/scripts/transform.sh +++ b/scripts/transform.sh @@ -247,19 +247,16 @@ trap - EXIT # Moonarch custom paru repo log "Setting up Moonarch paru repo..." -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 +PARU_CONF="/etc/paru.conf" +if ! grep -q '\[moonarch-pkgbuilds\]' "$PARU_CONF" 2>/dev/null; then + printf '\n[moonarch-pkgbuilds]\nUrl = https://gitea.moonarch.de/nevaforget/moonarch-pkgbuilds.git\n' \ + | sudo tee -a "$PARU_CONF" > /dev/null log " + Moonarch repo added to paru.conf." else log " ~ Moonarch repo already in paru.conf." fi -paru -Sy --pkgbuilds --noconfirm +paru -Syu --pkgbuilds --noconfirm log "Installing moonarch-git package..." paru -S --needed --noconfirm moonarch-git