diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2020-04-08 22:01:51 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2020-04-08 22:01:51 -0400 |
| commit | 4814403bbf58794da3349f21e55746e50e68eab4 (patch) | |
| tree | 3bc52b7cd8eefc02d9d74e1442e7a979507b460d /.local | |
| parent | 3e8f5c1647e15586b7ec09f9c415b3a50f49e6ac (diff) | |
| download | eibhear-4814403bbf58794da3349f21e55746e50e68eab4.tar.gz eibhear-4814403bbf58794da3349f21e55746e50e68eab4.tar.zst eibhear-4814403bbf58794da3349f21e55746e50e68eab4.zip | |
pgrep junk removed and minor script changes
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/setbg | 2 | ||||
| -rwxr-xr-x | .local/bin/statusbar/battery | 2 | ||||
| -rwxr-xr-x | .local/bin/statusbar/clock | 6 | ||||
| -rwxr-xr-x | .local/bin/statusbar/help | 2 | ||||
| -rwxr-xr-x | .local/bin/statusbar/internet | 9 | ||||
| -rwxr-xr-x | .local/bin/statusbar/iplocate | 1 | ||||
| -rwxr-xr-x | .local/bin/statusbar/mailbox | 4 | ||||
| -rwxr-xr-x | .local/bin/statusbar/moonphase | 4 | ||||
| -rwxr-xr-x | .local/bin/statusbar/music | 2 | ||||
| -rwxr-xr-x | .local/bin/statusbar/news | 3 | ||||
| -rwxr-xr-x | .local/bin/statusbar/pacpackages | 2 | ||||
| -rwxr-xr-x | .local/bin/statusbar/statusbarinfo | 21 | ||||
| -rwxr-xr-x | .local/bin/statusbar/torrent | 2 | ||||
| -rwxr-xr-x | .local/bin/statusbar/volume | 2 | ||||
| -rwxr-xr-x | .local/bin/statusbar/weather | 2 |
15 files changed, 34 insertions, 30 deletions
diff --git a/.local/bin/setbg b/.local/bin/setbg index 8269378..b91c87c 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -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" diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index 395ad8d..65152f7 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -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 diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index 23e881e..9799b97 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -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 diff --git a/.local/bin/statusbar/help b/.local/bin/statusbar/help index c1f1caa..70ca383 100755 --- a/.local/bin/statusbar/help +++ b/.local/bin/statusbar/help @@ -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 "β" diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet index 8063e19..82b1080 100755 --- a/.local/bin/statusbar/internet +++ b/.local/bin/statusbar/internet @@ -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)" diff --git a/.local/bin/statusbar/iplocate b/.local/bin/statusbar/iplocate index 1dddb7c..8dc6290 100755 --- a/.local/bin/statusbar/iplocate +++ b/.local/bin/statusbar/iplocate @@ -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/;.*//" diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index 49630ad..06b622f 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -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)" diff --git a/.local/bin/statusbar/moonphase b/.local/bin/statusbar/moonphase index 09af87b..12ed90b 100755 --- a/.local/bin/statusbar/moonphase +++ b/.local/bin/statusbar/moonphase @@ -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"% diff --git a/.local/bin/statusbar/music b/.local/bin/statusbar/music index fadc15e..1412ae3 100755 --- a/.local/bin/statusbar/music +++ b/.local/bin/statusbar/music @@ -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. diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index 28b2940..455f64d 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -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 diff --git a/.local/bin/statusbar/pacpackages b/.local/bin/statusbar/pacpackages index 4273c86..6f439cc 100755 --- a/.local/bin/statusbar/pacpackages +++ b/.local/bin/statusbar/pacpackages @@ -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 diff --git a/.local/bin/statusbar/statusbarinfo b/.local/bin/statusbar/statusbarinfo index ae799e9..2b3e58c 100755 --- a/.local/bin/statusbar/statusbarinfo +++ b/.local/bin/statusbar/statusbarinfo @@ -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 diff --git a/.local/bin/statusbar/torrent b/.local/bin/statusbar/torrent index 4b559b8..6f8fc5f 100755 --- a/.local/bin/statusbar/torrent +++ b/.local/bin/statusbar/torrent @@ -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 diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume index fd59a6f..cd79de3 100755 --- a/.local/bin/statusbar/volume +++ b/.local/bin/statusbar/volume @@ -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 diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 59198a0..853d262 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -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 |
