refactor: clean up service implementations and remove dead code
This commit is contained in:
22 files changed
+2067
-756
No files matched your search
+12
-3
@@ -16,9 +16,18 @@ HOME_DIR = GLib.get_home_dir()
|
||||
|
||||
CONFIG_DIR = os.path.expanduser(f"~/.config/{APP_NAME}")
|
||||
|
||||
screen = Gdk.Screen.get_default()
|
||||
CURRENT_WIDTH = screen.get_width()
|
||||
CURRENT_HEIGHT = screen.get_height()
|
||||
|
||||
def _get_screen_dimensions():
|
||||
try:
|
||||
screen = Gdk.Screen.get_default()
|
||||
if screen:
|
||||
return screen.get_width(), screen.get_height()
|
||||
except Exception:
|
||||
pass
|
||||
return 1920, 1080
|
||||
|
||||
|
||||
CURRENT_WIDTH, CURRENT_HEIGHT = _get_screen_dimensions()
|
||||
|
||||
|
||||
WALLPAPERS_DIR_DEFAULT = get_relative_path("../assets/wallpapers_example/")
|
||||
|
||||
@@ -2,7 +2,7 @@ import subprocess
|
||||
|
||||
from fabric.utils import GdkPixbuf, Gtk, get_relative_path, logger, os, re
|
||||
|
||||
from utils.functions import escape_markup_text
|
||||
from utils.functions import escape_markup_text, find_binary
|
||||
from utils.icon_resolver import IconResolver
|
||||
from utils.utils import setup_cursor_hover
|
||||
|
||||
@@ -70,9 +70,9 @@ def get_executable_path(exec_string):
|
||||
|
||||
# Search in PATH
|
||||
try:
|
||||
result = subprocess.run(["which", executable], capture_output=True, text=True)
|
||||
if result.returncode == 0:
|
||||
return result.stdout.strip()
|
||||
result = find_binary(executable)
|
||||
if result:
|
||||
return result
|
||||
except Exception as e:
|
||||
logger.error(f"An error occurred: {e}")
|
||||
|
||||
@@ -207,11 +207,9 @@ def get_app_info(wmclass):
|
||||
# Fallback: try to find executable in PATH
|
||||
location = ""
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["which", wmclass.lower()], capture_output=True, text=True
|
||||
)
|
||||
if result.returncode == 0:
|
||||
location = result.stdout.strip()
|
||||
result = find_binary(wmclass.lower())
|
||||
if result:
|
||||
location = result
|
||||
except Exception as e:
|
||||
logger.error(f"An error occurred: {e}")
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import math
|
||||
from typing import cast
|
||||
|
||||
import cairo
|
||||
from fabric.utils import cairo
|
||||
from fabric.widgets.box import Box
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import math
|
||||
from typing import cast
|
||||
|
||||
import cairo
|
||||
from fabric.utils import Gtk
|
||||
from fabric.utils import cairo, Gtk
|
||||
|
||||
from fabric.widgets.image import Image
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import math
|
||||
from typing import Callable, Iterable, Literal, TypedDict
|
||||
|
||||
import cairo
|
||||
from fabric.utils import Gdk, GObject, Gtk
|
||||
from fabric.utils import Gdk, GObject, Gtk, cairo
|
||||
from fabric.utils.helpers import clamp
|
||||
from fabric.widgets.widget import Widget
|
||||
from gi.repository import Pango, PangoCairo # noqa: E402
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import cairo
|
||||
from fabric.utils import Gdk, Gtk
|
||||
from fabric.utils import Gdk, Gtk, cairo
|
||||
|
||||
from shared.widgets.animator import Animator, ease_in_out
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
from fabric.utils import logger
|
||||
from fabric.utils import GLib, logger
|
||||
from fabric.widgets.box import Box
|
||||
from fabric.widgets.centerbox import CenterBox
|
||||
from fabric.widgets.eventbox import EventBox
|
||||
from gi.repository import GLib
|
||||
|
||||
from shared.window.applet_window import AppletWindow
|
||||
from utils.roam import modus_service
|
||||
|
||||
Reference in new issue
Block a user