summaryrefslogtreecommitdiff
path: root/.config/waybar
diff options
context:
space:
mode:
Diffstat (limited to '.config/waybar')
-rw-r--r--.config/waybar/config22
-rwxr-xr-x.config/waybar/modules/storagehome.sh24
-rwxr-xr-x.config/waybar/modules/storagestorage.sh24
3 files changed, 67 insertions, 3 deletions
diff --git a/.config/waybar/config b/.config/waybar/config
index 3dbeb15..2575944 100644
--- a/.config/waybar/config
+++ b/.config/waybar/config
@@ -4,7 +4,7 @@
"height": 24,
"modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": [""],
- "modules-right": ["mpd", "network", "idle_inhibitor", "battery", "custom/storage", "cpu", "memory", "custom/weather", "tray", "clock"],
+ "modules-right": ["mpd", "network", "idle_inhibitor", "battery", "custom/storage", "custom/storagehome", "custom/storagestorage", "cpu", "memory", "custom/weather", "tray", "clock"],
"sway/mode": {
"format": " {}"
},
@@ -31,7 +31,7 @@
"tooltip": false
},
"network": {
- "interface": "wlp3s0",
+ "interface": "wlp1s0",
"format": "{ifname}",
"format-wifi": "{essid} ({signalStrength}%) | ",
"format-ethernet": "{ifname} ",
@@ -40,7 +40,7 @@
"tooltip-format-wifi": "{essid} ({signalStrength}%) ",
"tooltip-format-ethernet": "{ifname} ",
"tooltip-format-disconnected": "Disconnected",
- "on-click": "alacritty -e nmtui",
+ "on-click": "foot -e nmtui",
"tooltip": false
},
"pulseaudio": {
@@ -77,6 +77,22 @@
"interval": 60,
"exec": "$HOME/.config/waybar/modules/storage.sh"
},
+ "custom/storagestorage": {
+ "format": "{}  |",
+ "format-alt": "{percentage}% ",
+ "format-alt-click": "click-right",
+ "return-type": "json",
+ "interval": 60,
+ "exec": "$HOME/.config/waybar/modules/storagestorage.sh"
+ },
+ "custom/storagehome": {
+ "format": "{}  |",
+ "format-alt": "{percentage}% ",
+ "format-alt-click": "click-right",
+ "return-type": "json",
+ "interval": 60,
+ "exec": "$HOME/.config/waybar/modules/storagehome.sh"
+ },
"backlight": {
"format": "{icon}",
"format-alt": "{percent}% {icon} | ",
diff --git a/.config/waybar/modules/storagehome.sh b/.config/waybar/modules/storagehome.sh
new file mode 100755
index 0000000..e59c051
--- /dev/null
+++ b/.config/waybar/modules/storagehome.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+mount="/home"
+warning=20
+critical=10
+
+df -h -P -l "$mount" | awk -v warning=$warning -v critical=$critical '
+/\/.*/ {
+ text=$4
+ tooltip="Filesystem: "$1"\rSize: "$2"\rUsed: "$3"\rAvail: "$4"\rUse%: "$5"\rMounted on: "$6
+ use=$5
+ exit 0
+}
+END {
+ class=""
+ gsub(/%$/,"",use)
+ if ((100 - use) < critical) {
+ class="critical"
+ } else if ((100 - use) < warning) {
+ class="warning"
+ }
+ print "{\"text\":\""text"\", \"percentage\":"use",\"tooltip\":\""tooltip"\", \"class\":\""class"\"}"
+}
+ '
diff --git a/.config/waybar/modules/storagestorage.sh b/.config/waybar/modules/storagestorage.sh
new file mode 100755
index 0000000..f04adfd
--- /dev/null
+++ b/.config/waybar/modules/storagestorage.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+mount="/storage"
+warning=20
+critical=10
+
+df -h -P -l "$mount" | awk -v warning=$warning -v critical=$critical '
+/\/.*/ {
+ text=$4
+ tooltip="Filesystem: "$1"\rSize: "$2"\rUsed: "$3"\rAvail: "$4"\rUse%: "$5"\rMounted on: "$6
+ use=$5
+ exit 0
+}
+END {
+ class=""
+ gsub(/%$/,"",use)
+ if ((100 - use) < critical) {
+ class="critical"
+ } else if ((100 - use) < warning) {
+ class="warning"
+ }
+ print "{\"text\":\" "text"\", \"percentage\":"use",\"tooltip\":\""tooltip"\", \"class\":\""class"\"}"
+}
+ '