Exemple #1
0
def mpd2_manager(manager_nospawn, monkeypatch, minimal_conf_noscreen):
    # monkeypatch.setattr("libqtile.widget.mpd2widget.MPDClient", MockMPDClient)
    monkeypatch.setitem(sys.modules, "mpd", MockMPD("mpd"))

    config = minimal_conf_noscreen
    config.screens = [
        libqtile.config.Screen(
            top=libqtile.bar.Bar(
                [widget.Mpd2()],
                50,
            ),
        )
    ]

    manager_nospawn.start(config)
    yield manager_nospawn
Exemple #2
0
# Widgets on main bar #
#######################
w_main = [
    widget.CurrentLayout(),
    widget.GroupBox(hide_unused=True),
    widget.Prompt(),
    widget.Spacer(),
    widget.WindowName(max_chars=45),
    widget.Chord(
        chords_colors={
            'launch': ("#ff0000", "#ffffff"),
        },
        name_transform=lambda name: name.upper(),
    ),
    widget.Sep(),
    widget.Mpd2(status_format="{play_status} {file}"),
    #widget.Volume(emoji=True),
    widget.Sep(),
    widget.Battery(format="🔋 {char} {percent:2.0%}", discharge_char=""),
    widget.Sep(),
    widget.Clock(format='⏲ %H:%M | 📅 %d %h'),
    widget.Sep(),
    widget.Systray(),
]

