from pathlib import Path from libqtile import bar, widget from colors import theme, border_color icon_theme_path = Path.home() / '{{ icon_dir | replace(user_dir + '/', '') }}' bar_size = 36 groupbox = { 'center_aligned': True, 'foreground': theme['very_light_white'], 'inactive': theme['gray'], 'other_current_screen_border': theme['gray'], 'this_current_screen_border': theme['dark_blue'], 'this_screen_border': theme['dark_blue'], 'urgent_border': theme['red'], 'urgent_text': theme['red']} sep = { 'linewidth': 2, 'size_percent': 100, 'padding': 12} soft_sep = { 'linewidth': 2, 'size_percent': 70, 'foreground': theme['dark_gray'], 'padding': 7} tasklist = { 'border': border_color, 'max_title_width': 200, 'txt_floating': '🗗', 'txt_maximized': '🗖', 'txt_minimized': '🗕'} volume = {'theme_path': icon_theme_path} clock = { 'timezone': 'Europe/Paris', 'format': '%B %-d, %H:%M'} music = widget.Mpris2( background=theme['dark_blue'], name='spotify', scroll_chars=0, stop_pause_text='', display_metadata=['xesam:title', 'xesam:artist'], objname="org.mpris.MediaPlayer2.spotify") disk = widget.DF( update_interval=3600, warn_space=5, format=' {p} ({uf}{m})') updates = widget.CheckUpdates( distro='Arch_checkupdates', display_format=' {updates}', execute='termite -e "pikaur -Syu"', colour_have_updates=theme['dark_blue'], colour_no_updates=theme['dark_green'], update_interval=600) battery = widget.Battery( foreground=theme['green'], low_percentage=0.10, low_foreground=theme['red'], update_delay=10, format='{percent:.0%} {hour:d}:{min:02d} {watt:.2}W') battery_icon = widget.BatteryIcon( theme_path=icon_theme_path, update_interval=120) systray = widget.Systray( icon_size=24 ) main_bar = bar.Bar( [ widget.GroupBox(**groupbox, visible_groups=['a', 's', 'd', 'f', 'music', 'chat', 'game']), widget.Sep(**sep), widget.Volume(**volume), music, widget.TaskList(**tasklist), systray, widget.Sep(**sep), disk, updates, widget.Sep(**soft_sep), battery_icon, battery, widget.Sep(**soft_sep), widget.Clock(**clock), ], bar_size) bar1 = bar.Bar( [ widget.GroupBox(**groupbox, visible_groups=['a', 's', 'd', 'f', 'game']), widget.Sep(**sep), widget.Volume(**volume), music, widget.TaskList(**tasklist), systray, widget.Sep(**sep), disk, updates, widget.Sep(**soft_sep), widget.Clock(**clock), ], bar_size) bar2 = bar.Bar( [ widget.GroupBox(**groupbox, visible_groups=['u', 'i', 'o', 'p', 'music', 'chat']), widget.Sep(**sep), widget.Volume(**volume), widget.TaskList(**tasklist), battery_icon, battery, widget.Sep(**soft_sep), widget.Clock(**clock), ], bar_size)