summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/statusbar/battery4
-rwxr-xr-x.local/bin/statusbar/cpu5
-rwxr-xr-x.local/bin/statusbar/help14
-rwxr-xr-x.local/bin/statusbar/memory4
-rwxr-xr-x.local/bin/statusbar/pacpackages8
-rwxr-xr-x.local/bin/statusbar/weather2
6 files changed, 24 insertions, 13 deletions
diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery
index 65152f7..981fc3a 100755
--- a/.local/bin/statusbar/battery
+++ b/.local/bin/statusbar/battery
@@ -22,6 +22,6 @@ do
# If it is discharging and 25% or less, we will add a ❗ as a warning.
[ "$capacity" -le 25 ] && [ "$status" = "🔋" ] && warn="❗"
- printf "%s%s%s%%\n" "$status" "$warn" "$capacity"
+ printf "%s%s%s%% " "$status" "$warn" "$capacity"
unset warn
-done
+done | sed s/\ $/\\n/
diff --git a/.local/bin/statusbar/cpu b/.local/bin/statusbar/cpu
index 5b5528e..bd0c77a 100755
--- a/.local/bin/statusbar/cpu
+++ b/.local/bin/statusbar/cpu
@@ -1,10 +1,11 @@
#!/bin/sh
case $BLOCK_BUTTON in
- 1) notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)" ;;
+ 1) notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)\\n(100% per core)" ;;
+ 2) setsid "$TERMINAL" -e htop & ;;
3) notify-send "🖥 CPU module " "\- Shows CPU temperature.
- Click to show intensive processes.
-- % is of single core." ;;
+- Middle click to open htop." ;;
esac
sensors | awk '/Core 0/ {print "🌡", $3}'
diff --git a/.local/bin/statusbar/help b/.local/bin/statusbar/help
index 70ca383..4d8e3c2 100755
--- a/.local/bin/statusbar/help
+++ b/.local/bin/statusbar/help
@@ -1,8 +1,16 @@
#!/bin/sh
+# The clickable help menu. Middle click to restart wm.
+
+# If dwm is running, use dwm's readme and restart.
+ps ax | grep -q "\sdwm$" &&
+ READMEFILE=/usr/local/share/dwm/larbs.mom
+ restartwm() { pkill -HUP dwm ;} ||
+ restartwm() { i3 restart ;}
+
case $BLOCK_BUTTON in
- 1) groff -mom ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - ;;
- 2) i3 restart ;;
+ 1) groff -mom "${READMEFILE:-${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom}" -Tpdf | zathura - ;;
+ 2) restartwm ;;
3) notify-send "❓ Help module" "\- Left click to open LARBS guide.
-- Middle click to refresh i3.";;
+- Middle click to refresh window manager.";;
esac; echo "❓"
diff --git a/.local/bin/statusbar/memory b/.local/bin/statusbar/memory
index 25a2958..dce5268 100755
--- a/.local/bin/statusbar/memory
+++ b/.local/bin/statusbar/memory
@@ -2,8 +2,10 @@
case $BLOCK_BUTTON in
1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;;
+ 2) setsid "$TERMINAL" -e htop & ;;
3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total.
-- Click to show memory hogs." ;;
+- Click to show memory hogs.
+- Middle click to open htop." ;;
esac
free -h | sed -n '2{p;q}' | awk '{print "🧠", $3 "/" $2}'
diff --git a/.local/bin/statusbar/pacpackages b/.local/bin/statusbar/pacpackages
index 6f439cc..49ba319 100755
--- a/.local/bin/statusbar/pacpackages
+++ b/.local/bin/statusbar/pacpackages
@@ -15,14 +15,14 @@
# [Action]
# Description = Updating statusbar...
# When = PostTransaction
-# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks
+# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks # Or i3blocks if using i3.
case $BLOCK_BUTTON in
- 1) $TERMINAL -e popupgrade ;;
+ 1) setsid "$TERMINAL" -e popupgrade & ;;
2) notify-send "$(/usr/bin/pacman -Qu)" ;;
- 3) notify-send "Upgrade module" "📦: number of upgradable packages
+ 3) notify-send "🎁 Upgrade module" "📦: number of upgradable packages
- Left click to upgrade packages
- Middle click to show upgradable packages" ;;
esac
-pacman -Qu | grep -v "\[ignored\]" | wc -l | sed "s/^/📦/;s/^📦0$//g"
+pacman -Qu | grep -cv "\[ignored\]" | sed "s/^/📦/;s/^📦0$//g"
diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather
index 853d262..875259c 100755
--- a/.local/bin/statusbar/weather
+++ b/.local/bin/statusbar/weather
@@ -18,7 +18,7 @@ sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\(
# The BLOCK_BUTTON bloat for clicking in i3.
case $BLOCK_BUTTON in
- 1) $TERMINAL -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" ;;
+ 1) setsid "$TERMINAL" -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;;
2) getforecast && showweather ;;
3) notify-send "🌈 Weather module" "\- Left click for full forecast.
- Middle click to update forecast.