summaryrefslogtreecommitdiff
path: root/bin/simulate-refresh
diff options
context:
space:
mode:
authorLibravatar Mubashshir <ahmubashshir@gmail.com>2023-01-03 23:42:47 +0600
committerLibravatar Mubashshir <ahmubashshir@gmail.com>2023-01-03 23:42:47 +0600
commitf58c88726ec16c97f1eaa6645780f4832905100e (patch)
tree706be603399fea2969cc436769ee237b4a66122a /bin/simulate-refresh
parent312834342d06470ef24e51402a09997394336425 (diff)
downloadpatches-f58c88726ec16c97f1eaa6645780f4832905100e.tar.gz
patches-f58c88726ec16c97f1eaa6645780f4832905100e.zip
xfce: Implement refresh context menu
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Diffstat (limited to 'bin/simulate-refresh')
-rwxr-xr-xbin/simulate-refresh17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/simulate-refresh b/bin/simulate-refresh
new file mode 100755
index 0000000..064fade
--- /dev/null
+++ b/bin/simulate-refresh
@@ -0,0 +1,17 @@
+#!/bin/sh
+AW=$( (
+ xdotool getactivewindow
+ printf :
+ xdotool getactivewindow getwindowpid
+) | tr -d '[:space:]')
+PROC=$(realpath "/proc/${AW#*:}/exe" | xargs basename)
+
+unset REFOCUS
+if ! echo "$PROC" | grep -qlE '(thunar|xfdesktop)'; then
+ REFOCUS=true
+ xdotool search --onlyvisible --classname Xfdesktop windowfocus
+fi
+
+xdotool key F5
+
+"${REFOCUS:-false}" && xdotool windowfocus "${AW%:*}"