xsay: add support for sselp and xclip; output error message
[grml-scripts.git] / usr_bin / runit
1 #!/bin/sh
2 # Filename:      runit
3 # Purpose:       prompt for command via Xdialog and execute it afterwards
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2.
7 # Latest change: Fre Jän 07 11:46:02 CET 2005 [mika]
8 ################################################################################
9
10 tempfile=$(mktemp)
11 trap "rm -f $tempfile" 0 1 2 5 15
12
13 Xdialog --cr-wrap \
14         --title "INPUT BOX" --clear \
15         --inputbox \
16 "run command:" 0 0 2> $tempfile
17
18 retval=$?
19
20 COMMAND=$(cat "$tempfile")
21
22 case $retval in
23   0)
24     echo "Trying to run: $COMMAND"
25     exec "$COMMAND" & ;;
26   1)
27     echo "Cancel pressed.";;
28 esac
29
30 ## END OF FILE #################################################################