Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- minfonts="25" # Set minimum font size here.
- maxfonts="100" # Set maximum font size here.
- bcolor="#111111" # Set default background color here.
- lcolor="#c0c0c0" # Set default line color here.
- tcolor="#ffffff" # Set default top color here.
- dcolor="#1793d1" # Set default dependency color here.
- maxwidth="99999" # Set maximum width of the wallpaper here.
- maxheight="99999" # Set maximum height of the wallpaper here.
- cd $HOME
- createimage () {
- pacgraph -b $bcolor -l $lcolor -t $tcolor -d $dcolor -p $minfonts $maxfonts
- width=`identify -format %[fx:w] pacgraph.png`
- height=`identify -format %[fx:h] pacgraph.png`
- }
- setwallpaper () {
- if [ $width -le "$maxwidth" ] && [ $height -le "$maxheight" ]; then
- gconftool-2 -s --type=string /desktop/gnome/background/picture_filename $HOME/pacgraph.png
- gconftool-2 -s --type=string /desktop/gnome/background/picture_options stretched
- exit 0
- else
- createimage
- setwallpaper
- fi
- }
- about ()
- {
- cat << EOF
- pgwall is a small bash script, written by Thijs Kleintjens.
- The purpose of writing this script was not to create something usefull,
- it was to become more familiar with the Bourne Again Shell.
- This script is based upon a nice little piece of software called pacgraph,
- created by keenerd, available in the Arch User Repository.
- Information about pacgraph is available here: kmkeen.com/pacgraph
- You can copy, modify, redistribute, or anything else you want to do with pgwall, without asking me.
- To contact me you can send an e-mail to [email protected]
- My website is Chef1411.com
- EOF
- }
- usage ()
- {
- cat << EOF
- Usage: pgwall [options]
- Options:
- -a, --about Display information about the author.
- -h, --help Display this usage information.
- -v, --version Display pgwall version.
- -b COLOR, --background COLOR Set background color, default is "#111111".
- -l COLOR, --line COLOR Set line color, default is "#c0c0c0".
- -t COLOR, --top COLOR Set top color, default is "#ffffff".
- -d COLOR, --dependency COLOR Set dependency color, default is "#1793d1".
- -mw WIDTH, --maxwidth WIDTH Set the maximum width of the entire wallpaper, default is unlimited (99999).
- -mh HEIGHT, --maxheight HEIGHT Set the maximum height of the entire wallpaper, default is unlimited (99999).
- -mif MIN-FONT, --minfont MIN-FONT Set minimum font size, default is "25".
- -maf MAX-FONT, --maxfont MAX-FONT Set maximum font size, default is "100".
- COLOR has to be in hex code.
- Report gpwall bugs to [email protected]"
- EOF
- }
- version ()
- {
- cat << EOF
- pgwall v2
- 14/04/2010
- EOF
- }
- while [ "$1" != "" ]; do
- case $1 in
- -a | --about ) shift
- about
- exit 0
- ;;
- -h | --help ) usage
- exit 0
- ;;
- -v | --version ) version
- exit 0
- ;;
- -b | --background ) bcolor="$2"; shift
- ;;
- -l | --line ) lcolor="$2"; shift
- ;;
- -t | --top ) tcolor="$2"; shift
- ;;
- -d | --dependency ) dcolor="$2"; shift
- ;;
- -mw | --maxwidth ) maxwidth="$2"; shift
- ;;
- -mh | --maxheight ) maxheight="$2"; shift
- ;;
- -mif | --minfont ) minfonts="$2"; shift
- ;;
- -maf | --maxfont ) maxfonts="$2"; shift
- ;;
- * ) usage
- exit 1
- esac
- shift
- done
- createimage
- setwallpaper
Advertisement
Add Comment
Please, Sign In to add comment