Last active
August 29, 2015 14:00
-
-
Save thwarted/ea392da4da0aaf8f9c19 to your computer and use it in GitHub Desktop.
notify on ssh-agent use
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
countfile=/tmp/agentcount.${USER}.$( date +%Y%m%d ) | |
c=$( cat "$countfile" 2>/dev/null ) | |
c=$(( c + 1 )) | |
echo $c > "$countfile" | |
msg="${*/Allow use of/Using}" | |
msg="$( echo "${msg/\?/}" | fold -w 34 )" | |
exec /usr/bin/notify-send --expire-time=3000 -u normal -i /usr/share/icons/hicolor/48x48/apps/seahorse.png "ssh-agent use" "$( date +%Y-%m-%d\ %T )\n$msg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment