summaryrefslogtreecommitdiff
path: root/yad-panel.sh
diff options
context:
space:
mode:
authorsrv <enmanuel.saravia.externo@pandero.com.pe>2025-05-06 03:56:46 -0500
committersrv <enmanuel.saravia.externo@pandero.com.pe>2025-05-06 03:56:46 -0500
commit2d867a0310dcca0208f934cdabc8b568205d4610 (patch)
tree107756bbcfc76e6fd504be2cb0e5c74d815d9e70 /yad-panel.sh
parent894516236922d3acf343c55eb55301bee07c7b00 (diff)
Add bucle for repeat dialog
Diffstat (limited to 'yad-panel.sh')
-rw-r--r--yad-panel.sh42
1 files changed, 22 insertions, 20 deletions
diff --git a/yad-panel.sh b/yad-panel.sh
index 9ad789a..bcf0fae 100644
--- a/yad-panel.sh
+++ b/yad-panel.sh
@@ -1,25 +1,27 @@
#!/bin/bash
buttons() {
- if [ -f "$HOME/.automatisiere-lieblingstexte.pause.switch" ]; 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" || touch "$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
+ 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
+ fi
+ done
}
# Primer YAD inicial
@@ -42,7 +44,7 @@ case $? in
--button="πŸ‘":0 \
--text="Puedes modificar el texto ...o si ya estΓ‘ todo listo empezemos!"
- buttons
+ buttons &
case $? in
0)
bash "$HOME/automatisiere-lieblingstexte/run.sh" 'Z9SWsMuc89'