Merge branch 'master' of ssh://git.jonathanh.co.uk:2222/jab2870/dotfiles

Jonathan Hodgson 3 years ago
commit bd638bd20c
  1. 2
      shells/zsh/includes/auto-notify.zsh
  2. 33
      shells/zsh/includes/focus.zsh
  3. 2
      shells/zsh/includes/overidepartialcompletion.zsh

@ -2,4 +2,4 @@ source "$ZSH_FOLDER/plugins/zsh-auto-notify/auto-notify.plugin.zsh"
export AUTO_NOTIFY_THRESHOLD=5
export AUTO_NOTIFY_TITLE="Hey! %command has just finished"
export AUTO_NOTIFY_BODY="It completed in %elapsed seconds with exit code %exit_code"
AUTO_NOTIFY_IGNORE+=("bat" "zathura" "libreoffice" "lf" "davmail" "neomutt" "newsboat" "w3m" "sl")
AUTO_NOTIFY_IGNORE+=("bat" "cat" "zathura" "libreoffice" "lf" "davmail" "neomutt" "newsboat" "w3m" "sl")

@ -1,33 +0,0 @@
#Gain focus
gain_focus(){
export HASFOCUS="true"
set_prompts
zle reset-prompt
}
zle -N gain_focus
bindkey '\033[I' gain_focus # Gain Focus
loose_focus(){
export HASFOCUS="false"
set_prompts
zle reset-prompt
}
zle -N loose_focus
bindkey '\033[O' loose_focus # Loose Focus
# Stop terminal from sending focus events before a process runs
# This eliviates the issue of getting weird characters when a read (or similar) prompt is visible
dont_listen_for_focus(){
printf '\033[?1004l'
}
add-zsh-hook preexec dont_listen_for_focus
# Make the terminal send focus events again when the prompt is being drawn
# This almost works, although, if a long running process finishes in the background, that terminal will still look like it has focus
listen_for_focus(){
# This makes sc (and maybe other terminals?) send escape codes to the shell when focus is gained / lost
printf '\033[?1004h'
}
add-zsh-hook precmd listen_for_focus
HASFOCUS="true"

@ -44,7 +44,7 @@ overidecomplete(){
# If I want to install something, give a list of things to install
-S) toadd="$($cmd -Slq | fzf -m --preview "$cmd -Si {1}" | tr '\n' ' ')"; ret=0 ;;
# If I want to uninstall something, give a list of things to uninstall
-R*) toadd="$($cmd -Qq | fzf -m --preview "$cmd -Qi {1}" | tr '\n' ' ')"; ret=0 ;;
-R*) toadd="$($cmd -Qeq | fzf -m --preview "$cmd -Qi {1}" | tr '\n' ' ')"; ret=0 ;;
-Ql) toadd="$($cmd -Qq | fzf -m --preview "$cmd -Qi {1}" | tr '\n' ' ')"; ret=0 ;;
esac ;;
msfvenom)

Loading…
Cancel
Save