summaryrefslogtreecommitdiff
path: root/bin/simulate-refresh
blob: 7657457d77d4733d5752a6b883dc1845e0e62efe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
AW=$(
	xdotool getactivewindow
	printf :
	xdotool getactivewindow getwindowpid
)
AW=$(echo "$AW" | tr -d '[:space:]')

PROC=$(realpath "/proc/${AW#*:}/exe" | xargs basename)

unset NOREFOCUS

if ! echo "$PROC" | grep -qlE '(thunar|xfdesktop)'; then
	NOREFOCUS=false
	xdotool search --onlyvisible --classname Xfdesktop windowfocus
fi

xdotool key F5

"${NOREFOCUS:-true}" || xdotool windowfocus "${AW%:*}"