Make sleep time configurable

This commit is contained in:
BarbUk 2021-11-12 11:52:30 +01:00
parent c4a53091af
commit 3eb60c9626
No known key found for this signature in database
GPG Key ID: DB301C759539E9FE

5
snippy
View File

@ -53,6 +53,7 @@ set -o errexit -o pipefail -o nounset
readonly snippets_directory=${XDG_CONFIG_HOME:-$HOME/.config}/snippy readonly snippets_directory=${XDG_CONFIG_HOME:-$HOME/.config}/snippy
readonly rofi_args=(-no-lazy-grab -dmenu -i -sort -sorting-method fzf -async-pre-read 20 -theme-str 'element-icon { size: 2.35ch;}' -kb-accept-custom "" -kb-custom-1 "Ctrl+Return") readonly rofi_args=(-no-lazy-grab -dmenu -i -sort -sorting-method fzf -async-pre-read 20 -theme-str 'element-icon { size: 2.35ch;}' -kb-accept-custom "" -kb-custom-1 "Ctrl+Return")
readonly fzf_args=(--select-1 --reverse --inline-info --multi --preview '( bat --style auto --color always --language bash {} 2> /dev/null || highlight --force -O ansi -l {} 2> /dev/null ) | head -200' -1) readonly fzf_args=(--select-1 --reverse --inline-info --multi --preview '( bat --style auto --color always --language bash {} 2> /dev/null || highlight --force -O ansi -l {} 2> /dev/null ) | head -200' -1)
readonly focus_wait=0.15
# Placeholders # Placeholders
readonly placeholder_cursor="{cursor}" readonly placeholder_cursor="{cursor}"
@ -386,9 +387,9 @@ run() {
# Paste into the current application. # Paste into the current application.
if is_gui; then if is_gui; then
# We need a little pause to handle the time to focus on the window # We need a little pause to handle the time to focus on the window
sleep 0.15 sleep "$focus_wait"
# Paste # Paste
xdotool key ctrl+v sleep 0.15 xdotool key ctrl+v sleep "$focus_wait"
move_cursor "Up" $cursor_line_position move_cursor "Up" $cursor_line_position
else else
xdotool key ctrl+shift+v xdotool key ctrl+shift+v