Guest User

Untitled

a guest
Mar 12th, 2022
780
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 9.86 KB | None | 0 0
  1. # Copyright (c) 2010 Aldo Cortesi
  2. # Copyright (c) 2010, 2014 dequis
  3. # Copyright (c) 2012 Randall Ma
  4. # Copyright (c) 2012-2014 Tycho Andersen
  5. # Copyright (c) 2012 Craig Barnes
  6. # Copyright (c) 2013 horsik
  7. # Copyright (c) 2013 Tao Sauvage
  8. #
  9. # Permission is hereby granted, free of charge, to any person obtaining a copy
  10. # of this software and associated documentation files (the "Software"), to deal
  11. # in the Software without restriction, including without limitation the rights
  12. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. # copies of the Software, and to permit persons to whom the Software is
  14. # furnished to do so, subject to the following conditions:
  15. #
  16. # The above copyright notice and this permission notice shall be included in
  17. # all copies or substantial portions of the Software.
  18. #
  19. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  25. # SOFTWARE.
  26.  
  27. from typing import List  # noqa: F401
  28.  
  29. from libqtile import bar, layout, widget
  30. from libqtile.config import Click, Drag, Group, Key, Match, Screen
  31. from libqtile.lazy import lazy
  32.  
  33. mod = "mod4"
  34.  
  35. keys = [
  36.     # A list of available commands that can be bound to keys can be found
  37.     # at https://docs.qtile.org/en/latest/manual/config/lazy.html
  38.     # Switch between windows
  39.     Key([mod], "Left", lazy.layout.left(), desc="Move focus to left"),
  40.     Key([mod], "Right", lazy.layout.right(), desc="Move focus to right"),
  41.     Key([mod], "Down", lazy.layout.down(), desc="Move focus down"),
  42.     Key([mod], "Up", lazy.layout.up(), desc="Move focus up"),
  43.     Key([mod], "Tab", lazy.screen.next_group(), desc="Move to the group on the right"),
  44.     Key([mod, "shift"], "Tab", lazy.screen.toggle_group(), desc="Move to the last visited group"),
  45.     # Move windows between left/right columns or move up/down in current stack.
  46.     # Moving out of range in Columns layout will create new column.
  47.     Key([mod, "shift"], "Left", lazy.layout.shuffle_left(), desc="Move window to the left"),
  48.     Key([mod, "shift"], "Right", lazy.layout.shuffle_right(), desc="Move window to the right"),
  49.     Key([mod, "shift"], "Down", lazy.layout.shuffle_down(), desc="Move window down"),
  50.     Key([mod, "shift"], "Up", lazy.layout.shuffle_up(), desc="Move window up"),
  51.     # Grow windows. If current window is on the edge of screen and direction
  52.     # will be to screen edge - window would shrink.
  53.     Key([mod, "control"], "Left", lazy.layout.grow_left(), desc="Grow window to the left"),
  54.     Key([mod, "control"], "Right", lazy.layout.grow_right(), desc="Grow window to the right"),
  55.     Key([mod, "control"], "Down", lazy.layout.grow_down(), desc="Grow window down"),
  56.     Key([mod, "control"], "Up", lazy.layout.grow_up(), desc="Grow window up"),
  57.     Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
  58.     # Toggle between split and unsplit sides of stack.
  59.     # Split = all windows displayed
  60.     # Unsplit = 1 window displayed, like Max layout, but still with
  61.     # multiple stack panes
  62.     Key([mod], "a", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack"),
  63.     Key([mod], "e", lazy.window.toggle_floating(), desc="Put the focused window to/from floating mode"),
  64.     Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Put the focused window to/from fullscreen mode"),
  65.     # Toggle between different layouts as defined below
  66.     Key([mod], "w", lazy.next_layout(), desc="Toggle between layouts"),
  67.     Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
  68.     Key([mod, "shift"], "r", lazy.reload_config(), desc="Reload the config"),
  69.     Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
  70.     Key([mod], "z", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
  71.     # Volume control
  72.     Key([], "XF86AudioRaiseVolume", lazy.spawn("amixer -D pulse sset Master 5%+")),
  73.     Key([], "XF86AudioLowerVolume", lazy.spawn("amixer -D pulse sset Master 5%-")),
  74.     Key([], "XF86AudioMute", lazy.spawn("amixer -D pulse sset Master toggle")),
  75.     # Brightness
  76.     Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl s +10%")),
  77.     Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl s 10%-")),
  78.     # Lockscreen
  79.     Key([mod], "l", lazy.spawn("i3lock -i /home/sergey/Pictures/soty.png")),
  80.     # Reboot / Poweroff
  81.     Key([mod, "shift"], "k", lazy.spawn("systemctl reboot")),
  82.     Key([mod, "shift"], "m", lazy.spawn("systemctl poweroff")),
  83.     # Dunst
  84.     Key([mod], "u", lazy.spawn("dunstctl history-pop")),
  85.     Key([mod, "shift"], "u", lazy.spawn("dunstctl close-all")),
  86.     # Apps keys
  87.     Key([mod], "c", lazy.spawn("firefox")),
  88.     Key([mod], "Return", lazy.spawn("xterm")),
  89.     Key([mod], "x", lazy.spawn("xterm -e ranger")),
  90.     Key([mod, "shift"], "x", lazy.spawn("pcmanfm-qt")),
  91.     Key([mod], "d", lazy.spawn("quodlibet")),
  92.     Key([mod, "shift"], "d", lazy.spawn("quodlibet --play-pause")),
  93.     Key([mod, "shift"], "Return", lazy.spawn("geany")),
  94. ]
  95.  
  96. groups = [
  97.     Group("1", label="WEB", matches=[Match(wm_class="firefox")]),
  98.     Group("2", label="FILE", matches=[Match(wm_class="xterm", title="ranger"), Match(wm_class="pcmanfm-qt")]),
  99.     Group("3", label="MUS", matches=[Match(wm_class="Quodlibet"), Match(wm_class="audacity")]),
  100.     Group("4", label="VID", matches=[Match(wm_class="mpv")]),
  101.     Group("5", label="EDIT", matches=[Match(wm_class="geany")]),
  102.     Group("6", label="TERM", matches=[Match(wm_class="XTerm")]),
  103.     Group("7", label="GIMP", matches=[Match(wm_class="gimp")]),
  104.     Group("8", label="PIC", matches=[Match(wm_class="picard")]),
  105.     Group("9", label="GAME", matches=[Match(wm_class="steam")]),
  106. ]
  107.  
  108. for i in groups:
  109.     keys.extend([
  110.         Key([mod], i.name, lazy.group[i.name].toscreen(), desc="Switch to group {}".format(i.name)),
  111.         Key([mod, "shift"], i.name, lazy.window.togroup(i.name, switch_group=True), desc="Switch to & move focused window to group {}".format(i.name)),
  112.     ]
  113. )
  114.  
  115. layouts = [
  116.     layout.Columns(name="COL", border_focus="#2B6AA7", border_focus_stack="#FFA500", border_normal="#212134", border_width=5),
  117.     layout.Max(name="MAX"),
  118.     # Try more layouts by unleashing below layouts.
  119.     # layout.Stack(num_stacks=2),
  120.     # layout.Bsp(),
  121.     # layout.Matrix(),
  122.     # layout.MonadTall(),
  123.     # layout.MonadWide(),
  124.     # layout.RatioTile(),
  125.     # layout.Tile(),
  126.     # layout.TreeTab(),
  127.     # layout.VerticalTile(),
  128.     # layout.Zoomy(),
  129. ]
  130.  
  131. widget_defaults = dict(font="JetBrains Mono", fontsize=14, padding=2, foreground="#88EE9A")
  132.  
  133. extension_defaults = widget_defaults.copy()
  134.  
  135. screens = [
  136.     Screen(
  137.         top=bar.Bar(
  138.             [
  139.                 widget.CurrentLayout(font="JetBrains Mono", fontsize=12, foreground="#F16E88"),
  140.                 widget.GroupBox(disable_drag="True", font="JetBrains Mono", fontsize=12, this_current_screen_border="#FF7200"),
  141.                 widget.Prompt(foreground="#F16E88", font="JetBrains Mono", fontsize = 14, cursor_color="#FFA500", padding=5),
  142.                 widget.WindowName(font="JetBrains Mono", fontsize=14, foreground="#88BFF6", padding=5),
  143.                 widget.TextBox(text=" "),
  144.                 widget.Volume(background="#212134", padding=5),
  145.                 widget.Sep(background="#FF7200", linewidth=0),
  146.                 widget.Memory(format=" {MemUsed: .0f}{mm}", padding=5),
  147.                 widget.Sep(background="#FF7200", linewidth=0),
  148.                 widget.CPU(format=" {load_percent}%", padding=5),
  149.                 widget.Sep(background="#FF7200", linewidth=0),
  150.                 widget.TextBox(text=" ", fontsize=12),
  151.                 widget.ThermalSensor(background="#212134", update_interval=5, padding=5),
  152.                 widget.Sep(background="#FF7200", linewidth=0),
  153.                 widget.Clock(format="  %a %d  %H:%M:%S", padding=5),
  154.                 widget.Sep(background="#FF7200", linewidth=0),
  155.                 widget.TextBox(text=" ", background="#212134"),
  156.                 widget.Battery(background="#212134", format="{percent:2.0%}", padding=5),
  157.                 widget.Sep(background="#FF7200", linewidth=0),
  158.                 widget.Systray(padding=5),
  159.             ],
  160.             24,
  161.             # border_width=[2, 0, 2, 0],  # Draw top and bottom borders
  162.             # border_color=["ff00ff", "000000", "ff00ff", "000000"]  # Borders are magenta
  163.             background="#212134",
  164.         )
  165.     )
  166. ]
  167.  
  168. # Drag floating layouts.
  169. mouse = [
  170.     Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
  171.     Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()),
  172.     Click([mod], "Button2", lazy.window.bring_to_front()),
  173. ]
  174.  
  175. dgroups_key_binder = None
  176. dgroups_app_rules = []  # type: List
  177. follow_mouse_focus = True
  178. bring_front_click = False
  179. cursor_warp = False
  180. floating_layout = layout.Floating(
  181.     float_rules=[
  182.         # Run the utility of `xprop` to see the wm class and name of an X client.
  183.         *layout.Floating.default_float_rules,
  184.         Match(wm_class="steam"),
  185.         Match(wm_class="confirmreset"),  # gitk
  186.         Match(wm_class="makebranch"),  # gitk
  187.         Match(wm_class="maketag"),  # gitk
  188.         Match(wm_class="ssh-askpass"),  # ssh-askpass
  189.         Match(title="branchdialog"),  # gitk
  190.         Match(title="pinentry"),  # GPG key password entry
  191.     ]
  192. )
  193. auto_fullscreen = True
  194. focus_on_window_activation = "smart"
  195. reconfigure_screens = True
  196.  
  197. # If things like steam games want to auto-minimize themselves when losing
  198. # focus, should we respect this or not?
  199. auto_minimize = True
  200. wmname = "Qtile"
  201.  
Add Comment
Please, Sign In to add comment