Advertisement
mrneilypops

qtile-config-01-02-18

Feb 1st, 2018
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.99 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 libqtile.config import Key, Screen, Group, Drag, Click
  28. from libqtile.command import lazy
  29. from libqtile import layout, bar, widget
  30. from libqtile import extension
  31.  
  32. mod = "mod1"
  33. win = "mod4"
  34.  
  35. keys = [
  36. # Switch between windows in current stack pane
  37. Key([mod], "k", lazy.layout.down()),
  38. Key([mod], "j", lazy.layout.up()),
  39.  
  40. # Move windows up or down in current stack
  41. Key([mod, "control"], "k", lazy.layout.shuffle_down()),
  42. Key([mod, "control"], "j", lazy.layout.shuffle_up()),
  43.  
  44. # Switch window focus to other pane(s) of stack
  45. Key([mod], "space", lazy.layout.next()),
  46.  
  47. # Swap panes of split stack
  48. Key([mod, "shift"], "space", lazy.layout.rotate()),
  49.  
  50. # Toggle between split and unsplit sides of stack.
  51. # Split = all windows displayed
  52. # Unsplit = 1 window displayed, like Max layout, but still with
  53. # multiple stack panes
  54. Key([mod, "shift"], "Return", lazy.layout.toggle_split()),
  55. Key([mod], "Return", lazy.spawn("urxvtc")),
  56.  
  57. # Toggle between different layouts as defined below
  58. Key([mod], "Tab", lazy.next_layout()),
  59. Key([mod], "w", lazy.window.kill()),
  60.  
  61. Key([mod, "control"], "r", lazy.restart()),
  62. Key([mod, "control"], "q", lazy.shutdown()),
  63. Key([mod], "r", lazy.spawncmd()),
  64.  
  65. Key([win], "r", lazy.spawn("dmenu_run -fn 'ohsnap:size=14' -nb '#000000' -nf '#ffffff' -sb '#458588' -sf '#ffffff'")),
  66.  
  67.  
  68.  
  69. ]
  70.  
  71. groups = [Group(i) for i in "asdfuiop"]
  72.  
  73. for i in groups:
  74. keys.extend([
  75. # mod1 + letter of group = switch to group
  76. Key([mod], i.name, lazy.group[i.name].toscreen()),
  77.  
  78. # mod1 + shift + letter of group = switch to & move focused window to group
  79. Key([mod, "shift"], i.name, lazy.window.togroup(i.name)),
  80. ])
  81.  
  82. layouts = [
  83. layout.Max(border_focus='A89984', border_normal='414141', ),
  84. layout.Floating(border_focus='A89984', border_normal='414141', ),
  85. layout.Tile(border_focus='A89984', border_normal='414141', ),
  86. #layout.Stack(num_stacks=2)
  87. ]
  88.  
  89. widget_defaults = dict(
  90. font='ohsnap',
  91. fontsize=12,
  92. padding=3,
  93. )
  94. extension_defaults = widget_defaults.copy()
  95.  
  96. screens = [
  97. Screen(
  98. top=bar.Bar(
  99. [
  100. widget.GroupBox(),
  101. widget.CurrentLayoutIcon(scale=0.9),
  102. widget.Prompt(),
  103. widget.WindowName(),
  104. widget.TextBox("", name="default"),
  105. widget.Mpd(fmt_playing='%t'),
  106. widget.Sep(),
  107. widget.Systray(),
  108. widget.Sep(),
  109. #widget.CPUGraph(border_color='282828', graph_color='D3869B', fill_color='B16286', line_width=1, type='line'),
  110. #widget.MemoryGraph(border_color='282828', graph_color='83A598', fill_color='458588', line_width=1, type='line'),
  111. widget.Memory(),
  112. #widget.NetGraph(border_color='282828', graph_color='FABD2F', fill_color='D79921', line_width=1, type='line'),
  113. widget.Net(interface='enp4s0'),
  114. widget.Sep(),
  115. widget.Clock(format='%d-%m-%Y %H:%M'),
  116. ],
  117. 24,
  118. ),
  119. ),
  120. ]
  121.  
  122. # Drag floating layouts.
  123. mouse = [
  124. Drag([mod], "Button1", lazy.window.set_position_floating(),
  125. start=lazy.window.get_position()),
  126. Drag([mod], "Button3", lazy.window.set_size_floating(),
  127. start=lazy.window.get_size()),
  128. Click([mod], "Button2", lazy.window.bring_to_front())
  129. ]
  130.  
  131. dgroups_key_binder = None
  132. dgroups_app_rules = []
  133. main = None
  134. follow_mouse_focus = True
  135. bring_front_click = False
  136. cursor_warp = False
  137. floating_layout = layout.Floating(
  138. border_focus='A89984',
  139. border_normal='414141',
  140. float_rules=[
  141. {'wmclass': 'confirm'},
  142. {'wmclass': 'dialog'},
  143. {'wmclass': 'download'},
  144. {'wmclass': 'error'},
  145. {'wmclass': 'file_progress'},
  146. {'wmclass': 'notification'},
  147. {'wmclass': 'splash'},
  148. {'wmclass': 'toolbar'},
  149. {'wmclass': 'confirmreset'}, # gitk
  150. {'wmclass': 'makebranch'}, # gitk
  151. {'wmclass': 'maketag'}, # gitk
  152. {'wname': 'branchdialog'}, # gitk
  153. {'wname': 'pinentry'}, # GPG key password entry
  154. {'wmclass': 'ssh-askpass'}, # ssh-askpass
  155. ])
  156. auto_fullscreen = True
  157. focus_on_window_activation = "smart"
  158.  
  159. class Commands(object):
  160. dmenu = 'dmenu_run -i -p ">>>" -fn "ohsnap-14" -nb "#000" -nf "#fff" -sb "#373737" -sf "#fff"'
  161.  
  162.  
  163.  
  164.  
  165. # XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this
  166. # string besides java UI toolkits; you can see several discussions on the
  167. # mailing lists, github issues, and other WM documentation that suggest setting
  168. # this string if your java app doesn't work correctly. We may as well just lie
  169. # and say that we're a working one by default.
  170. #
  171. # We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in
  172. # java that happens to be on java's whitelist.
  173. wmname = "LG3D"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement