move to backup
This commit is contained in:
parent
294dc66380
commit
a0e3d792a9
182 changed files with 156 additions and 103 deletions
7
bak/modules/wm/awww/default.nix
Normal file
7
bak/modules/wm/awww/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."awww/bin" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/nix-config/modules/wm/awww/scripts";
|
||||
};
|
||||
}
|
||||
35
bak/modules/wm/awww/scripts/random-bg.sh
Executable file
35
bak/modules/wm/awww/scripts/random-bg.sh
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/bin/sh
|
||||
# Changes the wallpaper to a randomly chosen image in a given directory
|
||||
# at a set interval.
|
||||
|
||||
DEFAULT_INTERVAL=300 # In seconds
|
||||
|
||||
if [ $# -lt 1 ] || [ ! -d "$1" ]; then
|
||||
printf "Usage:\n\t\e[1m%s\e[0m \e[4mDIRECTORY\e[0m [\e[4mINTERVAL\e[0m]\n" "$0"
|
||||
printf "\tChanges the wallpaper to a randomly chosen image in DIRECTORY every\n\tINTERVAL seconds (or every %d seconds if unspecified)." "$DEFAULT_INTERVAL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# See awww-img(1)
|
||||
RESIZE_TYPE="crop"
|
||||
export AWWW_TRANSITION_FPS="${AWWW_TRANSITION_FPS:-60}"
|
||||
export AWWW_TRANSITION_STEP="${AWWW_TRANSITION_STEP:-2}"
|
||||
|
||||
# Kill existing script executions
|
||||
for pid in $(pidof -x "random-bg.sh"); do
|
||||
if [ $pid != $$ ]; then
|
||||
kill $pid
|
||||
fi
|
||||
done
|
||||
|
||||
while true; do
|
||||
find "$1" -type f \
|
||||
| while read -r img; do
|
||||
echo "$(</dev/urandom tr -dc a-zA-Z0-9 | head -c 8):$img"
|
||||
done \
|
||||
| sort -n | cut -d':' -f2- \
|
||||
| while read -r img; do
|
||||
swww img --resize="$RESIZE_TYPE" "$img"
|
||||
sleep "${2:-$DEFAULT_INTERVAL}"
|
||||
done
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue