Advertisement
Hiroi

Untitled

Jul 19th, 2021
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.92 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. import os
  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. from libqtile.utils import guess_terminal
  33. from libqtile import qtile
  34.  
  35. mod = "mod4"
  36. terminal = "alacritty"
  37.  
  38. keys = [
  39. # Open Firefox
  40. Key([mod, "shift"], "f", lazy.spawn ("firefox"), desc="Run firefox"),
  41. # Run Rofi
  42. Key([mod], "d", lazy.spawn ("rofi -show run"), desc="Run rofi"),
  43. # Open Discord
  44. Key([mod, "shift"], "d", lazy.spawn ("discord"), desc="Run discord"),
  45. # Switch between windows
  46. Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
  47. Key([mod], "l", lazy.layout.right(), desc="Move focus to right"),
  48. Key([mod], "j", lazy.layout.down(), desc="Move focus down"),
  49. Key([mod], "k", lazy.layout.up(), desc="Move focus up"),
  50. Key([mod], "space", lazy.layout.next(),
  51. desc="Move window focus to other window"),
  52.  
  53. # Move windows between left/right columns or move up/down in current stack.
  54. # Moving out of range in Columns layout will create new column.
  55. Key([mod, "shift"], "h", lazy.layout.shuffle_left(),
  56. desc="Move window to the left"),
  57. Key([mod, "shift"], "l", lazy.layout.shuffle_right(),
  58. desc="Move window to the right"),
  59. Key([mod, "shift"], "j", lazy.layout.shuffle_down(),
  60. desc="Move window down"),
  61. Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"),
  62.  
  63. # Grow windows. If current window is on the edge of screen and direction
  64. # will be to screen edge - window would shrink.
  65. Key([mod, "control"], "h", lazy.layout.grow_left(),
  66. desc="Grow window to the left"),
  67. Key([mod, "control"], "l", lazy.layout.grow_right(),
  68. desc="Grow window to the right"),
  69. Key([mod, "control"], "j", lazy.layout.grow_down(),
  70. desc="Grow window down"),
  71. Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"),
  72. Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
  73.  
  74. # Toggle between split and unsplit sides of stack.
  75. # Split = all windows displayed
  76. # Unsplit = 1 window displayed, like Max layout, but still with
  77. # multiple stack panes
  78. Key([mod, "shift"], "Return", lazy.layout.toggle_split(),
  79. desc="Toggle between split and unsplit sides of stack"),
  80. Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
  81.  
  82. # Toggle between different layouts as defined below
  83. Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
  84. Key([mod, "shift"], "q", lazy.window.kill(), desc="Kill focused window"),
  85.  
  86. Key([mod, "control"], "r", lazy.restart(), desc="Restart Qtile"),
  87. Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
  88. Key([mod], "r", lazy.spawncmd(),
  89. desc="Spawn a command using a prompt widget"),
  90. ]
  91. #groups
  92. group_names=["TERM","WEB","CHAT","GAMES","VIRT","INSP"]
  93.  
  94. groups = [Group(name) for name in group_names]
  95. for i,name in enumerate(group_names, 1):
  96. keys.append(Key([mod], str(i), lazy.group[name].toscreen()))
  97. keys.append(Key([mod, "shift"], str(i), lazy.window.togroup(name)))
  98.  
  99.  
  100.  
  101. ##for i in groups:
  102. ## keys.extend([
  103. # mod1 + letter of group = switch to group
  104. ## Key([mod], i.name, lazy.group[i.name].toscreen(),
  105. ## desc="Switch to group {}".format(i.name)),
  106.  
  107. # mod1 + shift + letter of group = switch to & move focused window to group
  108. ## Key([mod, "shift"], i.name, lazy.window.togroup(i.name, switch_group=True),
  109. ## desc="Switch to & move focused window to group {}".format(i.name)),
  110. # Or, use below if you prefer not to switch to that group.
  111. # # mod1 + shift + letter of group = move focused window to group
  112. # Key([mod, "shift"], i.name, lazy.window.togroup(i.name),
  113. # desc="move focused window to group {}".format(i.name)),
  114. ## ])
  115.  
  116. layouts = [
  117. layout.Columns(
  118. border_focus_MonadTall='#467b80',
  119. margin= 5,
  120. border_focus="#5c1212"
  121.  
  122.  
  123. ),
  124.  
  125.  
  126. #layout.Max(),
  127. # Try more layouts by unleashing below layouts.
  128. # layout.Stack(num_stacks=2),
  129. # layout.Bsp(),
  130. # layout.Matrix(),
  131. # layout.MonadTall(),
  132. # layout.MonadWide(),
  133. # layout.RatioTile(),
  134. # layout.Tile(),
  135. # layout.TreeTab(),
  136. # layout.VerticalTile(),
  137. # layout.Zoomy(),
  138. ]
  139. widget_defaults = dict(
  140. font='sans',
  141. fontsize=12,
  142. padding=3,
  143. )
  144. extension_defaults = widget_defaults.copy()
  145. screens = [
  146. Screen(
  147. top=bar.Bar(
  148. [
  149. widget.Sep(
  150. linewidth=0,
  151. padding=6,
  152. background="#282c34",
  153. foreground="#ffffff"),
  154. widget.GroupBox(
  155. rounded=False,
  156. margin_y=0,
  157. margin_x=0,
  158. paddind_y=5,
  159. padding_x=5,
  160. inactive="#ffffff",
  161. highlight_method= "block",
  162. this_current_screen_border="#6a040f",
  163. this_screen_border="#434758",
  164. foreground="#6a040f",
  165. background="#282c34",
  166. other_current_screen_border="#282c34",
  167. other_screen_border="#282c34",
  168.  
  169.  
  170. ),
  171. widget.Prompt(
  172. font = "Ubuntu Mono",
  173. padding=10,
  174. background="#434758",
  175. foreground="#8d99ae"
  176. ),
  177.  
  178. widget.Sep(
  179. linewidth=0,
  180. padding=6,
  181. foreground="#282c34",
  182. background="#282c34"
  183. ),
  184.  
  185. widget.WindowName(
  186. foreground="#8d99ae",
  187. background="#282c34",
  188. padding=0,
  189.  
  190. ),
  191. widget.TextBox(
  192. text="",
  193. background="#282c34",
  194. foreground="#6a040f",
  195. padding=-16,
  196. fontsize=78
  197. ),
  198. widget.TextBox(
  199. text = " ",
  200. padding = 2,
  201. background="#6a040f",
  202. foreground="#ffffff",
  203. fontsize="20"
  204. ),
  205.  
  206. widget.CheckUpdates(
  207. update_interval= 30,
  208. distro='Arch',
  209. display_format="{updates} Updates",
  210. foreground="#ffffff",
  211. no_update_string="N/A",
  212. mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(terminal + 'sudo pacman -Syu')},
  213. background="#6a040f",
  214. padding=5,
  215. ),
  216.  
  217. widget.TextBox(
  218. text="",
  219. background="#6a040f",
  220. foreground="#434758",
  221. padding=-16,
  222. fontsize=78
  223. ),
  224. widget.Memory(
  225. foreground="#ffffff",
  226. measure_mem="G",
  227. background="#434758",
  228. padding=5
  229. ),
  230.  
  231. widget.TextBox(
  232. text="",
  233. background="#434758",
  234. foreground="#6a040f",
  235. padding=-16,
  236. fontsize=78
  237. ),
  238. widget.OpenWeather(
  239. location="Timisoara",
  240. foreground="#ffffff",
  241. background="#6a040f",
  242. format='{location_city}: {main_temp} °{units_temperature}',
  243. update_interval=60
  244. ),
  245. widget.TextBox(
  246. text="",
  247. background="#6a040f",
  248. foreground="#434758",
  249. padding=-16,
  250. fontsize=78
  251. ),
  252.  
  253. widget.CPU(
  254. format='CPU {load_percent}%',
  255. background="#434758",
  256. padding=5,
  257. foreground="#ffffff",
  258. ),
  259. widget.TextBox(
  260. text="",
  261. background="#434758",
  262. foreground="#6a040f",
  263. padding=-16,
  264. fontsize=78
  265. ),
  266. widget.TextBox(
  267. text="墳",
  268. foreground="#ffffff",
  269. background="#6a040f",
  270. fontsize=17,
  271. mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn("pavucontrol")},
  272. ),
  273. widget.Volume(
  274. background="#6a040f",
  275. foreground="#ffffff",
  276. padding=5,
  277. ),
  278. widget.TextBox(
  279. text="",
  280. background="#6a040f",
  281. foreground="#434758",
  282. padding=-16,
  283. fontsize=78
  284. ),
  285. widget.Clock(
  286. foreground="#ffffff",
  287. background="#434758",
  288. format = "%A, %B %d - %H:%M ",
  289. ),
  290.  
  291. ],
  292. 28,
  293. background="#282c34",
  294.  
  295.  
  296.  
  297. ),
  298. ),
  299.  
  300.  
  301. Screen(
  302. top=bar.Bar(
  303. [
  304. widget.Sep(
  305. linewidth=0,
  306. padding=6,
  307. background="#282c34",
  308. foreground="#ffffff"),
  309. widget.GroupBox(
  310. rounded=False,
  311. margin_y=0,
  312. margin_x=0,
  313. paddind_y=5,
  314. padding_x=5,
  315. inactive="#ffffff",
  316. highlight_method= "block",
  317. this_current_screen_border="#6a040f",
  318. this_screen_border="#434758",
  319. foreground="#6a040f",
  320. background="#282c34",
  321. other_current_screen_border="#282c34",
  322. other_screen_border="#282c34",
  323.  
  324.  
  325. ),
  326. widget.Prompt(
  327. font = "Ubuntu Mono",
  328. padding=10,
  329. background="#434758",
  330. foreground="#8d99ae"
  331. ),
  332.  
  333. widget.Sep(
  334. linewidth=0,
  335. padding=6,
  336. foreground="#282c34",
  337. background="#282c34"
  338. ),
  339.  
  340. widget.WindowName(
  341. foreground="#8d99ae",
  342. background="#282c34",
  343. padding=0,
  344.  
  345. ),
  346. widget.Systray(
  347. background="#282c34",
  348. padding=5
  349. ),
  350. widget.TextBox(
  351. text="",
  352. background="#282c34",
  353. foreground="#6a040f",
  354. padding=-16,
  355. fontsize=78
  356. ),
  357.  
  358. widget.OpenWeather(
  359. location="Timisoara",
  360. foreground="#ffffff",
  361. background="#6a040f",
  362. format='{location_city}: {main_temp} °{units_temperature}',
  363. update_interval=60
  364. ),
  365.  
  366. widget.TextBox(
  367. text="",
  368. background="#6a040f",
  369. foreground="#434758",
  370. padding=-16,
  371. fontsize=78
  372. ),
  373. widget.TextBox(
  374. text="墳",
  375. foreground="#ffffff",
  376. background="#434758",
  377. fontsize=17,
  378. mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn("pavucontrol")},
  379. ),
  380. widget.Volume(
  381. background="#434758",
  382. foreground="#ffffff",
  383. padding=5,
  384. ),
  385. widget.TextBox(
  386. text="",
  387. background="#434758",
  388. foreground="#6a040f",
  389. padding=-16,
  390. fontsize=78
  391. ),
  392. widget.Clock(
  393. foreground="#ffffff",
  394. background="#6a040f",
  395. format = "%A, %B %d - %H:%M ",
  396. ),
  397.  
  398. ],
  399. 28,
  400. background="#282c34",
  401.  
  402.  
  403.  
  404. ),
  405. ),
  406.  
  407.  
  408.  
  409. ]
  410.  
  411. # Drag floating layouts.
  412. mouse = [
  413. Drag([mod], "Button1", lazy.window.set_position_floating(),
  414. start=lazy.window.get_position()),
  415. Drag([mod], "Button3", lazy.window.set_size_floating(),
  416. start=lazy.window.get_size()),
  417. Click([mod], "Button2", lazy.window.bring_to_front())
  418. ]
  419.  
  420. dgroups_key_binder = None
  421. dgroups_app_rules = [] # type: List
  422. main = None # WARNING: this is deprecated and will be removed soon
  423. follow_mouse_focus = True
  424. bring_front_click = False
  425. cursor_warp = False
  426. floating_layout = layout.Floating(float_rules=[
  427. # Run the utility of `xprop` to see the wm class and name of an X client.
  428. *layout.Floating.default_float_rules,
  429. Match(wm_class='confirmreset'), # gitk
  430. Match(wm_class='makebranch'), # gitk
  431. Match(wm_class='maketag'), # gitk
  432. Match(wm_class='ssh-askpass'), # ssh-askpass
  433. Match(title='branchdialog'), # gitk
  434. Match(title='pinentry'), # GPG key password entry
  435. ])
  436. auto_fullscreen = True
  437. focus_on_window_activation = "smart"
  438.  
  439. # XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this
  440. # string besides java UI toolkits; you can see several discussions on the
  441. # mailing lists, GitHub issues, and other WM documentation that suggest setting
  442. # this string if your java app doesn't work correctly. We may as well just lie
  443. # and say that we're a working one by default.
  444. #
  445. # We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in
  446. # java that happens to be on java's whitelist.
  447. wmname = "LG3D"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement