From 1e9384539889f2954da5fb5145fdd6c9a8f48da6 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Sun, 14 Oct 2018 22:38:28 +0200 Subject: [PATCH] Python Startup: Font Size trick on rxvt --- .bashrc | 2 ++ .config/pythonstartup.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .config/pythonstartup.py diff --git a/.bashrc b/.bashrc index 3f2bb7a..ec21379 100644 --- a/.bashrc +++ b/.bashrc @@ -68,6 +68,8 @@ alias ls='ls --color=auto' alias fingerprint='find /etc/ssh -name "*.pub" -exec ssh-keygen -l -f {} \;' alias rekey='ssh-add -e /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so; ssh-add -s /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so' +export PYTHONSTARTUP=$HOME/.config/pythonstartup.py + for extra in /etc/bash_completion ~/.bash_aliases ~/.my_bashrc ~/.git-prompt.sh do if [ -f "$extra" ] diff --git a/.config/pythonstartup.py b/.config/pythonstartup.py new file mode 100644 index 0000000..562beca --- /dev/null +++ b/.config/pythonstartup.py @@ -0,0 +1,16 @@ +class FontSize: + def __init__(self): + self.font_size = 20 + + def __iadd__(self, x): + self.font_size += x + print(f"\33]50;xft:LiberationMono:size={self.font_size}\007") + return self + + def __isub__(self, x): + self.font_size -= x + print(f"\33]50;xft:LiberationMono:size={self.font_size}\007") + return self + + +font_size = FontSize()