FiloSottile / yubikey-agent

yubikey-agent is a seamless ssh-agent for YubiKeys.
https://filippo.io/yubikey-agent
BSD 3-Clause "New" or "Revised" License
2.6k stars 124 forks source link

expire notification after five seconds in Linux #140

Open catdevnull opened 1 year ago

catdevnull commented 1 year ago

otherwise the notification stays forever which is kind of annoying in DEs that store it indefinitely (like gnome)

a better approach would be to remove the notification after it's been pressed, but notify-send doesn't allow that afaik (using a notification library would)

9ary commented 1 year ago

a better approach would be to remove the notification after it's been pressed, but notify-send doesn't allow that afaik (using a notification library would)

It seems like notify-send -w would work for that, in that case sending SIGINT will dismiss the notification. It would also be nice to show the notification immediately rather than wait 5 seconds. Maybe passing a timeout of 0 would also be good, so that notification daemons that do implement a default timeout don't dismiss it prematurely.

catdevnull commented 1 year ago

a better approach would be to remove the notification after it's been pressed, but notify-send doesn't allow that afaik (using a notification library would)

It seems like notify-send -w would work for that, in that case sending SIGINT will dismiss the notification. It would also be nice to show the notification immediately rather than wait 5 seconds. Maybe passing a timeout of 0 would also be good, so that notification daemons that do implement a default timeout don't dismiss it prematurely.

Huh, I didn't know that. See https://github.com/FiloSottile/yubikey-agent/pull/141