Added ags

TODO copy ags config
This commit is contained in:
2024-04-16 00:28:26 +02:00
parent be8fbb5d9f
commit 8aa6bcd5cb
125 changed files with 8130 additions and 113 deletions

View File

@@ -1,53 +0,0 @@
#!/bin/bash
#set -e # Exit immediately if a command exits with a non-zero status. (deprecated) -> [CMD] || exit 1
if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then
echo "Usage:
$0 <dir containing images> [interval(seconds)]"
exit 1
fi
## Check running
running=$(ps -ef | grep "$0" | grep -v grep | wc -l)
if [ ${running} -gt 2 ]; then
echo "Script already running! Killing others (TODO)..."
exit 1
# CRASHES EVERYTHING \/ !!!!!!!!!!
script_pids=$(ps aux | grep -E "$script_name" | grep -v "grep" | awk -v pid="$current_pid" '$2 != pid {print $2}')
# Loop through the PIDs and kill the processes
for pid in $script_pids; do
echo "Killing process $pid"
kill "$pid"
done
fi
## Start swww
swww init &> /dev/null
## Settings for swww
export SWWW_TRANSITION_FPS=60
export SWWW_TRANSITION_STEP=2
INTERVAL=300
if [ ! -z $2 ]; then
INTERVAL=$2
fi
## Main loop
while true; do
find "$1" \
| while read -r img; do
echo "$((RANDOM % 1000)):$img"
done \
| sort -n | cut -d':' -f2- \
| while read -r img; do
img=${img/\~/$HOME}
if [ -d $img ]; then
continue
fi
swww img "$img" --transition-type wipe --resize=fit
ln -sf "$img" ~/.config/background
sleep $INTERVAL
done
done

View File

@@ -1,10 +0,0 @@
#!/bin/bash
dnd=$(swaync-client -D)
swaync-client -dn
swaylock -C ~/.config/swaylock/swaylock.conf
if [ "$dnd" == "false" ]; then
swaync-client -df
fi