Created
May 8, 2014 18:34
-
-
Save grauwoelfchen/d1f7b0a25c02f880a313 to your computer and use it in GitHub Desktop.
Stumpish notification via X-session for root
This file contains hidden or 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/sh | |
| if [ $# -lt 1 ]; then | |
| echo "Usage: `basename $0` 'text'" >&2 | |
| exit 2 | |
| fi | |
| STUMPISH=/usr/local/bin/stumpish | |
| LEN=${#1} | |
| SPACE=$(printf "%${LEN}s") | |
| LINE="+-$(echo "${SPACE}" | sed 's/ /\-/g')-+" | |
| su -c "exec env DISPLAY='$DISPLAY' XAUTHORITY='$XAUTHORITY' '$SHELL' -c \"$STUMPISH echo '^1*$LINE | |
| | $SPACE | | |
| | $1 | | |
| | $SPACE | | |
| $LINE | |
| '\" >/dev/null 2>&1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment