feat: moved from waybar to caelestia

This commit is contained in:
oxypomme
2026-05-17 19:31:22 +02:00
parent 3eebdd1dc5
commit ae8a08fc0f
23 changed files with 189 additions and 338 deletions

55
.local/bin/screenshot Executable file
View File

@@ -0,0 +1,55 @@
#!/bin/bash
capture_region() {
wayfreeze & FREEZE_PID=$!
sleep 0.1
REGION=$(slurp -d -c "007DFFFF" -w 1)
if [ $? -eq 0 ]; then
sleep .3
grim -g "$REGION" - | wl-copy
caelestia shell toaster success 'Screenshot saved' 'Screenshot of region saved in clipboard' image
else
caelestia shell toaster error 'Screenshot failed' 'Failed to save screenshot' image
fi
kill $FREEZE_PID
}
capture_window() {
REGION=$(hyprctl activewindow -j | jq -r '"\(.at | join(",")) \(.size | join("x"))"')
grim -g "$REGION"
if [ $? -eq 0 ]; then
caelestia shell toaster success 'Screenshot saved' 'Screenshot of window in ~/Pictures' image
else
caelestia shell toaster error 'Screenshot failed' 'Failed to save screenshot' image
fi
}
capture_screen() {
SCREEN=$(hyprctl activeworkspace -j | jq -r ".monitor")
grim -o "$SCREEN" - | wl-copy
if [ $? -eq 0 ]; then
caelestia shell toaster success 'Screenshot saved' 'Screenshot of monitor saved in clipboard' image
else
caelestia shell toaster error 'Screenshot failed' 'Failed to save screenshot' image
fi
}
subcommand=$1
case $subcommand in
"r" | "region")
capture_region
;;
"w" | "window")
capture_window
;;
"s" | "screen")
capture_screen
;;
*)
;;
esac