screens = [
    Screen(
        wallpaper=WALLPAPER(screen=0),
        top=bar.Bar(
            w_main,
            24,
Exemple #3
0
             '⏰',
             font='JoyPixels',
             foreground='#C795AE',
         ),
         widget.Clock(foreground='#95AEC7', format='%H:%M'),
         widget.QuickExit(foreground='#C795AE', ),
     ],
     24,
 ),
 bottom=bar.Bar(
     [
         widget.TextBox(
             '🎵',
             foreground='#C7CCD1',
         ),
         widget.Mpd2(foreground='#95AEC7', ),
         widget.TextBox(
             '🔊',
             foreground='#C7CCD1',
             font='JoyPixels',
         ),
         widget.Volume(foreground='#C795AE', ),
         widget.TextBox(
             '🔆',
             font='JoyPixels',
             foreground='#C795AE',
         ),
         widget.Backlight(backlight_name='intel_backlight', ),
         widget.Spacer(width=bar.STRETCH),
         widget.Net(
             interface='wlp4s0',
Exemple #4
0
def init_widget_list():
    widgets_list = [
        widget.Sep(linewidth=0,
                   padding=6,
                   foreground=colors[2],
                   background=colors[0]),
        widget.GroupBox(font="PowerlineSymbols",
                        fontsize=9,
                        margin_y=3,
                        margin_x=0,
                        padding_y=5,
                        padding_x=3,
                        borderwidth=3,
                        active=colors[2],
                        inactive=colors[2],
                        rounded=False,
                        highlight_color=colors[1],
                        highlight_method="line",
                        this_current_screen_border=colors[3],
                        this_screen_border=colors[4],
                        other_current_screen_border=colors[0],
                        other_screen_border=colors[0],
                        foreground=colors[2],
                        background=colors[0]),
        widget.Spacer(length=STRETCH),
        widget.Mpd2(),
        widget.Spacer(length=STRETCH),
        widget.Net(format='↓{down} ↑{up}',
                   foreground=colors[2],
                   background=colors[4],
                   padding=5),
        widget.TextBox(text='',
                       background=colors[4],
                       foreground=colors[5],
                       padding=0,
                       fontsize=37),
        widget.TextBox(text='',
                       background=colors[5],
                       foreground=colors[4],
                       padding=0,
                       fontsize=37),
        widget.CurrentLayoutIcon(
            custom_icon_paths=[os.path.expanduser("~/.config/qtile/icons")],
            foreground=colors[0],
            background=colors[4],
            padding=0,
            scale=0.7),
        widget.CurrentLayout(foreground=colors[2],
                             background=colors[4],
                             padding=5),
        widget.TextBox(text='',
                       background=colors[4],
                       foreground=colors[5],
                       padding=0,
                       fontsize=37),
        widget.Clock(foreground=colors[2],
                     background=colors[5],
                     format="%A, %B %d  [ %H:%M ]"),
        widget.Sep(linewidth=0,
                   padding=10,
                   foreground=colors[0],
                   background=colors[5]),
        widget.Systray(background=colors[0], padding=5),
    ]
    return widgets_list
Exemple #5
0
     linewidth=0,
     padding=10,
     size_percent=50,
     background=colors[1],
 ),
 widget.TextBox(
     background=colors[1],
     foreground=colors[3],
     text=" ",
     font="Font Awesome 5 Free Solid",
     fontsize=icon_size,
 ),
 widget.Mpd2(background=colors[1],
             foreground=colors[0],
             mouse_callbacks={
                 "Button1":
                 lambda: qtile.cmd_spawn("mpc toggle"),
                 "Button2": lambda: qtile.cmd_spawn("mpc next"),
                 "Button3": lambda: qtile.cmd_spawn("mpc prev"),
             }),
 widget.Sep(
     linewidth=0,
     padding=10,
     size_percent=50,
     background=colors[1],
 ),
 widget.Sep(
     linewidth=0,
     padding=10,
     size_percent=50,
     background=colors[1],
 ),
Exemple #6
0
# pylint: disable=unnecessary-lambda
spacer = lambda length: widget.Spacer(length)

main_screen_widgets = [
    group_box,
    spacer(4),
    window_count,
    window_tabs,
    spacer(bar.STRETCH),
    widget.Mpd2(
        foreground=colors.get("color3"),
        status_format='<span size="large">{play_status}</span> {title}',
        idle_message="",
        idle_format="",
        no_connection="",
        fontsize=FONT_SIZE_MED,
        play_states={
            "pause": "",
            "play": "",
            "stop": ""
        },
        padding=PADDING,
    ),
    widget.GenPollText(
        func=check_rss,
        update_interval=8,
        fontsize=FONT_SIZE_MED,
        fontshadow=SHADOW,
        foreground=colors.get("color3"),
        padding=PADDING,
    ),
    widget.GenPollText(
Exemple #7
0
                 other_screen_border=colors[0],
                 foreground=colors[2],
                 background=colors[0],
                 hide_unused=True,
                 disable_drag=True),
 widget.Sep(linewidth=0,
            padding=5,
            foreground=colors[2],
            background=colors[0]),
 widget.WindowName(foreground=colors[6],
                   background=colors[0],
                   padding=0,
                   fontsize=15),
 widget.Mpd2(update_interval=0.1,
             idle_message="",
             foreground=colors[6],
             background=colors[0],
             padding=0,
             fontsize=15),
 widget.TextBox(text='',
                background=colors[0],
                foreground=colors[5],
                padding=-8,
                fontsize=49),
 widget.GenPollText(
     update_interval=180,
     func=lambda: subprocess.check_output(
         os.path.expanduser("~/.local/bin/statusbar/forecast")
     ).decode("utf-8"),
     background=colors[5],
     foreground=colors[2],
     fontsize=13),
Exemple #8
0
                 this_current_screen_border=colors[6],
                 highlight_method="line",
                 margin_x=0,
                 **widget_defaults),
 widget.WindowName(**widget_defaults),
 widget.KeyboardLayout(
     fmt=' {}', layout_groups=['us', 'es'], **widget_defaults),
 widget.Sep(padding=sep_padding),
 widget.CheckUpdates(fmt=' {}',
                     display_format='{updates}',
                     colour_have_updates=colors[7],
                     colour_no_updates=colors[1],
                     distro='Arch',
                     **widget_defaults),
 widget.Sep(padding=sep_padding),
 widget.Mpd2(foreground=colors[5], **widget_defaults),
 widget.Sep(padding=sep_padding),
 widget.CPU(**widget_defaults),
 widget.Sep(padding=sep_padding),
 widget.Memory(
     foreground=colors[8], measure_mem='G', **widget_defaults),
 widget.Sep(padding=sep_padding),
 widget.Battery(format='{char} {percent:2.0%}',
                full_char='',
                charge_char='',
                discharge_char='',
                empty_char='',
                foreground=colors[7],
                low_foreground=colors[9],
                **widget_defaults),
 widget.Sep(padding=sep_padding),
Exemple #9
0
from libqtile import bar, widget
from settings.theme import colors

primary = bar.Bar(
    [
        widget.GroupBox(active=colors['green'],
                        this_current_screen_border=colors['yellow'],
                        urgent_color=colors['magenta'],
                        urgent_border=colors['magenta'],
                        borderwidth=1),
        widget.CurrentLayoutIcon(),
        widget.Prompt(),
        widget.TaskList(border=colors['blue'], borderwidth=1),
        widget.Mpd2(),
        widget.PulseVolume(update_interval=2),
        widget.TextBox('|'),
        widget.Systray(),
        widget.TextBox('|'),
        widget.ThermalSensor(),
        widget.TextBox('|'),
        widget.CPUGraph(graph_color=colors['green'],
                        border_color=colors['black'],
                        samples=30),
        widget.MemoryGraph(graph_color=colors['blue'],
                           border_color=colors['black'],
                           samples=30),
        widget.NetGraph(graph_color=colors['yellow'],
                        border_color=colors['black'],
                        samples=30),
        widget.Wlan(interface="wlp2s0"),
        widget.TextBox('|'),
Exemple #10
0
# the top bar. not currently in use.
top_bar = bar.Bar(
    [
        widget.Mpd2(
            status_format=
            "{play_status} {artist}: {title} ({elapsed}/{duration}) [{repeat}{random}{single}{consume}]",
            idle_format=" {idle_message} ",
            idle_message="Nothing playing",
            format_fns=dict(
                #all=lambda s: cgi.escape(s),
                artist=artist_truncate,
                title=title_truncate,
                elapsed=lambda s: str(datetime.timedelta(seconds=int(float(s)))
                                      )[2:],
                duration=lambda s: str(
                    datetime.timedelta(seconds=int(float(s))))[2:],
            ),
            padding=10,
            fontsize=13,
            play_states={
                'play': ' ',
                'pause': ' ',
                'stop': ' '
            },
            update_interval=0.5,
            markup=False,
        ),
        widget.Volume(
            fmt='墳 {}',
            fontsize=13,
        ),
Exemple #11
0
screens = [
    Screen(top=bar.Bar([
        widget.GroupBox(this_current_screen_border=COLORS[0],
                        highlight_method="block",
                        active="#FFFFFF",
                        inactive="#9c9d9e"),
        widget.TaskList(border=COLORS[0], highlight_method="block"),
        widget.Systray(),
        widget.PulseVolume(background=COLORS[1], padding=10),
        widget.CheckUpdates(colour_have_updates="ff0000",
                            colour_no_updates="0000ff",
                            background=COLORS[0],
                            padding=10),
        widget.Clock(format='%I:%M %p', background=COLORS[1], padding=10),
        widget.Mpd2(background=COLORS[0], status_format="MPD: {play_status}"),
    ],
                       20,
                       background=COLORS[2]), ),
]

# Drag floating layouts.
mouse = [
    Drag([mod],
         "Button1",
         lazy.window.set_position_floating(),
         start=lazy.window.get_position()),
    Drag([mod],
         "Button3",
         lazy.window.set_size_floating(),
         start=lazy.window.get_size()),
Exemple #12
0
 widget.GroupBox(highlight_method='line',
                 highlight_color="#565656",
                 inactive="#98c379",
                 active="#ffff00",
                 urgent_alert_method="block",
                 urgent_border="#fff"),
 widget.Prompt(),
 widget.WindowName(foreground="#61afef", background="#414141"),
 widget.Chord(
     chords_colors={
         'launch': ("#c98dcd", "#ffffff"),
     },
     name_transform=lambda name: name.upper(),
 ),
 widget.Mpd2(
     status_format=
     '{play_status} [{repeat}{random}{single}{consume}{updating_db}]',
     color_progress="#ffccf2"),
 widget.Systray(),
 widget.CPU(format=' 󰻠{load_percent}% ',
            foreground="#c98dcd",
            background="#454545"),
 widget.Memory(format=' {MemUsed: .0f}M ',
               foreground="#c98dcd",
               background="#454545"),
 #widget.TextBox(),
 widget.Wlan(interface="wlp1s0f0u8",
             format="󰖩  connected",
             foreground="#000000",
             background="#61afef"),
 widget.Volume(fmt="󰕾 {}",
               device='default',
Exemple #13
0
def init_widgets_list():
    widgets_list = [
        widget.Sep(linewidth=0,
                   padding=6,
                   foreground=colors[2],
                   background=colors[0]),
        widget.Image(filename="~/.config/qtile/icons/python.png",
                     mouse_callbacks={
                         'Button1': lambda qtile: qtile.cmd_spawn('dmenu_run')
                     }),
        widget.GroupBox(font="Ubuntu Bold",
                        fontsize=9,
                        margin_y=3,
                        margin_x=0,
                        padding_y=5,
                        padding_x=3,
                        borderwidth=3,
                        active=colors[2],
                        inactive=colors[2],
                        rounded=False,
                        highlight_color=colors[1],
                        highlight_method="line",
                        this_current_screen_border=colors[3],
                        this_screen_border=colors[4],
                        other_current_screen_border=colors[0],
                        other_screen_border=colors[0],
                        foreground=colors[2],
                        background=colors[0]),
        widget.Prompt(prompt=prompt,
                      font="Ubuntu Mono",
                      padding=10,
                      foreground=colors[3],
                      background=colors[1]),
        widget.Sep(linewidth=0,
                   padding=40,
                   foreground=colors[2],
                   background=colors[0]),
        widget.WindowName(foreground=colors[6],
                          background=colors[0],
                          padding=0),
        widget.TextBox(text='',
                       background=colors[0],
                       foreground=colors[5],
                       padding=0,
                       fontsize=37),
        widget.TextBox(text=" 🌡",
                       padding=2,
                       foreground=colors[2],
                       background=colors[5],
                       fontsize=11),
        widget.ThermalSensor(foreground=colors[2],
                             background=colors[5],
                             threshold=90,
                             padding=5),
        widget.TextBox(text='',
                       background=colors[5],
                       foreground=colors[4],
                       padding=0,
                       fontsize=37),
        widget.Mpd2(foreground=colors[2], background=colors[4]),
        widget.TextBox(text='',
                       background=colors[4],
                       foreground=colors[5],
                       padding=0,
                       fontsize=37),
        widget.BatteryIcon(foreground=colors[2],
                           background=colors[5],
                           padding=0,
                           fontsize=14),
        widget.Battery(foreground=colors[2],
                       background=colors[5],
                       format='{percent:2.0%} W',
                       padding=5),
        widget.TextBox(text='',
                       background=colors[5],
                       foreground=colors[4],
                       padding=0,
                       fontsize=37),
        widget.Net(interface="wlo1",
                   format='{down} ↓↑ {up}',
                   foreground=colors[2],
                   background=colors[4],
                   padding=5),
        widget.TextBox(text='',
                       background=colors[4],
                       foreground=colors[5],
                       padding=0,
                       fontsize=37),
        widget.TextBox(text=" Vol:",
                       foreground=colors[2],
                       background=colors[5],
                       padding=0),
        widget.Volume(foreground=colors[2], background=colors[5], padding=5),
        widget.TextBox(text='',
                       background=colors[5],
                       foreground=colors[4],
                       padding=0,
                       fontsize=37),
        widget.CurrentLayoutIcon(
            custom_icon_paths=[os.path.expanduser("~/.config/qtile/icons")],
            foreground=colors[0],
            background=colors[4],
            padding=0,
            scale=0.7),
        widget.CurrentLayout(foreground=colors[2],
                             background=colors[4],
                             padding=5),
        widget.TextBox(text='',
                       background=colors[4],
                       foreground=colors[5],
                       padding=0,
                       fontsize=37),
        widget.Clock(foreground=colors[2],
                     background=colors[5],
                     format="%I:%M %p"),
        widget.Sep(linewidth=0,
                   padding=10,
                   foreground=colors[0],
                   background=colors[5]),
        widget.Systray(foreground=colors[2], background=colors[5], padding=5),
    ]
    return widgets_list
Exemple #14
0
    },
)
volume = widget.Volume(volume_app="pavucontrol", background=soft, padding=0)
battery = widget.Battery(
    format="{char}{percent:2.0%}",
    unknown_char="",
    show_short_text=False,
    low_foreground=red,
    notify_below=10,
    padding=0,
)
mpd = widget.Mpd2(
    idle_message="idle",
    idle_format=
    "{play_status} [{repeat}{random}{single}{consume}{updating_db}] {idle_message}",
    status_format=
    "{play_status} [{repeat}{random}{single}{consume}{updating_db}] {artist} - {title}",
    no_connection="",
    space="",
)

screens = [
    Screen(top=bar.Bar(
        [
            widget.CurrentLayoutIcon(padding=3),
            widget.GroupBox(
                highlight_method="line",
                disable_drag=True,
                hide_unused=True,
                active=foreground,
                inactive=black0,
Exemple #15
0
 widget.Battery(
     foreground=GREEN,
     font = "PragmataPro Bold Italic",
     fontsize = 11,
     format = 'ᛈᚹᚱ {percent:2.0%}',
     notify_below = 0.2,
     low_percentage = 0.2,
     low_foreground = RED
 ),
 widget.TextBox("  ᛝ  ",
     font = "PragmataPro Bold",
                ),
 widget.Mpd2(
     no_connection = " ",
     keys = {'toggle': 1},
     font = "PragmataPro Bold Italic",
     fontsize = 11,
     idle_format = '',
     status_format = '{title}',
 ),
 widget.TextBox(""),
 widget.PulseVolume(
     font = "PragmataPro Bold Italic",
     fontsize = 11,
 ),
 widget.TextBox("  ᛝ  ",
     font = "PragmataPro Bold",
                ),
 widget.Clock(
     foreground = WHITE,
     font = "PragmataPro Bold",
     format='%I:%M %p'),
Exemple #16
0
def build_bar(settings: dict, secrets: dict = {}) -> List[bar.Bar]:
    theme = settings["theme"]
    barheight = theme["barheight"]
    font = theme["font"]
    iconfont = theme["iconfont"]
    fontsize = theme["fontsize"]
    theme_colors = theme["color"]
    owm_location_args = {}
    if "latitude" in secrets:
        owm_location_args["latitude"] = secrets["latitude"]
    if "longitude" in secrets:
        owm_location_args["longitude"] = secrets["longitude"]

    def _fg_sep():
        return widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["panel_fg"],
        )

    def _bg_sep():
        return widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["panel_bg"],
        )

    def _line_sep():
        return widget.Sep(
            linewidth=1,
            size_percent=50,
            padding=18,
            foreground="888888",
            background=theme_colors["panel_bg"],
        )

    top_bar_widgets = [
        # region LHS
        _fg_sep(),
        widget.TextBox(
            text=chr(983044),
            font=iconfont,
            fontsize=fontsize + 6,
            foreground=theme_colors["panel_bg"],
            background=theme_colors["panel_fg"],
        ),
        _fg_sep(),
        _bg_sep(),
        widget.GroupBox(
            margin_y=3,
            margin_x=2,
            padding_y=5,
            padding_x=5,
            borderwidth=0,
            foreground=theme_colors["panel_fg"],
            background=theme_colors["panel_bg"],
            active=theme_colors["group_active_fg"],
            inactive=theme_colors["group_inactive_fg"],
            rounded=True,
            highlight_method="block",
            this_current_screen_border=theme_colors["group_current_bg"],
            this_screen_border=theme_colors["group_current_bg"],
            # other_current_screen_border=theme_colors["panel_bg"],
            # other_screen_border=theme_colors["panel_bg"],
            disable_drag=True,
        ),
        _line_sep(),
        widget.CurrentLayout(
            foreground=theme_colors["panel_fg"],
            background=theme_colors["panel_bg"],
        ),
        _line_sep(),
        EscapedWindowName(
            padding=5,
            foreground=theme_colors["panel_fg"],
            background=theme_colors["panel_bg"],
        ),
        # endregion
        # region RHS
        # Systray
        widget.TextBox(
            text=theme["powerline_separator"][0],
            fontsize=barheight + 8,
            padding=0,
            margin=0,
            foreground=theme_colors["powerline_bg"][4],
            background=theme_colors["panel_bg"],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][4],
        ),
        widget.Systray(
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][4],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][4],
        ),
        widget.TextBox(
            text=chr(987798),
            font=iconfont,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][4],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][4],
        ),
        # OpenWeatherMap
        widget.TextBox(
            text=theme["powerline_separator"][0],
            font=font,
            fontsize=barheight + 6,
            margin=0,
            padding=0,
            foreground=theme_colors["powerline_bg"][3],
            background=theme_colors["powerline_bg"][4],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][3],
        ),
        OpenWeatherMap(
            format=
            '{temp:.1f}{temp_units} <span face="{icon_font}">{icon}</span>',
            apikey=secrets["owm_apikey"],
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][3],
            **owm_location_args,
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            foreground=theme_colors["panel_fg"],
            background=theme_colors["powerline_bg"][3],
        ),
        # volume control
        widget.TextBox(
            text=theme["powerline_separator"][0],
            font=font,
            fontsize=barheight + 6,
            margin=0,
            padding=0,
            foreground=theme_colors["powerline_bg"][2],
            background=theme_colors["powerline_bg"][3],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][2],
        ),
        FixedWidthVolume(
            # iconfont = "Material Design Icons",
            volume_up_command=settings["volume"]["up"],
            volume_down_command=settings["volume"]["down"],
            mute_command=settings["volume"]["toggle"],
            volume_app=settings["volume"]["app"],
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][2],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][2],
        ),
        widget.TextBox(
            text=theme["powerline_separator"][0],
            fontsize=barheight + 6,
            padding=0,
            margin=0,
            foreground=theme_colors["powerline_bg"][1],
            background=theme_colors["powerline_bg"][2],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][1],
        ),
        widget.Mpd2(
            status_format="{play_status} {artist} | {title} | {album}",
            idle_format="Play queue empty",
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][1],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][1],
        ),
        widget.TextBox(
            text=chr(984922),
            font=iconfont,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][1],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][1],
        ),
        # Clock
        widget.TextBox(
            text=theme["powerline_separator"][0],
            fontsize=barheight + 6,
            padding=0,
            margin=0,
            foreground=theme_colors["powerline_bg"][0],
            background=theme_colors["powerline_bg"][1],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][0],
        ),
        widget.Clock(
            format="%a %Y-%m-%d",
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][0],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][0],
        ),
        # calendar symbol
        widget.TextBox(
            text=chr(983277),
            font=iconfont,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][0],
        ),
        widget.Sep(
            linewidth=0,
            padding=12,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][0],
        ),
        widget.Clock(
            format="%H:%M",
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][0],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][0],
        ),
        # clock symbol
        widget.TextBox(
            text=chr(983376),
            font=iconfont,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][0],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][0],
        ),
        # endregion
    ]

    if "logo" in theme:
        top_bar_widgets.append(
            widget.TextBox(
                text=f"  {theme['logo']}  ",
                font=theme["logofont"],
                foreground=theme_colors["powerline_fg"],
                background=theme_colors["powerline_bg"][-1],
            ), )

    # def cpu_button(*args, **kwargs):
    #     command = [settings["term"], "-e", "htop"]
    #     Popen(command, shell=True)
    # with open(os.path.expanduser("~/cpu_button"), "w") as fp:
    #     fp.write(f"command={command}")

    bottom_bar_widgets = [
        # Updates
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][3],
        ),
        widget.TextBox(
            text=chr(984752),
            font=iconfont,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][3],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][3],
        ),
        widget.CheckUpdates(
            distro="Arch",
            execute="alacritty",
            update_interval=1800,
            display_format="{updates} Updates",
            colour_no_updates=theme_colors["powerline_fg"],
            colour_have_updates=theme_colors["panel_fg"],
            background=theme_colors["powerline_bg"][3],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][3],
        ),
        widget.TextBox(
            text=theme["powerline_separator"][1],
            fontsize=barheight + 6,
            padding=0,
            margin=2,
            foreground=theme_colors["powerline_bg"][3],
            background=theme_colors["powerline_bg"][4],
        ),
        # region Net
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][4],
        ),
        widget.TextBox(
            text=chr(986631),
            font=iconfont,
            fontsize=barheight - 4,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][4],
        ),
        NetMin(
            font=font,
            interface="wlp4s0f3u2",
            format="{up} ",
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][4],
        ),
        widget.TextBox(
            text=chr(985999),
            font=iconfont,
            fontsize=barheight - 4,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][4],
        ),
        NetMin(
            font=font,
            interface="wlp4s0f3u2",
            format="{down}",
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][4],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][4],
        ),
        widget.TextBox(
            text=theme["powerline_separator"][1],
            fontsize=barheight - 4,
            padding=0,
            margin=0,
            foreground=theme_colors["powerline_bg"][4],
            background=theme_colors["powerline_bg"][5],
        ),
        # endregion
        # region Memory
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][5],
        ),
        widget.TextBox(
            text=chr(983899),
            font=iconfont,
            fontsize=barheight - 4,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][5],
        ),
        widget.Memory(
            format="{MemUsed:5d}M/{MemTotal}M",
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][5],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][5],
        ),
        widget.TextBox(
            text=theme["powerline_separator"][1],
            fontsize=barheight - 4,
            padding=0,
            margin=0,
            foreground=theme_colors["powerline_bg"][5],
            background=theme_colors["powerline_bg"][6],
        ),
        # endregion
        # region CPU
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][6],
        ),
        widget.TextBox(
            text=chr(986848),
            font=iconfont,
            fontsize=barheight - 4,
            padding=0,
            margin=0,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][6],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][6],
        ),
        widget.CPU(
            format="{load_percent:4.1f}%",
            update_interval=5,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][6],
            # mouse_callbacks={"Button1": cpu_button},
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][6],
        ),
        widget.TextBox(
            text=theme["powerline_separator"][1],
            fontsize=barheight - 4,
            padding=0,
            margin=0,
            foreground=theme_colors["powerline_bg"][6],
            background=theme_colors["powerline_bg"][7],
        ),
        # endregion
        # region Temps
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][7],
        ),
        widget.TextBox(
            text=chr(984335),
            font=iconfont,
            fontsize=barheight - 4,
            padding=0,
            margin=0,
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][7],
        ),
        widget.Sep(
            linewidth=0,
            padding=6,
            background=theme_colors["powerline_bg"][7],
        ),
        widget.ThermalSensor(
            foreground=theme_colors["powerline_fg"],
            background=theme_colors["powerline_bg"][7],
        ),
        widget.Sep(
            linewidth=0,
            padding=12,
            background=theme_colors["powerline_bg"][7],
        ),
        widget.TextBox(
            text=theme["powerline_separator"][1],
            font=font,
            fontsize=barheight - 4,
            padding=0,
            margin=0,
            foreground=theme_colors["powerline_bg"][7],
            background=theme_colors["panel_bg"],
        ),
        # endregion
    ]

    # bottom_pl = Powerline(
    #     theme_colors["powerline_fg"], theme_colors["powerline_bg"], barheight,
    # )
    # ud = Segment(
    #     [
    #         widget.TextBox(
    #             text=chr(984752),
    #             font=iconfont,
    #             foreground=self.fg,
    #             background=self.segment_colors[3],
    #         ),
    #         widget.Sep(linewidth=0, padding=6, background=self.segment_colors[3],),
    #         widget.CheckUpdates(
    #             distro="Arch",
    #             execute="alacritty",
    #             update_interval=1800,
    #             display_format="{updates} Updates",
    #             colour_no_updates=self.fg,
    #             colour_have_updates=theme_colors["panel_fg"],
    #             background=self.segment_colors[3],
    #         ),
    #     ]
    # )

    return [
        bar.Bar(top_bar_widgets,
                size=barheight,
                background=theme_colors["panel_bg"]),
        bar.Bar(
            bottom_bar_widgets,
            size=barheight,
            background=theme_colors["panel_bg"],
        ),
    ]
