很多年前,自己写的,自己的文件丢失了,神奇的网络让我又找到了
 
#!/bin/bash
#Description:
 
# download national geographic photo of the day and set it as background
 
# wait for network connection to be established
[[ -n $1 ]] && sleep $1
 
resolution=$(xrandr |grep -o 'current [^,]*'|tr -d " "|sed 's:current::')
 
rss=`wget -q -O - http://feeds.nationalgeographic.com/ng/photography/photo-of-the-day/`
 
img_url=$(echo $rss|grep -o "http://[^\"]*exposure[^\"]*"|head -1)
 
img_url=$(echo $img_url|sed "s:360x270:$resolution:")
 
img=/tmp/pod.jpg
 
wget -q -O $img $img_url
 
cp /tmp/pod.jpg ~/BackGround/`date +%Y%m%d`.jpg
cp /tmp/pod.jpg ~/BackGround/today.jpg

相关文章:

  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2021-11-23
  • 2021-07-26
  • 2021-10-29
  • 2022-12-23
  • 2022-02-09
猜你喜欢
  • 2022-02-23
  • 2022-01-17
  • 2022-12-23
  • 2021-10-12
  • 2021-10-20
  • 2022-12-23
相关资源
相似解决方案