Daniel Gruss %!s(int64=4) %!d(string=hai) anos
pai
achega
46b01c4473
Modificáronse 2 ficheiros con 23 adicións e 2 borrados
  1. 3 2
      audience
  2. 20 0
      sshclick

+ 3 - 2
audience

@@ -1,4 +1,5 @@
 #!/usr/bin/zsh
 #!/usr/bin/zsh
-xinput test `xinput list | grep "Logitech USB Receiver" | grep -oE "id=[0-9]+" | grep -oE "[0-9]+"` | while read in ; do;  [[ $in = "key press   71" || $in = "key press   9" ]] && cvlc --no-loop --play-and-exit `ls applause* | shuf -n 1` 2>/dev/null 1>/dev/null &;
-  [[ $in = "key press   60" ]] && cvlc --no-loop --play-and-exit `ls laugh* | shuf -n 1` 2>/dev/null 1>/dev/null &
+cd /d/soundboard
+xinput test `xinput list | grep "Logitech USB Receiver" | grep -oE "id=[0-9]+" | grep -oE "[0-9]+"` | while read in ; do;  [[ $in = "key press   71" || $in = "key press   9" ]] && cvlc --no-loop --play-and-exit "`ls --indicator-style=none -- Applause\ [0-9]*.* | shuf -n 1`" 2>/dev/null 1>/dev/null &;
+  [[ $in = "key press   60" ]] && cvlc --no-loop --play-and-exit "`ls --indicator-style=none -- Laugh\ [0-9]*.* | shuf -n 1`" 2>/dev/null 1>/dev/null &
 done
 done

+ 20 - 0
sshclick

@@ -0,0 +1,20 @@
+#!/usr/bin/zsh
+echo "Exit with Ctrl+C"
+trap ctrl_c INT
+
+function ctrl_c() {
+	echo "exit\n" >> click
+}
+cd /tmp
+if [ ! -e click ]; then
+	mkfifo click
+fi
+tail -F click | ssh $1 & #> /dev/null &
+xinput test `xinput list | grep "Logitech USB Receiver" | grep -oE "id=[0-9]+" | grep -oE "[0-9]+"` | while read in ; do;
+	if [[ $in = "key press   117" ]]; then
+		echo 'export DISPLAY=:0.0 && export XAUTHORITY="/home/daniel/.Xauthority" && xdotool key 117\n' >> click
+	fi
+	if [[ $in = "key press   112" ]]; then
+		echo 'export DISPLAY=:0.0 && export XAUTHORITY="/home/daniel/.Xauthority" && xdotool key 112\n' >> click
+	fi
+done