You are not logged in.

#1 2025-11-04 07:51:32

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 347

[SOLVED] F5 Auto-Press Script Not Working (X)

hello,
I once used this script to automatically press F5 every 4 seconds:

$ cat f5.sh 
#!/bin/bash
while true;
do xdotool key F5
sleep 4
done

Now it doesn't work anymore:

$ sh f5.sh 
^[[15;3~^C

what could be the cause? I use X and openbox.
I even tried it on another user and another WM, but it doesn't work there either, so it's not a setup problem with my account.

Last edited by quellen (2025-11-04 12:16:34)


sorry for my bad english

Offline

#2 2025-11-04 08:13:47

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,855

Re: [SOLVED] F5 Auto-Press Script Not Working (X)

What do you mean by "doesn't work"?

cat # type F5 - similar to the output in your post?

What and where do you expect F5 to do (you're not spamming aur.archlinux.org, are you? tongue)

Offline

#3 2025-11-04 08:16:36

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 347

Re: [SOLVED] F5 Auto-Press Script Not Working (X)

seth wrote:

What do you mean by "doesn't work"?

cat # type F5 - similar to the output in your post?

What and where do you expect F5 to do (you're not spamming aur.archlinux.org, are you? tongue)

It doesn't work in the sense that it doesn't press F5.
I can't tell you why I need to press F5 every 4 seconds, it's a secret :þ


sorry for my bad english

Offline

#4 2025-11-04 08:46:31

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,855

Re: [SOLVED] F5 Auto-Press Script Not Working (X)

According to your OP F5 was pressed at least once by the script - test it w/ "xev -event keyboard" (you'll need to focus the xev window) - so I'm afraid you'll have to reveal at least parts of your secret (which is waiting for ticketmaster of black friday offers?) - notably what client you expect to respond to the F5 press.

Offline

#5 2025-11-04 09:01:55

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 347

Re: [SOLVED] F5 Auto-Press Script Not Working (X)

I solved it by using Ctrl+Shift+R instead of F5. I wonder why F5 isn't working anymore...

#!/bin/bash
while true;
do 
xdotool key "Control_L+Shift_L+r"
sleep 4
done

sorry for my bad english

Offline

#6 2025-11-04 12:15:38

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,855

Re: [SOLVED] F5 Auto-Press Script Not Working (X)

Your OP clearly shows F5 being send to the TE and the resulting escape sequence not handled by the shell.
The problem isn't the script or xdotool but whatever you expect F5 to do in the specific client (your secret)

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

#7 2025-11-07 11:20:42

gkatev
Member
Registered: 2021-02-26
Posts: 3

Re: [SOLVED] F5 Auto-Press Script Not Working (X)

Are you using KDE? I also have an xdotool script that does F5 that recently stopped working.

I also noticed that if I do xdotool key F3, it opens the window menu, i.e. the one that appears when you right on the title bar (has options like Move to Desktop, Maximize). But this doesn't happen if I just press F3. There is a shortcut under Window Management called Window Menu, mapped to Alt+F3; if I disable it, the menu no longer appears with xdotool key F3. Something definitely seems afoot here, but I was also able to solve my issue with Ctrl+Shift+R, so I didn't dig in deeper.

Offline

#8 2025-11-07 11:58:23

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 347

Re: [SOLVED] F5 Auto-Press Script Not Working (X)

gkatev wrote:

Are you using KDE? I also have an xdotool script that does F5 that recently stopped working.

no. i use only openbox.


sorry for my bad english

Offline

#9 2025-11-07 12:52:10

gkatev
Member
Registered: 2021-02-26
Posts: 3

Re: [SOLVED] F5 Auto-Press Script Not Working (X)

Appears to be due to xkeyboard-config: https://github.com/jordansissel/xdotool/issues/491

Offline

#10 2025-12-02 09:29:23

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 347

Re: [SOLVED] F5 Auto-Press Script Not Working (X)

gkatev wrote:

Appears to be due to xkeyboard-config: https://github.com/jordansissel/xdotool/issues/491

Then I solved it with this script:

#!/bin/bash
while true; do
    xdotool key XF86Reload
    sleep 4
done

sorry for my bad english

Offline

Board footer

Powered by FluxBB