Skip to content

Instantly share code, notes, and snippets.

@popstas
Created May 1, 2018 03:29
Show Gist options
  • Save popstas/deecce960a44368cff7da33f6c8583a8 to your computer and use it in GitHub Desktop.
Save popstas/deecce960a44368cff7da33f6c8583a8 to your computer and use it in GitHub Desktop.
Quick open gnome-terminal profile with fzf - http://blog.popstas.ru/blog/2018/05/01/gnome-terminal-solarized/
list_terms (){
uuids=$(gsettings get org.gnome.Terminal.ProfilesList list | tr -d \' | tr -d \[ | tr -d \] | tr -d ,)
for uuid in $(echo $uuids); do
gsettings get org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${uuid}/ visible-name | tr -d \'
done
}
select_term (){
selected="$(list_terms | sort -n | fzf)"
if [ -n "$selected" ]; then
gnome-terminal --window-with-profile="$selected"
fi
}
zle -N select_term
bindkey ^n select_term
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment