diff options
| author | Ivan K. Boikov <mail@ikboikov.net> | 2025-01-25 14:20:48 +0100 |
|---|---|---|
| committer | Ivan K. Boikov <mail@ikboikov.net> | 2025-01-25 19:35:11 +0100 |
| commit | 5c298b6a3e59820b98b6de22240696c6aca2d20d (patch) | |
| tree | 5149d17d6c6f1e2ea87d60a1703c8bf655d1ea18 | |
| parent | e83844d94b10fb7994ff7bc4b5f9addd7c8d2102 (diff) | |
Drop statusbar scripts
| -rwxr-xr-x | scripts/.local/bin/sb-battery | 23 | ||||
| -rwxr-xr-x | scripts/.local/bin/sb-clock | 3 | ||||
| -rwxr-xr-x | scripts/.local/bin/sb-cpubars | 34 | ||||
| -rwxr-xr-x | scripts/.local/bin/sb-cpufreq | 5 | ||||
| -rwxr-xr-x | scripts/.local/bin/sb-cputemp | 3 | ||||
| -rwxr-xr-x | scripts/.local/bin/sb-disk | 16 | ||||
| -rwxr-xr-x | scripts/.local/bin/sb-internet | 13 | ||||
| -rwxr-xr-x | scripts/.local/bin/sb-mailbox | 15 | ||||
| -rwxr-xr-x | scripts/.local/bin/sb-memory | 16 | ||||
| -rwxr-xr-x | scripts/.local/bin/sb-music | 5 | ||||
| -rwxr-xr-x | scripts/.local/bin/sb-nettraf | 22 | ||||
| -rwxr-xr-x | scripts/.local/bin/sb-volume | 23 |
12 files changed, 0 insertions, 178 deletions
diff --git a/scripts/.local/bin/sb-battery b/scripts/.local/bin/sb-battery deleted file mode 100755 index 04a3cf7..0000000 --- a/scripts/.local/bin/sb-battery +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# Prints all batteries, their percentage remaining - -# Loop through all attached batteries and format the info -for battery in /sys/class/power_supply/BAT?*; do - # If non-first battery, print a space separator. - [ -n "${capacity+x}" ] && printf " " - # Sets up the status and capacity - case "$(cat "$battery/status" 2>&1)" in - "Full") status="F" ;; - "Discharging") status="-" ;; - "Charging") status="+" ;; - "Not charging") status="" ;; - "Unknown") status="?" ;; - *) exit 1 ;; - esac - capacity="$(cat "$battery/capacity" 2>&1)" - # Will make a warn variable if discharging and low - [ "$status" = "D" ] && [ "$capacity" -le 25 ] && warn="!!!" - # Prints the info - printf "%d%%%s%s" "$capacity" "$status" "$warn" ; unset warn -done && printf "\\n" diff --git a/scripts/.local/bin/sb-clock b/scripts/.local/bin/sb-clock deleted file mode 100755 index e6fbb6b..0000000 --- a/scripts/.local/bin/sb-clock +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -date "+%d/%m/%y %a %H:%M:%S" diff --git a/scripts/.local/bin/sb-cpubars b/scripts/.local/bin/sb-cpubars deleted file mode 100755 index 82567a3..0000000 --- a/scripts/.local/bin/sb-cpubars +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -# Cache in tmpfs to improve speed and reduce SSD load -cache="$XDG_CACHE_HOME/cpubarscache" - -# id total idle -stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat) -[ ! -f "$cache" ] && echo "$stats" > "$cache" -old=$(cat "$cache") -printf "" -echo "$stats" | while read -r row; do - id=${row%% *} - rest=${row#* } - total=${rest%% *} - idle=${rest##* } - - case "$(echo "$old" | awk '{if ($1 == id) - printf "%d\n", (1 - (idle - $3) / (total - $2))*100 /12.5}' \ - id="$id" total="$total" idle="$idle")" in - - # these are called "block elements" - "0") printf "▁";; - "1") printf "▂";; - "2") printf "▃";; - "3") printf "▄";; - "4") printf "▅";; - "5") printf "▆";; - "6") printf "▇";; - "7") printf "█";; - "8") printf "█";; - *) printf " ";; - esac -done; printf "\\n" -echo "$stats" > "$cache" diff --git a/scripts/.local/bin/sb-cpufreq b/scripts/.local/bin/sb-cpufreq deleted file mode 100755 index 820e366..0000000 --- a/scripts/.local/bin/sb-cpufreq +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# based on https://github.com/Orienfish/RPi_Useful_Script/blob/master/get_cpu_freq.sh - -awk -F " " '{ total += $1; count++ } END { printf "%.1f\n", total/count/1e6 }' /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq diff --git a/scripts/.local/bin/sb-cputemp b/scripts/.local/bin/sb-cputemp deleted file mode 100755 index 03d7f89..0000000 --- a/scripts/.local/bin/sb-cputemp +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -sensors | awk '/^CPU/ {print $2}' | sed 's/....$//' diff --git a/scripts/.local/bin/sb-disk b/scripts/.local/bin/sb-disk deleted file mode 100755 index c5629cd..0000000 --- a/scripts/.local/bin/sb-disk +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -# Status bar module for disk space -# $1 should be drive mountpoint, otherwise assumed /. - -location=${1:-/} - -[ -d "$location" ] || exit - -case "$location" in - "/home"* ) icon="H" ;; - "/mnt"* ) icon="M" ;; - *) icon="O";; -esac - -printf "%s: %s\n" "$icon" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')" diff --git a/scripts/.local/bin/sb-internet b/scripts/.local/bin/sb-internet deleted file mode 100755 index 6d80852..0000000 --- a/scripts/.local/bin/sb-internet +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# Show wifi W and percent strength or w if none. -# Show E if connected to ethernet or e if none. -# Show V if a vpn connection is active - -if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then - wifiicon="$(awk '/^\s*w/ { print "W" int($3 * 100 / 70) }' /proc/net/wireless)" -elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then - grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="w" || wifiicon="w" -fi - -printf "%s%s%s\n" "$(sed "s/.*/V/" /sys/class/net/tun*/operstate 2>/dev/null)" "$(sed "s/down/e/;s/up/E/" /sys/class/net/e*/operstate 2>/dev/null)" "$wifiicon" diff --git a/scripts/.local/bin/sb-mailbox b/scripts/.local/bin/sb-mailbox deleted file mode 100755 index 243987a..0000000 --- a/scripts/.local/bin/sb-mailbox +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# Displays number of unread mail and an loading icon if updating. - -unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)" - -pidof mbsync >/dev/null 2>&1 && icon="U" - -if [ $(pgrep gpg) ]; then - emailicon="" -else - emailicon="" -fi - -[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "$emailicon$unread$icon" diff --git a/scripts/.local/bin/sb-memory b/scripts/.local/bin/sb-memory deleted file mode 100755 index bfb31c3..0000000 --- a/scripts/.local/bin/sb-memory +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -case $BLOCK_BUTTON in - 1) notify-send "Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; - 2) setsid -f "$TERMINAL" -e htop ;; - 3) notify-send "Memory module" "\- Shows Memory Used/Total. -- Click to show memory hogs. -- Middle click to open htop." ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -RAM=$(free --mebi | sed -n '2{p;q}' | awk '{printf ("%2.1f/%2.1f\n", ( $3 / 1024), ($2 / 1024))}') - -swap=$(free --mebi | sed -n '3{p;q}' | awk '{printf ("%2.1f/%2.1f\n", ( $3 / 1024), ($2 / 1024))}') - -echo "$RAM $swap" diff --git a/scripts/.local/bin/sb-music b/scripts/.local/bin/sb-music deleted file mode 100755 index 06e7e4d..0000000 --- a/scripts/.local/bin/sb-music +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 & - -mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -; diff --git a/scripts/.local/bin/sb-nettraf b/scripts/.local/bin/sb-nettraf deleted file mode 100755 index 76b7935..0000000 --- a/scripts/.local/bin/sb-nettraf +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# Module showing network traffic. Shows how much data has been received (RX) or -# transmitted (TX) since the previous time this script ran. So if run every -# second, gives network traffic per second. - -update() { - sum=0 - for arg; do - read -r i < "$arg" - sum=$(( sum + i )) - done - cache=${XDG_CACHE_HOME:-$HOME/.cache}/${1##*/} - [ -f "$cache" ] && read -r old < "$cache" || old=0 - printf %d\\n "$sum" > "$cache" - printf %d\\n $(( sum - old )) -} - -rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes) -tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes) - -printf "%4s %4s\\n" $(numfmt --to=iec $rx) $(numfmt --to=iec $tx) diff --git a/scripts/.local/bin/sb-volume b/scripts/.local/bin/sb-volume deleted file mode 100755 index bfa7899..0000000 --- a/scripts/.local/bin/sb-volume +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# Prints the current volume or MUT if muted. - -if [ "$(pamixer --get-mute)" = true ]; then - vol="MUT" -else - vol="$(pamixer --get-volume)" -fi - -if ! command -v pamixer ;then - vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" - case "$vol" in - *MUTED*) vol="MUT" ;; - *) vol=$(echo "100*$(echo "$vol" | cut -d' ' -f2)/1" | bc) ;; - esac -fi - -# for slstatus -printf "%s" "$vol" > "$XDG_RUNTIME_DIR/volume" - -# for dwmblocks -printf "%3d" "$vol" |
