Следующий скрипт проверяет, работает ли Xfce4 Terminal. Если это не так, сценарий завершается. Этот сценарий использует аргументы script-name --in для увеличения и script-name --out для уменьшения. Он будет работать для любого типа шрифта. (Различные типы шрифтов имеют различное количество слов.)
Я назвал свой сценарий терминального масштабирования, и я использую Ctrl Alt + для terminal-zoom --in и Ctrl Alt - для terminal-zoom --out. [!d1 ]
#!/bin/bash
# Check if Xfce4 Terminal is running. If it is not, exit.
status=$(pgrep xfce4-terminal)
if [ -z "$status" ]; then
notify-send "No Xfce4 Terminal session is open."
exit 1
fi
# 1. Get the full line. 2. Get the entire line minus font size. 3. Get only font size.
line=$(grep "FontName" ~/.config/xfce4/terminal/terminalrc)
font_name=$(echo "$line" | sed s/'\w*$'//)
font_size=$(echo "$line" | grep -oE '[^ ]+$')
# Increase or decrease font size. You might want to change this to increase and decrease by two.
if [ "$1" = "--in" ]; then
new_size=$((font_size + 1))
elif [ "$1" = "--out" ]; then
new_size=$((font_size - 1))
else
notify-send "Argument options: --in --out"
exit 1
fi
# Replace the line with the new font size.
action='s/'$font_name$font_size'/'$font_name$new_size'/'
sed -i "$action" ~/.config/xfce4/terminal/terminalrc
# Show the new current font being used.
notify-send -t 200 "$new_size pt font"
Запуск
sudo apt-get update
sudo apt-get dist-upgrade
должен обновить сохраненный пакет.