*workspaces(), separator(), powerline('color1', 'dark'), widget.CurrentLayoutIcon(**base(bg='color1'), scale=0.65), widget.CurrentLayout(**base(bg='color1'), padding=5), powerline('color2', 'color1'), icon(bg="color2", fontsize=22, text=' '), # Icon: nf-mdi-calendar_clock widget.Memory(**base(bg="color2"), padding=5), powerline('color3', 'color2'), icon(bg="color3", text=" "), # Icon: nf-fa-feed widget.Net(**base(bg='color3'), format="{down} | {up}"), powerline('color4', 'color3'), icon(bg="color4", text=' '), # Icon: nf-weather-thermometer widget.OpenWeather( **base(bg='color4'), format= "{location_city} {main_temp}°{units_temperature} [{weather_details}]", cityid='3893894', language='es', update_interval=60), powerline('dark', 'color4'), widget.ThermalSensor(**base(bg='dark', fg='light')), ] widget_defaults = { 'font': 'UbuntuMono Nerd Font Bold', 'fontsize': 14, 'padding': 1, } extension_defaults = widget_defaults.copy()
widget.Sep(), widget.Spacer(length=10), widget.Clock(format="%H:%M:%S %h %d, %Y"), widget.Spacer(length=10), widget.Sep(), widget.Spacer(length=10), widget.Battery(), widget.Spacer(length=10), widget.Sep(), widget.Spacer(length=10), widget.Volume(emoji=True), widget.Spacer(length=10), widget.Sep(), widget.Spacer(length=10), widget.OpenWeather( location="Florianopolis", format="fln: {main_temp} °{units_temperature}", ), widget.Spacer(length=10), widget.Sep(), widget.Spacer(length=10), widget.OpenWeather( location="Amsterdam", format="ams: {main_temp} °{units_temperature}", ), widget.Spacer(length=10), widget.Sep(), widget.Spacer(length=10), widget.Maildir( maildir_path="~/mail/personal", sub_folders=( {"label": "i", "path": "inbox"},
width=bar.CALCULATED, empty_group_string="Desktop", max_chars=40, ), widget.Spacer(background=colors[1]), widget.Sep( linewidth=0, padding=10, size_percent=50, background=colors[1], ), widget.OpenWeather( background=colors[1], foreground=colors[0], app_key="eaf0bf95962bd42471d02500acc89aa1", cityid="1812537", language="zh_cn", format= "{main_temp}°{units_temperature} {humidity}% {weather_details}", ), widget.Sep( background=colors[1], linewidth=0, padding=25, size_percent=50, ), widget.TextBox( background=colors[1], foreground=colors[4], text=" ", font="Font Awesome 5 Free Solid",
def init_widgets_list(): rightSideWidgets = [ # Weather [ { "icon": icons["weather"], "widget": lambda bg: widget.OpenWeather( app_key=env_config["OPEN_WEATHER_API_KEY"], cityid=706483, background=bg, format="{main_temp} °{units_temperature} {humidity}% {weather_details}", ), } ], # Thermal sensor (CPU) [ { "icon": icons["cpu_temp"], "widget": lambda bg: widget.ThermalSensor( foreground=widgetColor, background=bg, threshold=90, padding=0, ), } ], [ { "icon": icons["ram"], "widget": lambda bg: widget.Memory( foreground=widgetColor, background=bg, mouse_callbacks={ "Button1": lambda: qtile.cmd_spawn(myTerm + " -e htop") }, padding=0, format="{MemUsed: .0f}{mm} /{MemTotal: .0f}{mm}", ), } ], [ { "icon": f"{icons['volume']}", "widget": lambda bg: widget.Volume( foreground=widgetColor, background=bg, padding=0, ), } ], # [{ # "widget": lambda bg: widget.BitcoinTicker( # foreground = widgetColor, # background = bg, # padding = 0, # ), # }], # [ # { # "widget": lambda bg: widget.Pomodoro( # color_active=widgetColor, # color_break=widgetColor, # color_inactive=widgetColor, # foreground=widgetColor, # background=bg, # padding=0, # ) # } # ], [ { "widget": lambda bg: keyboard_widget, } ], # Music # [ # {"widget": lambda bg: widget.Cmus( # play_color = widgetColor, # background = bg, # padding = 0, # )}, # ], [ { "widget": lambda bg: widget.Clock( foreground=widgetColor, background=bg, padding=0, format="%A, %B %d - %H:%M ", ) }, ], [ { "widget": lambda bg: widget.CurrentLayoutIcon( custom_icon_paths=[os.path.expanduser("~/.config/qtile/icons")], foreground=barFg, background=bg, padding=0, scale=0.7, ), } ], ] def renderStripedWidgetGroup(grp, even=False): res = [] bg = widgetStripedBg2 if even else widgetStripedBg1 res.append( widget.Sep( linewidth=0, padding=wp, foreground=sepColor, background=bg, ), ) for j, wdesc in enumerate(grp): text = wdesc.get("label", None) widget_fn = wdesc["widget"] has_text = text != None label_size = wdesc.get("label_fsize", 14) inner_padding = wdesc.get("inner_padding", 6) icon = wdesc.get("icon", None) has_icon = icon != None if has_text: res.append( widget.TextBox( text=text, foreground=widgetColor, background=bg, padding=0, fontsize=label_size, ), ) elif has_icon: res.append( widget.TextBox( text=icon, foreground=widgetColor, background=bg, padding=0, fontsize=icon_size, font="Font Awesome 5 Free Solid", ), ) res.append( widget.Sep( linewidth=0, padding=inner_padding, foreground=sepColor, background=bg, ) ) res.append(widget_fn(bg)) if j != (len(grp) - 1): res.append( widget.Sep( linewidth=0, padding=inner_padding, foreground=sepColor, background=bg, ), ) res.append( widget.Sep( linewidth=0, padding=wp, foreground=sepColor, background=bg, ), ) return res # Append rightSideWidgets with separators & alternating background color rightSide = [] for i, grp in enumerate(rightSideWidgets): even = i % 2 == 0 rightSide += renderStripedWidgetGroup(grp, even=even) widgets_list = [ emptySep, # Icon widget.Image( filename="~/.config/qtile/icons/yin-yang.png", scale=True, margin_y=3, mouse_callbacks={"Button1": lambda: qtile.cmd_spawn(myTerm)}, ), emptySep, # Workspaces widget.GroupBox( font="Source Code Pro Bold", fontsize=8, margin_y=4, margin_x=2, padding_y=5, padding_x=12, borderwidth=2, active=activeWsColor, block_highlight_text_color=theme.fg, inactive=inactiveWsColor, disable_drag=True, rounded=False, highlight_color=activeWsBg, highlight_method="line", this_current_screen_border=thisCurrentScreenBorder, this_screen_border=thisScreenBorder, other_current_screen_border=otherCurrentScreenBorder, other_screen_border=otherScreenBorder, foreground=barFg, background=barBg, ), widget.TextBox( text="|>", foreground=barFg, background=barBg, padding=8, fontsize=14 ), # Current window name widget.WindowName( foreground=winTitleColor, background=barBg, padding=0, max_chars=currWindowMaxChars, ), # System tray widget.Systray( background=barBg, padding=8, icon_size=14, ), emptySep, emptySep, *rightSide, ] return widgets_list
extension_defaults = widget_defaults.copy() common_bar_prefix = [ widget.CurrentLayout(), widget.GroupBox(active="ebdbb2", disable_drag=True, highlight_method="block", this_current_screen_border='928374', this_screen_border='928374', other_current_screen_border='3c3836', other_screen_border='3c3836'), widget.Prompt(), widget.WindowName(background="3c3836"), widget.OpenWeather( zip="35114", metric=False, format='⛅ {main_temp} °{units_temperature} {humidity}% {weather_details}'), widget.Sep(padding=12, size_percent=80, foreground="504945"), widget.Net(format="{down} ↓↑ {up}"), widget.Sep(padding=12, size_percent=80, foreground="504945"), widget.TextBox("CPU:"), widget.CPUGraph(), ] common_bar_suffix = [ widget.Sep(padding=12, size_percent=80, foreground="504945"), widget.Clock(format='%a %m/%d/%Y %H:%M:%S'), widget.Sep(padding=12, size_percent=80, foreground="504945"), widget.Systray(), ] bar_settings = {
widget.GroupBox(), widget.Spacer(length=bar.STRETCH), widget.CPUGraph(graph_color="99ccff", fill_color="bbeeff.3", width=40, border_color='000000'), widget.MemoryGraph( graph_color="bbeeff", fill_color="bbeeff.3", width=40, border_color='000000', ), widget.Systray(), widget.OpenWeather( foreground='bbeeff', zip='51109,DE', language='pt', format="{main_temp}°{units_temperature} {weather_details}" ), widget.Clock(format='%I:%M %p [%d-%m-%Y]'), widget.KeyboardLayout(configured_keyboards=["de"]), widget.Net(), # widget.QuickExit(), ], 32, ), wallpaper="~/.config/qtile/arch_bg.jpg", ), ] # Drag floating layouts. mouse = [
widget.OpenWeather( background=colors[14], foreground=colors[7], app_key="7834197c2338888258f8cb94ae14ef49", zip=location, language="en", metric=False, format="{icon} {temp:.0f}°{units_temperature}", # from https://github.com/sffjunkie/qtile-openweathermap/blob/de368ac36736391dfafe18367f9d12c2fc258149/owm.py#L37 # NOTE: Nerdfonts is missing the MD icon for partly cloudy night weather_symbols={ "01d": "\U0000fa98", # Clear sky 滛望 "01n": "\U0000fa93", "02d": "\U0000fa94", # Few clouds 杖 "02n": "\U0000e37e", "03d": "\U0000fa94", # Scattered Clouds 杖 "03n": "\U0000e37e", "04d": "\U0000fa8f", # Broken clouds 摒 "04n": "\U0000fa8f", "09d": "\U0000fa95", # Shower Rain 歹 "09n": "\U0000fa95", "10d": "\U0000fa95", # Rain 歹 "10n": "\U0000fa95", "11d": "\U0000fb7c", # Thunderstorm ﭼ "11n": "\U0000fb7c", "13d": "\U0000fa97", # Snow 流 "13n": "\U0000fa97", "50d": "\U0000fa90", # Mist 敖 "50n": "\U0000fa90", "sleetd": "\U0000fb7d", "sleetn": "\U0000fb7d", }, ),
screens = [ Screen( top=bar.Bar( [ widget.GroupBox(), widget.Prompt(), widget.WindowName(), widget.Chord( chords_colors={ 'launch': ("#ff0000", "#ffffff"), }, name_transform=lambda name: name.upper(), ), widget.TextBox(text=' | '), widget.OpenWeather(location='Champaign,US'), widget.TextBox(text=' | '), #widget.CPU(), widget.Battery(), widget.TextBox(text=' | '), widget.Memory(), widget.TextBox(text=' | '), widget.Systray(), widget.TextBox(text=' | '), widget.Clock(format='%Y-%m-%d %a %I:%M %p'), widget.TextBox(text=' | '), ], 24, ), ), ]
def in_wid_list_bot(): wid_list_bot = [ #widget.DebugInfo(foreground=colors[7], background=colors[0], fontshadow=colors[2]), widget.Spacer(length=bar.STRETCH), #### Network #### widget.TextBox(text='◢', background=colors[0], foreground=colors[5], padding=-2, fontsize=45), widget.Net(font='Font Awesome 5 Free', fontsize=15, interface=netact, format='', foreground=colors[0], background=colors[5], fontshadow=colors[7], mouse_callbacks={'Button1': wnetw}), widget.Wlan(interface=netact, format='{essid} {percent:2.0%} ', disconnected_message='Unplugged', foreground=colors[0], background=colors[5], mouse_callbacks={'Button1': wnetw}), widget.Net(font='Font Awesome 5 Free', fontsize=15, interface=netact, format='{down} ↓↑ {up}', foreground=colors[0], background=colors[5], use_bits=True, mouse_callbacks={'Button1': wnetw}), #### Bitcoin #### widget.TextBox(text="◢", background=colors[5], foreground=colors[3], padding=-2, fontsize=45), widget.BitcoinTicker(background=colors[3], foreground=colors[0]), widget.TextBox(text="◢", background=colors[3], foreground=colors[1], padding=-2, fontsize=45), #### Weather #### widget.OpenWeather( app_key='e45a0f07f0c675b273ef8636663941db', cityid='3521342', background=colors[1], foreground=colors[0], format= '{main_temp}°{units_temperature} {humidity}% {weather_details}', metric=True, update_interval=600), #### RAM #### widget.TextBox(text="◢", background=colors[1], foreground=colors[2], padding=-2, fontsize=45), widget.TextBox(font='Font Awesome 5 Free', fontsize=15, background=colors[2], foreground=colors[0], fontshadow=colors[7], text=""), widget.Memory(format='{MemUsed}Mb', foreground=colors[0], background=colors[2], padding=5), #### CPU #### widget.TextBox(text="◢", background=colors[2], foreground=colors[5], padding=-2, fontsize=45), widget.TextBox(font='Font Awesome 5 Free', fontsize=15, background=colors[5], foreground=colors[0], text="", fontshadow=colors[7]), widget.CPU(format='{load_percent}%', foreground=colors[0], background=colors[5], mouse_callbacks={ 'Button1': lambda: qtile.cmd_spawn(term + ' -e htop') }), #### Disk Space #### widget.TextBox(text="◢", background=colors[5], foreground=colors[3], padding=-2, fontsize=45), widget.TextBox(font='Font Awesome 5 Free', fontsize=15, background=colors[3], foreground=colors[0], fontshadow=colors[7], text=""), widget.DF(format='{p} ({uf}{m}|{r:.0f}%)', measure='G', Partition='/', update_interval=60, foreground=colors[0], background=colors[3], padding=5, visible_on_warn=False, mouse_callbacks={ 'Button1': lambda: qtile.cmd_spawn(term + ' -e ranger') }, warn_color="ff0000"), #### Thermal Sensors #### widget.TextBox(text="◢", background=colors[3], foreground=colors[7], padding=-2, fontsize=45), widget.TextBox(font='Font Awesome 5 Free', fontsize=15, text=" ", background=colors[7], foreground=colors[0], fontshadow=colors[6], metric=True), widget.ThermalSensor(background=colors[7], foreground=colors[0]), #### Keyboard Layout #### widget.TextBox(text="◢", background=colors[7], foreground=colors[0], padding=-2, fontsize=45), widget.TextBox(font='Font Awesome 5 Free', fontsize=17, text="", foreground=colors[7], background=colors[0]), widget.KeyboardLayout(foreground=colors[7], background=colors[0], padding=5, fontshadow=colors[4]), #### Caps lock Num Lock Indicator #### widget.TextBox(text="◢", background=colors[0], foreground=colors[1], padding=-2, fontsize=45), widget.CapsNumLockIndicator(foreground=colors[0], background=colors[1], padding=5), #### Battery for laptops #### widget.TextBox(text="◢", background=colors[1], foreground=colors[0], padding=-2, fontsize=45), # widget.BatteryIcon( # show_short_text=True, # notify_below=30, # discharge_char=' ', # empty_char='', # full_char=' ', # background=colors[0], # foreground=colors[7] # ), #widget.Battery( # format='{percent:2.0%}', # show_short_text=False, # update_interval=5, # background=colors[0], # foreground=colors[7] # ), #### Systray #### widget.Systray(icon_size=18, background=colors[0], foreground=colors[7]), ] return wid_list_bot
background=colors[0]), widget.Sep(linewidth=0, padding=40, foreground=colors[2], background=colors[0]), widget.Prompt(), widget.WindowName( borderwidth=3, font="Comic Mono", fontsize=15, ), widget.TextBox(text=" ", background=colors[4], fontsize=14), widget.OpenWeather( app_key="89055558a0d4f266d3213909268cb9a9", cityid="2530335", background=colors[4], font='Comic Mono', fontsize=11, ), widget.TextBox(text=" ", background=colors[8], fontsize=14), widget.CPU(background=colors[8], font='Comic Mono', fontsize=11, foreground=colors[0]), widget.TextBox(text="", background=colors[4], fontsize=14), widget.Memory(background=colors[4], font='Comic Mono', fontsize=11, update_interval=1), widget.TextBox(text="", background=colors[8], fontsize=14), widget.CheckUpdates(