Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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