Exemple #17
0
                    txt_floating='',
                    markup_focused='<span underline="low">{}</span>'),
                widget.Prompt(),

                # widget.GenPollText(
                #     func=user.inbox, foreground='fe1b22', update_interval=300),
                widget.GenPollText(func=user.iCWidget, update_interval=20),
                widget.Battery(hide_threshold=0.9),

                # widget.GenPollText(func=user.netSpeedUp, update_interval=2),
                # widget.TextBox(text='⇅', padding=0),
                # widget.GenPollText(func=user.netSpeedDown, update_interval=2),
                widget.GenPollText(func=user.pacmanUpdates,
                                   update_interval=1800),
                widget.Mpd2(idle_message='',
                            fmt_stopped='',
                            fmt_playing='🎵 %a / %t',
                            foreground_progress='7b5830'),
                widget.Volume(emoji=True, padding=0),
                widget.Volume(padding=0),
                widget.TextBox(text=' ', padding=1),
                widget.Systray(icon_size=16),
                widget.TextBox(text=' ', padding=1),
                widget.GenPollText(func=user.usedMem, update_interval=5),
                widget.TextBox(text='⌛', padding=0),
                widget.GenPollText(func=user.allDistractingTime,
                                   update_interval=300),
                widget.TextBox(text='💓', padding=0),
                widget.GenPollText(func=user.productivityPulse,
                                   update_interval=300),
                widget.Clock(format='%a, %d ', update_interval=300, padding=0),
                widget.GenPollText(
Exemple #18
0
            foreground=colors2[2],
            background=colors2[0],
            format='{percent:2.0%} {watt:.2f} W',
            mouse_callbacks={
                'Button1':
                lambda: qtile.cmd_spawn('xfce4-power-manager-settings'),
            },
        ),
        widget.Clock(
            format='%a %H:%M:S %d/%m/%Y',
            foreground=colors2[1],
            background=colors2[0],
        ),
        widget.Mpd2(
            background=colors2[0],
            foreground=colors2[2],
            colors_progress=colors2[2],
        ),
    ],
    24,
    background=colors2[0],
    margin=[5, 5, 5, 5],
)

bottom2 = bar.Bar(
    [
        widget.Image(
            filename='~/.config/qtile/icons/hard-drive.png',
            background=colors2[0],
        ),
        widget.DF(