From 66e8f203c480e798b737b98cbda22397714d7189 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Tue, 10 Jan 2023 00:47:27 +0100 Subject: [PATCH] bin: more typing options --- .local/bin/scripts/emacstty | 2 +- .local/bin/scripts/vnctype | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.local/bin/scripts/emacstty b/.local/bin/scripts/emacstty index 1887a0a..0f3c4f3 100755 --- a/.local/bin/scripts/emacstty +++ b/.local/bin/scripts/emacstty @@ -1,6 +1,6 @@ #!/bin/sh # Emacs in the terminal -pgrep --full "emacs .*-daemon" >/dev/null || emacs --daemon +pgrep --full "emacs" >/dev/null || emacs --daemon emacsclient --create-frame --tty "$@" exit=$? stty sane diff --git a/.local/bin/scripts/vnctype b/.local/bin/scripts/vnctype index d4f210b..1c254bd 100755 --- a/.local/bin/scripts/vnctype +++ b/.local/bin/scripts/vnctype @@ -1,7 +1,12 @@ #!/bin/sh -e -# Type in NoVNC with german layout +# Type in NoVNC - from clipboard or interactively with german layout xdotool search --onlyvisible --classname Navigator windowactivate # Activate Firefox +if test $# -gt 0 +then setxkbmap de sleep 0.1 -xdotool type --delay 80ms --clearmodifiers "$@" +xdotool type --delay 80ms --clearmodifiers "${@:-$(xclip -sel clip -o)}" update-keyboard-layout >/dev/null +else +xdotool type --delay 80ms --clearmodifiers "${xclip -sel clip -o}" +fi