def main(): hc = hlwm.connect() monitor = int(sys.argv[1]) if len(sys.argv) >= 2 else 0 x, y, monitor_w, _monitor_h = hc.monitor_rect(monitor) geom = Geometry(x, y, width=monitor_w, height=16) hc(['pad', str(monitor), str(geom.height)]) cg = conky.ConkyGenerator(lemonbar.textpainter()) cg_cpu(cg) cg_space(cg) cg_fan(cg) cg_temp(cg) cg_net(cg) cg_battery(cg) cg_time(cg) conky_config = { 'update_interval': '1', 'update_interval_on_battery': '10', } trayer_config = { 'tint': Gruv.BG.replace('#', '0x'), 'iconspacing': '5', 'padding': '5' } bar = lemonbar.Lemonbar(geometry=geom, foreground=Gruv.FG, background=Gruv.BG) title_theme = core.Theme(fg=Gruv.FG4, padding=(40, 0)) left_widgets = [ hlwm.HLWMTags(hc, monitor, tag_renderer=tag_renderer), title_theme(hlwm.HLWMWindowTitle(hc)), ] right_widgets = [ conky.ConkyWidget(text=str(cg), config=conky_config), ] if monitor == 0: right_widgets.append(trayer.TrayerWidget(args=trayer_config)) bar.widget = widgets.ListLayout([ widgets.RawLabel('%{l}'), *left_widgets, widgets.RawLabel('%{r}'), *right_widgets, ]) return bar
from barpyrus import conky import sys # Copy this config to ~/.config/barpyrus/config.py # set up a connection to herbstluftwm in order to get events # and in order to call herbstclient commands 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) height = 16 # height of the panel width = monitor_w # width of the panel hc(['pad', str(monitor), str(height)]) # get space for the panel # you can define custom themes grey_frame = Theme(bg='#303030', fg='#EFEFEF', padding=(3, 3)) # Widget configuration: bar = lemonbar.Lemonbar(geometry=(x, y, width, height)) bar.widget = W.ListLayout([ W.RawLabel('%{l}'), hlwm.HLWMTags(hc, monitor), W.RawLabel('%{c}'), grey_frame(hlwm.HLWMWindowTitle(hc)), W.RawLabel('%{r}'), conky.ConkyWidget('df /: ${fs_used_perc /}%'), grey_frame(W.DateTime('%d. %B, %H:%M')), ])
] #setxkbmap = 'setxkbmap -option compose:menu -option rctrl:nocaps' setxkbmap = 'setxkbmap -layout us,gr -option grp:ctrl_shift_toggle' #setxkbmap += ' -option compose:ralt -option compose:rctrl' # you can define custom themes grey_frame = Theme(bg='#6272a4', fg='#32302f', padding=(3, 3)) green_frame = Theme(bg='#458588', fg='#32302f', padding=(3, 3)) orange_frame = Theme(bg='#d79921', fg='#32302f', padding=(3, 3)) pink_frame = Theme(bg='#ebdbb2', fg='#32302f', padding=(3, 3)) purple_frame = Theme(bg='#d5c4a1', fg='#32302f', padding=(3, 3)) # Widget configuration: bar = lemonbar.Lemonbar(geometry=(x, y, width, height)) bar.widget = W.ListLayout([ W.RawLabel('%{l}'), hlwm.HLWMTags(hc, monitor, tag_renderer=hlwm.underlined_tags), hlwm.HLWMMonitorFocusLayout( hc, monitor, # this widget is shown on the focused monitor: green_frame(hlwm.HLWMLayout(hc)), # this widget is shown on all unfocused monitors: green_frame(hlwm.HLWMLayout(hc))), #hlwm.HLWMMonitorFocusLayout(hc, monitor, # # this widget is shown on the focused monitor: # grey_frame(hlwm.HLWMWindowTitle(hc)), # # this widget is shown on all unfocused monitors: # grey_frame(hlwm.HLWMWindowTitle(hc)) # ), W.RawLabel('%{c}'),
lemonbar_options['font'] = 'misc nexus' lemonbar_options['symbol_font'] = 'Wuncon Siji' if is_hidpi: lemonbar_options['font'] = 'Bitstream Vera Sans:size=8' lemonbar_options['symbol_font'] = \ '-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1' tag_renderer = simple_tag_renderer else: tag_renderer = hlwm.underlined_tags tag_renderer.activecolor = 'red' bar = lemonbar.Lemonbar(**lemonbar_options) bar.widget = W.ListLayout([ W.RawLabel('%{l}'), hlwm.HLWMTags(hc, monitor, tag_renderer=tag_renderer), W.TabbedLayout( list( enumerate([ W.ListLayout([ W.RawLabel('%{c}'), hlwm.HLWMMonitorFocusLayout( hc, monitor, # this widget is shown on the focused monitor: grey_frame(hlwm.HLWMWindowTitle(hc, maxlen=70)), # this widget is shown on all unfocused monitors: conky_widget, ) ]),