Reputation: 51
Hi I am trying to refresh my Desktop, simulate "F5"/"ctrl+R" key pressing using xdotool.
I have tried to xdotool key F5
but I got
^[[15~jake@jake-PC ~ $ ~
and after pressing Enter:
bash: /home/jake: Is a directory
Then I have tried
xdotool search --classname Desktop
73400321
Got that id, then tried:
xdotool search --classname Desktop key F5
xdotool search --classname Desktop key ctrl+R
it didn't refresh my page.
Question: what can I do to refresh my desktop? By the way I am using Ubuntu 16.04. Thank you
Upvotes: 0
Views: 1130
Reputation: 456
You need to call with sync:
xdotool search --onlyvisible --classname Desktop windowactivate --sync key F5
also you can try xdotool script like this:
#!/usr/bin/env xdotool
keydown Ctrl
keydown super
sleep 0.1
key D
keyup Ctrl
keyup super
key F5
Another alternative you can use exec function on xdotool to call show desktop script (or create it)
Upvotes: 0