updated on Wed Jan 25 20:08:56 UTC 2012
[aur-mirror.git] / fbsplash-extras / fbsplash-control-functions.bash
blobbcb84e5dafcd3907457d29fd4026af5d1bd9c367
1 #!/bin/bash
3 # fbsplash-control-functions.bash
5 # Send commands to fbsplash-controld (if running)
6 splash_control() {
7 local FIFO="/run/fbsplash-controld.fifo" fd ret=0
8 [[ -p $FIFO ]] || return 0
9 # Open an extra file descriptor to avoid blocking
10 exec {fd}<>"$FIFO" || return 1
11 case $1
12 # Also send splashd commands thru the controld FIFO to maintain order
13 in comms ) printf 'comm %s\n' "${@:2}" >"$FIFO" || ret=1
14 ;; * ) echo "$*" >"$FIFO" || ret=1
15 esac
16 exec {fd}>&-
17 return $ret
20 # EOF #