Skip to content

Commit

Permalink
date
Browse files Browse the repository at this point in the history
  • Loading branch information
adam committed Jun 27, 2006
1 parent 43222d4 commit 5e2023b
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions bin/alertme
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
#!/bin/bash

if [ "$1" = '-d' ]; then
text="`date` "
gtext="`date`\n"
shift
else
text=
gtext=
fi

text="$text$*"
gtext="$gtext$*"

beep

if [ -n "$DISPLAY" ]; then
if which zenity >& /dev/null; then
zenity --info --text "$*" && exit 0
zenity --info --text "$gtext" && exit 0
fi

if which xmessage >/dev/null 2>&1; then
xmessage "$*" && exit 0
xmessage "$text" && exit 0
fi
fi

# getting desperate
echo "$*" | write `id -un`
logger "$0: $*"
echo "$text" | write `id -un`
logger "$0: $text"

0 comments on commit 5e2023b

Please sign in to comment.