barpyrus: add compatibility for HiDPI
This commit is contained in:
parent
e7a83e8bab
commit
e597cdb77d
1 changed files with 10 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ from barpyrus.core import Theme
|
|||
from barpyrus import lemonbar
|
||||
from barpyrus import conky
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Copy this config to ~/.config/barpyrus/config.py
|
||||
|
||||
|
|
@ -14,6 +15,9 @@ hc = hlwm.connect()
|
|||
# get the geometry of the monitor
|
||||
monitor = sys.argv[1] if len(sys.argv) >= 2 else 0
|
||||
(x, y, monitor_w, monitor_h) = hc.monitor_rect(monitor)
|
||||
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
|
||||
hc(['pad', str(monitor), str(height)]) # get space for the panel
|
||||
|
|
@ -22,6 +26,10 @@ hc(['pad', str(monitor), str(height)]) # get space for the panel
|
|||
grey_frame = Theme(bg = '#303030', fg = '#EFEFEF', padding = (3,3))
|
||||
|
||||
# Widget configuration:
|
||||
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([
|
||||
W.RawLabel('%{l}'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue