-
-
Save mslinn/6311db4020f1ade77310 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
CONFIG=~/.config/xfce4/terminal/terminalrc | |
# Prevent terminal window losing focus | |
# sudo apt-get install xdotool wmctrl | |
get_winid() { | |
xwininfo -name "$(xdotool getwindowfocus getwindowname)" | \ | |
grep 'Window id:' | \ | |
cut -d" " -f4 | |
} | |
restoreFocus() { | |
wmctrl -i -a "$1" | |
} | |
zi() { | |
#set -xv | |
#wind_id=`get_winid` | |
SIZE=`grep 'FontName' $CONFIG | awk '{print $NF}'` | |
if [[ "$1" ]]; then | |
steps=$1 | |
NEWSIZE=$((SIZE + steps)) | |
else | |
NEWSIZE=$((SIZE + 2)) | |
fi | |
#echo "old size $SIZE, new size $NEWSIZE" | |
REGEXPR="s/FontName\(.*\)${SIZE}$/FontName\1"$NEWSIZE"/g" | |
#echo "$REGEXPR" | |
sed -i "$REGEXPR" $CONFIG | |
#restoreFocus "$wind_id" | |
#set +xv | |
} | |
zo() { | |
#set -xv | |
#wind_id=`get_winid` | |
SIZE=`grep 'FontName' $CONFIG | awk '{print $NF}'` | |
if [[ "$1" ]]; then | |
steps=$1 | |
NEWSIZE=$((SIZE - steps)) | |
else | |
NEWSIZE=$((SIZE - 2)) | |
fi | |
#echo "old size $SIZE, new size $NEWSIZE" | |
REGEXPR="s/FontName\(.*\)${SIZE}$/FontName\1"$NEWSIZE"/g" | |
sed -i "$REGEXPR" $CONFIG | |
#restoreFocus "$wind_id" | |
#set +xv | |
} | |
z() { | |
#set -xv | |
#wind_id=`get_winid` | |
SIZE=`grep 'FontName' $CONFIG | awk '{print $NF}'` | |
if [[ "$1" ]]; then | |
NEWSIZE=$1 | |
else | |
NEWSIZE=9 | |
fi | |
#echo "old size $SIZE, new size $NEWSIZE" | |
REGEXPR="s/FontName\(.*\)${SIZE}$/FontName\1"$NEWSIZE"/g" | |
sed -i "$REGEXPR" $CONFIG | |
#restoreFocus "$wind_id" | |
#set +xv | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment