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