summaryrefslogtreecommitdiff
path: root/yad-panel.sh
diff options
context:
space:
mode:
Diffstat (limited to 'yad-panel.sh')
-rw-r--r--yad-panel.sh40
1 files changed, 21 insertions, 19 deletions
diff --git a/yad-panel.sh b/yad-panel.sh
index bcf0fae..163541b 100644
--- a/yad-panel.sh
+++ b/yad-panel.sh
@@ -1,25 +1,27 @@
#!/bin/bash
buttons() {
- while [ -f "$HOME/.automatisiere-lieblingstexte.pause.switch" ]; do
- if ! pgrep yad; then
- yad --title="Yad Icon panel" \
- --button="👍":0 --button="🔊":1 --button="🔁":2 \
- --form \
- --columns=1 \
- --text "$(echo -n \"$(cat \\"$HOME/.automatisiere-lieblingstexte.linea.actual.txt\\")\")" \
- --width=400 --posx=$(($(( $(xrandr --query | grep '*' | awk '{print $1}' | cut -d'x' -f1) )) - 400 - 20)) --posy=20
- case $? in
- 0)
- [ -f "$HOME/.automatisiere-lieblingstexte.pause.switch" ] && rm "$HOME/.automatisiere-lieblingstexte.pause.switch"
- ;;
- 1)
- sleep 0.2 && xdotool key Shift+Tab && sleep 0.1 && xdotool key space && sleep 0.7 && xdotool key e && sleep 0.5 && xdotool key space && sleep 0.4 && xdotool key Tab
- ;;
- 2)
- sleep 0.2 && xdotool key control+r
- ;;
- esac
+ while true; do
+ if [ -f "$HOME/.automatisiere-lieblingstexte.pause.switch" ]; then
+ if ! pgrep yad; then
+ yad --title="Yad Icon panel" \
+ --button="👍":0 --button="🔊":1 --button="🔁":2 \
+ --form \
+ --columns=1 \
+ --text "$(echo -n \"$(cat \\"$HOME/.automatisiere-lieblingstexte.linea.actual.txt\\")\")" \
+ --width=400 --posx=$(($(( $(xrandr --query | grep '*' | awk '{print $1}' | cut -d'x' -f1) )) - 400 - 20)) --posy=20
+ case $? in
+ 0)
+ [ -f "$HOME/.automatisiere-lieblingstexte.pause.switch" ] && rm "$HOME/.automatisiere-lieblingstexte.pause.switch"
+ ;;
+ 1)
+ sleep 0.2 && xdotool key Shift+Tab && sleep 0.1 && xdotool key space && sleep 0.7 && xdotool key e && sleep 0.5 && xdotool key space && sleep 0.4 && xdotool key Tab
+ ;;
+ 2)
+ sleep 0.2 && xdotool key control+r
+ ;;
+ esac
+ fi
fi
done
}