| Afiseaza wallpaperul X11 cu xv |
|
| Scris de Cypress | ||||||
| Thursday, 22 November 2007 | ||||||
|
#!/bin/bash ########################################################################## # Title : getpic - background picture for X11 with xv # Author : Heiner Steven ( Aceasta adresa e-mail este protejata impotriva spamului, JavaScript trebuie activat pentru a putea vizualiza pagina. ) # (based on a script by Aceasta adresa e-mail este protejata impotriva spamului, JavaScript trebuie activat pentru a putea vizualiza pagina. ) # Date : 1995-03-07 # Requires : cfcat, rand # Category : Desktop # SCCS-Id. : @(#) getpic 2.1 04/03/12 ########################################################################## # Description # Prints name of a background image ########################################################################## PN=`basename "$0"` # program name VER='2.1' : ${GREP:=egrep} # Directories to search for pictures : ${PICDIRS:="$HOME/pictures:/export/pictures:/usr/local/pictures"} : ${PICEXCL:=$HOME/.picexclude} # exclude list : ${PICDEF:=`cfcat $HOME/.picdefault 2>/dev/null`} # Default image usage () { echo >&2 "$PN - print name of a background picture, $VER usage: $PN [picture|pattern] If no picture is specified, one is chosen randomly. Otherwise a picture is chosen randomly chosen from all files matching the specified pattern. Environment variables: Directory to search for pictures: PICDIRS=$PICDIRS Pictures to exclude: PICEXCL=$PICEXCL Name of default picture: PICDEV=$PICDEF" exit 1 } msg () { for i do echo "$PN: $i" >&2 done } fatal () { msg "$@"; exit 1; } while [ $# -gt 0 ] do case "$1" in --) shift; break;; -h) usage;; -*) usage;; *) break;; # First file name esac shift done [ -f "$PICEXCL" ] || > $PICEXCL [ -f "$PICDEF" ] || echo "# default picture for $PN" > $HOME/.picdefault Pic=$PICDEF PicList=${TMPDIR:=/tmp}/gp$$.l Tmp=$TMPDIR/gp$$.t # Remove temporary file at exit or interrupt trap 'rm -f "$PicList" "$Tmp" > /dev/null 2>&1' 0 trap "exit 2" 1 2 3 15 # Create picture list and return count for dir in `echo "$PICDIRS" | tr : ' '` do find "$dir" -type f -print 2>/dev/null | fgrep -v -f "$PICEXCL" done > "$PicList" if [ $# -gt 0 ] then # try to get specified picture # Select the matching pictures "$GREP" "$1" "$PicList" > "$Tmp" && mv "$Tmp" "$PicList" || exit 1 fi # Count images (lines), remove leading blanks n=`echo \`wc -l < "$PicList"\`` if [ ${n:=0} -gt 0 ] then # randomly select picture # Randomly choose one picture k=`rand "$n"` Pic=`sed -ne "${k}{p;q;}" "$PicList"` if [ -r "$Pic" ] then msg "selected #$k of $n pictures: $Pic" else msg "could not read file $Pic - using default" Pic=$PICDEF fi fi [ -z "$Pic" ] && fatal "could not determine picture" cat <<EOT $Pic EOT
Only registered users can write comments! Powered by !JoomlaComment 3.12 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved. |
||||||



4 Jocuri "High-End"
Patronul: Ce naiba are iar site-ul asta ...
E greu sa inveti
Chiar ca e un dobitoc
ATI Radeon HD 4870 cu drivere Linux
Multe alte firme ar trebui sa ia exemplu...
E greu sa inveti
Ei bine, omul ala e un dobitoc. C'mon......
Ubuntu 8.10 Alpha 1 Screenshots
Cypress a zis:"apt nu m-a mai dezama...
Ubuntu 8.10 Alpha 1 Screenshots
Cum sa nu...
Ubuntu 8.10 Alpha 1 Screenshots
De acord cu tine Daniel, dar la mine am ...