From d24f56519425c3dd4a4e016002f9305957895afb Mon Sep 17 00:00:00 2001 From: doc Date: Sun, 27 Jul 2025 21:40:33 +0000 Subject: second commit --- dunstapt.sh | 17 +++++++++++++++++ lemonstart.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ rofimenu.sh | 7 +++++++ 3 files changed, 71 insertions(+) create mode 100755 dunstapt.sh create mode 100755 lemonstart.sh create mode 100755 rofimenu.sh diff --git a/dunstapt.sh b/dunstapt.sh new file mode 100755 index 0000000..6cae44b --- /dev/null +++ b/dunstapt.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +dunstify -r 9999 -h int:value:0 "APT" "Running update..." +sudo apt update + +dunstify -r 9999 -h int:value:0 "APT" "Running upgrade..." + +( + for i in $(seq 1 10 100); do + dunstify -r 9999 -h int:value:$i "APT Upgrade" "$i% complete..." + sleep 2 + done +) & + +sudo apt upgrade -y + +dunstify -r 9999 -h int:value:100 "APT Upgrade" "System is fully upgraded!" diff --git a/lemonstart.sh b/lemonstart.sh new file mode 100755 index 0000000..850cb8e --- /dev/null +++ b/lemonstart.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +NETIF="enp0s31f6" # <-- Replace with your real interface name if different +POOL_NAME="gigapool" + +get_net_speed() { + if [[ ! -f /sys/class/net/$NETIF/statistics/rx_bytes ]]; then + echo "🌐 No iface" + return + fi + + R1=$(cat /sys/class/net/$NETIF/statistics/rx_bytes) + T1=$(cat /sys/class/net/$NETIF/statistics/tx_bytes) + sleep 1 + R2=$(cat /sys/class/net/$NETIF/statistics/rx_bytes) + T2=$(cat /sys/class/net/$NETIF/statistics/tx_bytes) + + RXBPS=$(( (R2 - R1) / 1024 )) + TXBPS=$(( (T2 - T1) / 1024 )) + + echo "↓ ${RXBPS}KB/s ↑ ${TXBPS}KB/s" +} + +get_zpool_status() { + if sudo zpool list "$POOL_NAME" &>/dev/null; then + HEALTH=$(sudo zpool get -H -o value health "$POOL_NAME" 2>/dev/null) + FREE=$(sudo zpool list -H -o free "$POOL_NAME" 2>/dev/null) + echo "$POOL_NAME: $HEALTH ($FREE free)" + else + echo "$POOL_NAME: Not Imported" + fi +} + + + +get_volume() { + pamixer --get-volume 2>/dev/null || echo "NoVol" +} + +while true; do + TIME=$(date '+%H:%M:%S') + UPTIME=$(uptime -p | sed 's/up //') + VOLUME=$(get_volume) + NET=$(get_net_speed) + + echo "%{l}💾 $ZPOOL %{c}🌐 $NET %{r}🔊 ${VOLUME}% 🕒 $TIME ⏳ $UPTIME" +done | lemonbar -g x24 -B "#1e1e1e" -F "#00ff00" -p -f "NotoSansMono-Regular" diff --git a/rofimenu.sh b/rofimenu.sh new file mode 100755 index 0000000..8c47c35 --- /dev/null +++ b/rofimenu.sh @@ -0,0 +1,7 @@ +#!/bin/bash +chosen=$(echo -e "Reboot\nShutdown\nLock" | rofi -dmenu -solarized -p "Power") +case "$chosen" in + Reboot) systemctl reboot ;; + Shutdown) systemctl poweroff ;; + Lock) i3lock ;; +esac -- cgit v1.2.3