Skip to content

Instantly share code, notes, and snippets.

@mslinn
Forked from samuell/zoom_xfce4_terminal.sh
Last active February 12, 2016 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mslinn/6311db4020f1ade77310 to your computer and use it in GitHub Desktop.
Save mslinn/6311db4020f1ade77310 to your computer and use it in GitHub Desktop.
Place this in your ```~/.bash_aliases``` file.
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