dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit debbe40d2c60d4eb8c407d16075838a84edf91d6
parent 9fd0e6575439747e179be8218b0f372fedf69dc4
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sun, 11 Nov 2018 21:27:04 -0500

right click on modules shows module info

Diffstat:
M.scripts/statusbar/i3battery | 10++++++++++
M.scripts/statusbar/i3mail | 9+++++++--
M.scripts/statusbar/i3mpd | 10++++++++--
M.scripts/statusbar/i3pacman | 9++++++---
M.scripts/statusbar/i3volume | 6+++++-
M.scripts/statusbar/i3weather | 14++++++++++----
6 files changed, 46 insertions(+), 12 deletions(-)

diff --git a/.scripts/statusbar/i3battery b/.scripts/statusbar/i3battery @@ -20,3 +20,13 @@ fi [ "$status" = "Charging" ] && color="#FFF" printf "<span color='%s'>%s %s</span>" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$(echo "$capacity" | sed -e 's/$/%/')" + +case $BLOCK_BUTTON in + 3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b> +🔋: discharging +♻: stagnant charge +🔌: charging +⚡: charged +- Text color reflects charge left" ;; +esac + diff --git a/.scripts/statusbar/i3mail b/.scripts/statusbar/i3mail @@ -5,7 +5,12 @@ # When clicked, brings up `neomutt`. case $BLOCK_BUTTON in - 1) $TERMINAL -e neomutt ;; + 1) "$TERMINAL" -e neomutt ;; + 3) pgrep -x dunst >/dev/null && notify-send "<b>📬 Mail module:</b> +- Shows unread mail +- Left click opens neomutt" ;; esac -echo "$(du -a ~/.mail/*/INBOX/new/* | sed -n '$=')" $(cat ~/.config/mutt/.dl) + + +echo "$(du -a ~/.mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat ~/.config/mutt/.dl 2>/dev/null)" diff --git a/.scripts/statusbar/i3mpd b/.scripts/statusbar/i3mpd @@ -5,8 +5,14 @@ filter() { } case $BLOCK_BUTTON in - 1) mpc status | filter && $TERMINAL -e ncmpcpp & disown ;; # right click, pause/unpause - 3) mpc toggle | filter ;; # right click, pause/unpause + 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 "<b>🎵 Music module:</b> +- 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 ;; diff --git a/.scripts/statusbar/i3pacman b/.scripts/statusbar/i3pacman @@ -4,10 +4,13 @@ # 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 `yay`. (`yay` required, duh.) +# When clicked, it will run an upgrade via pacman. case $BLOCK_BUTTON in - 1) $TERMINAL -e "popupgrade" ;; + 1) $TERMINAL -e popupgrade ;; + 3) pgrep -x dunst >/dev/null && notify-send "<b>Upgrade module:</b> +📦: number of upgradable packages" ;; esac -yay -Qu | sed -e '/^Get/d' | wc -l | sed -e "s/^0$//g" + +pacman -Qu | wc -l | sed -e "s/^0$//g" diff --git a/.scripts/statusbar/i3volume b/.scripts/statusbar/i3volume @@ -2,9 +2,13 @@ case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e pulsemixer & ;; - 3) pulsemixer --toggle-mute ;; + 2) pulsemixer --toggle-mute ;; 4) pulsemixer --change-volume +5 ;; 5) pulsemixer --change-volume -5 ;; + 3) pgrep -x dunst >/dev/null && notify-send "<b>Volume module:</b> +- Shows volume 🔊, 🔇 if muted. +- Middle click to mute. +- Scroll to change." esac [ "$(pulsemixer --get-mute)" = "1" ] && printf "🔇\\n" && exit diff --git a/.scripts/statusbar/i3weather b/.scripts/statusbar/i3weather @@ -1,10 +1,16 @@ #!/bin/sh ### This is only if your location isn't automatically detected, otherwise you can leave it blank. -location="" +location="Statesboro" -[ "$location" != "" ] && location="$location+" +case $BLOCK_BUTTON in + 1) $TERMINAL -e popweather ;; + 3) pgrep -x dunst >/dev/null && notify-send "<b>🌈 Weather module:</b> +☔: Chance of rain/snow +❄: Daily low +🌞: Daily high" ;; +esac -[ "$BLOCK_BUTTON" = "1" ] && $TERMINAL -e popweather +[ "$location" != "" ] && location="$location+" ping -q -w 1 -c 1 "$(ip r | grep default | tail -1 | cut -d ' ' -f 3)" >/dev/null || exit @@ -12,4 +18,4 @@ curl -s wttr.in/$location > ~/.weatherreport printf "%s" "$(sed '16q;d' ~/.weatherreport | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')" -sed '13q;d' ~/.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' ~/.weatherreport | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}'