Krolyxon
Commit 3df9232

Branches

Refs →

dotfiles-x113df9232

sbar changed and rm sxhkd

Author
krolyxon
Date
2022-09-11 14:01 +0530
Parent
87bf632
Commit
3df92328cd72edd10522dae651f7352543f5e387

+41 −45

6 files changed

  1. M .config/paru/paru.conf +2 −2
  2. D .config/sxhkd/sxhkdrc +0 −35
  3. M .config/x11/xinitrc +1 −4
  4. A .local/bin/sb-mpdup +8 −0
  5. A .local/bin/sb-music +19 −0
  6. M .local/bin/sbar +11 −4
M .config/paru/paru.conf View
@@ -33,7 +33,7 @@ RemoveMake
3333 #
3434 # Binary OPTIONS
3535 #
36−#[bin]
37−FileManager = lf
36+#$[bin]
37+#FileManager = lf
3838 #MFlags = --skippgpcheck
3939 #Sudo = doas
D .config/sxhkd/sxhkdrc View
@@ -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−Print
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)
M .config/x11/xinitrc View
@@ -1,13 +1,10 @@
11 #!/bin/sh
22
33 #setwall &
4−xwallpaper --zoom ~/.local/share/wallpaper.jpg
4+xwallpaper --zoom ~/.local/share/wallpaper.jpg &
55 xcompmgr &
66 xset r rate 300 50
77 sbar &
88 dunst &
9−sxhkd &
10−# setxkbmap -option caps:swapescape
119 # exec dwm > /dev/null 2>&1
1210 while type dwm > /dev/null ; do dwm && continue || break ; done
13−$exec dwm
A .local/bin/sb-mpdup View
@@ -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
A .local/bin/sb-music View
@@ -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
M .local/bin/sbar View
@@ -17,6 +17,10 @@ update_time () {
1717 time="$(date "+[  %a %d %b ] [  %I:%M %P ]")"
1818 }
1919
20+update_music () {
21+ music="[ $(sb-music) ] "
22+}
23+
2024 # update_bat () {
2125 # # you might need to change the path depending on your device
2226 # read -r bat_status </sys/class/power_supply/BAT1/status
@@ -37,16 +41,17 @@ update_vol () {
3741
3842
3943 # 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
4145
4246 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 "
4549 }
4650
4751 # SIGNALLING
4852 # trap "<function>;display" "RTMIN+n"
4953 trap "update_vol;display" "RTMIN"
54+trap "update_music;display" "RTMIN+10"
5055 # trap "update_bat;display" "RTMIN+2"
5156 # to update it from external commands
5257 ## kill -m "$(cat ~/.cache/pidofbar)"
@@ -58,8 +63,10 @@ do
5863 # to update item ever n seconds with a offset of m
5964 ## [ $((sec % n)) -eq m ] && udpate_item
6065 [ $((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
6168 [ $((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
6370 # [ $((sec % 60)) -eq 0 ] && update_bat
6471 #[ $((sec % 300)) -eq 1 ] && update_event
6572