Image Geektool internet打开/关闭图像
当我连接到互联网时尝试显示一个图像,当我没有连接到互联网时尝试显示另一个图像,我成功地想出了这个2 geeklet系统: 1外壳:Image Geektool internet打开/关闭图像,image,macos,connection,status,geektool,Image,Macos,Connection,Status,Geektool,当我连接到互联网时尝试显示一个图像,当我没有连接到互联网时尝试显示另一个图像,我成功地想出了这个2 geeklet系统: 1外壳: if curl -f -s http://google.com > /dev/null ; then cp /Users/mike/Documents/net.png /tmp/connstatus.png ; /Users/mike/Documents/noNet.png /tmp/connstatus.png ; fi ; 2图像: 指向/tm
if curl -f -s http://google.com > /dev/null ; then cp /Users/mike/Documents/net.png /tmp/connstatus.png ; /Users/mike/Documents/noNet.png /tmp/connstatus.png ; fi ;
2图像:
指向/tmp/connstatus.png
它不起作用。
感谢andvace您在
中缺少else
语句,如果
:
if curl -f -s http://google.com > /dev/null
then
cp /Users/mike/Documents/net.png /tmp/connstatus.png
else
cp /Users/mike/Documents/noNet.png /tmp/connstatus.png
fi
非常感谢您的输入,但它似乎不起作用,没有图像显示再次感谢您的帮助,是的,确实如此您是对的,图像发生了变化,只是第二个geeklet上的路径有问题,我将它指向/private/tmp/connstatus.png,但是桌面上的图像没有显示
/private/tmp
与/tmp
不同,它们是不同的路径。是的,我没有键入路径,而是使用向导到达那里,效果非常好,谢谢!