summaryrefslogtreecommitdiffstats
path: root/roles/hyprland/files/scripts/screenshot.sh
blob: 9fcbe12bf30c0fc4e0574a7e531f6f58fcf16120 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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"