I am currently using this script in kde to change my wallpaper to a random wallpaper and it works for the most part. (Original script found on appleInsider.com)
I'd like to snag only .png and .jpg out of the $dir.
The commented line illustrates what I'm trying to accomplish, with a generic regular expression. Using the commented line, the script breaks.
Any suggestions are appreciated.
Code:#!/bin/bash dir=/usr/share/wallpapers/ pics=(${dir}*) #pics=$(ls $dir | grep [.]...$) numpics=${#pics} img=${pics[$((RANDOM%numpics))]} dcop kdesktop KBackgroundIface setWallpaper $img 6
Bookmarks