commit 52a759423468f8ce6d5c0ed06d850a4303bfd564
parent 8f351d8d005f023b5b9b8d60bce73be1d704e2a2
Author: Jacob R. Edwards <n/a>
Date: Fri, 18 Nov 2022 14:22:14 -0600
Embed xinput menu in active window
The previous issue with this feature was fixed by using xdotool(1)'s
getactivewindow instead of wmutils' pfw(1). (Firefox must do some
strange window magic, so the window xdotool's returns works while
pfw's does not.)
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/local/bin/bin/xinput b/local/bin/bin/xinput
@@ -3,6 +3,14 @@
# Get keyboard input through X, using dmenu, with history.
# usage: xinput name
+xgetroot() {
+ xwininfo -root | sed -En '/^xwininfo/ {
+ s/[^0]*(0x[0-9a-f]+).*/\1/p
+ q
+ }'
+}
+dmenu() command dmenu -w $(xdotool getactivewindow 2>/dev/null || xgetroot) "$@"
+
data="${XDG_DATA_HOME:-"$HOME"/.share}"/xinput
if test $# -le 0; then
dmenu < /dev/null