From c4fb21b2840298b064be3747f3541bcd0d03f90a Mon Sep 17 00:00:00 2001 From: tr1x_em Date: Thu, 14 Aug 2025 10:15:41 +0530 Subject: [PATCH] Initial Hyprconf --- .gitignore | 2 +- config/hypr/modus.conf | 54 ++++++++++++++++++++++++++++++++++++++++++ modules/dock.py | 25 ++++++++++++------- 3 files changed, 71 insertions(+), 10 deletions(-) create mode 100644 config/hypr/modus.conf diff --git a/.gitignore b/.gitignore index c549013..f732789 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ config/assets/dock.json config/assets/accounts.json config/assets/passwords.json config/assets/bookmarks.json -config/hypr/modus.conf +# config/hypr/modus.conf config/hypr/colors.conf fabric/** fabric/ diff --git a/config/hypr/modus.conf b/config/hypr/modus.conf new file mode 100644 index 0000000..baae019 --- /dev/null +++ b/config/hypr/modus.conf @@ -0,0 +1,54 @@ +# LAYER RULES FOR BLURS + +layerrule = blur, ^modus-notifications$ +layerrule = xray 0, ^modus-notifications$ +layerrule = blurpopups, ^modus-notifications$ +layerrule = ignorezero, ^modus-notifications$ +layerrule = noanim , ^modus-notifications$ +layerrule = animation popin, ^lockscreen$ + +layerrule = blur, ^modus-launcher$ +layerrule = xray 0, ^modus-launcher$ +layerrule = blurpopups, ^modus-launcher$ +layerrule = ignorezero, ^modus-launcher$ +layerrule = animation popin, ^modus-launcher$ + +layerrule = blur, ^fabric$ +layerrule = ignorezero, ^fabric$ +layerrule = xray 0, ^fabric$ +layerrule = blurpopups, ^fabric$ +layerrule = blur, ^modus$ +layerrule = xray 0, ^modus$ +layerrule = blurpopups, ^modus$ +layerrule = ignorezero, ^modus$ +layerrule = animation slide right, ^notification-center$ + + +# KEYBINDS + +$HOME = /home/username +exec-once = uwsm-app $(python $HOME/.config/Modus/main.py) +$fabricSend = fabric-cli exec modus +# Reload Modus +bind = SUPER ALT, B, exec, killall modus; uwsm-app $(python $HOME/.config/Modus/main.py) +# Message +bind = SUPER SHIFT, y, exec, $fabricSend 'app.set_css()' # Reload CSS +# # Application Switcher +bind = ALT, TAB, exec, $fabricSend 'switcher.show_switcher()' +# Kanban +bind = SUPER, T, exec, $fabricSend "launcher.show_launcher('kanban')" # Kanban +# App Launcher +bind = SUPER, SPACE, exec, $fabricSend "launcher.show_launcher()" +# Clipboard History +bind = SUPER, V, exec, $fabricSend "launcher.show_launcher('clip')" +# Wallpapers +bind = SUPER, W, exec, $fabricSend "launcher.show_launcher('wall')" +# Random Wallpaper +bind = ALT SHIFT, W, exec, $fabricSend "launcher.show_launcher('wall random', external=True)" +# Emoji Picker +bind = SUPER, Period, exec, $fabricSend "launcher.show_launcher('em')" +# Power Menu +bind = SUPER, ESCAPE, exec, $fabricSend "launcher.show_launcher('power')" +# Toggle Caffeine +bind = SUPER SHIFT, M, exec, $fabricSend "launcher.show_launcher('caffeine on', external=True)" + diff --git a/modules/dock.py b/modules/dock.py index e4c5b29..1f2d326 100644 --- a/modules/dock.py +++ b/modules/dock.py @@ -155,7 +155,7 @@ class AppBar(Box): trash_icon_pixbuf = self.icon_resolver.get_icon_pixbuf( "user-trash", data.DOCK_ICON_SIZE ) - + trash_image = Image(name="dock_item_icon") trash_image.set_from_pixbuf(trash_icon_pixbuf) @@ -287,11 +287,20 @@ class AppBar(Box): if event.button == 1: # Left click try: trash_path = os.path.expanduser("~/.local/share/Trash/files") - file_managers = ["nautilus", "dolphin", "thunar", "nemo", "caja", "pcmanfm"] - + file_managers = [ + "nautilus", + "dolphin", + "thunar", + "nemo", + "caja", + "pcmanfm", + ] + for fm in file_managers: try: - result = subprocess.run(["which", fm], capture_output=True, text=True) + result = subprocess.run( + ["which", fm], capture_output=True, text=True + ) if result.returncode == 0: subprocess.Popen([fm, trash_path]) return @@ -300,8 +309,6 @@ class AppBar(Box): except Exception as e: logger.error(f"[AppBar] Error opening trash: {e}") - - def _handle_item_hovered(self, item, pinned=False): if pinned: try: @@ -527,9 +534,9 @@ class AppBar(Box): for app_identifier, button in self.pinned_buttons.items(): # Skip trash button as it's not a regular app - if app_identifier == "trash" or hasattr(button, 'is_trash'): + if app_identifier == "trash" or hasattr(button, "is_trash"): continue - + if app_identifier.lower() in running_app_classes: button.add_style_class("instance") else: @@ -738,7 +745,7 @@ class Dock(Window): def __init__(self): if not data.DOCK_ENABLED: anchor = self._get_anchor_from_position() - super().__init__(layer="top", anchor=anchor) + super().__init__(layer="top", title="dock", anchor=anchor) self.children = Box() # Empty dock if disabled return