How to redraw status line after a shortcut or any shortcut?
For example I bind +- keys for alsa volume.
I want see current voulume after a shortcut was pressed.
For example I bind +- keys for alsa volume.
I want see current voulume after a shortcut was pressed.
I defined a variable $update in my config file that can be appended to any command that you would like to update the statusbar.
set $update && killall -SIGUSR1 i3status
For volume up, down and mute I have following commands:
bindsym XF86AudioLowerVolume exec $psst pactl set-sink-volume @DEFAULT_SINK@ -- -5% && pactl set-sink-mute @DEFAULT_SINK@ 0 $update
bindsym XF86AudioRaiseVolume exec $psst pactl set-sink-volume @DEFAULT_SINK@ -- +5% && pactl set-sink-mute @DEFAULT_SINK@ 0 $update
bindsym XF86AudioMute exec $psst pactl set-sink-mute @DEFAULT_SINK@ toggle $update
where $psst is another variable that just disables any startup notification.
set $psst --no-startup-id
You can find my whole config file on github for reference.
You can send the signal SIGUSR1
to i3status
to force an update. To do this add ; killall -SIGUSR1 i3stats
to the commands you use for volume control and make sure that the whole command (what is actually run, not the i3 configuration parts) is in quotes, else the ;
will be interpreted by i3.
So something like this should work
bindsym SomeKey exec --no-startup-id "change-volume +5 ; killall -SIGUSR1 i3status"
Asked: 2014-10-17 13:22:25 +0000
Seen: 146 times
Last updated: Oct 18 '14