general ipc calls

This commit is contained in:
Zacharias-Brohn
2026-02-18 23:39:06 +01:00
parent e2eb0631cf
commit 5d5d9575b6
3 changed files with 38 additions and 1 deletions
+26
View File
@@ -1,6 +1,8 @@
import subprocess
import typer
from typing import Annotated
from PIL import Image, ImageFilter
from pathlib import Path
args = ["qs", "-c", "zshell"]
@@ -12,3 +14,27 @@ app = typer.Typer()
def set(wallpaper: Path):
subprocess.run(args + ["ipc"] + ["call"] +
["wallpaper"] + ["set"] + [wallpaper], check=True)
@app.command()
def lockscreen(
input_image: Annotated[
Path,
typer.Option(),
],
output_path: Annotated[
Path,
typer.Option(),
],
blur_amount: int = 20
):
img = Image.open(input_image)
size = img.size
if (size[0] < 3840 or size[1] < 2160):
img = img.resize((size[0] // 2, size[1] // 2), Image.NEAREST)
else:
img = img.resize((size[0] // 4, size[1] // 4), Image.NEAREST)
img = img.filter(ImageFilter.GaussianBlur(blur_amount))
img.save(output_path, "PNG")