Created
October 3, 2014 14:51
-
-
Save samuell/107a498821c88426fa5a to your computer and use it in GitHub Desktop.
Place this in your ```~/.bash_aliases``` file.
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
zi() { | |
if [[ ! -z $1 ]]; then | |
steps=$1; | |
SIZE=`grep 'FontName' ~/.config/Terminal/terminalrc | cut -d' ' -f 2` | |
NEWSIZE=$((SIZE + steps)) | |
REGEXPR='s/FontName.*/FontName=Monospace '$NEWSIZE'/g' | |
sed -i "$REGEXPR" ~/.config/Terminal/terminalrc | |
else | |
echo "Usage: zi [zoom steps]"; | |
fi; | |
} | |
zo() { | |
if [[ ! -z $1 ]]; then | |
steps=$1; | |
SIZE=`grep 'FontName' ~/.config/Terminal/terminalrc | cut -d' ' -f 2` | |
NEWSIZE=$((SIZE - steps)) | |
REGEXPR='s/FontName.*/FontName=Monospace '$NEWSIZE'/g' | |
sed -i "$REGEXPR" ~/.config/Terminal/terminalrc | |
else | |
echo "Usage: zi [zoom steps]"; | |
fi; | |
} | |
z() { | |
if [[ ! -z $1 ]]; then | |
SIZE=$1; | |
REGEXPR='s/FontName.*/FontName=Monospace '$SIZE'/g' | |
sed -i "$REGEXPR" ~/.config/Terminal/terminalrc | |
else | |
echo "Usage: z [font size]" | |
fi; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A slight tweak to the underlying code that allows for the font name to be something other than
Monospace
... (with a fixed step of -2 in this case, but that's obviously easy to adapt)