def detect_screens(qtile): while len(screens) < len(qtile.conn.pseudoscreens): screens.append( Screen(bottom=bar.Bar( [ widget.CurrentLayout(), widget.TextBox('|'), widget.AGroupBox(), ], 25, background="#042a2b", foreground="#eeeeee", )))
class FakeScreenConfig(Config): auto_fullscreen = True groups = [ libqtile.config.Group("a"), libqtile.config.Group("b"), libqtile.config.Group("c"), libqtile.config.Group("d") ] layouts = [ layout.Max(), layout.RatioTile(), layout.Tile(), ] floating_layout = libqtile.resources.default_config.floating_layout keys = [] mouse = [] fake_screens = [ Screen(bottom=bar.Bar([ widget.GroupBox(this_screen_border=CHAM3, borderwidth=1, fontsize=FONTSIZE, padding=1, margin_x=1, margin_y=1), widget.AGroupBox(), widget.Prompt(), widget.Sep(), widget.WindowName(fontsize=FONTSIZE, margin_x=6), widget.Sep(), widget.CPUGraph(**GRAPH_KW), widget.MemoryGraph(**GRAPH_KW), widget.SwapGraph(foreground='20C020', **GRAPH_KW), widget.Sep(), widget.Clock(format='%H:%M:%S %d.%manager.%Y', fontsize=FONTSIZE, padding=6), ], 24, background="#555555"), left=bar.Gap(16), right=bar.Gap(20), x=0, y=0, width=500, height=340), Screen(top=bar.Bar( [widget.GroupBox(), widget.WindowName(), widget.Clock()], 30, ), bottom=bar.Gap(24), left=bar.Gap(12), x=500, y=0, width=300, height=380), Screen(top=bar.Bar( [widget.GroupBox(), widget.WindowName(), widget.Clock()], 30, ), bottom=bar.Gap(16), right=bar.Gap(40), x=0, y=340, width=450, height=220), Screen(top=bar.Bar( [widget.GroupBox(), widget.WindowName(), widget.Clock()], 30, ), left=bar.Gap(20), right=bar.Gap(24), x=450, y=380, width=350, height=220), ] screens = []
## # @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),
class FakeScreenConfig: auto_fullscreen = True main = None groups = [ libqtile.config.Group("a"), libqtile.config.Group("b"), libqtile.config.Group("c"), libqtile.config.Group("d") ] layouts = [ layout.Max(), layout.RatioTile(), layout.Tile(), ] floating_layout = libqtile.layout.floating.Floating() keys = [] mouse = [] fake_screens = [Screen( bottom=bar.Bar( [ widget.GroupBox(this_screen_border=CHAM3, borderwidth=1, fontsize=FONTSIZE, padding=1, margin_x=1, margin_y=1), widget.AGroupBox(), widget.Prompt(), widget.Sep(), widget.WindowName( fontsize=FONTSIZE, margin_x=6), widget.Sep(), widget.CPUGraph(**GRAPH_KW), widget.MemoryGraph(**GRAPH_KW), widget.SwapGraph(foreground='20C020', **GRAPH_KW), widget.Sep(), widget.Systray(), widget.Sep(), widget.Clock(format='%H:%M:%S %d.%m.%Y', fontsize=FONTSIZE, padding=6), ], 24, background="#555555" ), x=0, y=0, width=600, height=480 ), Screen( top=bar.Bar( [ widget.GroupBox(), widget.WindowName(), widget.Clock() ], 30, ), x=600, y=0, width=300, height=580 ), Screen( top=bar.Bar( [ widget.GroupBox(), widget.WindowName(), widget.Clock() ], 30, ), x=0, y=480, width=500, height=400), Screen( bottom=bar.Bar( [ widget.GroupBox(), widget.WindowName(), widget.Clock() ], 30, ), x=500, y=580, width=400, height=400), ] screens = fake_screens
def make_agroupbox_widget(widget_foreground, firstcolour, powerline: bool): foreground = "#d19a66" background = BACKGROUND return widget.AGroupBox(foreground=foreground, background=background, borderwidth=0)