Guest User

Untitled

a guest
Jan 22nd, 2021
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.66 KB | None | 0 0
  1. import os
  2. import re
  3. import socket
  4. import subprocess
  5. from typing import List  # noqa: F401
  6. from libqtile.command import lazy
  7. from libqtile import bar, layout, widget, hook
  8. from libqtile.config import Click, Drag, Group, Key, Screen, Match, KeyChord
  9. from libqtile.lazy import lazy
  10. from libqtile.utils import guess_terminal
  11.  
  12. mod = "mod4"
  13. terminal = guess_terminal()
  14.  
  15. keys = [
  16.     # Switch between windows in current stack pane
  17.     Key([mod], "k", lazy.layout.down(),
  18.         desc="Move focus down in stack pane"),
  19.     Key([mod], "j", lazy.layout.up(),
  20.         desc="Move focus up in stack pane"),
  21.  
  22.     # Move windows up or down in current stack
  23.     Key([mod, "control"], "k", lazy.layout.shuffle_down(),
  24.         desc="Move window down in current stack "),
  25.     Key([mod, "control"], "j", lazy.layout.shuffle_up(),
  26.         desc="Move window up in current stack "),
  27.  
  28.     # Switch window focus to other pane(s) of stack
  29.     Key([mod], "space", lazy.layout.next(),
  30.         desc="Switch window focus to other pane(s) of stack"),
  31.  
  32.     # Swap panes of split stack
  33.     Key([mod, "shift"], "space", lazy.layout.rotate(),
  34.         desc="Swap panes of split stack"),
  35.  
  36.     # Toggle between split and unsplit sides of stack.
  37.     # Split = all windows displayed
  38.     # Unsplit = 1 window displayed, like Max layout, but still with
  39.     # multiple stack panes
  40.     Key([mod, "shift"], "Return", lazy.layout.toggle_split(),
  41.         desc="Toggle between split and unsplit sides of stack"),
  42.     Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
  43.  
  44.     # Toggle between different layouts as defined below
  45.     Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
  46.     Key([mod], "w", lazy.window.kill(), desc="Kill focused window"),
  47.  
  48.     Key([mod, "control"], "r", lazy.restart(), desc="Restart qtile"),
  49.     Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown qtile"),
  50.     Key([mod], "r", lazy.spawncmd(),
  51.         desc="Spawn a command using a prompt widget"),
  52. ]
  53.  
  54. groups = [
  55.         Group("1", label='GEN', matches=[Match(wm_class=["firefox"])]),
  56.         Group("2", label='DEV', matches=[Match(wm_class=["zathura"])]),
  57.         Group("3", label='CHT', matches=[Match(wm_class=["discord"])]),
  58.         Group("4", label='SYS', matches=[Match(wm_class=["ranger", "pcmanfm", "pavucontrol"])]),
  59.         Group("5", label='MUS', matches=[Match(wm_class=["spotify"])]),
  60.     Group("6", label='GAME', matches=[Match(wm_class=["steam"])]),
  61. ]
  62.  
  63. for i in groups:
  64.     keys.extend([
  65.  
  66.                 Key([mod], i.name,
  67.                 lazy.group[i.name].toscreen(),
  68.                 desc="Switch to group {}".format(i.name)),
  69.  
  70.                 Key([mod, "shift"], i.name,
  71.                 lazy.window.togroup(i.name, switch_group=True),
  72.                 desc="Switch to & move focused window to group {}".format(i.name)),
  73.  
  74.                 ])
  75.  
  76. layout_theme = {
  77.     "border_width": 2,
  78.     "margin" : 5,
  79.     "border_normal": "273032",
  80.     "border_focus": "cccccc"
  81.     }
  82.  
  83. layouts = [
  84.     layout.Max(**layout_theme),
  85.     layout.MonadWide(**layout_theme),
  86.     layout.MonadTall(**layout_theme),
  87.     # layout.Stack(num_stacks=2),
  88.     # Try more layouts by unleashing below layouts.
  89.     # layout.Bsp(),
  90.     # layout.Columns(),
  91.     # layout.Matrix(),
  92.     # layout.RatioTile(),
  93.     # layout.Tile(),
  94.     # layout.TreeTab(),
  95.     # layout.VerticalTile(),
  96.     # layout.Zoomy(),
  97. ]
  98.  
  99.  
  100. widget_defaults = dict(
  101.     font='sans',
  102.     fontsize=12,
  103.     padding=5,
  104.     backgound="273032"
  105. )
  106. extension_defaults = widget_defaults.copy()
  107.  
  108. widgets_list = (
  109.     widget.GroupBox(
  110.         highlight_method = "line",
  111.         inactive = "273032",
  112.         borderwidth = 2,
  113.         rounded = "false",
  114.         background = "273032"
  115.         ),
  116.     widget.Prompt(
  117.         prompt = ''
  118.         ),
  119.     widget.WindowName(
  120.         ),
  121.     widget.Systray(
  122.         ),
  123.     widget.Clock(
  124.         background = "273032",
  125.         foreground = "273032",
  126.         format = '%a,  %b %d - %H:%M',
  127.         font='noto sans bold',
  128.         fontsize = 15,
  129.         padding = 5
  130.         )
  131. )
  132.  
  133. screens = [Screen(top=bar.Bar([widgets_list()], 25, opacity=0.75, margin=[5, 5, 0, 5]))]
  134.  
  135. # Drag floating layouts.
  136. mouse = [
  137.     Drag([mod], "Button1", lazy.window.set_position_floating(),
  138.          start=lazy.window.get_position()),
  139.     Drag([mod], "Button3", lazy.window.set_size_floating(),
  140.          start=lazy.window.get_size()),
  141.     Click([mod], "Button2", lazy.window.bring_to_front())
  142. ]
  143.  
  144. dgroups_key_binder = None
  145. dgroups_app_rules = []  # type: List
  146. main = None  # WARNING: this is deprecated and will be removed soon
  147. follow_mouse_focus = True
  148. bring_front_click = False
  149. cursor_warp = False
  150. floating_layout = layout.Floating(float_rules=[
  151.     # Run the utility of `xprop` to see the wm class and name of an X client.
  152.     {'wmclass': 'confirm'},
  153.     {'wmclass': 'dialog'},
  154.     {'wmclass': 'download'},
  155.     {'wmclass': 'error'},
  156.     {'wmclass': 'file_progress'},
  157.     {'wmclass': 'notification'},
  158.     {'wmclass': 'splash'},
  159.     {'wmclass': 'toolbar'},
  160.     {'wmclass': 'confirmreset'},  # gitk
  161.     {'wmclass': 'makebranch'},  # gitk
  162.     {'wmclass': 'maketag'},  # gitk
  163.     {'wname': 'branchdialog'},  # gitk
  164.     {'wname': 'pinentry'},  # GPG key password entry
  165.     {'wmclass': 'ssh-askpass'},  # ssh-askpass
  166. ])
  167. auto_fullscreen = True
  168. focus_on_window_activation = "smart"
  169.  
  170. # XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this
  171. # string besides java UI toolkits; you can see several discussions on the
  172. # mailing lists, GitHub issues, and other WM documentation that suggest setting
  173. # this string if your java app doesn't work correctly. We may as well just lie
  174. # and say that we're a working one by default.
  175. #
  176. # We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in
  177. # java that happens to be on java's whitelist.
  178. wmname = "LG3D"
Add Comment
Please, Sign In to add comment