def init_widgets(): prompt = "{0}@{1}: ".format(os.environ["USER"], hostname) widgets = [ Prompt(prompt=prompt, font="DejaVu Sans Mono", padding=10, background=GREY), TextBox(text="◤ ", fontsize=45, padding=-8, foreground=GREY, background=DARK_GREY), CurrentLayoutIcon(scale=0.6, padding=-4), TextBox(text=" ", padding=2), GroupBox(fontsize=8, padding=4, borderwidth=1, urgent_border=DARK_BLUE, disable_drag=True, highlight_method="block", this_screen_border=DARK_BLUE, other_screen_border=DARK_ORANGE, this_current_screen_border=BLUE, other_current_screen_border=ORANGE), TextBox(text="◤", fontsize=45, padding=-1, foreground=DARK_GREY, background=GREY), TaskList(borderwidth=0, highlight_method="block", background=GREY, border=DARK_GREY, urgent_border=DARK_BLUE), Systray(background=GREY), TextBox(text="◤", fontsize=45, padding=-1, foreground=GREY, background=DARK_GREY), TextBox(text=" ⚠", foreground=BLUE, fontsize=18), Notify(), TextBox(text=" ⌚", foreground=BLUE, fontsize=18), Clock(format="%A %d-%m-%Y %H:%M") ] if hostname in ("spud", "saiga"): widgets[-2:-2] = [ TextBox(text=" ↯", foreground=BLUE, fontsize=14), Battery(update_delay=2) ] if DEBUG: widgets += [Sep(), CurrentLayout()] return widgets
def init_widgets(): prompt = "{0}@{1}: ".format(os.environ["USER"], hostname) widgets = [ Prompt(prompt=prompt, font="DejaVu Sans Mono", padding=10, background=GREY), TextBox(text="◤ ", fontsize=45, padding=-8, foreground=GREY, background=DARK_GREY), CurrentLayoutIcon(scale=0.6, padding=-4), Spacer(width=10), GroupBox(fontsize=8, padding=4, borderwidth=1, urgent_border=DARK_BLUE, disable_drag=True, highlight_method="block", this_screen_border=DARK_BLUE, other_screen_border=DARK_ORANGE, this_current_screen_border=BLUE, other_current_screen_border=ORANGE), TextBox(text="◤", fontsize=45, padding=-1, foreground=DARK_GREY, background=GREY), TaskList(borderwidth=0, highlight_method="block", background=GREY, border=DARK_GREY, urgent_border=DARK_BLUE), Systray(background=GREY), TextBox(text="◤", fontsize=45, padding=-1, foreground=GREY, background=DARK_GREY), Notify(fmt=" 🔥 {}"), Clock(fmt=" ⌚ {}", format="%A %d-%m-%Y %H:%M") ] if os.path.isdir("/sys/module/battery"): widgets.insert(-1, Battery(fmt=" ⚡️ {}", update_delay=2)) if DEBUG: widgets += [Sep(), CurrentLayout()] return widgets
}, } screens = [ Screen(top=bar.Bar( [ CurrentLayoutIcon(custom_icon_paths=wd_icon), Sep(**w_sep), GroupBox(**w_gbox, ), TextBox( text="🐸", fontsize="16", padding=5, ), WindowCount(), Prompt(**w_prompt), WindowName(foreground=colorz[1]), TextBox( text="📂", fontsize="16", padding=5, mouse_callbacks={'Button1': open_fm}, ), Systray(icon_size=20), TextBox( text="[", foreground=colorz[2], fontsize=18, ), Net(**w_net, ), TextBox(
def init_top_main(self, hidpi = False): fontsize = 12 if not hidpi else 22 wl = [] wl += [CurrentLayoutIcon( fontsize=fontsize, # custom_icon_paths=[expanduser("~/.config/qtile/icons")], foreground=self.color.white, padding=10, scale=0.7 )] wl += [GroupBox( fontsize=24 if not hidpi else 40, font=self.font.bold, margin_y=3, margin_x=0, padding_y=5, padding_x=10 if not hidpi else 20, borderwidth=3, hide_unused=True, active=self.color.yellow, inactive=self.color.lightgrey, urgent_text=self.color.white, highlight_method="line", urgent_alert_method="line", highlight_color=self.color.grey, urgent_border=self.color.red, this_current_screen_border=self.color.yellow, other_screen_border=self.color.magenta, this_screen_border=self.color.magenta, other_current_screen_border=self.color.yellow, rounded=False, disable_drag=True, use_mouse_wheel=False )] wl += [self.space.small()] wl += [Prompt( fontsize=fontsize, prompt="λ : ", padding=10, bell_style="visual", foreground=self.color.magenta, background=self.color.black )] wl += [self.space.small()] wl += [WindowName( fontsize=fontsize, padding=0, show_state=False, for_current_screen=False, foreground=self.color.yellow )] wl += [self.space.extra_large()] wl += [TextBox( fontsize=fontsize, foreground=self.color.magenta, text=" " )] wl += [DF( fontsize=fontsize, foreground=self.color.magenta, format='{uf}{m}', partition='/', visible_on_warn=False )] wl += [self.space.small()] wl += [TextBox( fontsize=fontsize, foreground=self.color.magenta, text=" " )] wl += [DF( fontsize=fontsize, foreground=self.color.magenta, format='{uf}{m}', partition='/home', visible_on_warn=False )] wl += [self.separator.normal()] wl += [TextBox( fontsize=fontsize, foreground=self.color.blue, text=" " )] wl += [CPU( fontsize=fontsize, foreground=self.color.blue, # TODO Remove hard coded terminal mouse_callbacks={'Button1': lambda qtile: qtile.cmd_spawn("alacritty -e ytop")}, format='{load_percent}%', update_interval=2.0 )] wl += [self.space.small()] wl += [TextBox( fontsize=fontsize, foreground=self.color.blue, text=" " )] wl += [ThermalSensor( fontsize=fontsize, foreground=self.color.blue, threshold=90, mouse_callbacks={'Button1': lambda qtile: qtile.cmd_spawn("alacritty -e ytop")}, update_interval=2.0 )] wl += [self.separator.normal()] wl += [TextBox( fontsize=fontsize, foreground=self.color.cyan, text=" " )] wl += [Memory( fontsize=fontsize, foreground=self.color.cyan, mouse_callbacks={'Button1': lambda qtile: qtile.cmd_spawn(terminal + ' -e ytop')}, update_interval=2.0, )] wl += [self.separator.normal()] wl += [TextBox( fontsize=fontsize, foreground=self.color.green, font=self.font.bold, text="直 " )] wl += [Wlan( fontsize=fontsize, foreground=self.color.green, interface='wlp60s0', format='{essid} ({percent:2.0%})' )] wl += [self.separator.normal()] wl += [TextBox( fontsize=fontsize, foreground=self.color.orange, font=self.font.bold, text=" " )] wl += [Volume( fontsize=fontsize, foreground=self.color.orange )] wl += [self.space.small()] wl += [TextBox( fontsize=fontsize, foreground=self.color.orange, font=self.font.bold, text=" " )] wl += [Backlight( fontsize=fontsize, foreground=self.color.orange, backlight_name='intel_backlight', format='{percent:2.0%}' )] wl += [self.space.small()] wl += [Battery( fontsize=fontsize, foreground=self.color.orange, low_foreground=self.color.red, format='{char} {percent:2.0%}', low_percentage=0.2, charge_char='', full_char='', empty_char='', ramp_cap0_char='', ramp_cap1_char='', ramp_cap2_char='', ramp_cap3_char='', ramp_cap4_char='', ramp_cap0_foreground=self.color.red[0], ramp_cap1_foreground=self.color.red[0], ramp_cap2_foreground=self.color.orange[0], ramp_cap3_foreground=self.color.orange[0], ramp_cap4_foreground=self.color.green[0], )] # wl += [self.separator.normal()] # wl += [TextBox( # font=self.font.bold, # text=" " # )] # wl += [CheckUpdates( # distro="Arch_checkupdates", # display_format="{updates}", # update_interval=900, # colour_have_updates=self.color.white, # colour_no_updates=self.color.white # )] # wl += [self.separator.normal()] # wl += [Systray( # padding=3, # icon_size=19 if not hidpi else 30 # )] wl += [self.separator.normal()] wl += [Clock( fontsize=fontsize, foreground=self.color.yellow, format=" %d.%m.%Y %H:%M" )] wl += [self.space.large()] return wl
def init_top_single(self, tray=True): wl = [] wl += [self.space.large_black()] wl += [ GroupBox( font=self.font.bold, fontsize=9, margin_y=0, margin_x=0, # padding_y = 6, padding_x=3, borderwidth=2, # hide_unused = True, active=self.color.white, inactive=self.color.lightgrey, urgent_text=self.color.white, highlight_method="line", highlight_color=["2B303B", "14161B"], urgent_alert_method="line", rounded=False, urgent_border=self.color.red, this_current_screen_border=self.color.blue, other_screen_border=self.color.magenta, this_screen_border=self.color.orange, other_current_screen_border=self.color.magenta, disable_drag=True, use_mouse_wheel=False) ] wl += [ Prompt(prompt="λ : ", padding=5, bell_style="visual", foreground=self.color.magenta, background=self.color.black) ] wl += [self.space.large_black()] wl += [ WindowName(fontsize=11, padding=0, show_state=False, foreground=self.color.darkgreen) ] wl += [self.space.large_black()] wl += [TextBox(fontsize=16, text="")] wl += [Net(interface="eth0")] wl += [self.separator.bold_white()] wl += [TextBox(text="")] wl += [ ThermalSensor(tag_sensor="CPU", threshold=85, update_interval=1, foreground_alert=self.color.red, foreground=self.color.white) ] wl += [self.separator.bold_white()] wl += [TextBox(text="")] wl += [ Battery(format="{char} {percent:0.1%}", update_interval=5, low_percentage=0.10, unknown_char="", full_char="", charge_char="+", discharge_char="-", empty_char="", low_foreground=self.color.red) ] wl += [self.separator.bold_white()] wl += [TextBox(font=self.font.bold, text="")] wl += [ Memory( # fmt = "{MemUsed}M/{MemTotal}M - {SwapUsed}M", fmt="{MemUsed}M - {SwapUsed}M", update_interval=1) ] wl += [self.separator.bold_white()] wl += [TextBox(font=self.font.bold, text="")] wl += [CurrentLayout()] wl += [self.separator.bold_white()] wl += [TextBox(font=self.font.bold, text="")] wl += [ CheckUpdates(distro="Arch_checkupdates", display_format="{updates}", update_interval=900, colour_have_updates=self.color.white, colour_no_updates=self.color.white) ] if tray: wl += [self.separator.bold_white()] wl += [Systray(padding=3, icon_size=19)] # if not tray: # wl += [self.separator.bold_white()] # wl += [CurrentLayoutIcon( # padding = 0, # custom_icon_paths = [expanduser("~/.config/qtile/icons")], # scale = 0.6 # )] wl += [self.separator.bold_white()] wl += [TextBox(font=self.font.bold, text="")] wl += [Clock(format="%a, %b %d - %H:%M")] wl += [self.space.large_black()] return wl
def init_top_double(self, tray=True): wl = [] wl += [self.space.large_black()] wl += [ GroupBox( font=self.font.bold, fontsize=9, margin_y=0, margin_x=0, # padding_y = 6, padding_x=3, borderwidth=2, # hide_unused = True, active=self.color.white, inactive=self.color.lightgrey, urgent_text=self.color.white, highlight_method="line", highlight_color=["2B303B", "14161B"], urgent_alert_method="line", rounded=False, urgent_border=self.color.red, this_current_screen_border=self.color.blue, other_screen_border=self.color.magenta, this_screen_border=self.color.orange, other_current_screen_border=self.color.magenta, disable_drag=True, use_mouse_wheel=False) ] wl += [ Prompt(prompt="λ : ", padding=5, bell_style="visual", foreground=self.color.magenta, background=self.color.black) ] wl += [self.space.large_black()] wl += [ WindowName(fontsize=11, padding=0, show_state=False, foreground=self.color.darkgreen) ] wl += [self.space.large_black()] wl += [TextBox(fontsize=16, text="")] wl += [Net(interface="eth0")] if tray: wl += [self.separator.bold_white()] wl += [Systray(padding=3, icon_size=19)] # if not tray: # wl += [self.separator.bold_white()] # wl += [CurrentLayoutIcon( # padding = 0, # custom_icon_paths = [expanduser("~/.config/qtile/icons")], # scale = 0.6 # )] wl += [self.space.large_black()] return wl