dotfiles-x113df9232
sbar changed and rm sxhkd
+41 −45
6 files changed
- M .config/paru/paru.conf +2 −2
- D .config/sxhkd/sxhkdrc +0 −35
- M .config/x11/xinitrc +1 −4
- A .local/bin/sb-mpdup +8 −0
- A .local/bin/sb-music +19 −0
- M .local/bin/sbar +11 −4
| @@ -33,7 +33,7 @@ RemoveMake | |||
| 33 | 33 | # | |
| 34 | 34 | # Binary OPTIONS | |
| 35 | 35 | # | |
| 36 | − | #[bin] | |
| 37 | − | FileManager = lf | |
| 36 | + | #$[bin] | |
| 37 | + | #FileManager = lf | |
| 38 | 38 | #MFlags = --skippgpcheck | |
| 39 | 39 | #Sudo = doas | |
| @@ -1,35 +0,0 @@ | |||
| 1 | − | # | |
| 2 | − | # wm independent hotkeys | |
| 3 | − | # | |
| 4 | − | #emoji menu | |
| 5 | − | # super + period | |
| 6 | − | super + grave | |
| 7 | − | unicode_emoji | |
| 8 | − | ||
| 9 | − | # swap cap if stops working | |
| 10 | − | super + c | |
| 11 | − | xset r rate 300 50 | |
| 12 | − | ||
| 13 | − | # ncmpcpp | |
| 14 | − | super + shift + n | |
| 15 | − | $TERMINAL -e ncmpcpp | |
| 16 | − | ||
| 17 | − | # Screenshot tool | |
| 18 | − | ||
| 19 | − | maimshot | |
| 20 | − | ||
| 21 | − | # file explorer | |
| 22 | − | super + shift + f | |
| 23 | − | pcmanfm | |
| 24 | − | ||
| 25 | − | # web browser | |
| 26 | − | super + shift + b | |
| 27 | − | firefox | |
| 28 | − | ||
| 29 | − | # make sxhkd reload its configuration files: | |
| 30 | − | super + Escape | |
| 31 | − | pkill -USR1 -x sxhkd | |
| 32 | − | ||
| 33 | − | # Volume | |
| 34 | − | XF86Audio{RaiseVolume,LowerVolume,Mute} | |
| 35 | − | pamixer -{i,d,t} 2; kill -34 $(cat ~/.cache/pidofbar) | |
| @@ -1,13 +1,10 @@ | |||
| 1 | 1 | #!/bin/sh | |
| 2 | 2 | ||
| 3 | 3 | #setwall & | |
| 4 | − | xwallpaper --zoom ~/.local/share/wallpaper.jpg | |
| 4 | + | xwallpaper --zoom ~/.local/share/wallpaper.jpg & | |
| 5 | 5 | xcompmgr & | |
| 6 | 6 | xset r rate 300 50 | |
| 7 | 7 | sbar & | |
| 8 | 8 | dunst & | |
| 9 | − | sxhkd & | |
| 10 | − | # setxkbmap -option caps:swapescape | |
| 11 | 9 | # exec dwm > /dev/null 2>&1 | |
| 12 | 10 | while type dwm > /dev/null ; do dwm && continue || break ; done | |
| 13 | − | $exec dwm | |
| @@ -0,0 +1,8 @@ | |||
| 1 | + | #!/bin/sh | |
| 2 | + | ||
| 3 | + | # This loop will update the mpd statusbar module whenever a command changes the | |
| 4 | + | # music player's status. mpd must be running on X's start for this to work. | |
| 5 | + | ||
| 6 | + | while : ; do | |
| 7 | + | mpc idle >/dev/null && kill -44 $(cat ~/.cache/pidofbar) || break | |
| 8 | + | done | |
| @@ -0,0 +1,19 @@ | |||
| 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 | |
| @@ -17,6 +17,10 @@ update_time () { | |||
| 17 | 17 | time="$(date "+[ %a %d %b ] [ %I:%M %P ]")" | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | + | update_music () { | |
| 21 | + | music="[ $(sb-music) ] " | |
| 22 | + | } | |
| 23 | + | ||
| 20 | 24 | # update_bat () { | |
| 21 | 25 | # # you might need to change the path depending on your device | |
| 22 | 26 | # read -r bat_status </sys/class/power_supply/BAT1/status | |
| @@ -37,16 +41,17 @@ update_vol () { | |||
| 37 | 41 | ||
| 38 | 42 | ||
| 39 | 43 | # modules that don't update on their own need to be run at the start for getting their initial value | |
| 40 | − | update_vol | |
| 44 | + | # update_vol | |
| 41 | 45 | ||
| 42 | 46 | display () { | |
| 43 | − | #printf "%s\n" " $event [$weather] [$memory $cpu] [$bat] [$backlight] [$vol] $time " | |
| 44 | − | xsetroot -name " [ $vol ] [ $memory $cpu ] $time " | |
| 47 | + | #printf "%s\n" " $event [$memory $cpu] [$bat] [$backlight] [$vol] $time " | |
| 48 | + | xsetroot -name "$music[ $vol ] [ $memory $cpu ] $time " | |
| 45 | 49 | } | |
| 46 | 50 | ||
| 47 | 51 | # SIGNALLING | |
| 48 | 52 | # trap "<function>;display" "RTMIN+n" | |
| 49 | 53 | trap "update_vol;display" "RTMIN" | |
| 54 | + | trap "update_music;display" "RTMIN+10" | |
| 50 | 55 | # trap "update_bat;display" "RTMIN+2" | |
| 51 | 56 | # to update it from external commands | |
| 52 | 57 | ## kill -m "$(cat ~/.cache/pidofbar)" | |
| @@ -58,8 +63,10 @@ do | |||
| 58 | 63 | # to update item ever n seconds with a offset of m | |
| 59 | 64 | ## [ $((sec % n)) -eq m ] && udpate_item | |
| 60 | 65 | [ $((sec % 5 )) -eq 0 ] && update_time # update time every 5 seconds | |
| 66 | + | [ $((sec % 5 )) -eq 0 ] && update_vol # update vol every 5 seconds | |
| 67 | + | [ $((sec % 5 )) -eq 0 ] && update_music # update music every 5 seconds | |
| 61 | 68 | [ $((sec % 5)) -eq 0 ] && update_cpu # update cpu every 15 seconds | |
| 62 | − | [ $((sec % 15)) -eq 0 ] && update_memory | |
| 69 | + | [ $((sec % 5)) -eq 0 ] && update_memory | |
| 63 | 70 | # [ $((sec % 60)) -eq 0 ] && update_bat | |
| 64 | 71 | #[ $((sec % 300)) -eq 1 ] && update_event | |
| 65 | 72 | ||