Advertisement
Hiroi

Untitled

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