Compare commits
1 Commits
feat/disk-
...
a14724c0ec
| Author | SHA1 | Date | |
|---|---|---|---|
| a14724c0ec |
@@ -230,6 +230,10 @@ bind = $mainMod, B, exec, python /home/tpouplier/ExoKortex/4-Automata/recordntra
|
|||||||
bind = $mainMod, A, exec, $music
|
bind = $mainMod, A, exec, $music
|
||||||
bind = $mainMod, C, exec, emacsclient -n -c -e '(gortium/hermes-vterm)'
|
bind = $mainMod, C, exec, emacsclient -n -c -e '(gortium/hermes-vterm)'
|
||||||
|
|
||||||
|
# WireGuard VPN toggle
|
||||||
|
bind = $mainMod CTRL, V, exec, sudo wg-quick up wg0
|
||||||
|
bind = $mainMod CTRL SHIFT, V, exec, sudo wg-quick down wg0
|
||||||
|
|
||||||
# Full screen
|
# Full screen
|
||||||
bind = SUPER, F, fullscreen
|
bind = SUPER, F, fullscreen
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
"modules-right": [
|
"modules-right": [
|
||||||
"group/hardware",
|
"group/hardware",
|
||||||
"custom/disk-monitor",
|
|
||||||
"pulseaudio",
|
"pulseaudio",
|
||||||
"bluetooth",
|
"bluetooth",
|
||||||
"network",
|
"network",
|
||||||
|
|||||||
@@ -88,13 +88,6 @@
|
|||||||
"path": "/",
|
"path": "/",
|
||||||
"on-click": "kitty btop"
|
"on-click": "kitty btop"
|
||||||
},
|
},
|
||||||
|
|
||||||
// disk monitor (standalone, color-coded)
|
|
||||||
"custom/disk-monitor": {
|
|
||||||
"exec": "$HOME/.config/waybar/scripts/disk-monitor.sh --waybar",
|
|
||||||
"return-type": "json",
|
|
||||||
"interval": 60
|
|
||||||
},
|
|
||||||
|
|
||||||
// memory
|
// memory
|
||||||
"memory": {
|
"memory": {
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# disk-monitor.sh -- Waybar disk usage monitor
|
|
||||||
# Outputs JSON for custom/disk-monitor module
|
|
||||||
# Class: "good" (<80%), "warning" (80-90%), "critical" (>90%)
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Target partition (default: root)
|
|
||||||
TARGET="${1:-/}"
|
|
||||||
|
|
||||||
# Get disk usage percentage (strip % sign)
|
|
||||||
USAGE=$(df --output=pcent "$TARGET" | tail -1 | tr -d '% ')
|
|
||||||
|
|
||||||
# Determine icon and CSS class based on usage thresholds
|
|
||||||
if [ "$USAGE" -ge 90 ]; then
|
|
||||||
CLASS="critical"
|
|
||||||
TOOLTIP="Disk $TARGET at ${USAGE}% - CRITICAL"
|
|
||||||
elif [ "$USAGE" -ge 80 ]; then
|
|
||||||
CLASS="warning"
|
|
||||||
TOOLTIP="Disk $TARGET at ${USAGE}% - Warning"
|
|
||||||
else
|
|
||||||
CLASS="good"
|
|
||||||
TOOLTIP="Disk $TARGET at ${USAGE}%"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Output JSON for waybar
|
|
||||||
printf '{"text": " \uf4be %s%% ", "class": "%s", "alt": "%s", "tooltip": "%s"}\n' \
|
|
||||||
"$USAGE" "$CLASS" "disk-$CLASS" "$TOOLTIP"
|
|
||||||
Reference in New Issue
Block a user