From 628e62684548e72ec72b1fec5c8981d25e63a22a Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 21 Oct 2023 21:20:04 +0200 Subject: fzmenu: xdotool -> xvkbd xdotool breaks when changing keyboard layouts: https://code.google.com/archive/p/semicomplete/issues/13 --- pkgs/simple/fzmenu/bin/otpmenu | 5 ++++- pkgs/simple/fzmenu/bin/passmenu | 5 ++++- pkgs/simple/fzmenu/default.nix | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/simple/fzmenu/bin/otpmenu b/pkgs/simple/fzmenu/bin/otpmenu index 273a408..714ab7c 100755 --- a/pkgs/simple/fzmenu/bin/otpmenu +++ b/pkgs/simple/fzmenu/bin/otpmenu @@ -34,9 +34,12 @@ case ${FZMENU_PHASE-0} in fi ;; 2) + # Specify a font, so xvkbd doesn't use the potentially missing + # lucidatypewriter, causing a warning to be printed to stderr. + font='-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1' pass=$(pass otp code "$FZMENU_RESULT/otp") printf %s "$pass" | - xdotool type -f - + xvkbd -xrm "xvkbd*Font: $font" -xsendevent -file - ;; *) echo "$0: error: bad phase: $FZMENU_PHASE" >&2 diff --git a/pkgs/simple/fzmenu/bin/passmenu b/pkgs/simple/fzmenu/bin/passmenu index 76153f5..a798925 100755 --- a/pkgs/simple/fzmenu/bin/passmenu +++ b/pkgs/simple/fzmenu/bin/passmenu @@ -35,9 +35,12 @@ case ${FZMENU_PHASE-0} in fi ;; 2) + # Specify a font, so xvkbd doesn't use the potentially missing + # lucidatypewriter, causing a warning to be printed to stderr. + font='-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1' pass=$(pass show "$FZMENU_RESULT") printf %s "$pass" | - xdotool type -f - + xvkbd -xrm "xvkbd*Font: $font" -xsendevent -file - ;; *) echo "$0: error: bad phase: $FZMENU_PHASE" >&2 diff --git a/pkgs/simple/fzmenu/default.nix b/pkgs/simple/fzmenu/default.nix index 1a285ee..c4dccbf 100644 --- a/pkgs/simple/fzmenu/default.nix +++ b/pkgs/simple/fzmenu/default.nix @@ -28,7 +28,7 @@ pkgs.runCommand "fzmenu" { ext.pass-otp ])) pkgs.utillinux - pkgs.xdotool + pkgs.xvkbd terminal ]} @@ -44,7 +44,7 @@ pkgs.runCommand "fzmenu" { ext.pass-otp ])) pkgs.utillinux - pkgs.xdotool + pkgs.xvkbd terminal ]} '' -- cgit v1.2.3