dotfiles-x11c866ba8
switch to dwmblocks
+31 −107
9 files changed
- M .config/x11/xinitrc +2 −2
- D .local/bin/sb-music +0 −19
- D .local/bin/sbar +0 −84
- A .local/bin/statusbar/sb-clock +2 −0
- A .local/bin/statusbar/sb-memory +2 −0
- R .local/bin/sb-mpdup → .local/bin/statusbar/sb-mpdup +1 −1
- A .local/bin/statusbar/sb-music +11 −0
- A .local/bin/statusbar/sb-volume +2 −0
- M .local/share/vocab/words.txt +11 −1
| @@ -5,7 +5,7 @@ xwallpaper --zoom ~/.local/share/wallpaper.jpg & | |||
| 5 | 5 | xcompmgr & | |
| 6 | 6 | xset r rate 300 50 | |
| 7 | 7 | unclutter & | |
| 8 | − | sbar & | |
| 8 | + | dwmblocks & | |
| 9 | 9 | dunst & | |
| 10 | − | # exec dwm > /dev/null 2>&1 | |
| 10 | + | # exec dwm > /dev/null 2>&1 | |
| 11 | 11 | while type dwm > /dev/null ; do dwm && continue || break ; done | |
| @@ -1,19 +0,0 @@ | |||
| 1 | − | #!/bin/sh | |
| 2 | − | ||
| 3 | − | filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;} | |
| 4 | − | ||
| 5 | − | pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 & | |
| 6 | − | ||
| 7 | − | case $BLOCK_BUTTON in | |
| 8 | − | 1) mpc status | filter ; setsid -f "$TERMINAL" -e ncmpcpp ;; # right click, pause/unpause | |
| 9 | − | 2) mpc toggle | filter ;; # right click, pause/unpause | |
| 10 | − | 3) mpc status | filter ; notify-send "🎵 Music module" "\- Shows mpd song playing. | |
| 11 | − | - ⏸ when paused. | |
| 12 | − | - Left click opens ncmpcpp. | |
| 13 | − | - Middle click pauses. | |
| 14 | − | - Scroll changes track.";; # right click, pause/unpause | |
| 15 | − | 4) mpc prev | filter ;; # scroll up, previous | |
| 16 | − | 5) mpc next | filter ;; # scroll down, next | |
| 17 | − | 6) mpc status | filter ; "$TERMINAL" -e "$EDITOR" "$0" ;; | |
| 18 | − | *) mpc status | filter ;; | |
| 19 | − | esac | |
| @@ -1,84 +0,0 @@ | |||
| 1 | − | #!/bin/env sh | |
| 2 | − | ||
| 3 | − | # INIT | |
| 4 | − | printf "$$" > ~/.cache/pidofbar | |
| 5 | − | sec=0 | |
| 6 | − | ||
| 7 | − | # MODULES | |
| 8 | − | update_cpu () { | |
| 9 | − | cpu=" $(grep -o "^[^ ]*" /proc/loadavg )" | |
| 10 | − | } | |
| 11 | − | ||
| 12 | − | update_memory () { | |
| 13 | − | memory=" $(free -h --si | sed -n "2s/\([^ ]* *\)\{2\}\([^ ]*\).*/\2/p")" | |
| 14 | − | } | |
| 15 | − | ||
| 16 | − | update_time () { | |
| 17 | − | time="$(date "+[ %a %d %b ] [ %I:%M %P ]")" | |
| 18 | − | } | |
| 19 | − | ||
| 20 | − | update_music () { | |
| 21 | − | # music="[ $(sb-music) ] " | |
| 22 | − | if [ -z "$(sb-music)" ]; then | |
| 23 | − | music="" | |
| 24 | − | else | |
| 25 | − | music="[ $(sb-music) ] " | |
| 26 | − | fi | |
| 27 | − | } | |
| 28 | − | ||
| 29 | − | # update_bat () { | |
| 30 | − | # # you might need to change the path depending on your device | |
| 31 | − | # read -r bat_status </sys/class/power_supply/BAT1/status | |
| 32 | − | # read -r bat_capacity </sys/class/power_supply/BAT1/capacity | |
| 33 | − | # bat="$bat_status $bat_capacity%" | |
| 34 | − | # } | |
| 35 | − | ||
| 36 | − | update_vol () { | |
| 37 | − | vol="$([ "$(pamixer --get-mute)" = "false" ] && printf ' ' || printf ' ')$(pamixer --get-volume)%" | |
| 38 | − | } | |
| 39 | − | ||
| 40 | − | # For calcurse users, refer https://github.com/pystardust/automeet | |
| 41 | − | #update_event () { | |
| 42 | − | # event="$(calcurse -n | sed 1d | \ | |
| 43 | − | # sed -E "s_^ *\[(.*):(.*)\] ([^\t]*)\t?.*_[\1h \2m->\3]_")" | |
| 44 | − | # [ "[]" = "$event" ] && event="" | |
| 45 | − | #} | |
| 46 | − | ||
| 47 | − | ||
| 48 | − | # modules that don't update on their own need to be run at the start for getting their initial value | |
| 49 | − | # update_vol | |
| 50 | − | ||
| 51 | − | display () { | |
| 52 | − | #printf "%s\n" " $event [$memory $cpu] [$bat] [$backlight] [$vol] $time " | |
| 53 | − | xsetroot -name "$music[ $vol ] [ $memory $cpu ] $time " | |
| 54 | − | } | |
| 55 | − | ||
| 56 | − | # SIGNALLING | |
| 57 | − | # trap "<function>;display" "RTMIN+n" | |
| 58 | − | trap "update_vol;display" "RTMIN" | |
| 59 | − | trap "update_music;display" "RTMIN+10" | |
| 60 | − | # trap "update_bat;display" "RTMIN+2" | |
| 61 | − | # to update it from external commands | |
| 62 | − | ## kill -m "$(cat ~/.cache/pidofbar)" | |
| 63 | − | # where m = 34 + n | |
| 64 | − | ||
| 65 | − | while true | |
| 66 | − | do | |
| 67 | − | sleep 1 & wait && { | |
| 68 | − | # to update item ever n seconds with a offset of m | |
| 69 | − | ## [ $((sec % n)) -eq m ] && udpate_item | |
| 70 | − | [ $((sec % 5 )) -eq 0 ] && update_time # update time every 5 seconds | |
| 71 | − | [ $((sec % 5 )) -eq 0 ] && update_vol # update vol every 5 seconds | |
| 72 | − | [ $((sec % 5 )) -eq 0 ] && update_music # update music every 5 seconds | |
| 73 | − | [ $((sec % 5)) -eq 0 ] && update_cpu # update cpu every 15 seconds | |
| 74 | − | [ $((sec % 5)) -eq 0 ] && update_memory | |
| 75 | − | # [ $((sec % 60)) -eq 0 ] && update_bat | |
| 76 | − | #[ $((sec % 300)) -eq 1 ] && update_event | |
| 77 | − | ||
| 78 | − | # how often the display updates ( 5 seconds ) | |
| 79 | − | [ $((sec % 5 )) -eq 0 ] && display | |
| 80 | − | sec=$((sec + 1)) | |
| 81 | − | } | |
| 82 | − | done | |
| 83 | − | ||
| 84 | − | ||
| @@ -0,0 +1,2 @@ | |||
| 1 | + | #!/bin/sh | |
| 2 | + | echo "$(date "+[ %a %d %b ] [ %I:%M %P ]")" | |
| @@ -0,0 +1,2 @@ | |||
| 1 | + | #!/bin/sh | |
| 2 | + | echo "[ $(free --mebi | sed -n '2{p;q}' | awk '{printf ("%2.2fGiB", ( $3 / 1024), ($2 / 1024))}') $(sensors | awk '/Core 0/ {print " " $3}') ]" | |
| @@ -4,5 +4,5 @@ | |||
| 4 | 4 | # music player's status. mpd must be running on X's start for this to work. | |
| 5 | 5 | ||
| 6 | 6 | while : ; do | |
| 7 | − | mpc idle >/dev/null && kill -44 $(cat ~/.cache/pidofbar) || break | |
| 7 | + | mpc idle >/dev/null && kill -45 $(pidof dwmblocks) || break | |
| 8 | 8 | done | |
| @@ -0,0 +1,11 @@ | |||
| 1 | + | #!/bin/sh | |
| 2 | + | ||
| 3 | + | filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;} | |
| 4 | + | ||
| 5 | + | pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 & | |
| 6 | + | ||
| 7 | + | if [ -z "$(filter)" ]; then | |
| 8 | + | echo "" | |
| 9 | + | else | |
| 10 | + | echo "[ $(filter) ]" | |
| 11 | + | fi | |
| @@ -0,0 +1,2 @@ | |||
| 1 | + | #!/bin/sh | |
| 2 | + | echo [ "$([ "$(pamixer --get-mute)" = "false" ] && printf ' ' || printf ' ')$(pamixer --get-volume)%" ] | |
| @@ -91,7 +91,7 @@ eerie -> strange and frightening | |||
| 91 | 91 | prepend -> add (something) to the beginning of something else | |
| 92 | 92 | notion -> a conception of or belief about something | |
| 93 | 93 | robust -> strong and healthy | |
| 94 | − | mundane -> | |
| 94 | + | mundane -> | |
| 95 | 95 | mundane -> lacking interest or excietement; dull. | |
| 96 | 96 | inevitable -> certain to happen; unavoidable. | |
| 97 | 97 | postulate -> suggest or assume the existence, fact, or truth of something as a basis for reasoning, discussion or belief. | |
| @@ -103,3 +103,13 @@ ardent -> very enthusiastic or passionate. | |||
| 103 | 103 | absolute -> existing independently and not in relation to other things | |
| 104 | 104 | reciprocal (mathematics) -> a multiplicative invers | |
| 105 | 105 | intuitive -> easy to use and understand. | |
| 106 | + | ubiquitous -> found everywhere, present or appearing. | |
| 107 | + | poofta -> a man who is considered effiminate or homosexual | |
| 108 | + | camouflage -> it is the use of any combination of materials to either make objects hard to see or by disguising them as someting else. | |
| 109 | + | aisle -> a passage between rows of seats in a building such as a curch or theatre, an aircraft or train. | |
| 110 | + | ensemble -> a group of items viewed as a whole rather than individually. | |
| 111 | + | traverse -> travel across or through, "he traversed the forest" | |
| 112 | + | fiend -> an evil spirit or demon | |
| 113 | + | contiguous -> sharing a common border; touching. | |
| 114 | + | transgression -> an act that goes against a law, rule, or code of conduct. | |
| 115 | + | onosecond -> its the fraction of time before one realizes that they have made a crucial mistake after the mistake was made | |