clipboard-speaker (603B)
1 #!/bin/sh 2 3 clipboard_speaker_directory="$HOME/.clipboard-speaker" 4 lock_file_path="$clipboard_speaker_directory/lock" 5 pid_file_path="$clipboard_speaker_directory/pid" 6 fifo_path="$clipboard_speaker_directory/fifo" 7 speak_ng_path="$(which speak-ng)" 8 9 10 mkdir -p "$clipboard_speaker_directory" 11 mkfifo --mode=600 "$fifo_path" 12 13 # pgrep speak-ng >/dev/null || speak-ng -f "$fifo_path" 14 # pgrep speak-ng >/dev/null || { 15 # echo $$ > "$pid_file_path" 16 # speak-ng -f "$fifo_path" 17 # } 18 19 xsel -p | tr '\n' ' ' > "$fifo_path" & 20 21 daemonize -v -l "$lock_file_path" -p "$pid_file_path" "$speak_ng_path" -f "$fifo_path"