diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2019-05-18 00:07:32 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2019-05-18 00:07:32 -0400 |
| commit | 54920103c2843f5a3620effbccaceaee7f6885c1 (patch) | |
| tree | 222aa8e75573364cd043382996f4798d94104f65 /.scripts/statusbar | |
| parent | 18e001db07d7105ab4dc4f4f836ca0d3a516a791 (diff) | |
| download | eibhear-54920103c2843f5a3620effbccaceaee7f6885c1.tar.gz eibhear-54920103c2843f5a3620effbccaceaee7f6885c1.tar.zst eibhear-54920103c2843f5a3620effbccaceaee7f6885c1.zip | |
scripts moved to ~/.local/bin
Diffstat (limited to '.scripts/statusbar')
| -rwxr-xr-x | .scripts/statusbar/battery | 32 | ||||
| -rwxr-xr-x | .scripts/statusbar/clock | 10 | ||||
| -rwxr-xr-x | .scripts/statusbar/cpu | 10 | ||||
| -rwxr-xr-x | .scripts/statusbar/disk | 18 | ||||
| -rwxr-xr-x | .scripts/statusbar/help | 7 | ||||
| -rwxr-xr-x | .scripts/statusbar/internet | 17 | ||||
| -rwxr-xr-x | .scripts/statusbar/iplocate | 9 | ||||
| -rwxr-xr-x | .scripts/statusbar/mailbox | 16 | ||||
| -rwxr-xr-x | .scripts/statusbar/memory | 9 | ||||
| -rwxr-xr-x | .scripts/statusbar/mpdupdate | 8 | ||||
| -rwxr-xr-x | .scripts/statusbar/music | 18 | ||||
| -rwxr-xr-x | .scripts/statusbar/news | 17 | ||||
| -rwxr-xr-x | .scripts/statusbar/pacpackages | 18 | ||||
| -rwxr-xr-x | .scripts/statusbar/popupgrade | 9 | ||||
| -rwxr-xr-x | .scripts/statusbar/torrent | 28 | ||||
| -rwxr-xr-x | .scripts/statusbar/volume | 25 | ||||
| -rwxr-xr-x | .scripts/statusbar/weather | 23 |
17 files changed, 0 insertions, 274 deletions
diff --git a/.scripts/statusbar/battery b/.scripts/statusbar/battery deleted file mode 100755 index 25c9269..0000000 --- a/.scripts/statusbar/battery +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# Give a battery name (e.g. BAT0) as an argument. - -case $BLOCK_BUTTON in - 3) pgrep -x dunst >/dev/null && notify-send "🔋 Battery module" "🔋: discharging -🛑: not charging -♻: stagnant charge -🔌: charging -⚡: charged -❗: battery very low! -- Text color reflects charge left" ;; -esac - -capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit -status=$(cat /sys/class/power_supply/"$1"/status) - -if [ "$capacity" -ge 75 ]; then - color="#00ff00" -elif [ "$capacity" -ge 50 ]; then - color="#ffffff" -elif [ "$capacity" -ge 25 ]; then - color="#ffff00" -else - color="#ff0000" - warn="❗" -fi - -[ -z $warn ] && warn=" " - -[ "$status" = "Charging" ] && color="#ffffff" - -printf "<span color='%s'>%s%s%s</span>" "$color" "$(echo "$status" | sed -e "s/,//;s/Discharging/🔋/;s/Not Charging/🛑/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" diff --git a/.scripts/statusbar/clock b/.scripts/statusbar/clock deleted file mode 100755 index d6d54ef..0000000 --- a/.scripts/statusbar/clock +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -date '+%Y %b %d (%a) %I:%M%p' - -case $BLOCK_BUTTON in - 1) pgrep -x dunst >/dev/null && notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -D ~/.config/calcurse -d3)" ;; - 2) "$TERMINAL" -e calcurse -D ~/.config/calcurse ;; - 3) pgrep -x dunst >/dev/null && notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` -- Middle click opens calcurse if installed" ;; -esac diff --git a/.scripts/statusbar/cpu b/.scripts/statusbar/cpu deleted file mode 100755 index 3b1394a..0000000 --- a/.scripts/statusbar/cpu +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -case $BLOCK_BUTTON in - 1) notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)" ;; - 3) notify-send "🖥 CPU module " "\- Shows CPU temperature. -- Click to show intensive processes. -- % is of single core." ;; -esac - -sensors | awk '/Core 0/ {print $3}' diff --git a/.scripts/statusbar/disk b/.scripts/statusbar/disk deleted file mode 100755 index d3dd07d..0000000 --- a/.scripts/statusbar/disk +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Status bar module for disk space -# $1 should be drive mountpoint -# $2 is optional icon, otherwise mountpoint will displayed - -[ -z "$1" ] && exit - -icon="$2" -[ -z "$2" ] && icon="$1" - -case $BLOCK_BUTTON in - 1) pgrep -x dunst >/dev/null && notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;; - 3) pgrep -x dunst >/dev/null && notify-send "💽 Disk module" "\- Shows used hard drive space. -- Click to show all disk info." ;; -esac - -printf "%s: %s" "$icon" "$(df -h "$1" | awk ' /[0-9]/ {print $3 "/" $2}')" diff --git a/.scripts/statusbar/help b/.scripts/statusbar/help deleted file mode 100755 index 1374769..0000000 --- a/.scripts/statusbar/help +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -case $BLOCK_BUTTON in - 1) groff -mom ~/.readme.mom -Tpdf | zathura - ;; - 2) i3 restart ;; - 3) pgrep -x dunst >/dev/null && notify-send "❓ Help module" "\- Left click to open LARBS guide. -- Middle click to refresh i3.";; -esac; echo "❓" diff --git a/.scripts/statusbar/internet b/.scripts/statusbar/internet deleted file mode 100755 index 1d2f2e8..0000000 --- a/.scripts/statusbar/internet +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -case $BLOCK_BUTTON in - 1) $TERMINAL -e nmtui ;; - 3) pgrep -x dunst >/dev/null && notify-send "🌐 Internet module" "\- Click to connect -📡: no wifi connection -📶: wifi connection with quality -❎: no ethernet -🌐: ethernet working -" ;; -esac - -[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡" - -[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }') - -printf "%s %s" "$wifiicon" "$(cat /sys/class/net/e*/operstate | sed "s/down/❎/;s/up/🌐/")" diff --git a/.scripts/statusbar/iplocate b/.scripts/statusbar/iplocate deleted file mode 100755 index 4ca4f10..0000000 --- a/.scripts/statusbar/iplocate +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# Gets your public ip address checks which country you are in and -# displays that information in the statusbar -# -# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/ -ifinstalled "geoiplookup" || exit -addr="$(curl ifconfig.me 2>/dev/null)" || exit -grep "flag: " ~/.config/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" diff --git a/.scripts/statusbar/mailbox b/.scripts/statusbar/mailbox deleted file mode 100755 index 21c85ab..0000000 --- a/.scripts/statusbar/mailbox +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -# i3blocks mail module. -# Displays number of unread mail and an loading icon if updating. -# When clicked, brings up `neomutt`. - -case $BLOCK_BUTTON in - 1) "$TERMINAL" -e neomutt ;; - 2) setsid mailsync >/dev/null & ;; - 3) pgrep -x dunst >/dev/null && notify-send "📬 Mail module" "\- Shows unread mail -- Shows 🔃 if syncing mail -- Left click opens neomutt -- Middle click syncs mail" ;; -esac - -echo "$(du -a ~/.local/share/mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat /tmp/imapsyncicon_$USER 2>/dev/null)" diff --git a/.scripts/statusbar/memory b/.scripts/statusbar/memory deleted file mode 100755 index dfd3d7b..0000000 --- a/.scripts/statusbar/memory +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -case $BLOCK_BUTTON in - 1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; - 3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total. -- Click to show memory hogs." ;; -esac - -free -h | awk '/^Mem:/ {print $3 "/" $2}' diff --git a/.scripts/statusbar/mpdupdate b/.scripts/statusbar/mpdupdate deleted file mode 100755 index afe11bb..0000000 --- a/.scripts/statusbar/mpdupdate +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Whenever the mpd state changes, update the mpd i3 module. -kill -0 "$(cat /tmp/mpdupdate)" 2>/dev/null && exit || echo $$ > /tmp/mpdupdate - -sleep 5 && while : ; do - pkill -RTMIN+11 i3blocks - mpc idle >/dev/null || exit -done diff --git a/.scripts/statusbar/music b/.scripts/statusbar/music deleted file mode 100755 index 93c2c9c..0000000 --- a/.scripts/statusbar/music +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -filter() { - sed "/^volume:/d" | tac | sed -e "s/\\&/&/g;s/\\[paused\\].*/<span color=\"gray\" font_style=\"italic\">/g;s/\\[playing\\].*/<span>/g" | tr -d '\n' | sed -e "s/$/<\\/span>/g" - } - -case $BLOCK_BUTTON in - 1) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause - 2) mpc toggle | filter ;; # right click, pause/unpause - 3) mpc status | filter && pgrep -x dunst >/dev/null && notify-send "🎵 Music module" "\- Shows mpd song playing. -- Italic when paused. -- Left click opens ncmpcpp. -- Middle click pauses. -- Scroll changes track.";; # right click, pause/unpause - 4) mpc prev | filter ;; # scroll up, previous - 5) mpc next | filter ;; # scroll down, next - *) mpc status | filter ;; -esac; exit diff --git a/.scripts/statusbar/news b/.scripts/statusbar/news deleted file mode 100755 index b7ca1a7..0000000 --- a/.scripts/statusbar/news +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# i3blocks newsboat module. -# Displays number of unread news items and an loading icon if updating. -# When clicked, brings up `newsboat`. - -case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e newsboat ;; - 2) setsid newsup >/dev/null & exit ;; - 3) pgrep -x dunst >/dev/null && notify-send "📰 News module" "\- Shows unread news items -- Shows 🔃 if updating with \`newsup\` -- Left click opens newsboat -- Middle click syncs RSS feeds -<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;; -esac - - cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)" diff --git a/.scripts/statusbar/pacpackages b/.scripts/statusbar/pacpackages deleted file mode 100755 index 418bc2d..0000000 --- a/.scripts/statusbar/pacpackages +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# i3blocks module for pacman upgrades. -# Displays number of upgradeable packages. -# For this to work, have a `pacman -Sy` command run in the background as a -# cronjob every so often as root. This script will then read those packages. -# When clicked, it will run an upgrade via pacman. - -case $BLOCK_BUTTON in - 1) $TERMINAL -e popupgrade ;; - 2) notify-send "$(/usr/bin/pacman -Qu)" ;; - 3) pgrep -x dunst >/dev/null && 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 -e "s/^0$//g" diff --git a/.scripts/statusbar/popupgrade b/.scripts/statusbar/popupgrade deleted file mode 100755 index 83035c3..0000000 --- a/.scripts/statusbar/popupgrade +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -printf "Beginning upgrade.\\n" - -yay -Syu -pkill -RTMIN+8 i3blocks - -printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n" -read -r diff --git a/.scripts/statusbar/torrent b/.scripts/statusbar/torrent deleted file mode 100755 index 0ab811c..0000000 --- a/.scripts/statusbar/torrent +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/.*Uploading.*/L/g; - s/.*%.*/M/g" | - sort -h | uniq -c | sed " # Now we replace the standin letters with icons. - s/A/🛑/g; - s/B/⌛️/g; - s/L/🔼/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 "Torrent module" "🛑: paused -⏳: idle (seeds needed) -🔼: uploading (unfinished) -🔽: downloading -✅: done -🌱: done and seeding" ;; -esac - diff --git a/.scripts/statusbar/volume b/.scripts/statusbar/volume deleted file mode 100755 index 3bbb32b..0000000 --- a/.scripts/statusbar/volume +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e pulsemixer & ;; - 2) pulsemixer --toggle-mute ;; - 4) pulsemixer --change-volume +5 ;; - 5) pulsemixer --change-volume -5 ;; - 3) pgrep -x dunst >/dev/null && notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. -- Middle click to mute. -- Scroll to change." -esac - -[ "$(pulsemixer --get-mute)" = "1" ] && printf "🔇\\n" && exit - -vol=$(pulsemixer --get-volume | awk '{print $1}') - -if [ "$vol" -gt "70" ]; then - icon="🔊" -elif [ "$vol" -lt "30" ]; then - icon="🔈" -else - icon="🔉" -fi - -printf "%s %s%%\\n" "$icon" "$vol" diff --git a/.scripts/statusbar/weather b/.scripts/statusbar/weather deleted file mode 100755 index e4de680..0000000 --- a/.scripts/statusbar/weather +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -location="$1"; [ -z "$location" ] || { location="$location+" && rm -f "$HOME/.local/share/weatherreport" ;} - -getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1 -curl -s "wttr.in/$location" > "$HOME/.local/share/weatherreport" || exit 1 ;} - -showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')" -sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} - -case $BLOCK_BUTTON in - 1) $TERMINAL -e less -S "$HOME/.local/share/weatherreport" ;; - 2) getforecast && showweather ;; - 3) pgrep -x dunst >/dev/null && notify-send "🌈 Weather module" "\- Left click for full forecast. -- Middle click to update forecast. -☔: Chance of rain/snow -❄: Daily low -🌞: Daily high" ;; -esac - -if [ "$(stat -c %y "$HOME/.local/share/weatherreport" >/dev/null 2>&1 | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] - then getforecast && showweather - else showweather -fi |
