dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

hashwall (2179B)


      1 #!/bin/sh
      2 #
      3 #  ██                        ██                            ██  ██
      4 # ░██                       ░██                           ░██ ░██
      5 # ░██       ██████    ██████░██      ███     ██  ██████   ░██ ░██
      6 # ░██████  ░░░░░░██  ██░░░░ ░██████ ░░██  █ ░██ ░░░░░░██  ░██ ░██
      7 # ░██░░░██  ███████ ░░█████ ░██░░░██ ░██ ███░██  ███████  ░██ ░██
      8 # ░██  ░██ ██░░░░██  ░░░░░██░██  ░██ ░████░████ ██░░░░██  ░██ ░██
      9 # ░██  ░██░░████████ ██████ ░██  ░██ ███░ ░░░██░░████████ ███ ███
     10 # ░░   ░░  ░░░░░░░░ ░░░░░░  ░░   ░░ ░░░    ░░░  ░░░░░░░░ ░░░ ░░░
     11 #
     12 #  ▓▓▓▓▓▓▓▓▓▓
     13 # ░▓ author ▓ xero <x@xero.nu>
     14 # ░▓ code   ▓ http://code.xero.nu/dotfiles
     15 # ░▓ mirror ▓ http://git.io/.files
     16 # ░▓▓▓▓▓▓▓▓▓▓
     17 # ░░░░░░░░░░
     18 #
     19 #█▓▒░ requires: imagemagick + hsetroot
     20 
     21 usage() {
     22 	echo "usage: `basename $0` [-bfsr]
     23     -b background color (#222222)
     24     -f foreground color (#3e3e3e)
     25     -s step (2)
     26     -r resolution (24)"
     27 	exit 1
     28 }
     29 
     30 #args
     31 res=24
     32 step=4
     33 bg="#222222"
     34 fg="#3e3e3e"
     35 
     36 # evaluate
     37 while [ $# -gt 0 ]
     38 do
     39 	case "$1" in
     40 			-b)
     41 				bg="$2"
     42 				shift
     43 			;;
     44 			-f)
     45 				fg="$2"
     46 				shift
     47 			;;
     48 			-s)
     49 				step="$2"
     50 				shift
     51 			;;
     52 			-r)
     53 				res="$2"
     54 				shift
     55 			;;
     56 			--)
     57 				shift
     58 				break
     59 			;;
     60 			-*)
     61 				usage
     62 			;;
     63 			*)
     64 				break
     65 			;;
     66 	esac
     67 	shift
     68 done
     69 
     70 # calculate
     71 max=$((res*2+2))
     72 i=0
     73 lines=""
     74 while
     75 	lines="$lines line $i,-1 -1,$i"
     76 	i="$((i+step))"
     77 	[ "$i" -lt "$max" ]
     78 do :; done
     79 
     80 # generate
     81 convert -size ${res}x${res} xc:${bg} -stroke ${fg} -draw "${lines}" /tmp/wall.png
     82 hsetroot -tile /tmp/wall.png