diff options
Diffstat (limited to '.scripts')
| -rwxr-xr-x | .scripts/statusbar/battery (renamed from .scripts/statusbar/i3battery) | 21 | ||||
| -rwxr-xr-x | .scripts/statusbar/clock (renamed from .scripts/statusbar/i3date) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/cpu (renamed from .scripts/statusbar/i3cpu) | 2 | ||||
| -rwxr-xr-x | .scripts/statusbar/disk (renamed from .scripts/statusbar/i3disk) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/help (renamed from .scripts/statusbar/i3help) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/i3mpdupdate | 9 | ||||
| -rwxr-xr-x | .scripts/statusbar/i3torrent | 6 | ||||
| -rwxr-xr-x | .scripts/statusbar/internet (renamed from .scripts/statusbar/i3internet) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/mailbox (renamed from .scripts/statusbar/i3mail) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/memory (renamed from .scripts/statusbar/i3mem) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/music (renamed from .scripts/statusbar/i3mpd) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/news (renamed from .scripts/statusbar/i3news) | 2 | ||||
| -rwxr-xr-x | .scripts/statusbar/pacpackages (renamed from .scripts/statusbar/i3pacman) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/torrent | 26 | ||||
| -rwxr-xr-x | .scripts/statusbar/volume (renamed from .scripts/statusbar/i3volume) | 0 | ||||
| -rwxr-xr-x | .scripts/statusbar/weather (renamed from .scripts/statusbar/i3weather) | 0 |
16 files changed, 39 insertions, 27 deletions
diff --git a/.scripts/statusbar/i3battery b/.scripts/statusbar/battery index b485d9a..b2634e6 100755 --- a/.scripts/statusbar/i3battery +++ b/.scripts/statusbar/battery @@ -1,6 +1,9 @@ #!/bin/sh # Give a battery name (e.g. BAT0) as an argument. +# get xresources colors +for x in "$(xrdb -query | sed "s/.*\./export /g;s/:\s*/=\"/g;s/$/\"/g")"; do eval "$x"; done + case $BLOCK_BUTTON in 3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b> 🔋: discharging @@ -14,21 +17,19 @@ esac capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit status=$(cat /sys/class/power_supply/"$1"/status) -if [ "$capacity" -ge 80 ]; then - color="#b8bb26" -elif [ "$capacity" -ge 60 ]; then - color="#ebdbb2" -elif [ "$capacity" -ge 40 ]; then - color="#fabd2f" -elif [ "$capacity" -ge 20 ]; then - color="#fe8019" +if [ "$capacity" -ge 75 ]; then + color="$color10" +elif [ "$capacity" -ge 50 ]; then + color="$color15" +elif [ "$capacity" -ge 25 ]; then + color="$color11" else - color="#fb4934" + color="$color9" warn="❗" fi [ -z $warn ] && warn=" " -[ "$status" = "Charging" ] && color="#FFF" +[ "$status" = "Charging" ] && color="$color15" printf "<span color='%s'>%s%s%s</span>" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" diff --git a/.scripts/statusbar/i3date b/.scripts/statusbar/clock index caed51a..caed51a 100755 --- a/.scripts/statusbar/i3date +++ b/.scripts/statusbar/clock diff --git a/.scripts/statusbar/i3cpu b/.scripts/statusbar/cpu index 7dbdc1f..fc9d617 100755 --- a/.scripts/statusbar/i3cpu +++ b/.scripts/statusbar/cpu @@ -9,4 +9,4 @@ $(ps axch -o cmd:15,%cpu --sort=-%cpu | head)" ;; - % is of single core." ;; esac -sensors | awk '/^temp1/ {print $2}' +sensors | awk '/Core 0/ {print $3}' diff --git a/.scripts/statusbar/i3disk b/.scripts/statusbar/disk index 3a12394..3a12394 100755 --- a/.scripts/statusbar/i3disk +++ b/.scripts/statusbar/disk diff --git a/.scripts/statusbar/i3help b/.scripts/statusbar/help index eacb15b..eacb15b 100755 --- a/.scripts/statusbar/i3help +++ b/.scripts/statusbar/help diff --git a/.scripts/statusbar/i3mpdupdate b/.scripts/statusbar/i3mpdupdate deleted file mode 100755 index 646b49e..0000000 --- a/.scripts/statusbar/i3mpdupdate +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -[ "$(pgrep -x i3mpdupdate | wc -l)" -gt 2 ] && exit - -while : ; do - pgrep -x mpd || exit - mpc idle > /dev/null - pkill -RTMIN+11 i3blocks ; -done diff --git a/.scripts/statusbar/i3torrent b/.scripts/statusbar/i3torrent deleted file mode 100755 index 603ff01..0000000 --- a/.scripts/statusbar/i3torrent +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -case $BLOCK_BUTTON in - 1) $TERMINAL -e transmission-remote-cli -esac - -transmission-remote -l | grep % | sed -e "s/.*100%.*/Z/g;s/.*Idle.*/A/g;s/.*%.*/M/g" | sort -h | uniq -c | sed -e "s/Z/🌱/g;s/M/⬇️/g;s/A/⌛️/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed -e "s/ $//g" diff --git a/.scripts/statusbar/i3internet b/.scripts/statusbar/internet index e26e633..e26e633 100755 --- a/.scripts/statusbar/i3internet +++ b/.scripts/statusbar/internet diff --git a/.scripts/statusbar/i3mail b/.scripts/statusbar/mailbox index bb72c5d..bb72c5d 100755 --- a/.scripts/statusbar/i3mail +++ b/.scripts/statusbar/mailbox diff --git a/.scripts/statusbar/i3mem b/.scripts/statusbar/memory index 40705c4..40705c4 100755 --- a/.scripts/statusbar/i3mem +++ b/.scripts/statusbar/memory diff --git a/.scripts/statusbar/i3mpd b/.scripts/statusbar/music index ef3a6c3..ef3a6c3 100755 --- a/.scripts/statusbar/i3mpd +++ b/.scripts/statusbar/music diff --git a/.scripts/statusbar/i3news b/.scripts/statusbar/news index 9a036f5..95c9f18 100755 --- a/.scripts/statusbar/i3news +++ b/.scripts/statusbar/news @@ -6,7 +6,7 @@ case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e newsboat ;; - 2) setsid newsup >/dev/null ;; + 2) setsid newsup >/dev/null & exit ;; 3) pgrep -x dunst >/dev/null && notify-send "<b>📰 News module:</b> - Shows unread news items - Shows 🔃 if updating with \`newsup\` diff --git a/.scripts/statusbar/i3pacman b/.scripts/statusbar/pacpackages index 1207e2c..1207e2c 100755 --- a/.scripts/statusbar/i3pacman +++ b/.scripts/statusbar/pacpackages diff --git a/.scripts/statusbar/torrent b/.scripts/statusbar/torrent new file mode 100755 index 0000000..06ddd3e --- /dev/null +++ b/.scripts/statusbar/torrent @@ -0,0 +1,26 @@ +#!/bin/sh + +transmission-remote -l | grep % | + sed " # This first sed command is to ensure a desirable order with sort + s/.*Stopped.*/A/g; + s/.*Seeding.*/Z/g; + s/.*100%.*/N/g; + s/.*Idle.*/B/g; + s/.*%.*/M/g" | + sort -h | uniq -c | sed " # Now we replace the standin letters with icons. + s/A/🛑/g; + s/B/⌛️/g; + s/M/🔽/g; + s/N/✅/g; + s/Z/🌱/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed -e "s/ $//g" + +case $BLOCK_BUTTON in + 1) $TERMINAL -e transmission-remote-cli ;; + 3) pgrep -x dunst >/dev/null && notify-send "<b>Torrent module:</b> +🛑: paused +⏳: waiting +🔽: downloading +✅: done +🌱: done and seeding" ;; +esac + diff --git a/.scripts/statusbar/i3volume b/.scripts/statusbar/volume index 26e5a17..26e5a17 100755 --- a/.scripts/statusbar/i3volume +++ b/.scripts/statusbar/volume diff --git a/.scripts/statusbar/i3weather b/.scripts/statusbar/weather index a6c8d75..a6c8d75 100755 --- a/.scripts/statusbar/i3weather +++ b/.scripts/statusbar/weather |
