docs
[mirrors/Programs.git] / bash / caudacious.sh
CommitLineData
21c4e167
H
1#!/bin/sh
2
3export XDIALOG_HIGH_DIALOG_COMPAT=true;
4DISPLAY=':0.0';
5dialog="dialog"; #(dialog|whiptail|Xdialog|gdialog);
6tmpfile="/tmp/caudacui-$$.tmp";
7
8#ssh keepalive
9while true; do
10 sleep 1;
11 echo -ne '\x00';
12done &
13
14#menu loop
15while true; do
16 "$dialog" --title "Harvie's Remote Textmode UI for Audacious & amixer" --no-shadow --menu '' 0 0 0\
17 ' -t' '|> PLAY/PAUSE'\
18 ' -s' '## STOP'\
19 ' -f' '>> FWD'\
20 ' -r' '<< REV'\
21 ' -p' '-> PLAY'\
22 ' -u' '|| PAUSE'\
23 ' 100%' '-- VOLUME MAX'\
24 ' 5%+' '-- VOLUME +5dB'\
25 ' 5%-' '-- VOLUME -5dB'\
26 ' 0%- toggle' 'xx MUTE'\
27 2>"$tmpfile";
28 if [[ "$?" != 0 ]]; then
29 kill "$!"; >/dev/null 2>&1
30 rm -f "$tmpfile";
31 exit;
32 fi;
33 echo 'Processing...';
34 if ( grep '%' -F "$tmpfile" ); then
35 amixer -c 0 sset Master $(cat "$tmpfile");
36 continue;
37 fi;
38 audacious -n 0 $(cat "$tmpfile");
39done;
This page took 0.268699 seconds and 4 git commands to generate.