statusbar scripts now open when shift-clicked

weather module "fixed"
other minor statusbar script tweaks
This commit is contained in:
Luke Smith 2020-05-07 17:31:42 -04:00
parent baad9e0136
commit 33e329c8cb
No known key found for this signature in database
GPG key ID: 4C50B54A911F6252
17 changed files with 45 additions and 24 deletions

View file

@ -10,6 +10,7 @@ case $BLOCK_BUTTON in
🔌: charging 🔌: charging
⚡: charged ⚡: charged
❗: battery very low!" ;; ❗: battery very low!" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
# acpi alternative # acpi alternative

View file

@ -23,6 +23,7 @@ case $BLOCK_BUTTON in
2) setsid "$TERMINAL" -e calcurse -D ~/.config/calcurse & ;; 2) setsid "$TERMINAL" -e calcurse -D ~/.config/calcurse & ;;
3) 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\` 3) 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" ;; - Middle click opens calcurse if installed" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
printf '%s %s%s\n' "$(date '+%Y %b %d (%a)')" "$icon" "$(date '+%I:%M%p')" printf '%s %s%s\n' "$(date '+%Y %b %d (%a)')" "$icon" "$(date '+%I:%M%p')"

View file

@ -6,6 +6,7 @@ case $BLOCK_BUTTON in
3) notify-send "🖥 CPU module " "\- Shows CPU temperature. 3) notify-send "🖥 CPU module " "\- Shows CPU temperature.
- Click to show intensive processes. - Click to show intensive processes.
- Middle click to open htop." ;; - Middle click to open htop." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
sensors | awk '/Core 0/ {print "🌡", $3}' sensors | awk '/Core 0/ {print "🌡", $3}'

View file

@ -48,6 +48,7 @@ case $BLOCK_BUTTON in
- Middle click to update. - Middle click to update.
- Shows 🔃 if updating prices. - Shows 🔃 if updating prices.
- Manually add/remove currencies to list in the script." ;; - Manually add/remove currencies to list in the script." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
printprices printprices

View file

@ -11,6 +11,7 @@ case $BLOCK_BUTTON in
1) notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;; 1) notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;;
3) notify-send "💽 Disk module" "\- Shows used hard drive space. 3) notify-send "💽 Disk module" "\- Shows used hard drive space.
- Click to show all disk info." ;; - Click to show all disk info." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
case "$location" in case "$location" in

View file

@ -12,5 +12,6 @@ case $BLOCK_BUTTON in
1) groff -mom "${READMEFILE:-${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom}" -Tpdf | zathura - ;; 1) groff -mom "${READMEFILE:-${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom}" -Tpdf | zathura - ;;
2) restartwm ;; 2) restartwm ;;
3) notify-send "❓ Help module" "\- Left click to open LARBS guide. 3) notify-send "❓ Help module" "\- Left click to open LARBS guide.
- Middle click to refresh window manager.";; - Middle click to refresh window manager." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac; echo "❓" esac; echo "❓"

View file

@ -11,6 +11,7 @@ case $BLOCK_BUTTON in
❎: no ethernet ❎: no ethernet
🌐: ethernet working 🌐: ethernet working
" ;; " ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in

View file

@ -10,6 +10,7 @@ case $BLOCK_BUTTON in
- Shows 🔃 if syncing mail - Shows 🔃 if syncing mail
- Left click opens neomutt - Left click opens neomutt
- Middle click syncs mail" ;; - Middle click syncs mail" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)" unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"

View file

@ -6,6 +6,7 @@ case $BLOCK_BUTTON in
3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total. 3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total.
- Click to show memory hogs. - Click to show memory hogs.
- Middle click to open htop." ;; - Middle click to open htop." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
free -h | sed -n '2{p;q}' | awk '{print "🧠", $3 "/" $2}' free -h | sed -n '2{p;q}' | awk '{print "🧠", $3 "/" $2}'

View file

@ -15,10 +15,11 @@ case "$mnphs" in
"Waning Crescent") icon="🌘" ;; "Waning Crescent") icon="🌘" ;;
esac esac
case ${BUTTON:-$BLOCK_BUTTON} in case $BLOCK_BUTTON in
1) $mnphs ;; 1) $mnphs ;;
2) $mnphs ;; 2) $mnphs ;;
3) notify-send " 🌜$(pom)" ;; 3) notify-send " 🌜$(pom)" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
echo "${icon:?}" "$prcnt"% echo "${icon:?}" "$prcnt"%

View file

@ -3,14 +3,15 @@
filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | tr '\n' ' ' | sed 's/ $//' ;} filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | tr '\n' ' ' | sed 's/ $//' ;}
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause 1) mpc status | filter ; setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause
2) mpc toggle | filter ;; # right click, pause/unpause 2) mpc toggle | filter ;; # right click, pause/unpause
3) mpc status | filter && notify-send "🎵 Music module" "\- Shows mpd song playing. 3) mpc status | filter ; notify-send "🎵 Music module" "\- Shows mpd song playing.
- Italic when paused. - Italic when paused.
- Left click opens ncmpcpp. - Left click opens ncmpcpp.
- Middle click pauses. - Middle click pauses.
- Scroll changes track.";; # right click, pause/unpause - Scroll changes track.";; # right click, pause/unpause
4) mpc prev | filter ;; # scroll up, previous 4) mpc prev | filter ;; # scroll up, previous
5) mpc next | filter ;; # scroll down, next 5) mpc next | filter ;; # scroll down, next
6) mpc status | filter ; "$TERMINAL" -e "$EDITOR" "$0" ;;
*) mpc status | filter ;; *) mpc status | filter ;;
esac esac

View file

@ -7,6 +7,7 @@
case "$BLOCK_BUTTON" in case "$BLOCK_BUTTON" in
3) notify-send "🌐 Network traffic module" "🔻: Traffic received 3) notify-send "🌐 Network traffic module" "🔻: Traffic received
🔺: Traffic transmitted" ;; 🔺: Traffic transmitted" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
rxfile="${XDG_CACHE_HOME:-$HOME/.cache}/rxlog" rxfile="${XDG_CACHE_HOME:-$HOME/.cache}/rxlog"

View file

@ -11,6 +11,7 @@ case $BLOCK_BUTTON in
- Left click opens newsboat - Left click opens newsboat
- Middle click syncs RSS feeds - Middle click syncs RSS feeds
<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;; <b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed 's/^📰 0$//g')$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/.update 2>/dev/null)" cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed 's/^📰 0$//g')$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/.update 2>/dev/null)"

View file

@ -23,6 +23,7 @@ case $BLOCK_BUTTON in
3) notify-send "🎁 Upgrade module" "📦: number of upgradable packages 3) notify-send "🎁 Upgrade module" "📦: number of upgradable packages
- Left click to upgrade packages - Left click to upgrade packages
- Middle click to show upgradable packages" ;; - Middle click to show upgradable packages" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/📦/;s/^📦0$//g" pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/📦/;s/^📦0$//g"

View file

@ -10,18 +10,24 @@ transmission-remote -l | grep % |
s/.*%.*/M/g" | s/.*%.*/M/g" |
sort -h | uniq -c | sed " # Now we replace the standin letters with icons. sort -h | uniq -c | sed " # Now we replace the standin letters with icons.
s/A/🛑/g; s/A/🛑/g;
s/B/⌛️/g; s/B/🕰/g;
s/L/🔼/g; s/L/🔼/g;
s/M/🔽/g; s/M/🔽/g;
s/N/✅/g; s/N/✅/g;
s/Z/🌱/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed 's/ $//' s/Z/🌱/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed 's/ $//'
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) $TERMINAL -e tremc ;; 1) setsid "$TERMINAL" -e tremc & ;;
3) notify-send "Torrent module" "🛑: paused 2) td-toggle ;;
⏳: idle (seeds needed) 3) notify-send "🌱 Torrent module" "\- Left click to open tremc.
- Middle click to toggle transmission.
- Shift click to edit script.
Module shows number of torrents:
🛑: paused
🕰: idle (seeds needed)
🔼: uploading (unfinished) 🔼: uploading (unfinished)
🔽: downloading 🔽: downloading
✅: done ✅: done
🌱: done and seeding" ;; 🌱: done and seeding" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac

View file

@ -14,7 +14,8 @@ case $BLOCK_BUTTON in
5) pamixer --allow-boost -d 1 ;; 5) pamixer --allow-boost -d 1 ;;
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
- Middle click to mute. - Middle click to mute.
- Scroll to change." - Scroll to change." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
volstat="$(pactl list sinks)" volstat="$(pactl list sinks)"

View file

@ -15,15 +15,15 @@ showweather() { printf "%s" "$(sed '16q;d' "${XDG_DATA_HOME:-$HOME/.local/share}
grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔ /g;1q" | tr -d '\n')" grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔ /g;1q" | tr -d '\n')"
sed '13q;d' "${XDG_DATA_HOME:-$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 "°"}' ;} sed '13q;d' "${XDG_DATA_HOME:-$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 "°"}' ;}
# The BLOCK_BUTTON bloat for clicking in i3.
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) setsid "$TERMINAL" -e less -Sf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;; 1) setsid "$TERMINAL" -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;;
2) getforecast && showweather ;; 2) getforecast && showweather ;;
3) notify-send "🌈 Weather module" "\- Left click for full forecast. 3) notify-send "🌈 Weather module" "\- Left click for full forecast.
- Middle click to update forecast. - Middle click to update forecast.
☔: Chance of rain/snow ☔: Chance of rain/snow
🥶: Daily low 🥶: Daily low
🌞: Daily high" ;; 🌞: Daily high" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
# The test if our forcecast is updated to the day. If it isn't download a new # The test if our forcecast is updated to the day. If it isn't download a new