44 lines
980 B
Bash
Executable file
44 lines
980 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
|
|
##
|
|
## Script to take screenshots on Archcraft.
|
|
|
|
# file
|
|
dir=$HOME/Pictures/Screenshots
|
|
|
|
# countdown
|
|
countdown () {
|
|
for sec in `seq $1 -1 1`; do
|
|
dunstify -t 1000 -h string:x-dunst-stack-tag:screenshottimer -i $HOME/.local/share/icons/dunst/timer.png "Taking shot in : $sec"
|
|
sleep 1
|
|
done
|
|
}
|
|
|
|
shot5 () {
|
|
countdown '5'
|
|
sleep 1 && $HOME/.local/bin/hyprshot -m output -m eDP-1 -o $dir
|
|
}
|
|
|
|
shot10 () {
|
|
countdown '10'
|
|
sleep 1 && $HOME/.local/bin/hyprshot -m output -m eDP-1 -o $dir
|
|
}
|
|
|
|
# execute
|
|
if [[ "$1" == "--now" ]]; then
|
|
$HOME/.local/bin/hyprshot -m output -m eDP-1 -o $dir
|
|
elif [[ "$1" == "--in5" ]]; then
|
|
shot5
|
|
elif [[ "$1" == "--in10" ]]; then
|
|
shot10
|
|
elif [[ "$1" == "--win" ]]; then
|
|
$HOME/.local/bin/hyprshot -m window -o $dir
|
|
elif [[ "$1" == "--area" ]]; then
|
|
$HOME/.local/bin/hyprshot -m region -o $dir
|
|
else
|
|
echo -e "Available Options : --now --in5 --in10 --win --area"
|
|
fi
|
|
|
|
exit 0
|