[经典]shell 俄罗斯方块
Wednesday, 5. April 2006, 17:43:35
太历害了,有时间一定把这个程序好好研究一下!!
程序在这里:
http://my.opera.com/yunt/homes/notes/test4.sh.html
由于我的系统里没usleep这个程序,所以第128行的usleep是我用sleep做的替换
如果你的系统里有这个程序的话请把它删掉!
Wednesday, 5. April 2006, 17:43:35
Sunday, 26. March 2006, 07:08:29
#!/bin/sh
templateimg=${HOME}/.template.jpg; #这个是个1024x768的背景模板
tmpimg=${HOME}/.tmp.jpg;
font='VeraSansYuanTi-Regular.ttf'; #这个要自己指定中文字体的位置如果要用中文的话
ps=13;
size='254x364'; #贴在背景上的图片大小
color='#002040'; #跟背景颜色想同实现透明:D
geometry[1]=+0+0 #对于1024x768的大小一共能放上8个254x364的图片
geometry[2]=+0+364 #它们位置依次为
geometry[3]=+254+0 # 1 3 5 7
geometry[4]=+254+364 # 2 4 6 8
geometry[5]=+510+0 #
geometry[6]=+510+364 #
geometry[7]=+766+0 #
geometry[8]=+766+364 #
convert -size $size -background $color -border 1x1\
-fill white -font $font -pointsize $ps\
-gravity northwest caption:$2 miff:- |\
composite -geometry ${geometry[$1]} \
- ${templateimg} ${tmpimg}
mv ${tmpimg} ${templateimg}
举例: #./myhint 位置 "内容(换行可以用\n)" #./myhint 8 "今天天气不错\n心情愉快"
anonymous
anonymous
anonymous
anonymous
anonymous
anonymous
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
| ||||||
| 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 | ||
原文在这里:http://www.rayninfo.co.uk/vimtips.html