fix: only screenshot focused monitor in fs mode

This commit is contained in:
2 * r + 2 * t
2026-06-01 21:06:04 +10:00
parent ccd2712982
commit ad533a0dd4
+7 -1
View File
@@ -2,6 +2,7 @@ import subprocess
from argparse import Namespace from argparse import Namespace
from datetime import datetime from datetime import datetime
from caelestia.utils import hypr
from caelestia.utils.notify import notify from caelestia.utils.notify import notify
from caelestia.utils.paths import screenshots_cache_dir, screenshots_dir from caelestia.utils.paths import screenshots_cache_dir, screenshots_dir
@@ -33,7 +34,12 @@ class Command:
swappy.stdin.close() swappy.stdin.close()
def fullscreen(self) -> None: def fullscreen(self) -> None:
sc_data = subprocess.check_output(["grim", "-"]) cmd = ["grim"]
focused_monitor = next(monitor for monitor in hypr.message("monitors") if monitor["focused"])
if focused_monitor:
cmd += ["-o", focused_monitor["name"]]
cmd += ["-"]
sc_data = subprocess.check_output(cmd)
subprocess.run(["wl-copy"], input=sc_data) subprocess.run(["wl-copy"], input=sc_data)