Advertisement
mrneilypops

qtile-config-04-02-18

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