blob: 73d427f0f7a740d56b20c297e6679872a0ef60a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/bin/bash
# Reads a given directory and set a random
# wallpaper using the images on that dir.
[ -x /usr/bin/convert ] || exit 1
[ -x /usr/bin/feh ] || exit 1
if [ -d "${WALLPAPERDIR}" ]; then
files=$(ls "${WALLPAPERDIR}")
file_matrix=($files)
num_files=${#file_matrix[*]}
file="${WALLPAPERDIR}/${file_matrix[$((RANDOM%num_files))]}"
else
file = ${FVWM_USERDIR}/images/default_wall.jpg
fi
convert ${file} -resize `xdpyinfo |grep dimensions|awk '{print $2}'` "${FVWM_USERDIR}/tmp/current_wall.png"
feh --bg-center "${FVWM_USERDIR}/tmp/current_wall.png"
exit 0
|