diff --git a/main.py b/main.py index 805fdf6..d4ab529 100644 --- a/main.py +++ b/main.py @@ -1,11 +1,13 @@ import gi -gi.require_version('Gtk', '3.0') -gi.require_version('Gdk', '3.0') + +gi.require_version("Gtk", "3.0") +gi.require_version("Gdk", "3.0") from gi.repository import Gtk, Gdk # Initialize fontconfig early to prevent warnings try: import ctypes + libfontconfig = ctypes.CDLL("libfontconfig.so.1") libfontconfig.FcInit() except: @@ -31,11 +33,14 @@ from modules.switcher import ApplicationSwitcher for log in [ "fabric.hyprland.widgets", "fabric.audio.service", - "fabric.bluetooth.service", + "fabric.bluetooth.service", "services.network", "utils.wayland", "modules.notification.notification", "modules.notification.notification_center", + "modules.controlcenter.player", + "services.brightness", + "modules.controlcenter.expanded_player", ]: logger.disable(log) diff --git a/modules/launcher/plugins/wallpaper.py b/modules/launcher/plugins/wallpaper.py index 039beb9..3d4aa28 100644 --- a/modules/launcher/plugins/wallpaper.py +++ b/modules/launcher/plugins/wallpaper.py @@ -7,6 +7,7 @@ import re import threading import time from typing import Dict, List, Optional +from loguru import logger from gi.repository import GdkPixbuf from PIL import Image @@ -60,9 +61,9 @@ class WallpaperPlugin(PluginBase): [f for f in os.listdir(data.WALLPAPERS_DIR) if self._is_image(f)] ) else: - print(f"Wallpapers directory not found: {data.WALLPAPERS_DIR}") + logger.error(f"Wallpapers directory not found: {data.WALLPAPERS_DIR}") except Exception as e: - print(f"Error loading wallpapers: {e}") + logger.error(f"Error loading wallpapers: {e}") def _is_image(self, filename: str) -> bool: """Check if file is a supported image format.""" @@ -81,7 +82,7 @@ class WallpaperPlugin(PluginBase): # File doesn't exist, keep default True pass except Exception as e: - print(f"Error reading config file: {e}") + logger.error(f"Error reading config file: {e}") # Keep default True on error return self.matugen_enabled @@ -106,7 +107,7 @@ class WallpaperPlugin(PluginBase): json.dump(config, f, indent=4) except Exception as e: - print(f"Error writing matugen state to config: {e}") + logger.error(f"Error writing matugen state to config: {e}") # Clear the search query after toggling matugen self._clear_launcher_query() @@ -164,7 +165,7 @@ class WallpaperPlugin(PluginBase): return except Exception as e: - print(f"Could not clear launcher query: {e}") + logger.error(f"Could not clear launcher query: {e}") def _get_cache_path(self, filename: str) -> str: """Get cache path for wallpaper thumbnail.""" @@ -183,7 +184,7 @@ class WallpaperPlugin(PluginBase): img.thumbnail((32, 32), Image.Resampling.LANCZOS) img.save(cache_path, "PNG", optimize=True) except Exception as e: - print(f"Error creating thumbnail for {filename}: {e}") + logger.error(f"Error creating thumbnail for {filename}: {e}") return None return cache_path @@ -205,12 +206,14 @@ class WallpaperPlugin(PluginBase): ) self.thumbnail_cache[wallpaper] = pixbuf except Exception as e: - print(f"Error loading thumbnail for {wallpaper}: {e}") + logger.error( + f"Error loading thumbnail for {wallpaper}: {e}" + ) self.thumbnail_cache[wallpaper] = None else: self.thumbnail_cache[wallpaper] = None except Exception as e: - print(f"Error processing thumbnail for {wallpaper}: {e}") + logger.error(f"Error processing thumbnail for {wallpaper}: {e}") self.thumbnail_cache[wallpaper] = None finally: self.thumbnail_loading.discard(wallpaper) @@ -238,7 +241,7 @@ class WallpaperPlugin(PluginBase): self.thumbnail_cache[filename] = pixbuf return pixbuf except Exception as e: - print(f"Error loading thumbnail for {filename}: {e}") + logger.error(f"Error loading thumbnail for {filename}: {e}") self.thumbnail_cache[filename] = None return None