Reuse fonts in Xresources when changing size.
This commit is contained in:
parent
d99a97285c
commit
aabe0dcccb
|
@ -1,15 +1,22 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
with open(os.path.expanduser("~/.Xresources")) as xresources_file:
|
||||||
|
for line in xresources_file:
|
||||||
|
if line.startswith("URxvt.font"):
|
||||||
|
font = line.split(":", 1)[1].strip()
|
||||||
|
|
||||||
class FontSize:
|
class FontSize:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.font_size = 20
|
self.font_size = 20
|
||||||
|
|
||||||
def __iadd__(self, x):
|
def __iadd__(self, x):
|
||||||
self.font_size += x
|
self.font_size += x
|
||||||
print(f"\33]50;xft:LiberationMono:size={self.font_size}\007")
|
print(f"\33]710;xft:LiberationMono:size={self.font_size},{font}\007")
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def __isub__(self, x):
|
def __isub__(self, x):
|
||||||
self.font_size -= x
|
self.font_size -= x
|
||||||
print(f"\33]50;xft:LiberationMono:size={self.font_size}\007")
|
print(f"\33]710;xft:LiberationMono:size={self.font_size},{font}\007")
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue