commit 3162f393a2eb9acfcb5e65927c5e9ecc14a92ebf
parent fa7d5d843bbb723261b2ae48fb4fae42f983864e
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sat, 15 Dec 2018 08:50:06 +0100
Use signals for refreshing individual i3blocks
Diffstat:
3 files changed, 48 insertions(+), 30 deletions(-)
diff --git a/links/.config/i3/config b/links/.config/i3/config
@@ -34,27 +34,27 @@ bindsym $mod+Shift+Return exec st
bindsym $mod+b exec firefox
bindsym $mod+t exec tor-browser
bindsym $mod+p exec zathura
-bindsym Mod1+Mod4+l exec --no-startup-id ~/bin/keyboard-layout-switch.sh && notify-send `cat ~/.kbd-layout` && killall -SIGUSR1 i3status
+bindsym Mod1+Mod4+l exec --no-startup-id ~/bin/keyboard-layout-switch.sh && notify-send `cat ~/.kbd-layout` && pkill -RTMIN+3 i3blocks
bindsym $mod+n exec st -e ranger
# volume control with alsamixer
-bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 3%+ unmute && killall -SIGUSR1 i3status
-bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master 3%- unmute && killall -SIGUSR1 i3status
-bindsym XF86AudioMute exec --no-startup-id amixer set Master toggle && killall -SIGUSR1 i3status
-bindsym XF86AudioMicMute exec --no-startup-id amixer set 'Mic Mute' toggle && killall -SIGUSR1 i3status
-bindsym $mod+Shift+i exec --no-startup-id amixer set Master 3%+ unmute && killall -SIGUSR1 i3status
-bindsym $mod+Shift+o exec --no-startup-id amixer set Master 3%- unmute && killall -SIGUSR1 i3status
-bindsym $mod+Shift+m exec --no-startup-id amixer set Master toggle && killall -SIGUSR1 i3status
+bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 3%+ unmute && pkill -RTMIN+4 i3blocks
+bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master 3%- unmute && pkill -RTMIN+4 i3blocks
+bindsym XF86AudioMute exec --no-startup-id amixer set Master toggle && pkill -RTMIN+4 i3blocks
+bindsym XF86AudioMicMute exec --no-startup-id amixer set 'Mic Mute' toggle && pkill -RTMIN+4 i3blocks
+bindsym $mod+Shift+i exec --no-startup-id amixer set Master 3%+ unmute && pkill -RTMIN+4 i3blocks
+bindsym $mod+Shift+o exec --no-startup-id amixer set Master 3%- unmute && pkill -RTMIN+4 i3blocks
+bindsym $mod+Shift+m exec --no-startup-id amixer set Master toggle && pkill -RTMIN+4 i3blocks
# keyboard backlight
bindsym XF86KbdBrightnessDown exec --no-startup-id /home/ad/bin/kbd_backlight.sh down
bindsym XF86KbdBrightnessUp exec --no-startup-id /home/ad/bin/kbd_backlight.sh up
# mpd control
-bindsym $mod+Shift+p exec --no-startup-id mpc -h localhost toggle && killall -SIGUSR1 i3status
-bindsym $mod+Shift+n exec --no-startup-id mpc -h localhost next && killall -SIGUSR1 i3status
-bindsym $mod+Shift+b exec --no-startup-id mpc -h localhost prev && killall -SIGUSR1 i3status
-bindsym $mod+Shift+s exec --no-startup-id mpc -h localhost stop && killall -SIGUSR1 i3status
+bindsym Control+Shift+p exec --no-startup-id mpc -h localhost toggle && pkill -RTMIN+14 i3blocks
+bindsym Control+Shift+n exec --no-startup-id mpc -h localhost next && pkill -RTMIN+14 i3blocks
+bindsym Control+Shift+b exec --no-startup-id mpc -h localhost prev && pkill -RTMIN+14 i3blocks
+bindsym Control+Shift+s exec --no-startup-id mpc -h localhost stop && pkill -RTMIN+14 i3blocks
# configure displays
bindsym $mod+Shift+d exec --no-startup-id bash /home/ad/code/dotfiles/bin/xrandr-auto.sh
@@ -161,12 +161,11 @@ mode "resize" {
bindsym $mod+r mode "resize"
-# Start i3bar to display a workspace bar (plus the system information i3status
+# Start i3bar to display a workspace bar (plus the system information i3blocks
# finds out, if available)
bar {
- #status_command i3status --config ~/.i3/status
- status_command i3blocks -c ~/.i3/i3blocks
- #status_command conky -c ~/.i3/conkyrc
+ status_command i3blocks -c ~/.config/i3/i3blocks
+ #status_command conky -c ~/.config/i3/conkyrc
#position top
position bottom
mode dock
diff --git a/links/.config/i3/i3blocks b/links/.config/i3/i3blocks
@@ -21,18 +21,28 @@
# urgent
# Global properties
-#separator_block_width=15
-separator_block_width=10
+separator_block_width=14
+markup=pango
[MPD]
-label=MPD
-command=mpc status | perl -ne "if (/\\[playing\\]/) {CORE::say '$(mpc current)'}"
+label=
+#command=mpc status | perl -ne "if (/\\[playing\\]/) {CORE::say '$(mpc current)'}"
+#command=mpc current
+command=~/.config/i3/i3scripts/i3mpd
color=#00FF00
interval=20
+signal=14
+
+# [mail]
+# label=MPD
+# command=mailstatus.sh
+# interval=20
+# signal=2
[layout]
command=cat $HOME/.kbd-layout
-interval=30
+interval=once
+signal=3
[volume]
#label=VOL
@@ -41,24 +51,27 @@ instance=Master
#instance=PCM
command=/usr/lib/i3blocks/volume
interval=once
-signal=10
+signal=4
# [memory]
# label=MEM
# command=/usr/lib/i3blocks/memory
# #separator=false
# interval=30
+# signal=5
# [swap]
# label=SWAP
# instance=swap
# command=/usr/lib/i3blocks/memory
# interval=30
+# signal=6
# [disk-home]
# instance=$HOME
# command=/usr/lib/i3blocks/disk
# interval=30
+# signal=7
[wireless]
label=W
@@ -67,6 +80,7 @@ instance=wlp3s0
command=/usr/lib/i3blocks/wifi
color=#00FF00
interval=10
+signal=8
[ethernet]
label=E
@@ -75,6 +89,7 @@ instance=enp0s25
command=/usr/lib/i3blocks/network
color=#00FF00
interval=10
+signal=9
#[cpu]
#label=CPU
@@ -82,17 +97,21 @@ interval=10
#interval=10
#min_width=CPU: 100.00%
##separator=false
+#signal=10
#[load]
#command=/usr/lib/i3blocks/load_average
#interval=10
+#signal=11
[battery]
label=BAT
#label=⚡
command=/usr/lib/i3blocks/battery
interval=30
+signal=12
[time]
command=date '+%Y-%m-%d %H:%M:%S'
interval=5
+signal=13
diff --git a/links/.xbindkeysrc b/links/.xbindkeysrc
@@ -44,14 +44,14 @@
#"xvkbd -xsendevent -text "\[XF86Forward]""
#m:0x0 + b:10
-"mpc next"
- control+shift + n
+#"mpc next && pkill -RTMIN+14 i3blocks"
+# control+shift + n
-"mpc prev"
- control+shift + b
+#"mpc prev && pkill -RTMIN+14 i3blocks"
+# control+shift + b
-"mpc toggle"
- control+shift + p
+#"mpc toggle && pkill -RTMIN+14 i3blocks"
+# control+shift + p
-"mpc stop"
- control+shift + s
+#"mpc stop && pkill -RTMIN+14 i3blocks"
+# control+shift + s