def widget_stack(): gmail_config = { 'update_interval': 50, 'fmt': 'in[%s] unread(%s)', **get_gmail_config() } return [ widget.CurrentScreen(), widget.GroupBox(), widget.Prompt(), widget.TaskList(), widget.GmailChecker(**gmail_config), widget.Sep(), widget.CheckUpdates(), widget.Sep(), widget.Wlan(interface=auto_detect_interface()), widget.Sep(), widget.DF(visible_on_warn=False, format="Disk free {r:.1f}%"), widget.Sep(), widget.CPUGraph(), widget.Memory(), widget.Sep(), widget.Battery(update_interval=1, format="🔋 {char} {percent:2.0%}"), widget.Sep(), widget.Systray(), widget.Notify(), widget.Clock(), widget.CurrentLayoutIcon(), ]
def generic_bar(systray=False): widgets = [ widget.CurrentScreen(background=BAR_COLOR_NETWORK, active_color='ffffff', inactive_color='ffffff'), widget.GroupBox(disable_drag=True, hide_unused=True, this_current_screen_border=BAR_COLOR_CPU, background=BAR_COLOR_NETWORK), widget.CurrentLayout(background=BAR_COLOR_NETWORK), custom_widget.Powerline(foreground=BAR_COLOR_NETWORK, background=BAR_COLOR_MUSIC, right=True), widget.WindowName(show_state=True, width=bar.CALCULATED, background=BAR_COLOR_MUSIC, max_chars=120), custom_widget.Powerline(foreground=BAR_COLOR_MUSIC, right=True), widget.Spacer(length=bar.STRETCH), ] if systray: widgets.extend([ widget.Systray(), widget.Spacer(length=5), ]) widgets.extend(static_widgets) return bar.Bar(widgets, 24, background='#000000.0', opacity=1)
def init_widgets_list(): widgets_list = [ widget.Sep(linewidth=0, padding=3), widget.CurrentScreen( active_text="◉", active_color=colors[3], inactive_text="◉", inactive_color=colors[1], padding=2, ), widget.CurrentLayoutIcon(scale=0.57, padding=2), widget.GroupBox( margin_x=2, padding_y=2, padding_x=3, borderwidth=1, disable_drag=True, active=colors[5], inactive=colors[2], rounded=True, hide_unused=True, highlight_color=colors[1], highlight_method="border", this_current_screen_border=colors[2], this_screen_border=colors[4], other_current_screen_border=colors[1], other_screen_border=colors[1], ), widget.Sep(linewidth=0, padding=20), widget.WindowTabs(), widget.Sep(linewidth=0, padding=20), widget.Notify(audiofile=qtile_dir + "/.sounds/notify-sound.mp3"), widget.Sep(linewidth=0, padding=20), widget.Spacer(length=bar.STRETCH), widget.CheckUpdates(), widget.Sep(linewidth=0, padding=20), widget.Battery( discharge_char="-", charge_char="+", unknown_char="*", update_interval=30, format="{char}{percent:2.0%}", ), widget.Sep(linewidth=0), widget.Wlan( interface="wlp0s20f3", disconnected_message="W: N/A", format="{essid}", ), widget.Sep(linewidth=0), widget.Volume(), widget.Sep(linewidth=0), widget.Clock(format="%a, %H:%M (%d/%m)", update_interval=60), widget.Sep(linewidth=0), ] return widgets_list
def screen_widget(): if num_monitors > 1: return widget.CurrentScreen(**widget_theme, active_color=colors[4], active_text='||', inactive_text='||', inactive_color=colors[3]) else: return widget.Spacer(background=colors[0], length=10)
def widgets_left(): return [ widget.GroupBox( rounded=False, use_mouse_wheel=False, disable_drag=True, foreground=theme.groups["fg"], background=theme.groups["bg"], highlight_method="line", highlight_color=theme.groups["bg"], active=theme.groups["active_fg"], inactive=theme.groups["inactive_fg"], this_current_screen_border=theme.groups["current_screen_bg"], this_screen_border=theme.groups["current_screen_bg"], other_screen_border=theme.groups["other_screens_bg"], other_current_screen_border=theme.groups["other_screens_bg"], urgent_alert_method="text", urgent_text="#f44747", margin_y=5, ), widget.Sep(**sep_defaults), widget.CurrentScreen( font="Material Icons", padding=5, active_text="\ue055", inactive_text="\ue055", active_color=theme.screen_indicator["active_fg"], inactive_color=theme.screen_indicator["inactive_fg"], ), custom_widget.ChordStatus( font="Material Icons", padding=5, active_text="\ue312", inactive_text="\ue312", active_color=theme.screen_indicator["active_fg"], inactive_color=theme.screen_indicator["inactive_fg"], ), widget.Sep(**sep_defaults), widget.CurrentLayout( foreground=theme.layout_indicator["fg"], background=theme.layout_indicator["bg"], ), widget.Sep(**sep_defaults), widget.WindowName( width=500, padding=10, show_state=False, max_chars=60, format="{name}", foreground=theme.windows["title_fg"], background=theme.windows["title_bg"], ), ]
def init_widgets(): return [ widget.GroupBox( font='Hack Bold', highlight_method='block', active=colors[2], inactive=colors[11], padding=0, ), widget.Prompt(), #widget.WindowName(), widget.Spacer(), widget.Systray(icon_size=20, padding=2), widget.Sep(), widget.CurrentScreen(), widget.Sep(), widget.Volume(foreground=colors[2]), widget.Sep(background=colors[0], padding=2), widget.CPUGraph(width=30, border_width=1, border_color="#000000", frequency=5, line_width=1, samples=50), widget.MemoryGraph( width=30, border_width=1, border_color="#000000", frequency=5, line_width=1, ), widget.NetGraph( width=30, border_width=1, border_color="#000000", frequency=5, line_width=1, ), widget.Sep(background=colors[0], padding=2), widget.Memory(foreground=colors[2]), widget.Sep(background=colors[0], padding=2), widget.Clock(foreground=colors[2], format='%a %d %b %I:%M %p'), widget.CurrentLayoutIcon(foreground=colors[2]), ]
def init_screens(): widgetSets=[] screens=[] for i in range(0, numScreen ): widgetSets.append( [ widget.CurrentScreen(), widget.GroupBox(highlight_method="block",urgent_alert_method='text'), widget.CurrentLayout(), widget.Notify(audiofile= "/usr/share/skype/sounds/ChatOutgoing.wav", foreground_urgent="EE0000", foreground_low="dddddd", default_timeout=60, foreground="FF0000", fontsize=18, font="Ubuntu"), widget.Clock(format='%Y-%m-%d %a %H:%M %p', foreground='00FF7F'), widget.TextBox(text="Dim:"), widget.Backlight(brightness_file='/sys/class/backlight/intel_backlight/brightness', max_brightness_file='/sys/class/backlight/intel_backlight/max_brightness', ), widget.TextBox(text="Bat:"), widget.Battery(), widget.BatteryIcon(), widget.TextBox(text="Vol:"), widget.Volume(), widget.TextBox(text="C"), widget.CPUGraph(samples=100, width=200), widget.TextBox(text="D"), widget.NetGraph(samples=100, width=200, interface=network), widget.TextBox(text="U"), widget.NetGraph(samples=100, width=200, interface=network, bandwidth_type="up"), widget.TextBox(text="M"), widget.MemoryGraph(samples=100, width=200), ]) # truncate the last widget, and add on the systray, if we #widgetSets[ numScreen - 1 ] = widgetSets[ numScreen - 1 ][0:3] widgetSets[ numScreen - 1 ].insert( 0, widget.Systray() ) for i in range(0, numScreen ): screens.append( Screen(top = bar.Bar( widgetSets[ i ] , 30)) ) return(screens)
def test_change_screen(manager_nospawn, minimal_conf_noscreen): cswidget = widget.CurrentScreen(active_color=ACTIVE, inactive_color=INACTIVE) config = minimal_conf_noscreen config.screens = [ libqtile.config.Screen(top=libqtile.bar.Bar([cswidget], 10)), libqtile.config.Screen() ] manager_nospawn.start(config) w = manager_nospawn.c.screen[0].bar["top"].info()["widgets"][0] assert w["text"] == "A" assert w["foreground"] == ACTIVE manager_nospawn.c.to_screen(1) w = manager_nospawn.c.screen[0].bar["top"].info()["widgets"][0] assert w["text"] == "I" assert w["foreground"] == INACTIVE
def WidgetList(): return [ widget.GroupBox(font='Perfect DOS VGA 437 Win', fontsize=16, foreground=colors['white'], active=colors['white'], inactive=colors['black'], highlight_method='block', urgent_alert_method='block', block_highlight_text_color=colors['black'], this_screen_border=colors['white'], this_current_screen_border=colors['white'], rounded=False, padding=5, margin_x=0, margin_y=3, disable_drag=True, use_mouse_wheel=False), widget.CurrentScreen(font='Perfect DOS VGA 437 Win', fontsize=16, padding=7), widget.CurrentLayout(font='Perfect DOS VGA 437 Win', fontsize=16, foreground=colors['white'], padding=7), widget.Spacer(), widget.Notify(font='Perfect DOS VGA 437 Win', fontsize=16, padding=7), widget.Volume(font='Perfect DOS VGA 437 Win', fontsize=16, foreground=colors['white'], padding=7, fmt='Volume{}'), widget.Clock(font='Perfect DOS VGA 437 Win', fontsize=16, foreground=colors['white'], padding=7, format='%Y-%m-%d %a %I:%M %p') ]
def get_bar(): return bar.Bar( [ widget.CurrentScreen(), widget.Sep(), widget.GroupBox(disable_drag=True), widget.Sep(), widget.CurrentLayout(), widget.Sep(), widget.Chord( chords_colors={ 'launch': ("#ff0000", "#ffffff"), }, name_transform=lambda name: name.upper(), ), widget.Prompt(), widget.TaskList(), widget.BatteryIcon(battery=1), #widget.Systray(), widget.Clock(format='%a %d %b %H:%M '), ], 24, )
) groups.extend([ Group('g', layouts=[layout.Max()]), ]) widget_defaults = dict( font='Arial', fontsize=16, padding=3, ) main_bar = bar.Bar( [ widget.CurrentScreen( active_text="Arch", inactive_text="-", ), widget.GroupBox( background=l_blue, foreground=black, center_aligned=True, highlight_color=[red, 'ffffff'], highlight_method="block", ), widget.CurrentLayout( background=l_gray, foreground=black ), widget.Prompt( background=yellow, foreground=gray,
def primary_bar(): return bar.Bar( widgets=[ widget.CurrentLayoutIcon( custom_icon_paths=[ os.path.expanduser('~/.config/qtile/icons') ], scale=0.66, ), widget.GroupBox( padding_x=10, spacing=5, disable_drag=True, use_mouse_wheel=False, background=palette[1], inactive=palette[3], highlight_color=palette[10], highlight_method='line', this_current_screen_border=palette[13], other_current_screen_border=palette[13], this_screen_border=palette[10], other_screen_border=palette[10], ), widget.CurrentScreen(active_color=palette[14], active_text='\uF62E', inactive_color=palette[11], inactive_text='\uF62F'), widget.WindowName(for_current_screen=True), widget.GenPollText(func=mpris, update_interval=1, mouse_callbacks={'Button1': play_toggle}), separator(palette[10], palette[1]), widget.Systray(background=palette[10], icon_size=32, padding=10), separator(palette[9], palette[10]), widget.GenPollText(func=weather, update_interval=1200, mouse_callbacks={'Button1': weather}, background=palette[9]), separator(palette[10], palette[9]), # widget.GenPollText(func=memory_usage, # update_interval=1, # background=palette[10]), # separator(palette[9], palette[10]), # widget.CPU(format='\uF9C4 {load_percent}%', background=palette[9]), # separator(palette[10], palette[9]), widget.TextBox(text='\uF027', background=palette[10]), widget.Volume(step=5, background=palette[10]), separator(palette[9], palette[10]), widget.Battery(battery=1, format='{char} {percent:2.0%}', charge_char='\uF583', discharge_char='\uF57D', full_char='\uF578', empty_char='\uF58D', unknown_char='\uF578', update_interval=1, background=palette[9]), separator(palette[10], palette[9]), widget.Clock(format='\uF5ED %a %b %d', background=palette[10], mouse_callbacks={'Button1': open_calendar}), separator(palette[9], palette[10]), widget.Clock(format='\uF017 %I:%M %p', background=palette[9]), separator(palette[1], palette[9]), ], size=36, background=palette[1], )
screens = [ Screen( bottom=bar.Bar( [ widget.GroupBox(), widget.Prompt(), widget.WindowName(), widget.Systray(icon_size=32), widget.BatteryIcon(fontsize=12), widget.Clock(format='%b %d %Y %I:%M %p'), ], 40, ), top=bar.Bar( [widget.CurrentScreen(active_text="*" * 200, inactive_text="")], 20, ), ), Screen(top=bar.Bar( [widget.CurrentScreen(active_text="*" * 200, inactive_text="")], 20, ), ), Screen(top=bar.Bar( [widget.CurrentScreen(active_text="*" * 200, inactive_text="")], 20, ), ), ] # Drag floating layouts. mouse = [
widget.GroupBox( **widget_defaults, **color_scheme, ), separator(), widget.Spacer( length=16, **color_scheme, ), widget.WindowName( **widget_defaults, **color_scheme, ), separator(right_looking=False), widget.CurrentScreen(**widget_defaults, **color_scheme, active_text="active", inactive_text="inactive"), ] screens = [ Screen(bottom=bar.Bar( bar_widgets, 24, ), ), ] def get_num_monitors(): num_monitors = 0 try: display = xdisplay.Display()
top_bar = True bottom_bar = False def _get_interface(): with open('/proc/net/dev', 'r') as f: for line in f: info = line.split() if len(info) > 10 and info[0] not in ['lo:', 'face'] and float(info[1]) > 0: return info[0][:-1] interface = _get_interface() top_bars = [ bar.Bar([ widget.CurrentScreen( active_color=colors['color'][13], ), widget.Sep(padding=8, linewidth=2), widget.GroupBox(borderwidth=0, padding=3, margin=0, highlight_method='block', this_current_screen_border=colors['color'][1], urgent_border=colors['color'][9], active=colors['color'][13], inactive=colors['color'][12]), widget.Prompt(), widget.TaskList(highlight_method='block', urgent_border=colors['color'][9], icon_size=0, border=colors['color'][10], foreground=colors['color'][7], ),
def make_widgets(): top_widgets = [ left_corner(**colorset1), widget.CurrentScreen(active_color=colors['magenta'], inactive_color=colors['BGbase'], inactive_text='N', **colorset2), right_corner(**colorset1), separator(), left_corner(**colorset1), widget.CurrentLayout(fmt='{:.3}', **colorset2), right_corner(**colorset1), separator(), left_corner(**colorset4), widget.GroupBox(this_current_screen_border=colors['cyan'], borderwidth=BORDERWIDTH, **colorset3, active=colors['white']), right_corner(**colorset4), ] if not laptop: top_widgets += [ separator(), left_corner(**colorset1), widget.CPU(format=' {load_percent:0=4.1f}%', **colorset2), right_corner(**colorset1), widget.Memory(format=' {MemUsed:0=4.1f}{mm}/{MemTotal: .1f}{mm}', measure_mem='G', measure_swap='G', **colorset1), right_corner(**colorset2), widget.DF(format=" {uf}{m}/{s}{m} ({r:.0f}%)", visible_on_warn=False, partition='/home', **colorset2), right_corner(**colorset1), ] top_widgets += [ separator(), widget.Chord(**colorset6), widget.Spacer(), left_corner(**colorset1), widget.Clock(format='%Y-%m-%d %a %H:%M:%S', **colorset2), right_corner(**colorset1), ] if laptop: top_widgets += [widget.Spacer()] else: top_widgets += [ separator(), left_corner(**colorset4), widget.TaskList(border=colors['BGbase'], borderwidth=BORDERWIDTH, max_title_width=120, **colorset3), right_corner(**colorset4), separator() ] top_widgets += [ left_corner(**colorset1), widget.Net(format='{down} ↓↑ {up}', **colorset2), right_corner(**colorset1), widget.PulseVolume(fmt=' {}', limit_max_volume=True, volume_app='pavucontrol', update_interval=0.1, **colorset1), right_corner(**colorset2), ] if laptop: backlight = list(Path('/sys/class/backlight/').glob('*')) top_widgets += [ widget.Backlight(fmt=' {}', backlight_name=backlight[0], **colorset2), right_corner(**colorset1), widget.Battery(format='{char} {percent:2.0%}', charge_char='', discharge_char='', empty_char='', **colorset1), right_corner(**colorset2), ] top_widgets += [ widget.CheckUpdates(display_format=' {updates}', distro='Arch_checkupdates', colour_have_updates=colors['magenta'], colour_no_updates=colors['BGbase'], update_interval=60 * 60, no_update_string=' 0', **colorset2), right_corner(**colorset1) ] if laptop: bottom_bar = bar.Bar( [ separator(), left_corner(**colorset7), widget.CPU(format=' {load_percent:0=4.1f}%', **colorset2), right_corner(**colorset1), widget.Memory( format=' {MemUsed:0=4.1f}{mm}/{MemTotal: .1f}{mm}', measure_mem='G', measure_swap='G', **colorset1), right_corner(**colorset2), widget.DF(format=" {uf}{m}/{s}{m} ({r:.0f}%)", visible_on_warn=False, partition='/home', **colorset2), right_corner(**colorset7), widget.Spacer(), left_corner(**colorset5), widget.TaskList(border=colors['cyan'], borderwidth=BORDERWIDTH, max_title_width=120, **colorset6), right_corner(**colorset5), widget.Spacer(), ], font_size, background=colors['clear'], border_color=colors['cyan'], opacity=1, ) else: bottom_bar = None return top_widgets, bottom_bar
keyboard_widget = widget.KeyboardLayout(configured_keyboards=['gb', 'es']) volume_widget = widget.Volume(mute_command=mute_command, volume_up_command=volume_up_command, volume_down_command=volume_down_command, get_volume_command=get_volume_command) screens = [ Screen( wallpaper='/home/javi/Pictures/wallpapers/retro_game.jpg', wallpaper_mode='fill', top=bar.Bar( [ widget.CurrentLayout(), widget.GroupBox(), widget.CurrentScreen(active_text='ACTIVE', inactive_text='INACTIVE'), widget.Prompt(), widget.WindowName(), widget.Chord( chords_colors={ 'launch': ("#ff0000", "#ffffff"), }, name_transform=lambda name: name.upper(), ), widget.CheckUpdates( distro='Ubuntu', update_interval=3600, execute=terminal + ' -e "/home/javi/.config/qtile/bin/sysupdate.sh"', colour_have_updates='ff0000' ), #(Added "/usr/bin/aptitude update &" in /etc/cron.daily/aptitude"
def init_widgets_list(): prompt = "{0}@{1}: ".format(os.environ["USER"], socket.gethostname()) widgets_list = [ # workspaces ########################################################## widget.GroupBox( margin_y=3, margin_x=0, padding_y=6, padding_x=5, borderwidth=0, disable_drag=True, highlight_method="text", fontsize=16, this_current_screen_border=colors[4], active=colors[5], inactive=colors[8], ), widget.Sep( linewidth=sep_linewidth, padding=sep_padding, ), # layout section ###################################################### widget.CurrentLayoutIcon(scale=0.7, ), widget.CurrentLayout(font="Noto Sans Bold", ), widget.Sep( linewidth=sep_linewidth, padding=sep_padding, ), # window name section ################################################# widget.CurrentScreen( font="FontAwesome", active_text="", inactive_text="", active_color=colors[8], inactive_color=colors[8], ), widget.WindowName(), # updates ############################################################# # widget.TextBox( # font = "FontAwesome", # fontsize = 16, # text = " ", # padding = 0, # foreground = colors[5], # ), widget.Image( filename="~/.config/qtile/icons/updates.png", margin=icon_margin, ), widget.CheckUpdates( custom_command="checkupdates", display_format="{updates}", no_update_string="0", update_interval=1800, ), widget.Sep( linewidth=sep_linewidth, padding=sep_padding, ), # # battery ############################################################# # widget.TextBox( # # font = "FontAwesome", # # fontsize = 16, # # text = " ", # # padding = 0, # # foreground = colors[4], # # ), # widget.Image( # filename = "~/.config/qtile/icons/battery.png", # margin = icon_margin, # ), # widget.Battery( # #hide_threshold = 0.9, # doesnt hide icon # low_percentage = 0.2, # notify_below = 0.25, # charge_char = "∧", # discharge_char = "∨", # full_string = "full", # update_interval = 10, # background = colors[9], # ), # widget.Sep( # linewidth = sep_linewidth, # padding = sep_padding, # ), # cpu ################################################################# # widget.TextBox( # font = "FontAwesome", # fontsize = 16, # text = " ", # padding = 0, # foreground = colors[5], # ), widget.Image( filename="~/.config/qtile/icons/cpu.png", margin=icon_margin, ), widget.CPU( format="{load_percent}%", update_interval=2, ), widget.Sep( linewidth=sep_linewidth, padding=sep_padding, ), # temperature ######################################################### # widget.TextBox( # font = "FontAwesome", # fontsize = 16, # text = " ", # padding = 0, # foreground = colors[5], # ), widget.Image( filename="~/.config/qtile/icons/temperature.png", margin=icon_margin, ), widget.ThermalSensor( threshold=70, foreground=colors[8], foreground_alert=colors[1], ), widget.Sep( linewidth=sep_linewidth, padding=sep_padding, ), # memory ############################################################## # widget.TextBox( # font = "FontAwesome", # fontsize = 16, # text = " ", # padding = 0, # foreground = colors[4], # ), widget.Image( filename="~/.config/qtile/icons/memory.png", margin=icon_margin, ), widget.Memory( format="{MemUsed:.1f}G", measure_mem="G", update_interval=1, ), widget.Sep( linewidth=sep_linewidth, padding=sep_padding, ), # clock ############################################################### # widget.TextBox( # font = "FontAwesome", # fontsize = 16, # text = " ", # padding = 0, # foreground = colors[4], # ), widget.Image( filename="~/.config/qtile/icons/clock.png", margin=icon_margin, ), widget.Clock(format="%H:%M", ), widget.Sep( linewidth=sep_linewidth, padding=sep_padding, ), # systray ############################################################# widget.Systray(icon_size=20, ), ] return widgets_list
padding=2, ) icon_defaults = dict( font=font_name, fontsize=26, padding=2, ) screens = [ Screen( top=bar.Bar( [ widget.Spacer(length=10), widget.CurrentLayoutIcon( scale=0.7, foreground=FG, **icon_defaults), widget.CurrentScreen( active_color=GREEN, inactive_color=RED, **widget_defaults), widget.Spacer(length=10), widget.GroupBox(borderwidth=2, active=FG, inactive=BG3, this_current_screen_border=FG, this_screen_border=FG, other_current_screen_border=FG4, other_screen_border=FG4, font=icon_defaults['font'], fontsize=icon_defaults['fontsize'], highlight_method='line', highlight_color=BG), widget.Prompt(**widget_defaults), # widget.Spacer(length=30),
widget.Battery(background=color_yellow, charge_char=u'↑', discharge_char=u'↓'), widget.Backlight( background=color_red, backlight_name='intel_backlight', ), widget.ThermalSensor(background=color_magenta), widget.Wlan(interface='wlp59s0', background=color_cyan), widget.Volume(background=color_blue), widget.Systray(icon_size=dpToPx(30), padding=dpToPx(3)), widget.Clock(format='%Y-%m-%d %a %H:%M'), widget.CurrentScreen( active_text='●', inactive_text='○', fontsize=dpToPx(30), active_color=color_green, inactive_color=color_red, ), ], dpToPx(30), ), ), ] # Drag floating layouts. mouse = [ Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()), Drag([mod],
def init_widgets(self): allhosts = ["bifrost", "walhall"] hosts_and_widgets = [ [ allhosts, "allMonitors", widget.CurrentScreen( active_text="", active_color="FF0000", inactive_text="", inactive_color="222222", font="Ubuntu Mono Nerd Font", fontsize=16, ) ], [ allhosts, "allMonitors", widget.Sep(linewidth=1, padding=5), ], [ allhosts, "allMonitors", widget.GroupBox( highlight_method='line', this_screen_border='805300', this_current_screen_border='805300', active='e69500', inactive='555555', font="Ubuntu Mono Nerd Font", fontsize=16, ), ], [ allhosts, "allMonitors", widget.Sep(linewidth=1, padding=5), ], [ allhosts, "allMonitors", widget.TaskList(highlight_method="block", fontsize=12, border='805300', font="Ubuntu Mono Nerd Font"), ], [ allhosts, "allMonitors", widget.Sep(linewidth=1, padding=5), ], [ allhosts, "allMonitors", widget.TextBox(""), ], [ allhosts, "allMonitors", widget.CPUGraph( fill_color="e69500.3", graph_color='e69500', border_color='805300', font="Ubuntu Mono Nerd Font", fontsize=16, ), ], [ allhosts, "allMonitors", widget.TextBox(""), ], [ allhosts, "allMonitors", widget.MemoryGraph( fill_color="e69500.3", graph_color='e69500', border_color='805300', font="Ubuntu Mono Nerd Font", fontsize=16, ), ], # [ # allhosts, # # widget.TextBox(""), # ], # [ # allhosts, # # widget.NetGraph( # # fill_color = "e69500.3", # # graph_color = 'e69500', # # border_color = '805300' # # ), # ], [ allhosts, "allMonitors", widget.Sep(linewidth=1, padding=5), ], [ allhosts, "allMonitors", widget.CurrentLayout( font="Ubuntu Mono Nerd Font", fontsize=16, ), ], # [ # allhosts, # # widget.CurrentLayoutIcon( # custom_icon_paths = '/home/loki/.icons/layout-icons/' # ), # ], [ allhosts, "allMonitors", widget.Sep( padding=5, linewidth=1, ), ], [ allhosts, "primary", widget.Systray(padding=5), ], [ allhosts, "primary", widget.Sep( padding=5, linewidth=1, ), ], # [ # allhosts, # #widget.BatteryIcon( # # fontsize = 0, # #theme_path = '/home/loki/.icons/', # # update_interval = 5 # #), # ], [ ["bifrost"], "allMonitors", widget.GenPollText( func=Function.poll_battery, update_interval=5, font="Ubuntu Mono Nerd Font", fontsize=16, ), ], [ ["bifrost"], "allMonitors", widget.Sep(linewidth=1, padding=5), ], [ allhosts, "allMonitors", widget.GenPollText( func=Function.poll_volume, update_interval=5, font="Ubuntu Mono Nerd Font", fontsize=16, ), ], [ allhosts, "allMonitors", widget.Sep(linewidth=1, padding=5), ], [ ["bifrost"], "allMonitors", widget.GenPollText( func=Function.poll_brightness, update_interval=5, font="Ubuntu Mono Nerd Font", fontsize=16, ), ], [ ["bifrost"], "allMonitors", widget.Sep(linewidth=1, padding=5), ], [ allhosts, "allMonitors", widget.Clock( format="%Y-%m-%d - %H:%M:%S", font="Ubuntu Mono Nerd Font", fontsize=16, ) ] ] widgets = [] for i in hosts_and_widgets: if self.hostname in i[0]: if self.primaryMonitor: widgets.append(i[2]) elif i[1] == "allMonitors": widgets.append(i[2]) return widgets
## # @brief count_screen 计算我链接了几个屏幕 # # @return 链接屏幕的数量 def count_screen(): (st, _) = subprocess.Popen(['xrandr', '-q'], stdout=subprocess.PIPE, shell=True).communicate() return len(list(filter(lambda x: " connected" in x, str(st).split('\\n')))) screens = [ Screen(bottom=bar.Bar( widgets=[ widget.AGroupBox(), widget.CurrentScreen(), widget.GroupBox(invert_mouse_wheel=False, center_aligned=True, spacing=0, highlight_method='block', inactive='999999'), widget.currentlayout.CurrentLayout(), widget.currentscreen.CurrentScreen(), widget.Prompt(), widget.WindowName(), widget.Net(interface='wlan0'), widget.Memory(fmt="{MemAvailable}M/{MemTotal}M", update_interval=10), widget.volume.Volume(), widget.battery.Battery(low_percentage=0.3), widget.backlight.Backlight(backlight_name='intel_backlight'),
def funk(): return subprocess.check_output( ['curl', 'https://wttr.in/Foz+do+Iguacu?format=%c%f'] ).decode('utf-8') def uname(): return subprocess.check_output(['uname', '-r']).decode('utf-8') dnlBar = [ widget.CurrentLayoutIcon(background=colors['color0'],scale=.7), widget.CurrentScreen( 26, font="mono", active_color=colors['color8'], inactive_color=colors['color7'], padding=12 ), widget.GroupBox( hide_unused=True, margin=2.5, highlight_method='block', urgent_alert_methods='block', this_current_screen_border=colors['color2'], this_screen_border=colors['color2'] ), widget.WindowName(padding=12,background=colors['color0']), widget.Prompt(),