コード例 #1
0
ファイル: barpyrus.py プロジェクト: haxn8/dotfiles-1
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
コード例 #2
0
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')),
])
コード例 #3
0
    'foreground': '#CDCDCD',
    'background': '#CC101010',
}

lemonbar_options['font'] = 'Ubuntu Mono:size=10'

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:
コード例 #4
0
xkblayouts = [
    'us us -variant altgr-intl us'.split(' '),
    'de de de'.split(' '),
]
setxkbmap = 'setxkbmap -option compose:menu -option ctrl:nocaps'
setxkbmap += ' -option compose:ralt -option compose:rctrl'

# you can define custom themes
grey_frame = Theme(bg=BG, fg=FG, padding=(3, 3))

# Widget configuration:
font = '-*-fixed-medium-*-*-*-15-*-*-*-*-*-iso10646-1'
symbol_font = '-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1'
bar = lemonbar.Lemonbar(
    geometry=(x, y, width, height),
    font=font,
    symbol_font=symbol_font,
)
update_interval = '1'
bar.widget = W.ListLayout([
    W.RawLabel('%{l}'),
    # hlwm.HLWMTags(hc, monitor, tag_renderer=hlwm.underlined_tags),
    hlwm.HLWMTags(hc, monitor),
    W.RawLabel('%{c}'),
    grey_frame(hlwm.HLWMWindowTitle(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:
    #        conky.ConkyWidget('df /: ${fs_used_perc /}%'),
    #        # conky.ConkyWidget(' '),