barpyrus: add compatibility for HiDPI

This commit is contained in:
Thomas Preisner 2016-12-15 22:58:18 +01:00
parent e7a83e8bab
commit e597cdb77d

View file

@ -4,6 +4,7 @@ from barpyrus.core import Theme
from barpyrus import lemonbar from barpyrus import lemonbar
from barpyrus import conky from barpyrus import conky
import sys import sys
import os
# Copy this config to ~/.config/barpyrus/config.py # Copy this config to ~/.config/barpyrus/config.py
@ -14,7 +15,10 @@ hc = hlwm.connect()
# get the geometry of the monitor # get the geometry of the monitor
monitor = sys.argv[1] if len(sys.argv) >= 2 else 0 monitor = sys.argv[1] if len(sys.argv) >= 2 else 0
(x, y, monitor_w, monitor_h) = hc.monitor_rect(monitor) (x, y, monitor_w, monitor_h) = hc.monitor_rect(monitor)
height = 16 # height of the panel if os.uname().nodename == "warthog":
height = 30 # height of the panel
else:
height = 16 # height of the panel
width = monitor_w # width of the panel width = monitor_w # width of the panel
hc(['pad', str(monitor), str(height)]) # get space for the panel hc(['pad', str(monitor), str(height)]) # get space for the panel
@ -22,7 +26,11 @@ hc(['pad', str(monitor), str(height)]) # get space for the panel
grey_frame = Theme(bg = '#303030', fg = '#EFEFEF', padding = (3,3)) grey_frame = Theme(bg = '#303030', fg = '#EFEFEF', padding = (3,3))
# Widget configuration: # Widget configuration:
bar = lemonbar.Lemonbar(geometry = (x,y,width,height)) if os.uname().nodename == "warthog":
bar = lemonbar.Lemonbar(geometry = (x,y,width,height),
font = "-*-lucidatypewriter-medium-*-*-*-26-*-*-*-*-*-*-*")
else:
bar = lemonbar.Lemonbar(geometry = (x,y,width,height))
bar.widget = W.ListLayout([ bar.widget = W.ListLayout([
W.RawLabel('%{l}'), W.RawLabel('%{l}'),
hlwm.HLWMTags(hc, monitor), hlwm.HLWMTags(hc, monitor),