Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

goddamit bash

Name: Anonymous 2012-07-01 15:42

im running openbox+nitrogen. i wrote a little script to cycle through and change my wallpeper (im going to set it up as a cron job) but i cant quite seem to get it to go. help me out /prog/?

gives me the error: failed to open file
cat:/home/harry/images/wallpapers/walls/.last: No such file or directory
ERROR:/home/harry/images/wallpapers/wallsls -w1 $WALLPAPERS': No Such File or directory


#! /bin/bash
#using the path WALLPAPERS will select a new random wallpaper
WALLPAPERS="/home/harry/wallpapers/walls"
ALIST=( `ls -w1 $WALLPAPERS` )
RANGE=${#ALIST[@]}
let "number = $RANDOM"
let LASTNUM="`cat $WALLPAPERS/.last` + $number"
let "number = $LASTNUM % $RANGE"
echo $number > $WALLPAPERS/.last
nitrogen --set-scaled --save $WALLPAPERS/${ALIST[$number]}
exit

Name: Anonymous 2012-07-01 22:05

I don't have a clue about bash, but your script kinda relies on the file /home/harry/wallpapers/walls/.last existing before first execution. Does the file exist? Dos it contain a number?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List