config.py 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  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. import os
  27. import subprocess
  28. import logging
  29. from libqtile import qtile
  30. from libqtile import bar, layout, widget, hook
  31. from libqtile.config import (
  32. Click,
  33. Drag,
  34. Group,
  35. Key,
  36. Match,
  37. Screen,
  38. KeyChord,
  39. ScratchPad,
  40. DropDown,
  41. )
  42. from libqtile.lazy import lazy
  43. from libqtile.utils import guess_terminal
  44. mod = "mod4"
  45. # terminal = guess_terminal()
  46. terminal = "kitty -e fish"
  47. calendar = "kitty -e calcurse"
  48. filemanager = "kitty -e ranger"
  49. # player = "kitty -e cmus"
  50. ncmpcpp = "kitty -e ncmpcpp"
  51. password = "keepassxc"
  52. @lazy.function
  53. def float_to_front(qtile):
  54. logging.info("bring floating windows to front")
  55. for group in qtile.groups:
  56. for window in group.windows:
  57. if window.floating:
  58. window.cmd_bring_to_front()
  59. sticky_windows = []
  60. @lazy.function
  61. def toggle_sticky_windows(qtile, window=None):
  62. if window is None:
  63. window = qtile.current_screen.group.current_window
  64. if window in sticky_windows:
  65. sticky_windows.remove(window)
  66. else:
  67. sticky_windows.append(window)
  68. return window
  69. @hook.subscribe.setgroup
  70. def move_sticky_windows():
  71. for window in sticky_windows:
  72. window.togroup()
  73. return
  74. @hook.subscribe.client_killed
  75. def remove_sticky_windows(window):
  76. if window in sticky_windows:
  77. sticky_windows.remove(window)
  78. # Below is an example how to make Firefox Picture-in-Picture windows automatically sticky.
  79. # I have a German Firefox and don't know if the 'name' is 'Picture-in-Picture'.
  80. # You can check yourself with `xprop` and then lookup at the line `wm_name`.
  81. @hook.subscribe.client_managed
  82. def auto_sticky_windows(window):
  83. info = window.info()
  84. if (
  85. info["wm_class"] == ["Toolkit", "firefox"]
  86. and info["name"] == "Picture-in-Picture"
  87. ):
  88. sticky_windows.append(window)
  89. keys = [
  90. Key(["mod4", "shift"], "f", float_to_front),
  91. # A list of available commands that can be bound to keys can be found
  92. # at https://docs.qtile.org/en/latest/manual/config/lazy.html
  93. # Switch between windows
  94. Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
  95. Key([mod], "l", lazy.layout.right(), desc="Move focus to right"),
  96. # Key([mod], "j", lazy.layout.down(), desc="Move focus down"),
  97. Key(
  98. [mod],
  99. "j",
  100. lazy.group.next_window(),
  101. desc="Switch window focus to next window in group",
  102. ),
  103. Key([mod], "k", lazy.layout.up(), desc="Move focus up"),
  104. # Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"),
  105. # Move windows between left/right columns or move up/down in current stack.
  106. # Moving out of range in Columns layout will create new column.
  107. Key(
  108. [mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"
  109. ),
  110. Key(
  111. [mod, "shift"],
  112. "l",
  113. lazy.layout.shuffle_right(),
  114. desc="Move window to the right",
  115. ),
  116. Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"),
  117. Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"),
  118. # Grow windows. If current window is on the edge of screen and direction
  119. # will be to screen edge - window would shrink.
  120. # Key([mod, "control"], "h", lazy.layout.grow_left(), desc="Grow window to the left"),
  121. # Key([mod, "control"], "l", lazy.layout.grow_right(), desc="Grow window to the right"),
  122. # Key([mod, "control"], "j", lazy.layout.grow_down(), desc="Grow window down"),
  123. # Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"),
  124. # Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
  125. # Monad Tile
  126. Key([mod, "shift"], "h", lazy.layout.swap_left()),
  127. Key([mod, "shift"], "l", lazy.layout.swap_right()),
  128. Key([mod, "shift"], "j", lazy.layout.shuffle_down()),
  129. Key([mod, "shift"], "k", lazy.layout.shuffle_up()),
  130. Key([mod], "i", lazy.layout.grow()),
  131. Key([mod], "m", lazy.layout.shrink()),
  132. Key([mod], "n", lazy.layout.normalize()),
  133. Key([mod], "o", lazy.layout.maximize()),
  134. Key([mod, "shift"], "space", lazy.layout.flip()),
  135. # Toggle between split and unsplit sides of stack.
  136. # Split = all windows displayed
  137. # Unsplit = 1 window displayed, like Max layout, but still with
  138. # multiple stack panes
  139. # Key(
  140. # [mod, "shift"],
  141. # "Return",
  142. # lazy.layout.toggle_split(),
  143. # desc="Toggle between split and unsplit sides of stack",
  144. # ),
  145. Key([mod, "shift"], "Return", lazy.spawn(terminal), desc="Launch terminal"),
  146. # Toggle between different layouts as defined below
  147. Key([mod, "shift"], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
  148. Key(
  149. [mod], "Tab", lazy.screen.toggle_group(), desc="Move to the last visited group"
  150. ),
  151. Key([mod, "shift"], "c", lazy.window.kill(), desc="Kill focused window"),
  152. Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"),
  153. Key([mod, "shift"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
  154. # Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
  155. Key([mod], "p", lazy.spawn("dmenu_run -p 'RUN:'")),
  156. # Key([mod], "r", lazy.spawn("rofi -show run"), desc="launch rofi run"),
  157. # Key([mod], "u", lazy.spawn("kitty -e ranger")),
  158. # Key([mod], "c", lazy.spawn("kitty -e calcurse")),
  159. Key(["mod1"], "l", lazy.spawn("slock")),
  160. Key([mod], "Print", lazy.spawn("flameshot gui")),
  161. Key(["mod1"], "n", lazy.spawn("nemo"), desc="Nemo File Manager"),
  162. Key(["mod1"], "z", lazy.spawn("zuluCrypt-gui")),
  163. Key([mod], "f", lazy.window.toggle_fullscreen()),
  164. Key([mod], "b", lazy.hide_show_bar(position="top")),
  165. Key([mod], "F12", lazy.spawn("firefox")),
  166. Key([mod, "shift"], "F12", lazy.spawn("firefox -private-window")),
  167. KeyChord(
  168. ["control"],
  169. "m",
  170. [
  171. Key([], "e", lazy.spawn("element-desktop")),
  172. Key([], "t", lazy.spawn("telegram-desktop")),
  173. ],
  174. ),
  175. # Change the volume if your keyboard has special volume keys.
  176. # Sound
  177. Key([], "XF86AudioMute", lazy.spawn("amixer -q set Master toggle")),
  178. Key([], "XF86AudioLowerVolume", lazy.spawn("amixer -c 0 sset Master 5- unmute")),
  179. Key([], "XF86AudioRaiseVolume", lazy.spawn("amixer -c 0 sset Master 5+ unmute")),
  180. # Volume control
  181. # Key([], "XF86AudioLowerVolume", lazy.spawn("pamixer --decrease 5")),
  182. # Key([], "XF86AudioRaiseVolume", lazy.spawn("pamixer --increase 5")),
  183. # Key([], "XF86AudioMute", lazy.spawn("pamixer --toggle-mute")),
  184. # Brightness Control
  185. Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +10%")),
  186. Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 10%-")),
  187. Key(
  188. [mod],
  189. "s",
  190. toggle_sticky_windows(),
  191. desc="Toggle state of sticky for current window",
  192. ),
  193. ]
  194. groups = [
  195. Group("1", label="1", layout="monadwide"),
  196. Group("2", label="2", matches=[Match(wm_class=["firefox"])], layout="max"),
  197. Group(
  198. "3",
  199. label="3",
  200. matches=[Match(wm_class=["jetbrains-pycharm-ce", "code-oss"])],
  201. layout="max",
  202. ),
  203. Group("3", label="3", matches=[Match(wm_class=["obsidian"])], layout="max"),
  204. Group(
  205. "4",
  206. label="4",
  207. matches=[Match(wm_class=["element", "telegram-desktop", "rocket.chat"])],
  208. layout="max",
  209. ),
  210. Group("5", label="5", layout="max"),
  211. Group("6", label="6", layout="max"),
  212. Group("7", label="7", matches=[Match(wm_class=["virt-manager"])], layout="max"),
  213. Group("8", label="8", layout="max"),
  214. Group("9", label="9", matches=[Match(wm_class=["qbittorrent"])], layout="max"),
  215. ]
  216. # groups = [Group(i) for i in "123456789"]
  217. for i in groups:
  218. keys.extend(
  219. [
  220. # mod1 + letter of group = switch to group
  221. Key(
  222. [mod],
  223. i.name,
  224. lazy.group[i.name].toscreen(),
  225. desc="Switch to group {}".format(i.name),
  226. ),
  227. # mod1 + shift + letter of group = switch to & move focused window to group
  228. Key(
  229. [mod, "shift"],
  230. i.name,
  231. lazy.window.togroup(i.name, switch_group=True),
  232. desc="Switch to & move focused window to group {}".format(i.name),
  233. ),
  234. # Or, use below if you prefer not to switch to that group.
  235. # # mod1 + shift + letter of group = move focused window to group
  236. # Key([mod, "shift"], i.name, lazy.window.togroup(i.name),
  237. # desc="move focused window to group {}".format(i.name)),
  238. ]
  239. )
  240. # SCRATCHPADS
  241. groups.append(
  242. ScratchPad(
  243. "scratchpad",
  244. [
  245. DropDown("1", terminal, x=0.10, y=0.0, width=0.8, height=0.8),
  246. DropDown("2", filemanager, x=0.10, y=0.0, width=0.8, height=0.8),
  247. DropDown("3", calendar, x=0.10, y=0.0, width=0.8, height=0.8),
  248. # DropDown("4", player, x=0.10, y=0.0, width=0.8, height=0.8),
  249. DropDown("5", ncmpcpp, x=0.10, y=0.0, width=0.8, height=0.8),
  250. DropDown("6", password, x=0.10, y=0.10, width=0.8, height=0.8),
  251. DropDown("7", "galculator", x=0.40, y=0.30, width=0.2, height=0.3),
  252. ],
  253. )
  254. )
  255. keys.extend(
  256. [
  257. Key(["mod1"], "grave", lazy.group["scratchpad"].dropdown_toggle("1")),
  258. Key(["mod1"], "r", lazy.group["scratchpad"].dropdown_toggle("2")),
  259. Key(["mod1"], "c", lazy.group["scratchpad"].dropdown_toggle("3")),
  260. # Key(["mod1"], "m", lazy.group["scratchpad"].dropdown_toggle("4")),
  261. Key(["mod1"], "m", lazy.group["scratchpad"].dropdown_toggle("5")),
  262. Key(["mod1"], "p", lazy.group["scratchpad"].dropdown_toggle("6")),
  263. Key(["mod1"], "q", lazy.group["scratchpad"].dropdown_toggle("7")),
  264. ]
  265. )
  266. layouts = [
  267. layout.Max(),
  268. layout.MonadTall(
  269. border_normal="#373b41",
  270. # border_focus=["#b294bb"],
  271. border_focus=["#1177aa"],
  272. border_width=2,
  273. ratio=0.7,
  274. new_client_position="before_current",
  275. margin=4,
  276. ),
  277. layout.MonadWide(
  278. border_normal="#373b41",
  279. # border_focus=["#b294bb"],
  280. border_focus=["#1177aa"],
  281. border_width=2,
  282. ratio=0.7,
  283. new_client_position="before_current",
  284. margin=4,
  285. ),
  286. # layout.Floating(),
  287. # layout.MonadThreeCol(
  288. # border_normal="#373b41",
  289. # # border_focus=["#b294bb"],
  290. # border_focus=["#1177aa"],
  291. # border_width=2,
  292. # ratio=0.7,
  293. # new_client_position="before_current",
  294. # margin=4,
  295. # ),
  296. # layout.TreeTab(
  297. # active_bg="#b294bb",
  298. # active_fg="#373b41",
  299. # bg_color="#1d1f21",
  300. # border_width=4,
  301. # inactive_bg="#282a2e",
  302. # inactive_fg="#c5c8c6",
  303. # level_shift=8,
  304. # panel_width=150,
  305. # padding_x=8,
  306. # padding_y=4,
  307. # margin_y=0,
  308. # margin_left=0,
  309. # place_right=False,
  310. # section_bottom=16,
  311. # section_left=9,
  312. # sections=["Root", "Second"],
  313. # ),
  314. #
  315. # layout.Columns(
  316. # border_normal_stack=["#85678f"],
  317. # border_width=4,
  318. # fair=True,
  319. # ),
  320. # Try more layouts by unleashing below layouts.
  321. # layout.Stack(num_stacks=2),
  322. # layout.Bsp(),
  323. # layout.Matrix(),
  324. # layout.RatioTile(),
  325. # layout.Tile(),
  326. # layout.VerticalTile(),
  327. # layout.Zoomy(),
  328. ]
  329. widget_defaults = dict(
  330. font="JetBrains Mono",
  331. # font="Iosevka Term Light",
  332. fontsize=14,
  333. padding=4,
  334. )
  335. extension_defaults = widget_defaults.copy()
  336. screens = [
  337. Screen(
  338. top=bar.Bar(
  339. [
  340. # widget.Sep(
  341. # padding=10,
  342. # linewidth=0,
  343. # ),
  344. widget.WidgetBox(
  345. close_button_location="left",
  346. # text_open=" 󰔰 ",
  347. text_open="  ",
  348. text_closed="  ",
  349. # text_open=" 󰔰 ",
  350. # text_closed=" 󰧀 ",
  351. # background="#5f819d",
  352. # foreground="#1d1f21",
  353. foreground="#f2f2f2",
  354. fontsize=12,
  355. widgets=[
  356. widget.Sep(
  357. padding=10,
  358. linewidth=1,
  359. ),
  360. widget.TextBox(
  361. text="  Reboot ",
  362. mouse_callbacks={
  363. "Button1": lambda: qtile.cmd_spawn("kitty -e reboot"),
  364. },
  365. ),
  366. widget.Sep(
  367. padding=10,
  368. linewidth=1,
  369. ),
  370. widget.TextBox(
  371. text="  PowerOff ",
  372. mouse_callbacks={
  373. "Button1": lambda: qtile.cmd_spawn(
  374. "kitty -e shutdown -h now"
  375. ),
  376. # "Button1": lambda: qtile.cmd_spawn("kitty -e poweroff"),
  377. },
  378. ),
  379. widget.Sep(
  380. padding=10,
  381. linewidth=1,
  382. ),
  383. widget.QuickExit(default_text="Quit QTILE"),
  384. widget.Sep(
  385. padding=10,
  386. linewidth=1,
  387. ),
  388. ],
  389. ),
  390. # widget.Sep(
  391. # padding=10,
  392. # linewidth=0,
  393. # ),
  394. # widget.GroupBox(
  395. # background="#282a2e",
  396. # active="#f1f1f1",
  397. # highlight_color="#1d1f21",
  398. # this_current_screen_border="#8c9440",
  399. # block_highlight_text_color="#8c9440",
  400. # inactive="#707880",
  401. # highlight_method="line",
  402. # borderwidth=2,
  403. # padding_x=8,
  404. # rounded=False,
  405. # hide_unused=False,
  406. # fontsize=12,
  407. # ),
  408. widget.GroupBox(
  409. # background="#282a2e",
  410. background="#10181f",
  411. active="#f1f1f1",
  412. highlight_color="#1d1f21",
  413. # this_current_screen_border="#5f819d",
  414. this_current_screen_border="#1177aa",
  415. # block_highlight_text_color="#1d1f21",
  416. block_highlight_text_color="#f2f2f2",
  417. inactive="#707880",
  418. highlight_method="block",
  419. borderwidth=2,
  420. padding_x=8,
  421. rounded=False,
  422. hide_unused=False,
  423. fontsize=14,
  424. ),
  425. widget.CurrentLayoutIcon(
  426. scale=0.6,
  427. ),
  428. widget.Sep(
  429. padding=10,
  430. linewidth=0,
  431. ),
  432. widget.Prompt(),
  433. widget.WindowName(
  434. fontsize=14,
  435. ),
  436. widget.WidgetBox(
  437. close_button_location="right",
  438. text_open=" 󰔰 ",
  439. text_closed=" 󰧀 ",
  440. # background="#5f819d",
  441. background="#1177aa",
  442. foreground="#f2f2f2",
  443. # foreground="#1d1f21",
  444. fontsize=14,
  445. widgets=[
  446. widget.Wttr(
  447. location={"Simferopol": "󰖚"},
  448. fontsize=14,
  449. format="2",
  450. background="#282a2e",
  451. padding=10,
  452. ),
  453. widget.Sep(
  454. padding=10,
  455. linewidth=1,
  456. background="#282a2e",
  457. ),
  458. widget.CryptoTicker(
  459. update_interval=600,
  460. fontsize=14,
  461. background="#282a2e",
  462. padding=10,
  463. ),
  464. ],
  465. ),
  466. widget.Cmus(
  467. play_color="#8c9440",
  468. noplay_color="#CC6666",
  469. update_interval=0.5,
  470. markup=True,
  471. background="#282a2e",
  472. padding=10,
  473. margin=10,
  474. fontsize=14,
  475. ),
  476. # widget.Sep(
  477. # padding=10,
  478. # linewidth=1,
  479. # ),
  480. widget.CheckUpdates(
  481. distro="Arch_checkupdates",
  482. fmt="  {}",
  483. fontsize=14,
  484. update_interval=300,
  485. no_update_string="No",
  486. mouse_callbacks={
  487. # 'Button1': lambda: qtile.cmd_spawn("kitty -e sudo pacman -Syyu"),
  488. "Button1": lambda: qtile.cmd_spawn(
  489. "kitty -e sudo pacman -Syyu"
  490. ),
  491. "Button2": lambda: qtile.cmd_spawn("kitty -e yay -Sc"),
  492. "Button3": lambda: qtile.cmd_spawn("kitty -e sudo pacman -Sc"),
  493. },
  494. ),
  495. widget.Sep(
  496. padding=10,
  497. linewidth=1,
  498. ),
  499. # widget.Net(
  500. # fmt=' {}',
  501. # fontsize=12,
  502. # interface='enp0s31f6',
  503. # format='{interface}: U {up} D {down} T {total}',
  504. # prefix='M',
  505. # ),
  506. # widget.Sep(
  507. # padding=10,
  508. # linewidth=1,
  509. # ),
  510. # widget.Memory(
  511. # fmt=' {}',
  512. # fontsize=12,
  513. # mouse_callbacks={
  514. # 'Button1': lambda: qtile.cmd_spawn('st -e htop'),
  515. # 'Button3': lambda: qtile.cmd_spawn('st -e btm'),
  516. # },
  517. # ),
  518. # widget.Sep(
  519. # padding=10,
  520. # linewidth=1,
  521. # ),
  522. widget.DF(
  523. fmt=" {}",
  524. partition="/",
  525. measure="G",
  526. format="{p} ({uf}{m}|{r:.0f}%)",
  527. update_interval=60,
  528. fontsize=14,
  529. visible_on_warn=False,
  530. warn_space=40,
  531. mouse_callbacks={
  532. "Button1": lambda: qtile.cmd_spawn("kitty -e ncdu"),
  533. },
  534. ),
  535. widget.Sep(
  536. padding=10,
  537. linewidth=1,
  538. ),
  539. widget.ThermalZone(
  540. fmt=" {}",
  541. fontsize=14,
  542. mouse_callbacks={
  543. "Button3": lambda: qtile.cmd_spawn("kitty -e btm"),
  544. },
  545. ),
  546. widget.Sep(
  547. padding=10,
  548. linewidth=1,
  549. ),
  550. widget.Battery(
  551. fmt="󰁹 {}",
  552. fontsize=14,
  553. update_interval=60,
  554. battery=0,
  555. format="{char} {percent:2.0%} {hour:d}:{min:02d}",
  556. # format = '{char} {percent:2.0%} {hour:d}:{min:02d} {watt:.2f} W',
  557. ),
  558. # NB Systray is incompatible with Wayland, consider using StatusNotifier instead
  559. # widget.StatusNotifier(),
  560. widget.Sep(
  561. padding=10,
  562. linewidth=1,
  563. ),
  564. widget.Clock(
  565. fmt="󱇻 {}",
  566. format="%a, %b %d %T",
  567. fontsize=14,
  568. mouse_callbacks={
  569. "Button3": lambda: qtile.cmd_spawn("kitty -e calcurse")
  570. },
  571. ),
  572. widget.Sep(
  573. padding=10,
  574. linewidth=1,
  575. ),
  576. # widget.PulseVolume(
  577. # fmt="󰕾 {}",
  578. # fontsize=14,
  579. # emoji=False,
  580. # limit_max_volume=True,
  581. # mouse_callbacks={
  582. # 'Button3': lambda: qtile.cmd_spawn("kitty -e alsamixer")
  583. # },
  584. # ),
  585. # widget.Volume(
  586. # fmt="󰕾 {}",
  587. # fontsize=14,
  588. # emoji=False,
  589. # limit_max_volume=True,
  590. # mouse_callbacks={
  591. # "Button3": lambda: qtile.cmd_spawn("kitty -e alsamixer")
  592. # },
  593. # ),
  594. widget.TextBox(
  595. fmt="󱡫",
  596. mouse_callbacks={
  597. "Button1": lambda: qtile.cmd_spawn("kitty -e alsamixer")
  598. },
  599. ),
  600. widget.Sep(
  601. padding=10,
  602. linewidth=1,
  603. ),
  604. widget.Systray(),
  605. widget.Sep(
  606. padding=10,
  607. linewidth=0,
  608. ),
  609. ],
  610. 24,
  611. # border_width=[2, 0, 2, 0], # Draw top and bottom borders
  612. # border_color=["ff00ff", "000000", "ff00ff", "000000"] # Borders are magenta
  613. # background="#1d1f21"
  614. background="#10181f",
  615. ),
  616. ),
  617. ]
  618. # Drag floating layouts.
  619. mouse = [
  620. Drag(
  621. [mod],
  622. "Button1",
  623. lazy.window.set_position_floating(),
  624. start=lazy.window.get_position(),
  625. ),
  626. Drag(
  627. [mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()
  628. ),
  629. Click([mod], "Button2", lazy.window.bring_to_front()),
  630. ]
  631. dgroups_key_binder = None
  632. dgroups_app_rules = [] # type: list
  633. follow_mouse_focus = True
  634. bring_front_click = False
  635. cursor_warp = False
  636. floating_layout = layout.Floating(
  637. border_normal="#373b41",
  638. # border_focus="#b294bb",
  639. border_focus=["#1177aa"],
  640. border_width=2,
  641. float_rules=[
  642. # Run the utility of `xprop` to see the wm class and name of an X client.
  643. *layout.Floating.default_float_rules,
  644. Match(wm_class="confirmreset"), # gitk
  645. Match(wm_class="makebranch"), # gitk
  646. Match(wm_class="maketag"), # gitk
  647. Match(wm_class="ssh-askpass"), # ssh-askpass
  648. Match(title="branchdialog"), # gitk
  649. Match(title="pinentry"), # GPG key password entry
  650. Match(title="galculator"), # Galculator
  651. # Match(title="KeePassXC"), # KeePassXC pass manager
  652. ],
  653. )
  654. auto_fullscreen = True
  655. focus_on_window_activation = "smart"
  656. reconfigure_screens = True
  657. # If things like steam games want to auto-minimize themselves when losing
  658. # focus, should we respect this or not?
  659. auto_minimize = True
  660. # When using the Wayland backend, this can be used to configure input devices.
  661. wl_input_rules = None
  662. # XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this
  663. # string besides java UI toolkits; you can see several discussions on the
  664. # mailing lists, GitHub issues, and other WM documentation that suggest setting
  665. # this string if your java app doesn't work correctly. We may as well just lie
  666. # and say that we're a working one by default.
  667. #
  668. # We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in
  669. # java that happens to be on java's whitelist.
  670. wmname = "LG3D"