Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions ssh-askpass
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ set -o nounset
# exit if one command in a pipeline fails
set -o pipefail

SOUND="/System/Library/Sounds/Tink.aiff"

# check if paused for 1 minute
if [ -e '/tmp/disable-askpass' ]
then
Expand All @@ -23,9 +25,14 @@ then

fi

# create dialog window
# create dialog window and play sound
sleep 0.1 && afplay "$SOUND" & \
result=$(osascript \
-e 'tell application "Terminal"' \
-e "tell application \"System Events\"" \
-e "set frontmostProcess to first process where it is frontmost" \
-e "set appName to name of frontmostProcess" \
-e "end tell" \
-e "tell application appName" \
-e "display dialog \"$*\" buttons {\"Deny\", \"Allow for 1min\", \"Allow\"} default button 3 with title \"SSH Agent\" with icon caution" \
-e 'end tell')

Expand Down