Skip to content

Commit

Permalink
Only show Super+B notification while B is pressed
Browse files Browse the repository at this point in the history
Hide the notification as soon as the B key is released.  This is kind of
neat, but we'll have to see if it's actually convenient.  If it turns
out it is, there are some kinks to work out.

Also see <dunst-project/dunst#284>.
  • Loading branch information
meribold committed Jan 29, 2020
1 parent d32d29f commit 60f369b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions home/xbindkeysrc
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,19 @@
"lock"
XF86ScreenSaver

# These notifications are excluded from Dunst's history based on the "ephemeral" category.
# There is associated configuration in `home/config/dunst/dunstrc` that makes this work.
"notify-send -u low -t 0 -c ephemeral - "$(date -u +$'%A, %B %-d\n<b>%H:%M</b>') UTC · $(TZ=Europe/Berlin date +'<b>%H:%M</b>') Berlin · $(TZ=Asia/Taipei date +'<b>%H:%M</b>') Taipei"$'\n\n'"$(bat)""
# Show a "date and battery info" desktop notification. FIXME: This doesn't work correctly
# until I run `xset -r 56`, which disables autorepeat for the B key globally. That's an
# ugly workaround of course. TODO: take a look at what sxhkd can do. Also, these
# notifications are currently no longer excluded from Dunst's history because Dunstify
# doesn't seem to have an equivalent to the `--category` option of `notify-send`.
"dunstify -u low -t 0 -r 84873362 - "$(date -u +$'%A, %B %-d\n<b>%H:%M</b>') UTC · $(TZ=Europe/Berlin date +'<b>%H:%M</b>') Berlin · $(TZ=Asia/Taipei date +'<b>%H:%M</b>') Taipei"$'\n\n'"$(bat)""
Mod4 + b

# We only show this "date and battery info" notification while the B key is held down and
# close it as soon as the key is released.
"dunstify --close 84873362"
Mod4 + b + Release

"vimsel"
Mod4 + e

Expand All @@ -168,6 +176,8 @@
"xterm -name 'floating xterm' -geometry 180x29 -e htop"
Mod4 + apostrophe

# These notifications are excluded from Dunst's history based on the "ephemeral" category.
# There is associated configuration in `home/config/dunst/dunstrc` that makes this work.
"notify-send -u low -t 0 -c ephemeral - "$(date -u +$'%A, %B %-d\n<b>%H:%M</b>') UTC · $(TZ=Europe/Berlin date +'<b>%H:%M</b>') Berlin · $(TZ=Asia/Taipei date +'<b>%H:%M</b>') Taipei""
Mod4 + z

Expand Down

0 comments on commit 60f369b

Please sign in to comment.