summaryrefslogtreecommitdiffstats
path: root/roles/hyprland/files/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'roles/hyprland/files/scripts')
-rwxr-xr-xroles/hyprland/files/scripts/screenshot.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/roles/hyprland/files/scripts/screenshot.sh b/roles/hyprland/files/scripts/screenshot.sh
new file mode 100755
index 00000000..9fcbe12b
--- /dev/null
+++ b/roles/hyprland/files/scripts/screenshot.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -euo pipefail
+
+MODE="${1:-"--region"}"
+
+case "${MODE}" in
+ "--region")
+ hyprshot -m region -r -
+ ;;
+ "--window")
+ hyprshot -m window -r -
+ ;;
+ *)
+ echo -e "Usage:"
+ echo -e " --window to screenshot a window application"
+ echo -e " --region to screenshot a screen region"
+ exit 0
+ ;;
+
+esac | satty --filename - --disable-notifications --output-filename "$(xdg-user-dir PICTURES)/screenshot-%Y%m%d_%H%M%S.png"