xsay: add support for sselp and xclip; output error message
[grml-scripts.git] / usr_bin / xsay
1 #!/bin/sh
2 # Filename:      xsay
3 # Purpose:       output X clipboard text via flite
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 Jul 14 01:29:42 CEST 2006 [mika]
8 ################################################################################
9
10 if [ -x /usr/bin/sselp ] ; then       # package dwm-tools
11    flite -o play -t "$(sselp)"
12 elif [ -x /usr/bin/xclip ] ; then     # package xclip
13    flite -o play -t "$(xclip -o)"
14 elif [ -x /usr/bin/wmiipsel ] ; then  # old wmii package
15    flite -o play -t "$(wmiipsel)"
16 elif [ -x /usr/bin/wmiiplumb ] ; then # old wmii package
17    flite -o play -t "$(wmiiplumb)"
18 elif [ -x /usr/bin/wmiplumb ] ; then  # deprecated wmi package
19    flite -o play -t "$(wmiplumb)"
20 else
21   echo "error, no program for reading X selection found" | flite
22 fi
23
24 ## END OF FILE #################################################################