diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-26 16:15:00 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-26 16:15:00 +0900 |
| commit | 14671f902591c28d5fba0a8817ae7606d6fef02f (patch) | |
| tree | 0f2a82759d732c52ce7cab2e1e3bc767005e4a08 | |
| parent | dff9f14df74332c3f56615f6bd10b6261dab43d0 (diff) | |
modified statusbar/sb-memory, modified statusbar/sb-queues
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-memory | 10 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-queues | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/ar/.local/bin/statusbar/sb-memory b/ar/.local/bin/statusbar/sb-memory index bc7085a..804fd91 100755 --- a/ar/.local/bin/statusbar/sb-memory +++ b/ar/.local/bin/statusbar/sb-memory @@ -13,6 +13,10 @@ case $BLOCK_BUTTON in 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac -[ $(xrandr | grep "\*" | awk '{print $1}' | sed 's/x[0-9]*//g') -lt 1920 ] && - free --mebi | sed -n '2{p;q}' | awk '{printf ("🐏%d%%\n", ($3/$2)*100+0.5 )}' || - free --mebi | sed -n '2{p;q}' | awk '{printf ("🐏%dGB/%dGB", $3/1000+0.5,$2/1000+0.5)}' +width=$(xrandr | grep "\*" | awk '{print $1}' | sed 's/x[0-9]*//g' | head -n1) + +if [ -n "$width" ] && [ "$width" -eq "$width" ] 2>/dev/null; then + [ "$width" -lt 1920 ] && + free --mebi | sed -n '2{p;q}' | awk '{printf ("🐏%d%%\n", ($3/$2)*100+0.5 )}' || + free --mebi | sed -n '2{p;q}' | awk '{printf ("🐏%dGB/%dGB", $3/1000+0.5,$2/1000+0.5)}' +fi diff --git a/ar/.local/bin/statusbar/sb-queues b/ar/.local/bin/statusbar/sb-queues index e0ddefd..40445f8 100755 --- a/ar/.local/bin/statusbar/sb-queues +++ b/ar/.local/bin/statusbar/sb-queues @@ -37,4 +37,4 @@ case $BLOCK_BUTTON in 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac -cat /tmp/qplaylist 2>/dev/null || ([ "$num" != "0|0" ] && echo "🤖$num") +[ -f /tmp/qplaylist ] && cat /tmp/qplaylist 2>/dev/null || ([ "$num" != "0|0" ] && echo "🤖$num" || echo "") |
