Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##### IMPORTS #####
- import os
- import subprocess
- import socket
- import re
- from libqtile.config import Key, Screen, Group, Drag, Click
- from libqtile.lazy import lazy
- from libqtile import layout, bar, widget, hook
- from typing import List # noqa: F401
- ##### CONFIG #####
- mod = "mod4" # Sets mod key to SUPER/WINDOWS
- myTerm = "alacritty" # My terminal of choice
- myConfig = "/home/apoorv/.config/qtile/config.py" # The Qtile config file location
- ##### KEYBINDINGS #####
- keys = [
- # Switch between windows in current stack pane
- Key([mod], "k", lazy.layout.down()),
- Key([mod], "j", lazy.layout.up()),
- # Move windows up or down in current stack
- Key([mod, "control"], "k", lazy.layout.shuffle_down()),
- Key([mod, "control"], "j", lazy.layout.shuffle_up()),
- # Switch window focus to other pane(s) of stack
- Key([mod], "space", lazy.layout.next()),
- # Swap panes of split stack
- Key([mod, "shift"], "space", lazy.layout.rotate()),
- # Toggle between split and unsplit sides of stack.
- # Split = all windows displayed
- # Unsplit = 1 window displayed, like Max layout, but still with
- # multiple stack panes
- Key([mod, "shift"], "Return", lazy.layout.toggle_split()),
- Key([mod], "Return", lazy.spawn("alacritty")),
- # Toggle between different layouts as defined below
- Key([mod], "Tab", lazy.next_layout()),
- Key([mod], "w", lazy.window.kill()),
- Key([mod, "control"], "r", lazy.restart()),
- Key([mod, "control"], "q", lazy.shutdown()),
- Key([mod], "r", lazy.spawncmd()),
- ]
- ##### WORKSPACES #####
- group_names = [("WWW", {'layout': 'monadtall'}),
- ("DEV", {'layout': 'monadtall'}),
- ("SYS", {'layout': 'monadtall'}),
- ("DOC", {'layout': 'monadtall'}),
- ("VBOX", {'layout': 'monadtall'}),
- ("CHAT", {'layout': 'monadtall'}),
- ("MUS", {'layout': 'monadtall'}),
- ("VID", {'layout': 'monadtall'}),
- ("GFX", {'layout': 'floating'})]
- groups = [Group(name, **kwargs) for name, kwargs in group_names]
- for i, (name, kwargs) in enumerate(group_names, 1):
- keys.append(Key([mod], str(i), lazy.group[name].toscreen())) # Switch to another group
- keys.append(Key([mod, "shift"], str(i), lazy.window.togroup(name))) # Send current window to another group
- ##### LAYOUT SETTINGS #####
- layout_theme = {"border_width": 2,
- "margin": 6,
- "border_focus": "e1acff",
- "border_normal": "1D2330"
- }
- ##### LAYOUTS #####
- layouts = [
- layout.Max(**layout_theme),
- layout.MonadTall(**layout_theme),
- layout.MonadWide(**layout_theme),
- layout.Floating(**layout_theme),
- # layout.RatioTile(),
- ]
- ##### WIDGET COLORS #####
- colors = [["#d2e6f1", "#d2e6f1"], # panel background
- ["#434758", "#434758"], # background for current screen tab
- ["#ffffff", "#ffffff"], # font color for group names
- ["#ff5555", "#ff5555"], # border line color for current tab
- ["#8d62a9", "#8d62a9"], # border line color for other tab and odd widgets
- ["#668bd7", "#668bd7"], # color for the even widgets
- ["#e1acff", "#e1acff"]] # window name
- ##### PROMPT #####
- prompt = "{0}@{1}: ".format(os.environ["USER"], socket.gethostname())
- ##### WIDGET SETTINGS #####
- widget_defaults = dict(
- font='sans',
- fontsize=12,
- padding=2,
- background=colors[2]
- )
- extension_defaults = widget_defaults.copy()
- ##### WIDGETS #####
- def init_widgets_list():
- widgets_list = [
- [ widget.Sep(
- linewidth = 0,
- padding = 6,
- foreground = colors[2],
- background = colors[0]
- ),
- widget.GroupBox(font="Ubuntu Bold",
- fontsize = 9,
- margin_y = 3,
- margin_x = 0,
- padding_y = 5,
- padding_x = 5,
- borderwidth = 3,
- active = colors[2],
- inactive = colors[2],
- rounded = False,
- highlight_color = colors[1],
- highlight_method = "line",
- this_current_screen_border = colors[3],
- this_screen_border = colors [4],
- other_current_screen_border = colors[0],
- other_screen_border = colors[0],
- foreground = colors[2],
- background = colors[0]
- ),
- widget.Prompt(
- prompt=prompt,
- font="Ubuntu Mono",
- padding=10,
- foreground = colors[3],
- background = colors[1]
- ),
- widget.Sep(
- linewidth = 0,
- padding = 40,
- foreground = colors[2],
- background = colors[0]
- ),
- widget.WindowName(
- foreground = colors[6],
- background = colors[0],
- padding = 0
- ),
- widget.TextBox(
- text='',
- background = colors[0],
- foreground = colors[4],
- padding=0,
- fontsize=37
- ),
- widget.TextBox(
- text=" ₿",
- padding = 0,
- foreground=colors[2],
- background=colors[4],
- fontsize=12
- ),
- widget.BitcoinTicker(
- foreground=colors[2],
- background=colors[4],
- padding = 5
- ),
- widget.TextBox(
- text='',
- background = colors[4],
- foreground = colors[5],
- padding=0,
- fontsize=37
- ),
- widget.TextBox(
- text=" 🌡",
- padding = 2,
- foreground=colors[2],
- background=colors[5],
- fontsize=11
- ),
- widget.ThermalSensor(
- foreground=colors[2],
- background=colors[5],
- padding = 5
- ),
- widget.TextBox(
- text='',
- background = colors[5],
- foreground = colors[4],
- padding=0,
- fontsize=37
- ),
- widget.TextBox(
- text=" ⟳",
- padding = 2,
- foreground=colors[2],
- background=colors[4],
- fontsize=14
- ),
- widget.Pacman(
- execute = "alacritty",
- update_interval = 1800,
- foreground = colors[2],
- background = colors[4]
- ),
- widget.TextBox(
- text="Updates",
- padding = 5,
- foreground=colors[2],
- background=colors[4]
- ),
- widget.TextBox(
- text='',
- background = colors[4],
- foreground = colors[5],
- padding=0,
- fontsize=37
- ),
- widget.TextBox(
- text=" 🖬",
- foreground=colors[2],
- background=colors[5],
- padding = 0,
- fontsize=14
- ),
- widget.Memory(
- foreground = colors[2],
- background = colors[5],
- padding = 5
- ),
- widget.TextBox(
- text='',
- background = colors[5],
- foreground = colors[4],
- padding=0,
- fontsize=37
- ),
- widget.Net(
- interface = "wlp13s0",
- format = '{down} ↓↑ {up}',
- foreground = colors[2],
- background = colors[4],
- padding = 5
- ),
- widget.TextBox(
- text='',
- background = colors[4],
- foreground = colors[5],
- padding=0,
- fontsize=37
- ),
- widget.TextBox(
- text=" Vol:",
- foreground=colors[2],
- background=colors[5],
- padding = 0
- ),
- widget.Volume(
- foreground = colors[2],
- background = colors[5],
- padding = 5
- ),
- widget.TextBox(
- text='',
- background = colors[5],
- foreground = colors[4],
- padding=0,
- fontsize=37
- ),
- widget.CurrentLayoutIcon(
- custom_icon_paths=[os.path.expanduser("~/.config/qtile/icons")],
- foreground = colors[0],
- background = colors[4],
- padding = 0,
- scale=0.7
- ),
- widget.CurrentLayout(
- foreground = colors[2],
- background = colors[4],
- padding = 5
- ),
- widget.TextBox(
- text='',
- background = colors[4],
- foreground = colors[5],
- padding=0,
- fontsize=37
- ),
- widget.Clock(
- foreground = colors[2],
- background = colors[5],
- format="%A, %B %d [ %H:%M ]"
- ),
- widget.Sep(
- linewidth = 0,
- padding = 10,
- foreground = colors[0],
- background = colors[5]
- ),
- widget.Systray(
- background=colors[0],
- padding = 5
- ),
- ],
- ]
- return widgets_list
- ##### BAR #####
- def init_widgets_screen():
- widgets_screen = init_widgets_list()
- return widgets_screen
- def init_screens() :
- return [Screen(top=bar.Bar(widgets=init_widgets_screen(), opacity=0.95, size=20))]
- if __name__ in ["config", "__main__"]:
- screens = init_screens()
- widgets_list = init_widgets_list()
- widget_screen = init_widgets_screen()
- # Drag floating layouts.
- mouse = [
- Drag([mod], "Button1", lazy.window.set_position_floating(),
- start=lazy.window.get_position()),
- Drag([mod], "Button3", lazy.window.set_size_floating(),
- start=lazy.window.get_size()),
- Click([mod], "Button2", lazy.window.bring_to_front())
- ]
- dgroups_key_binder = None
- dgroups_app_rules = [] # type: List
- main = None
- follow_mouse_focus = True
- bring_front_click = False
- cursor_warp = False
- floating_layout = layout.Floating(float_rules=[
- # Run the utility of `xprop` to see the wm class and name of an X client.
- {'wmclass': 'confirm'},
- {'wmclass': 'dialog'},
- {'wmclass': 'download'},
- {'wmclass': 'error'},
- {'wmclass': 'file_progress'},
- {'wmclass': 'notification'},
- {'wmclass': 'splash'},
- {'wmclass': 'toolbar'},
- {'wmclass': 'confirmreset'}, # gitk
- {'wmclass': 'makebranch'}, # gitk
- {'wmclass': 'maketag'}, # gitk
- {'wname': 'branchdialog'}, # gitk
- {'wname': 'pinentry'}, # GPG key password entry
- {'wmclass': 'ssh-askpass'}, # ssh-askpass
- ])
- auto_fullscreen = True
- focus_on_window_activation = "smart"
- ##### AUTOSTART #####
- @hook.subscribe.startup_once
- def autostart():
- home = os.path.expanduser('~/.config/qtile/autostart.sh')
- subprocess.call([home])
Add Comment
Please, Sign In to add comment