mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-05-21 23:27:15 +02:00
fix: adjust hyprland configs
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
iDIR="$HOME/.config/hypr/mako/icons"
|
||||
|
||||
time=$(date +%Y-%m-%d-%H-%M-%S)
|
||||
dir="$(xdg-user-dir PICTURES)/Screenshots"
|
||||
dir="$(xdg-user-dir PICTURES)/Screenshots" # need
|
||||
file="Screenshot_${time}_${RANDOM}.png"
|
||||
|
||||
# notify and view screenshot
|
||||
@@ -20,32 +20,12 @@ notify_view () {
|
||||
fi
|
||||
}
|
||||
|
||||
# countdown
|
||||
countdown () {
|
||||
for sec in $(seq $1 -1 1); do
|
||||
notify-send -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR"/timer.png "Taking shot in : $sec"
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
# take shots
|
||||
shotnow () {
|
||||
cd ${dir} && grim - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
shot5 () {
|
||||
countdown '5'
|
||||
sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
shot10 () {
|
||||
countdown '10'
|
||||
sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
shotwin () {
|
||||
w_pos=$(hyprctl activewindow | grep 'at:' | cut -d':' -f2 | tr -d ' ' | tail -n1)
|
||||
w_size=$(hyprctl activewindow | grep 'size:' | cut -d':' -f2 | tr -d ' ' | tail -n1 | sed s/,/x/g)
|
||||
@@ -64,16 +44,12 @@ fi
|
||||
|
||||
if [[ "$1" == "--now" ]]; then
|
||||
shotnow
|
||||
elif [[ "$1" == "--in5" ]]; then
|
||||
shot5
|
||||
elif [[ "$1" == "--in10" ]]; then
|
||||
shot10
|
||||
elif [[ "$1" == "--win" ]]; then
|
||||
shotwin
|
||||
elif [[ "$1" == "--area" ]]; then
|
||||
shotarea
|
||||
elif [[ "$1" == "--win" ]]; then
|
||||
shotwin
|
||||
else
|
||||
echo -e "Available Options : --now --in5 --in10 --win --area"
|
||||
echo -e "Available Options : --now --win --area"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user