17 lines
433 B
Python
17 lines
433 B
Python
import os
|
|
import subprocess
|
|
from screenshot_backend import register_backend, ScreenshotBackend
|
|
|
|
|
|
@register_backend
|
|
class SpectacleBackend(ScreenshotBackend):
|
|
def supports(self) -> bool:
|
|
return "KDE" in os.environ.get("XDG_CURRENT_DESKTOP", "")
|
|
|
|
def active_window(self) -> str:
|
|
path = "hgot.png"
|
|
print("Running")
|
|
subprocess.run(["spectacle", "-a", "-b", "-n", "-o", path])
|
|
|
|
return path
|