From 54d01ddad337946de0bb20ad1592ed30b60fd558 Mon Sep 17 00:00:00 2001 From: cerberus Date: Tue, 24 Feb 2026 21:42:25 +0100 Subject: [PATCH] fix --- .gitignore | 177 ++++++++++++++++++ __pycache__/config.cpython-314.pyc | Bin 1346 -> 1274 bytes {res => assets}/images/no_cover.svg | 0 {res => assets}/images/normal.png | Bin {res => assets}/images/standby_rotated.png | Bin {res => assets}/images/standby_rotated_.png | Bin {modules => assets/plugins}/__init__.py | 0 .../plugins}/graphical_notifications.py | 0 {plugins => assets/plugins}/notifications.py | 0 .../plugins}/notifications_copy.py | 0 {popups => assets/popups}/calendar.py | 62 +++--- {popups => assets/popups}/monitor.py | 2 +- {popups => assets/popups}/mpris2_layout.py | 36 ++-- assets/popups/network.py | 50 +++++ assets/popups/powermenu.py | 71 +++++++ {popups => assets/popups}/powermenu_sub.py | 26 +-- assets/popups/settings.py | 61 ++++++ {popups => assets/popups}/start_menu.py | 13 +- .../popups}/volume_notification.py | 11 +- {res => assets}/scripts/autoclicker.py | 0 {res => assets}/scripts/autostart.sh | 0 {res => assets}/scripts/keybinds.py | 0 res/themes/colors.py => colors.py | 0 config.py | 10 +- modules/groups.py => groups.py | 2 +- modules/hooks.py => hooks.py | 28 ++- modules/keys.py => keys.py | 0 modules/layouts.py => layouts.py | 0 plugins/__init__.py | 0 popups/__init__.py | 0 popups/network.py | 48 ----- popups/powermenu.py | 70 ------- popups/settings.py | 59 ------ modules/screens.py => screens.py | 53 ++---- 34 files changed, 481 insertions(+), 298 deletions(-) create mode 100644 .gitignore rename {res => assets}/images/no_cover.svg (100%) rename {res => assets}/images/normal.png (100%) rename {res => assets}/images/standby_rotated.png (100%) rename {res => assets}/images/standby_rotated_.png (100%) rename {modules => assets/plugins}/__init__.py (100%) rename {plugins => assets/plugins}/graphical_notifications.py (100%) rename {plugins => assets/plugins}/notifications.py (100%) rename {plugins => assets/plugins}/notifications_copy.py (100%) rename {popups => assets/popups}/calendar.py (70%) rename {popups => assets/popups}/monitor.py (93%) rename {popups => assets/popups}/mpris2_layout.py (81%) create mode 100644 assets/popups/network.py create mode 100644 assets/popups/powermenu.py rename {popups => assets/popups}/powermenu_sub.py (87%) create mode 100644 assets/popups/settings.py rename {popups => assets/popups}/start_menu.py (94%) rename {popups => assets/popups}/volume_notification.py (83%) rename {res => assets}/scripts/autoclicker.py (100%) rename {res => assets}/scripts/autostart.sh (100%) rename {res => assets}/scripts/keybinds.py (100%) rename res/themes/colors.py => colors.py (100%) rename modules/groups.py => groups.py (99%) rename modules/hooks.py => hooks.py (66%) rename modules/keys.py => keys.py (100%) rename modules/layouts.py => layouts.py (100%) delete mode 100644 plugins/__init__.py delete mode 100644 popups/__init__.py delete mode 100644 popups/network.py delete mode 100644 popups/powermenu.py delete mode 100644 popups/settings.py rename modules/screens.py => screens.py (88%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4af8288 --- /dev/null +++ b/.gitignore @@ -0,0 +1,177 @@ +# ---> Python +# Byte-compiled / optimized / DLL files +**/__pycache__/** +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# UV +# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +#uv.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/latest/usage/project/#working-with-version-control +.pdm.toml +.pdm-python +.pdm-build/ + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +# Ruff stuff: +.ruff_cache/ + +# PyPI configuration file +.pypirc + + diff --git a/__pycache__/config.cpython-314.pyc b/__pycache__/config.cpython-314.pyc index 5ead62287db4ba137dfa3c4c91395f8e3aa35074..fcbefc6efebdd0e6ce8ebcecdbecde67fb625028 100644 GIT binary patch delta 370 zcmZ{ey-ve06os!H=f?>tZ30N4t*Q)Up(L2p&PtHm6=yy;SCrN zBO3x0b!TEmLgG413|#4aK37*hIuG%eOb>f$3^aGow-?J*T3rKzV#p>?gW;Mhj$C=@ zb-Sm95-609ezyx9r~re``#L=4oeOlNB+AZ*I#vlL6R?zNDce$>r94YHmU1lpHxX{l z08=BecS_hM^+^L#W@60g-68Fo1oy05%v|BWvzV_w%3*On{_osYtUM@8-zFv0PxYA@ zn9SrS;y31q;Xbt())|i4OZHuj8;>rHJ2$>V;1D`Q4wCTZ-@ou1R?f*Y($y>B(_@Tn TV7h@3@g0gaS| zIRgD$heCruksDBIVJjmR5Q~TVNX6PMxhP zF9_Qq-lKQKi@e0khsrEwhr&8uQS(Z$F$(DSz?s-r;dw9c<3@ZI`Tlhr$+#LN`;**U zy7c>Tq$YeO;eRc`Nk8mC9BGN9CsKZHxroBvO&l2sY0b$_7+%H`J?Ng^LO1ZE?A=%j isnf(Iiin@Ey~~u+DQQm0CiWNNJd?_3S9wtOQ2YUlS7`14 diff --git a/res/images/no_cover.svg b/assets/images/no_cover.svg similarity index 100% rename from res/images/no_cover.svg rename to assets/images/no_cover.svg diff --git a/res/images/normal.png b/assets/images/normal.png similarity index 100% rename from res/images/normal.png rename to assets/images/normal.png diff --git a/res/images/standby_rotated.png b/assets/images/standby_rotated.png similarity index 100% rename from res/images/standby_rotated.png rename to assets/images/standby_rotated.png diff --git a/res/images/standby_rotated_.png b/assets/images/standby_rotated_.png similarity index 100% rename from res/images/standby_rotated_.png rename to assets/images/standby_rotated_.png diff --git a/modules/__init__.py b/assets/plugins/__init__.py similarity index 100% rename from modules/__init__.py rename to assets/plugins/__init__.py diff --git a/plugins/graphical_notifications.py b/assets/plugins/graphical_notifications.py similarity index 100% rename from plugins/graphical_notifications.py rename to assets/plugins/graphical_notifications.py diff --git a/plugins/notifications.py b/assets/plugins/notifications.py similarity index 100% rename from plugins/notifications.py rename to assets/plugins/notifications.py diff --git a/plugins/notifications_copy.py b/assets/plugins/notifications_copy.py similarity index 100% rename from plugins/notifications_copy.py rename to assets/plugins/notifications_copy.py diff --git a/popups/calendar.py b/assets/popups/calendar.py similarity index 70% rename from popups/calendar.py rename to assets/popups/calendar.py index b5eac0d..7a705c8 100644 --- a/popups/calendar.py +++ b/assets/popups/calendar.py @@ -3,11 +3,12 @@ import subprocess from libqtile import qtile from qtile_extras import widget -from qtile_extras.popup.toolkit import (PopupRelativeLayout, - PopupWidget, - ) +from qtile_extras.popup.toolkit import ( + PopupRelativeLayout, + PopupWidget, +) -from res.themes.colors import gruvbox_dark +from colors import gruvbox_dark # https://discord.com/channels/955163559086665728/1166312212223250482/1322614846155657370 # check for this PR to change back the code with the message contents to the prev code of the widget: @@ -49,7 +50,7 @@ def calendar(qtile): rows=7, cols=9, width=300, - height=310, + height=310, opacity=0.8, hide_on_mouse_leave=True, close_on_click=False, @@ -63,11 +64,8 @@ def calendar(qtile): width=0.9, v_align="middle", h_align="center", - widget=widget.Wttr( - fontsize=40, - format='%c' - ) - ), + widget=widget.Wttr(fontsize=40, format="%c"), + ), PopupWidget( pos_x=0.3, pos_y=0.05, @@ -76,44 +74,36 @@ def calendar(qtile): v_align="middle", h_align="center", widget=widget.Wttr( - font='Open Sans Bold', - fontsize=18, - format='Actual: %t' - ) + font="Open Sans Bold", fontsize=18, format="Actual: %t" ), + ), PopupWidget( pos_x=0.3, pos_y=0.12, height=0.05, width=0.9, - widget=widget.Wttr( - font='Open Sans', - fontsize=14, - format='Feels: %f' - ) - ), + widget=widget.Wttr(font="Open Sans", fontsize=14, format="Feels: %f"), + ), PopupWidget( pos_x=0.05, pos_y=0.2, height=0.05, width=0.9, widget=widget.Wttr( - font='Open Sans', - fontsize=14, - format='Wind: %w Prec: %p' - ) + font="Open Sans", fontsize=14, format="Wind: %w Prec: %p" ), + ), PopupWidget( pos_x=0.05, pos_y=0.25, height=0.11, width=0.9, widget=widget.Wttr( - font='Open Sans Bold', + font="Open Sans Bold", fontsize=14, - format='City: %l', # \nFeel;%f Wind: %w' - ) + format="City: %l", # \nFeel;%f Wind: %w' ), + ), PopupWidget( pos_x=0.051, pos_y=0.38, @@ -121,15 +111,17 @@ def calendar(qtile): width=0.9, widget=widget.GenPollText( func=parse_cal, - font='mono', + font="mono", fontsize=20, markup=False, - ) ), - ] + ), + ], ) - layout.show(relative_to=3, - relative_to_bar=True, - y=3, - x=-3, - ) \ No newline at end of file + layout.show( + relative_to=3, + relative_to_bar=True, + y=3, + x=-3, + ) + diff --git a/popups/monitor.py b/assets/popups/monitor.py similarity index 93% rename from popups/monitor.py rename to assets/popups/monitor.py index 6ac460e..c14b2c0 100644 --- a/popups/monitor.py +++ b/assets/popups/monitor.py @@ -6,7 +6,7 @@ from qtile_extras.popup.toolkit import ( PopupWidget, ) -from res.themes.colors import gruvbox_dark +from colors import gruvbox_dark def monitor(qtile): diff --git a/popups/mpris2_layout.py b/assets/popups/mpris2_layout.py similarity index 81% rename from popups/mpris2_layout.py rename to assets/popups/mpris2_layout.py index 34998bc..8aa2e5d 100644 --- a/popups/mpris2_layout.py +++ b/assets/popups/mpris2_layout.py @@ -1,11 +1,12 @@ -from res.themes.colors import gruvbox_dark +from colors import gruvbox_dark from qtile_extras.popup.toolkit import ( PopupRelativeLayout, PopupImage, PopupText, - PopupSlider + PopupSlider, ) -image='/home/cerberus/.config/qtile/res/images/no_cover.svg' + +image = "/home/cerberus/.config/qtile/assets/images/no_cover.svg" MPRIS2_LAYOUT = PopupRelativeLayout( None, @@ -18,7 +19,7 @@ MPRIS2_LAYOUT = PopupRelativeLayout( PopupText( "", name="title", - font='Open Sans Bold', + font="Open Sans Bold", fontsize=18, pos_x=0.35, pos_y=0.1, @@ -30,7 +31,7 @@ MPRIS2_LAYOUT = PopupRelativeLayout( PopupText( "", name="artist", - font='Open Sans Medium', + font="Open Sans Medium", fontsize=14, pos_x=0.35, pos_y=0.24, @@ -42,7 +43,7 @@ MPRIS2_LAYOUT = PopupRelativeLayout( PopupText( "", name="album", - font='Open Sans', + font="Open Sans", fontsize=14, pos_x=0.35, pos_y=0.38, @@ -59,10 +60,12 @@ MPRIS2_LAYOUT = PopupRelativeLayout( width=0.21, height=0.42, ), - PopupSlider(name="progress", pos_x=0.1, pos_y=0.6, width=0.8, height=0.1, marker_size=0), + PopupSlider( + name="progress", pos_x=0.1, pos_y=0.6, width=0.8, height=0.1, marker_size=0 + ), PopupText( name="previous", - text='󰙤', + text="󰙤", fontsize=30, mask=True, pos_x=0.125, @@ -71,13 +74,13 @@ MPRIS2_LAYOUT = PopupRelativeLayout( height=0.1, v_align="middle", h_align="center", - highlight_method='text', + highlight_method="text", foreground=gruvbox_dark["fg0"], highlight=gruvbox_dark["green"], ), PopupText( name="play_pause", - text='󰐎', + text="󰐎", fontsize=30, mask=True, pos_x=0.325, @@ -86,13 +89,13 @@ MPRIS2_LAYOUT = PopupRelativeLayout( height=0.1, v_align="middle", h_align="center", - highlight_method='text', + highlight_method="text", foreground=gruvbox_dark["fg0"], highlight=gruvbox_dark["green"], ), PopupText( name="stop", - text='', + text="", fontsize=30, mask=True, pos_x=0.525, @@ -101,13 +104,13 @@ MPRIS2_LAYOUT = PopupRelativeLayout( height=0.1, v_align="middle", h_align="center", - highlight_method='text', + highlight_method="text", foreground=gruvbox_dark["fg0"], highlight=gruvbox_dark["green"], ), PopupText( name="next", - text='󰙢', + text="󰙢", fontsize=30, mask=True, pos_x=0.725, @@ -116,10 +119,11 @@ MPRIS2_LAYOUT = PopupRelativeLayout( height=0.1, v_align="middle", h_align="center", - highlight_method='text', + highlight_method="text", foreground=gruvbox_dark["fg0"], highlight=gruvbox_dark["green"], ), ], close_on_click=False, -) \ No newline at end of file +) + diff --git a/assets/popups/network.py b/assets/popups/network.py new file mode 100644 index 0000000..4b18506 --- /dev/null +++ b/assets/popups/network.py @@ -0,0 +1,50 @@ +from libqtile import qtile +from libqtile.lazy import lazy + +from colors import gruvbox_dark + +from qtile_extras.popup.menu import ( + PopupMenu, + PopupMenuItem, + PopupMenuSeparator, +) + +items = [ + PopupMenuItem( + show_icon=False, + text="󰛳 Network Manager", + font="Open Sans", + fontsize=16, + can_focus=True, + highlight_method="text", + foreground=gruvbox_dark["fg0"], + highlight=gruvbox_dark["green"], + mouse_callbacks={"Button1": lazy.spawn("nm-connection-editor")}, + ), + PopupMenuSeparator(), + PopupMenuItem( + show_icon=False, + text="󰐚 Wireguard", + font="Open Sans", + fontsize=16, + highlight_method="text", + can_focus=True, + foreground=gruvbox_dark["fg0"], + highlight=gruvbox_dark["green"], + mouse_callbacks={"Button1": lazy.spawn("wireguird")}, + ), +] + + +def network_menu(qtile): + layout = PopupMenu.generate( + qtile, + pos_x=100, + pos_y=100, + width=225, + opacity=0.7, + menuitems=items, + background=gruvbox_dark["bg0_soft"], + ) + layout.show(relative_to=1, relative_to_bar=True, y=136, x=220) + diff --git a/assets/popups/powermenu.py b/assets/popups/powermenu.py new file mode 100644 index 0000000..07dca39 --- /dev/null +++ b/assets/popups/powermenu.py @@ -0,0 +1,71 @@ +from libqtile.lazy import lazy +from colors import gruvbox_dark +from qtile_extras.popup.toolkit import ( + PopupRelativeLayout, + PopupText, +) + + +# qtile/resources/themes/colors.py +def power_menu(qtile): + layout = PopupRelativeLayout( + qtile, + width=800, + height=250, + opacity=0.7, + # border=gruvbox_dark["red"], + # border_width=3, + background=gruvbox_dark["bg0_soft"], + initial_focus=None, + controls=[ + PopupText( + # Lock betterlockscreen --lock blur + text="", + fontsize=80, + pos_y=0, + pos_x=0.1, + width=0.2, + height=1, + mouse_callbacks={"Button1": lazy.spawn("betterlockscreen --lock blur")}, + highlight_method="text", + highlight=gruvbox_dark["green"], + ), + PopupText( + # Hybrid Sleep systemctl hybrid-sleep + text="󰒲", + fontsize=80, + pos_y=0, + pos_x=0.32, + width=0.2, + height=1, + mouse_callbacks={"Button1": lazy.spawn("systemctl hybrid-sleep")}, + highlight_method="text", + highlight=gruvbox_dark["yellow"], + ), + PopupText( + # Hibernate systemctl hibernate + text="", + fontsize=80, + pos_y=0, + pos_x=0.55, + width=0.2, + height=1, + mouse_callbacks={"Button1": lazy.spawn("systemctl hibernate")}, + highlight_method="text", + highlight=gruvbox_dark["orange"], + ), + PopupText( + # Power off systemctl poweroff + text="", + fontsize=80, + pos_y=0, + pos_x=0.8, + width=0.2, + height=1, + mouse_callbacks={"Button1": lazy.spawn("systemctl poweroff")}, + highlight_method="text", + highlight=gruvbox_dark["red"], + ), + ], + ) + layout.show(relative_to=5, relative_to_bar=True, hide_on_timeout=5) diff --git a/popups/powermenu_sub.py b/assets/popups/powermenu_sub.py similarity index 87% rename from popups/powermenu_sub.py rename to assets/popups/powermenu_sub.py index 00efd79..1e5c3c7 100644 --- a/popups/powermenu_sub.py +++ b/assets/popups/powermenu_sub.py @@ -2,7 +2,7 @@ from pydoc import importfile from libqtile import qtile from libqtile.lazy import lazy -from res.themes.colors import gruvbox_dark +from colors import gruvbox_dark from qtile_extras.popup.toolkit import ( PopupRelativeLayout, @@ -10,11 +10,12 @@ from qtile_extras.popup.toolkit import ( PopupText, ) + def powermenu_2(qtile): layout = PopupRelativeLayout( qtile, width=170, - height=50, + height=50, opacity=0.7, hide_on_mouse_leave=True, close_on_click=False, @@ -23,7 +24,7 @@ def powermenu_2(qtile): controls=[ PopupText( # Lock - text='', + text="", fontsize=22, pos_x=0.07, pos_y=0.05, @@ -32,14 +33,14 @@ def powermenu_2(qtile): can_focus=True, v_align="middle", h_align="center", - highlight_method='text', + highlight_method="text", foreground=gruvbox_dark["fg0"], highlight=gruvbox_dark["green"], mouse_callbacks={"Button1": lazy.spawn("betterlockscreen --lock blur")}, ), PopupText( # Reboot - text='', + text="", fontsize=22, pos_x=0.3, pos_y=0.05, @@ -48,14 +49,14 @@ def powermenu_2(qtile): can_focus=True, v_align="middle", h_align="center", - highlight_method='text', + highlight_method="text", foreground=gruvbox_dark["fg0"], highlight=gruvbox_dark["green"], mouse_callbacks={"Button1": lazy.spawn("systemctl reboot")}, ), PopupText( # Suspend - text='󰒲', + text="󰒲", fontsize=22, pos_x=0.54, pos_y=0.05, @@ -64,14 +65,14 @@ def powermenu_2(qtile): can_focus=True, v_align="middle", h_align="center", - highlight_method='text', + highlight_method="text", foreground=gruvbox_dark["fg0"], highlight=gruvbox_dark["green"], mouse_callbacks={"Button1": lazy.spawn("systemctl suspend")}, ), PopupText( # Shutdown - text='', + text="", fontsize=22, pos_x=0.78, pos_y=0.05, @@ -80,11 +81,12 @@ def powermenu_2(qtile): can_focus=True, v_align="middle", h_align="center", - highlight_method='text', + highlight_method="text", foreground=gruvbox_dark["fg0"], highlight=gruvbox_dark["green"], mouse_callbacks={"Button1": lazy.spawn("systemctl poweroff")}, ), - ] + ], ) - layout.show(relative_to=1, relative_to_bar=True, y=136, x=30) \ No newline at end of file + layout.show(relative_to=1, relative_to_bar=True, y=136, x=30) + diff --git a/assets/popups/settings.py b/assets/popups/settings.py new file mode 100644 index 0000000..5a9dd69 --- /dev/null +++ b/assets/popups/settings.py @@ -0,0 +1,61 @@ +from libqtile import qtile +from libqtile.lazy import lazy + +from colors import gruvbox_dark + +from qtile_extras.popup.menu import ( + PopupMenu, + PopupMenuItem, + PopupMenuSeparator, +) + +items = [ + PopupMenuItem( # Wallpaper setting + show_icon=False, + text=" 󰸉 Nitrogen Wallpaper", + font="Open Sans", + fontsize=16, + can_focus=True, + highlight_method="text", + foreground=gruvbox_dark["fg0"], + highlight=gruvbox_dark["green"], + mouse_callbacks={"Button1": lazy.spawn("nitrogen")}, + ), + PopupMenuSeparator(), + PopupMenuItem( # Arandr + show_icon=False, + text=" 󰹑 Arandr Display", + font="Open Sans", + fontsize=16, + can_focus=True, + highlight_method="text", + foreground=gruvbox_dark["fg0"], + highlight=gruvbox_dark["green"], + mouse_callbacks={"Button1": lazy.spawn("arandr")}, + ), + PopupMenuSeparator(), + PopupMenuItem( # VS-Code qtile config + show_icon=False, + text="  Qtile Config", + font="Open Sans", + fontsize=16, + can_focus=True, + highlight_method="text", + foreground=gruvbox_dark["fg0"], + highlight=gruvbox_dark["green"], + mouse_callbacks={"Button1": lazy.spawn("code /home/cerberus/.config/")}, + ), +] + + +def settings(qtile): + layout = PopupMenu.generate( + qtile, + pos_x=100, + pos_y=100, + width=225, + opacity=0.7, + menuitems=items, + background=gruvbox_dark["bg0_soft"], + ) + layout.show(relative_to=1, relative_to_bar=True, y=75, x=325) diff --git a/popups/start_menu.py b/assets/popups/start_menu.py similarity index 94% rename from popups/start_menu.py rename to assets/popups/start_menu.py index 18709bf..edbe494 100644 --- a/popups/start_menu.py +++ b/assets/popups/start_menu.py @@ -9,11 +9,11 @@ from qtile_extras.popup.toolkit import ( PopupWidget, ) -from res.themes.colors import gruvbox_dark -from popups.settings import settings -from popups.network import network_menu -from popups.powermenu_sub import powermenu_2 -from popups.monitor import monitor +from colors import gruvbox_dark +from assets.popups.settings import settings +from assets.popups.network import network_menu +from assets.popups.powermenu_sub import powermenu_2 +from assets.popups.monitor import monitor def start_menu(qtile): @@ -36,7 +36,7 @@ def start_menu(qtile): width=0.3, mask=True, colour=gruvbox_dark["blue"], - filename="/home/cerberus/.config/qtile/res/images/standby_rotated.png", + filename="/home/cerberus/.config/qtile/assets/images/standby_rotated_.png", ), PopupWidget( # Welcome banner, fetching user name from $USER @@ -183,4 +183,3 @@ def start_menu(qtile): ], ) layout.show(relative_to=1, relative_to_bar=True, y=3, x=3) - diff --git a/popups/volume_notification.py b/assets/popups/volume_notification.py similarity index 83% rename from popups/volume_notification.py rename to assets/popups/volume_notification.py index 26bbccb..4a23860 100644 --- a/popups/volume_notification.py +++ b/assets/popups/volume_notification.py @@ -1,10 +1,6 @@ -from res.themes.colors import gruvbox_dark +from colors import gruvbox_dark -from qtile_extras.popup.toolkit import ( - PopupRelativeLayout, - PopupText, - PopupSlider -) +from qtile_extras.popup.toolkit import PopupRelativeLayout, PopupText, PopupSlider VOL_POPUP = PopupRelativeLayout( @@ -37,4 +33,5 @@ VOL_POPUP = PopupRelativeLayout( end_margin=0, ), ], -) \ No newline at end of file +) + diff --git a/res/scripts/autoclicker.py b/assets/scripts/autoclicker.py similarity index 100% rename from res/scripts/autoclicker.py rename to assets/scripts/autoclicker.py diff --git a/res/scripts/autostart.sh b/assets/scripts/autostart.sh similarity index 100% rename from res/scripts/autostart.sh rename to assets/scripts/autostart.sh diff --git a/res/scripts/keybinds.py b/assets/scripts/keybinds.py similarity index 100% rename from res/scripts/keybinds.py rename to assets/scripts/keybinds.py diff --git a/res/themes/colors.py b/colors.py similarity index 100% rename from res/themes/colors.py rename to colors.py diff --git a/config.py b/config.py index 92077a2..b9129b6 100644 --- a/config.py +++ b/config.py @@ -1,8 +1,8 @@ -from modules.screens import screens, widget_defaults -from modules.keys import keys, mouse -from modules.layouts import layouts, floating_layout -from modules.groups import groups -from modules.hooks import * +from screens import screens, widget_defaults +from keys import keys, mouse +from layouts import layouts, floating_layout +from groups import groups +from hooks import * from libqtile import qtile from libqtile.backend.wayland.inputs import InputConfig diff --git a/modules/groups.py b/groups.py similarity index 99% rename from modules/groups.py rename to groups.py index 30b3d27..32ec4d8 100644 --- a/modules/groups.py +++ b/groups.py @@ -1,6 +1,6 @@ from libqtile.config import Group, Key, Match, DropDown, ScratchPad from libqtile.lazy import lazy -from .keys import keys, mod +from keys import keys, mod import re group_screen_map = { diff --git a/modules/hooks.py b/hooks.py similarity index 66% rename from modules/hooks.py rename to hooks.py index d8a4a87..c849ee5 100644 --- a/modules/hooks.py +++ b/hooks.py @@ -14,6 +14,7 @@ from libqtile import hook, qtile import subprocess import os.path from libqtile.config import Match +import asyncio # -------------------------------------------------------------------- # HOOK startup @@ -24,7 +25,7 @@ FULLSCREEN_RULES = [Match(wm_class="flameshot")] @hook.subscribe.startup_once def autostart(): - autostartscript = "~/.config/qtile/res/scripts/autostart.sh" + autostartscript = "~/.config/qtile/assets/scripts/autostart.sh" home = os.path.expanduser(autostartscript) subprocess.Popen([home]) @@ -44,3 +45,28 @@ def force_fullscreen(client) -> None: if any(client.match(rule) for rule in FULLSCREEN_RULES): client.fullscreen = True + + +@hook.subscribe.client_new +def tile_mpv(client): + if client.name == "mpv" or "mpvk": + client.floating = False + + +# @hook.subscribe.client_new +# def tile_mpv(client): +# # wm_class gibt oft eine liste zurück, z.b. ['mpv', 'mpv'] +# if "mpv" in client.get_wm_class(): +# client.floating = false + + +# @hook.subscribe.client_new +# def tile_mpv(client): +# if client.name == "mpv": +# # Wartet 0.1 Sekunden, bevor das Floating deaktiviert wird +# asyncio.create_task(set_tile(client)) +# +# +# async def set_tile(client): +# await asyncio.sleep(0.1) +# client.floating = False diff --git a/modules/keys.py b/keys.py similarity index 100% rename from modules/keys.py rename to keys.py diff --git a/modules/layouts.py b/layouts.py similarity index 100% rename from modules/layouts.py rename to layouts.py diff --git a/plugins/__init__.py b/plugins/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/popups/__init__.py b/popups/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/popups/network.py b/popups/network.py deleted file mode 100644 index e0d46f4..0000000 --- a/popups/network.py +++ /dev/null @@ -1,48 +0,0 @@ -from libqtile import qtile -from libqtile.lazy import lazy - -from res.themes.colors import gruvbox_dark - -from qtile_extras.popup.menu import ( - PopupMenu, - PopupMenuItem, - PopupMenuSeparator, - ) - -items=[ - PopupMenuItem( - show_icon=False, - text='󰛳 Network Manager', - font='Open Sans', - fontsize=16, - can_focus=True, - highlight_method='text', - foreground=gruvbox_dark["fg0"], - highlight=gruvbox_dark["green"], - mouse_callbacks={"Button1": lazy.spawn("nm-connection-editor")}, - ), - PopupMenuSeparator(), - PopupMenuItem( - show_icon=False, - text='󰐚 Wireguard', - font='Open Sans', - fontsize=16, - highlight_method='text', - can_focus=True, - foreground=gruvbox_dark["fg0"], - highlight=gruvbox_dark["green"], - mouse_callbacks={"Button1": lazy.spawn("wireguird")}, - ) -] - -def network_menu(qtile): - layout = PopupMenu.generate( - qtile, - pos_x=100, - pos_y=100, - width=225, - opacity=0.7, - menuitems=items, - background=gruvbox_dark["bg0_soft"] - ) - layout.show(relative_to=1, relative_to_bar=True, y=136, x=220) \ No newline at end of file diff --git a/popups/powermenu.py b/popups/powermenu.py deleted file mode 100644 index 4912e8c..0000000 --- a/popups/powermenu.py +++ /dev/null @@ -1,70 +0,0 @@ -from libqtile.lazy import lazy -from res.themes.colors import gruvbox_dark -from qtile_extras.popup.toolkit import ( - PopupRelativeLayout, - PopupText, -) -# qtile/resources/themes/colors.py -def power_menu(qtile): - layout = PopupRelativeLayout( - qtile, - width=800, - height=250, - opacity=0.7, - # border=gruvbox_dark["red"], - # border_width=3, - background=gruvbox_dark["bg0_soft"], - initial_focus=None, - controls=[ - - PopupText( - # Lock betterlockscreen --lock blur - text="", - fontsize=80, - pos_y=0, - pos_x=0.1, - width=0.2, - height=1, - mouse_callbacks={"Button1": lazy.spawn("betterlockscreen --lock blur")}, - highlight_method='text', - highlight=gruvbox_dark["green"], - ), - PopupText( - # Hybrid Sleep systemctl hybrid-sleep - text="󰒲", - fontsize=80, - pos_y=0, - pos_x=0.32, - width=0.2, - height=1, - mouse_callbacks={"Button1": lazy.spawn("systemctl hybrid-sleep")}, - highlight_method='text', - highlight=gruvbox_dark["yellow"], - ), - PopupText( - # Hibernate systemctl hibernate - text="", - fontsize=80, - pos_y=0, - pos_x=0.55, - width=0.2, - height=1, - mouse_callbacks={"Button1": lazy.spawn("systemctl hibernate")}, - highlight_method='text', - highlight=gruvbox_dark["orange"], - ), - PopupText( - # Power off systemctl poweroff - text="", - fontsize=80, - pos_y=0, - pos_x=0.8, - width=0.2, - height=1, - mouse_callbacks={"Button1": lazy.spawn("systemctl poweroff")}, - highlight_method='text', - highlight=gruvbox_dark["red"], - ), - ], - ) - layout.show(relative_to=5, relative_to_bar=True, hide_on_timeout=5) diff --git a/popups/settings.py b/popups/settings.py deleted file mode 100644 index 7da8ec9..0000000 --- a/popups/settings.py +++ /dev/null @@ -1,59 +0,0 @@ -from libqtile import qtile -from libqtile.lazy import lazy - -from res.themes.colors import gruvbox_dark - -from qtile_extras.popup.menu import ( - PopupMenu, - PopupMenuItem, - PopupMenuSeparator, - ) - -items = [ - PopupMenuItem(# Wallpaper setting - show_icon=False, - text=' 󰸉 Nitrogen Wallpaper', - font='Open Sans', - fontsize=16, - can_focus=True, - highlight_method='text', - foreground=gruvbox_dark["fg0"], - highlight=gruvbox_dark["green"], - mouse_callbacks={"Button1": lazy.spawn("nitrogen")}, - ), - PopupMenuSeparator(), - PopupMenuItem(# Arandr - show_icon=False, - text=' 󰹑 Arandr Display', - font='Open Sans', - fontsize=16, - can_focus=True, - highlight_method='text', - foreground=gruvbox_dark["fg0"], - highlight=gruvbox_dark["green"], - mouse_callbacks={"Button1": lazy.spawn("arandr")},), - PopupMenuSeparator(), - PopupMenuItem(# VS-Code qtile config - show_icon=False, - text='  Qtile Config', - font='Open Sans', - fontsize=16, - can_focus=True, - highlight_method='text', - foreground=gruvbox_dark["fg0"], - highlight=gruvbox_dark["green"], - mouse_callbacks={"Button1": lazy.spawn("code /home/cerberus/.config/")},), -] - -def settings(qtile): - layout = PopupMenu.generate( - qtile, - pos_x=100, - pos_y=100, - width=225, - opacity=0.7, - menuitems=items, - background=gruvbox_dark["bg0_soft"] - ) - layout.show(relative_to=1, relative_to_bar=True, y=75, x=325) - diff --git a/modules/screens.py b/screens.py similarity index 88% rename from modules/screens.py rename to screens.py index 7037695..0bdcde2 100644 --- a/modules/screens.py +++ b/screens.py @@ -14,15 +14,15 @@ from qtile_extras import widget from qtile_extras.widget.groupbox2 import GroupBoxRule # from plugins.notifications import Notifier -from plugins.graphical_notifications import Notifier +from assets.plugins.graphical_notifications import Notifier -from popups.powermenu import power_menu -from popups.start_menu import start_menu -from popups.calendar import calendar -from popups.mpris2_layout import MPRIS2_LAYOUT -from popups.volume_notification import VOL_POPUP +from assets.popups.powermenu import power_menu +from assets.popups.start_menu import start_menu +from assets.popups.calendar import calendar +from assets.popups.mpris2_layout import MPRIS2_LAYOUT +from assets.popups.volume_notification import VOL_POPUP -from res.themes.colors import gruvbox_dark as THEME +from colors import gruvbox_dark as THEME # -------------------------------------------------------- @@ -62,14 +62,19 @@ extension_defaults = widget_defaults.copy() # All across defaults: -BACKGROUND = gruvbox_dark["bg0_hard"] +BACKGROUND = THEME["bg0_hard"] OPACITY = 0.7 SIZE = 32 MARGIN = [3, 3, 0, 3] -bar.Bar +# screens = [ +# Screen(top=bar.Bar([widget.Spacer()], size=SIZE)), +# Screen(top=bar.Bar([widget.Spacer()], size=SIZE)), +# Screen(top=bar.Bar([widget.Spacer()], size=SIZE)), +# ] screens = [ Screen( # Center Screen + serial="0000000000001", top=bar.Bar( [ widget.TextBox( @@ -118,20 +123,14 @@ screens = [ popup_show_args={"relative_to": 8, "y": -70}, ), ], -<<<<<<< HEAD background=BACKGROUND, opacity=OPACITY, size=SIZE, margin=MARGIN, -======= - background=THEME["bg0_hard"], - opacity=0.75, - size=32, - margin=[3, 3, 0, 3], ->>>>>>> unify_colors ), ), Screen( + serial="25175B003924", # Right Screen top=bar.Bar( [ @@ -151,7 +150,7 @@ screens = [ hide_unused=True, rules=get_groupbox_rules(monitor_specific=False), ), - widget.Spacer(status_format="{play_status} {artist}/{title}"), + widget.Spacer(), widget.WidgetBox( fontsize=22, text_closed="󱤟", @@ -177,21 +176,15 @@ screens = [ mouse_callbacks={"Button1": lazy.function(power_menu)}, ), ], -<<<<<<< HEAD background=BACKGROUND, opacity=OPACITY, size=SIZE, margin=MARGIN, -======= - background=THEME["bg0_hard"], - opacity=0.75, - size=32, - margin=[3, 3, 0, 3], ->>>>>>> unify_colors ), ), Screen( # Left Screen + serial="25175B004131", top=bar.Bar( [ widget.TextBox( @@ -239,17 +232,10 @@ screens = [ mouse_callbacks={"Button1": lazy.function(power_menu)}, ), ], -<<<<<<< HEAD background=BACKGROUND, opacity=OPACITY, size=SIZE, margin=MARGIN, -======= - background=THEME["bg0_hard"], - opacity=0.75, - size=32, - margin=[3, 3, 0, 3], ->>>>>>> unify_colors ), ), ] @@ -259,13 +245,8 @@ notifier = Notifier( width=350, height=80, format="{summary}\n{app_name}\n{body}", -<<<<<<< HEAD - # file_name="/home/cerberus/.config/qtile/res/images/normal.png", # Not working - foreground=gruvbox_dark["fg1"], -======= # file_name='/home/cerberus/.config/qtile/normal.png', # Not working foreground=THEME["fg1"], ->>>>>>> unify_colors background=( THEME["bg0_hard"], THEME["bg0_hard"],