summaryrefslogtreecommitdiff
path: root/lemonstart.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lemonstart.sh')
-rwxr-xr-xlemonstart.sh47
1 files changed, 47 insertions, 0 deletions
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"