feat: power and screenshot launchers

This commit is contained in:
2026-05-03 21:53:10 +02:00
parent 7bdf23001f
commit afcf8d51fe
9 changed files with 159 additions and 45 deletions

View File

@@ -21,9 +21,11 @@ from fabric.utils import (
from .modules.bar import StatusBar
from .modules.window_fuzzy import FuzzyWindowFinder
from .modules.launcher.apps import AppLauncher
from .modules.launcher.power import PowerMenu
from .modules.launcher.screenrec import ScreenrecMenu
from .modules.launcher.screenshot import ScreenshotMenu
from .modules.stylix import get_stylix_css_path
from .config import SCREENREC, STYLIX
from .config import POWER, SCREENREC, STYLIX
from .services.fenster import get_i3_connection
from .services.screenrec import ScreenrecService
@@ -34,6 +36,8 @@ i3 = get_i3_connection()
dummy = Window(visible=False)
finder = FuzzyWindowFinder()
app_launcher = AppLauncher()
power_menu = PowerMenu(lock_command=POWER.get("lock_command", ["waylock"]))
screenshot_menu = ScreenshotMenu()
screenrec_service: ScreenrecService | None = None
screenrec_menu = None
@@ -46,7 +50,7 @@ if SCREENREC.get("enable", False):
bar_windows = []
notmuch_widget = None
_app_windows = [dummy, finder, app_launcher]
_app_windows = [dummy, finder, app_launcher, power_menu, screenshot_menu]
if screenrec_menu is not None:
_app_windows.append(screenrec_menu)
app = Application("sims", *_app_windows)
@@ -62,6 +66,16 @@ def open_app_launcher():
app_launcher.show()
@Application.action()
def open_power_menu():
power_menu.show()
@Application.action()
def open_screenshot_menu():
screenshot_menu.show()
@Application.action()
def refresh_notmuch():
if notmuch_widget is not None: