Add .scripts directory

This commit is contained in:
Harzo 2023-05-26 13:29:25 +02:00
parent 571de7aca2
commit 477061982f
4 changed files with 62 additions and 0 deletions

3
.scripts/colorpicker Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
hyprpicker | tr -d '\n' | wl-copy && \
dunstify -t 5000 'Copied color hex code to clipboard'

15
.scripts/grimshot Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
filename=~/Pictures/Screenshots/Screenshot_"$(date +'%Y%m%d_%H%M%S').png"
grimblast copysave area "$filename" || exit 1
action="$(dunstify \
-i "$filename" \
-A "open,OPEN" \
-t 10000 \
"Screenshot saved" \
"$filename")"
case "$action" in
2) #click
xdg-open "$filename"
;;
esac

View File

@ -0,0 +1,16 @@
#!/bin/sh
INTERVAL="$1"
WALLPAPER_DIR="$2"
rm -rf ~/.cache/swww/
swww kill
swww init
interval_secs="$(echo "60 * ${INTERVAL}" | bc)"
while true; do
wallpaper="$(fd '\.(png|jpe?g|gif)$' "$WALLPAPER_DIR" --type f | shuf | head -1)"
swww img "$wallpaper"
sleep "$interval_secs"
done

28
.scripts/system/wofi-session Executable file
View File

@ -0,0 +1,28 @@
#!/bin/sh
option="$(printf "⏻ Shutdown\n Reboot\n Suspend\n Hibernate" | \
wofi --dmenu -p "Session")"
dialogue_box() {
yad --image=gtk-dialog-question \
--text="$1"
}
case $option in
*Shutdown)
dialogue_box "Are you sure you want to shutdown this computer?" && \
systemctl poweroff -i
;;
*Reboot)
dialogue_box "Are you sure you want to reboot this computer?" && \
systemctl reboot -i
;;
*Suspend)
dialogue_box "Are you sure you want to suspend this computer?" && \
systemctl suspend -i
;;
*Hibernate)
dialogue_box "Are you sure you want to hibernate this computer?" && \
systemctl hibernate -i
;;
esac