pgrep junk removed and minor script changes

This commit is contained in:
Luke Smith 2020-04-08 22:01:51 -04:00
parent 3e8f5c1647
commit 4814403bbf
No known key found for this signature in database
GPG key ID: 4C50B54A911F6252
15 changed files with 34 additions and 30 deletions

View file

@ -4,7 +4,7 @@
# Run by itself, set the wallpaper (at X start).
# If given a file, set that as the new wallpaper.
# If given a directory, choose random file in it.
# If wal is installed, also generate a colorscheme.
# If wal is installed, also generates a colorscheme.
# Location of link to wallpaper link.
bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg"

View file

@ -4,7 +4,7 @@
# to charge status (🔌 for plugged up, 🔋 for discharging on battery, etc.).
case $BLOCK_BUTTON in
3) pgrep -x dunst >/dev/null && notify-send "🔋 Battery module" "🔋: discharging
3) notify-send "🔋 Battery module" "🔋: discharging
🛑: not charging
♻: stagnant charge
🔌: charging

View file

@ -3,8 +3,8 @@
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 -d3)" ;;
2) $TERMINAL -e calcurse -D ${XDG_CONFIG_HOME:-$HOME/.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\`
1) 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) 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

View file

@ -3,6 +3,6 @@
case $BLOCK_BUTTON in
1) groff -mom ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - ;;
2) i3 restart ;;
3) pgrep -x dunst >/dev/null && 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 i3.";;
esac; echo "❓"

View file

@ -1,8 +1,11 @@
#!/bin/sh
# Show wifi 📶 and percent strength or 📡 if none.
# Show 🌐 if connected to ethernet or ❎ if none.
case $BLOCK_BUTTON in
1) $TERMINAL -e nmtui ;;
3) pgrep -x dunst >/dev/null && notify-send "🌐 Internet module" "\- Click to connect
3) notify-send "🌐 Internet module" "\- Click to connect
📡: no wifi connection
📶: wifi connection with quality
❎: no ethernet
@ -10,7 +13,7 @@ case $BLOCK_BUTTON in
" ;;
esac
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡" ||
wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }')
grep "down" /sys/class/net/w*/operstate && wifiicon="📡" ||
wifiicon="$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }')"
printf "%s %s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate)"

View file

@ -4,6 +4,7 @@
# 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: " ${XDG_CONFIG_HOME:-$HOME/.config}/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//"

View file

@ -7,7 +7,7 @@
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
3) notify-send "📬 Mail module" "\- Shows unread mail
- Shows 🔃 if syncing mail
- Left click opens neomutt
- Middle click syncs mail" ;;
@ -15,6 +15,6 @@ esac
unread="$(find ${XDG_DATA_HOME:-$HOME/.local/share}/mail/*/INBOX/new/* -type f | wc -l 2>/dev/null)"
icon="$(cat "/tmp/imapsyncicon_$USER")"
icon="$(cat "/tmp/imapsyncicon_$USER")" 2>/dev/null
[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬 $unread$(cat "/tmp/imapsyncicon_$USER" 2>/dev/null)"

View file

@ -1,5 +1,7 @@
#!/bin/sh
# Shows the current moon phase. Requires `pom-perl`.
mnphs=$(pom $1 | grep -o 'New\|Waxing Crescent\|First Quarter\|Waxing Gibbous\|Full\|Waning Gibbous\|Last Quarter\|Waning Crescent' | grep -m1 '.')
prcnt=$(pom $1 | grep -o '[[:digit:]]*%' | grep -o '[[:digit:]]*' )
case "$mnphs" in
@ -17,7 +19,7 @@ esac
case $BLOCK_BUTTON in
1) $mnphs ;;
2) $mnphs ;;
3) pgrep -x dunst >/dev/null && notify-send " 🌜$(pom)" ;;
3) notify-send " 🌜$(pom)" ;;
esac
echo "$icon" "$prcnt"%

View file

@ -7,7 +7,7 @@ filter() {
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.
3) mpc status | filter && notify-send "🎵 Music module" "\- Shows mpd song playing.
- Italic when paused.
- Left click opens ncmpcpp.
- Middle click pauses.

View file

@ -1,13 +1,12 @@
#!/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
3) notify-send "📰 News module" "\- Shows unread news items
- Shows 🔃 if updating with \`newsup\`
- Left click opens newsboat
- Middle click syncs RSS feeds

View file

@ -20,7 +20,7 @@
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
3) notify-send "Upgrade module" "📦: number of upgradable packages
- Left click to upgrade packages
- Middle click to show upgradable packages" ;;
esac

View file

@ -9,25 +9,24 @@ echo "
This is a list of the statusbar modules.
📦5 pacpackages: updatable packages (must have pacman -Sy run in root cronjob to check).
📰 41 news: unread RSS entries in newsboat.
☔ 83% ❄️ 69° 🌞 80° weather: ☔ for precipitation, 🌞 and ❄ for daily high and low.
📬 20 mailbox: number of unread mail if mutt-wizard is active.
🔉 62% volume: master sink volume.
🔌83% battery: 🔌 for charging, 🔋 for discharging, ⚡ for full.
📶 80% ❎ internet: 📶 for wifi with % (📡 if none), 🌐 for ethernet. (❎ if none).
📦5 \033[31mpacpackages\033[0m: updatable packages (must have pacman -Sy run in root cronjob to check).
📰 41 \033[32mnews\033[0m: unread RSS entries in newsboat.
☔ 83% ❄️ 69° 🌞 80° \033[33mweather\033[0m: ☔ for precipitation, 🌞 and ❄ for daily high and low.
📬 20 \033[34mmailbox\033[0m: number of unread mail if mutt-wizard is active.
🔉 62% \033[35mvolume\033[0m: master sink volume.
🔌83% \033[36mbattery\033[0m: 🔌 for charging, 🔋 for discharging, ⚡ for full.
📶 80% ❎ \033[37minternet\033[0m: 📶 for wifi with % (📡 if none), 🌐 for ethernet. (❎ if none).
Obviously the time and date are displayed as well.
Optional script modules:
Edit ~/.local/src/dwmblocks/config.h to add these or your own if you'd like (and recompile and restart dwmblocks).
Edit \033[32m~/.local/src/dwmblocks/config.h\033[0m to add these or your own if you'd like (and recompile and restart dwmblocks).
'memory' 🧠 559Mi/3.7Gi Current used memory/total memory.
'cpu' 🌡 +46.0°C CPU temperature.
'disk' 🖥 : 28G/30G Remaining disk space...
'disk ~' 🏠: 641G/850G ...can be given directory argument.
'moonphase' 🌕 39% Phase of the moon (requires \`pom-perl\`).
'iplocate' 🇺🇸 United States Your own or VPN location (requires \`geoiplookup\`).
'moonphase' 🌕 39% Phase of the moon (requires \033[32m\`pom-perl\`\033[0m).
'iplocate' 🇺🇸 United States Your own or VPN location (requires \033[32m\`geoiplookup\`\033[0m).
" | less

View file

@ -18,7 +18,7 @@ transmission-remote -l | grep % |
case $BLOCK_BUTTON in
1) $TERMINAL -e transmission-remote-cli ;;
3) pgrep -x dunst >/dev/null && notify-send "Torrent module" "🛑: paused
3) notify-send "Torrent module" "🛑: paused
⏳: idle (seeds needed)
🔼: uploading (unfinished)
🔽: downloading

View file

@ -5,7 +5,7 @@ case $BLOCK_BUTTON in
2) amixer sset Master toggle ;;
4) amixer sset Master 5%+ >/dev/null 2>/dev/null ;;
5) amixer sset Master 5%- >/dev/null 2>/dev/null ;;
3) pgrep -x dunst >/dev/null && notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
- Middle click to mute.
- Scroll to change."
esac

View file

@ -20,7 +20,7 @@ sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\(
case $BLOCK_BUTTON in
1) $TERMINAL -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" ;;
2) getforecast && showweather ;;
3) pgrep -x dunst >/dev/null && notify-send "🌈 Weather module" "\- Left click for full forecast.
3) notify-send "🌈 Weather module" "\- Left click for full forecast.
- Middle click to update forecast.
☔: Chance of rain/snow
❄: Daily low