Ubuntu – What keyboard shortcut changes the `xfce4-terminal` terminal text size

command lineshortcut-keysxubuntu

It used to be that Ctrl + - and Ctrl + + would increase or decrease the text size of the terminal in earlier versions of Ubuntu, which is helpful when you're giving presentations and want to show your code in a larger size. I switched to Xubuntu 12.04, and I'm missing these keyboard shortcuts.

Is there an alternative I can use? Or if not, is there a way I can define my own shortcut to replace these?

Update: Happy to report that this question is now moot for recent versions of xfce4-terminal! See here.

Best Answer

Instead of relying on Python and missing modules, as in Noah K. Tilton's github solution, I drafted up a bash script that's a step closer to being more portable (at least, for installations using the most generic, default paths).

You may need to tweak the script to setup your xfce configuration path, your favourite font, etc.

Just 2 files, dropped into my home's ~/bin folder, "zoomin" and "zoomout". I didn't go further than making short commands that I can type quickly, so I don't have a clue how I'd be able to configure these scripts to respond ONLY when I'm inside of xfce4-terminal -- meaning that I gave up thinking about how to get the keybindings made for Ctrl+- and Ctrl++ because I currently only know about global keyboard bindings and didn't want to override those Keypress Combos since other applications will need them (ex: web browser, text editor).

I also thought about having "zoommin" and "zoommax", to jump to my smallest and biggest fonts when needed, typically when I need to see tons of text VS when I need to show a colleague something on my screen. I'll leave those two scripts up to your imagination on how to create :P

~/bin/zoomin

#!/bin/bash
SIZE=`grep 'FontName' ~/.config/xfce4/terminal/terminalrc | cut -d' ' -f 2`
NEWSIZE=$((SIZE + 2))
REGEXPR='s/FontName.*/FontName=Monospace '$NEWSIZE'/g'
sed -i "$REGEXPR" ~/.config/xfce4/terminal/terminalrc

~/bin/zoomout

#!/bin/bash
SIZE=`grep 'FontName' ~/.config/xfce4/terminal/terminalrc | cut -d' ' -f 2`
NEWSIZE=$((SIZE - 2))
REGEXPR='s/FontName.*/FontName=Monospace '$NEWSIZE'/g'
sed -i "$REGEXPR" ~/.config/xfce4/terminal/terminalrc