代码: 全选
#!/bin/bash
#
# Photo in conky
# by helmuthdu and paulvictor
#source="~/.myconky/pics"
photo=/tmp/conkyPhoto.png
#cd $source
cd ~/.myconky/pics
number=$(ls -R | wc -l)
random=$RANDOM
random=${random}%${number}
lines=`echo ${random} + 2 | bc`
filename=`ls | head -n $lines | tail -n 1`
cp $filename $photo
janker@sars:~$ /home/janker/.myconky/bin/conkyStart
Conky: desktop window (1a000a7) is subwindow of root window (101)
Conky: window type - override
Conky: drawing to created window (0x3800001)
Conky: drawing to double buffer
/home/janker/.myconky/bin/conkyPhotoRandom: line 13: bc:找不到命令
head:选项需要一个参数 -- n
请尝试执行"head --help"来获取更多信息。
cp: 在"/tmp/conkyPhoto.png" 后缺少了要操作的目标文件
请尝试执行"cp --help"来获取更多信息。
identify: unable to open image `/tmp/conkyPhoto.png': 没有那个文件或目录 @ blob.c/OpenBlob/2480.
identify: unable to open file `/tmp/conkyPhoto.png' @ png.c/ReadPNGImage/2917.
identify: unable to open image `/tmp/conkyPhoto.png': 没有那个文件或目录 @ blob.c/OpenBlob/2480.
identify: unable to open file `/tmp/conkyPhoto.png' @ png.c/ReadPNGImage/2917.
/home/janker/.myconky/bin/conkyPhotoRandom: line 18: - : 语法出错:此处需要运算符 (error token is "- ")
/home/janker/.myconky/bin/conkyPhotoRandom: 第 20 行: [: :此处需要整数表达式
/home/janker/.myconky/bin/conkyPhotoRandom: 第 23 行: [: :此处需要整数表达式
convert: unable to open image `/tmp/conkyPhoto.png': 没有那个文件或目录 @ blob.c/OpenBlob/2480.
convert: unable to open file `/tmp/conkyPhoto.png' @ png.c/ReadPNGImage/2917.
convert: missing an image filename `/tmp/conkyPhoto.png' @ convert.c/ConvertImageCommand/2838.
identify: unable to open image `/tmp/conkyPhoto.png': 没有那个文件或目录 @ blob.c/OpenBlob/2480.
identify: unable to open file `/tmp/conkyPhoto.png' @ png.c/ReadPNGImage/2917.
convert: unable to open image `/tmp/conkyPhoto.png': 没有那个文件或目录 @ blob.c/OpenBlob/2480.
convert: unable to open file `/tmp/conkyPhoto.png' @ png.c/ReadPNGImage/2917.
convert: missing an image filename `/tmp/conkyPhoto.png' @ convert.c/ConvertImageCommand/2838.
convert: unable to open image `/tmp/conkyPhoto.png': 没有那个文件或目录 @ blob.c/OpenBlob/2480.
convert: unable to open file `/tmp/conkyPhoto.png' @ png.c/ReadPNGImage/2917.