Created
May 1, 2018 03:29
-
-
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/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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