每次开机下载国家地理Photo of the Day作为桌面

sh/bash/dash/ksh/zsh等Shell脚本
回复
头像
roylez
帖子: 1928
注册时间: 2005-10-04 10:59
来自: 上海

每次开机下载国家地理Photo of the Day作为桌面

#1

帖子 roylez » 2013-01-08 15:37

http://dooloo.info/p/QD4

Awesome从3.4升到3.5,让我在不淡定中挣扎了一天,总算完成了配置迁移。不过奇怪的是桌面壁纸,我忘了 是怎么设的了,索性查了下。于是找到了一篇用NASA的每日一图作为桌面背景的脚本。

点子很不错,不过我不喜欢NASA的那些拍得模模糊糊的图片。于是稍稍改了下,现在用国家地理杂志的。:D

自带屏幕分辨率检测,可以设置延时下载以免刚开机网络还没连好。

代码: 全选

#!/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

feh --bg-scale $img
弄个dropbox空间来备份文件或者做私人代码服务器
配置:[url]git://github.com/roylez/dotfiles.git[/url]
主页:http://roylez.heroku.com
各种稀奇玩意儿:http://dooloo.info
头像
HuntXu
帖子: 5776
注册时间: 2007-09-29 3:09

Re: 每次开机下载国家地理Photo of the Day作为桌面

#2

帖子 HuntXu » 2013-01-08 15:41

友情沙發~~~
HUNT Unfortunately No Talent...
头像
YeLee
论坛版主
帖子: 26406
注册时间: 2008-08-13 8:48
系统: Fundu i64
来自: 东海硇州,一双管钥。
联系:

Re: 每次开机下载国家地理Photo of the Day作为桌面

#3

帖子 YeLee » 2013-01-08 16:05

给主席支持一个。 :em09 :em09 :em09
◎当我站在道德的高度上俯视别人的时候,发现自己是多么渺小。
♥执着但不偏激,反对而不排斥,坚决捍卫矛盾体的存在方式。
★★★天气预报★★★
fcitx-yatable一个可以使用的码表输入法
[教程]几个实例攻克软件编译难关
Gentoo Development Guide
字体相关
linuxahah
帖子: 10
注册时间: 2007-01-14 21:46

Re: 每次开机下载国家地理Photo of the Day作为桌面

#4

帖子 linuxahah » 2013-01-08 16:13

LZ 有没有遇到过键盘短压不好使,长压才好使的问题?
用是用着用着键盘就无法输入了,但长压能输入字母。
我 3.4 3.5 都有这个问题。
头像
qy117121
论坛版主
帖子: 50538
注册时间: 2007-12-14 13:40
系统: Winbuntu
来自: 志虚国乌由市
联系:

Re: 每次开机下载国家地理Photo of the Day作为桌面

#5

帖子 qy117121 » 2013-01-08 16:22

YeLee 写了:给主席支持一个。 :em09 :em09 :em09
渠月 · QY   
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu

Ubuntu 20.04 快速设置指南,请配合浏浏览器自动翻译使用

邮箱 chuan@ubuntu.org.cn
头像
roylez
帖子: 1928
注册时间: 2005-10-04 10:59
来自: 上海

Re: 每次开机下载国家地理Photo of the Day作为桌面

#6

帖子 roylez » 2013-01-08 16:28

linuxahah 写了:LZ 有没有遇到过键盘短压不好使,长压才好使的问题?
用是用着用着键盘就无法输入了,但长压能输入字母。
我 3.4 3.5 都有这个问题。
木有。

你用Gnome啥的有这毛病没?有的话,那换键盘吧。
弄个dropbox空间来备份文件或者做私人代码服务器
配置:[url]git://github.com/roylez/dotfiles.git[/url]
主页:http://roylez.heroku.com
各种稀奇玩意儿:http://dooloo.info
头像
phoenixlzx
帖子: 2245
注册时间: 2009-07-29 20:11
系统: Arch Linux
来自: Gensokyo
联系:

Re: 每次开机下载国家地理Photo of the Day作为桌面

#7

帖子 phoenixlzx » 2013-01-08 18:38

KDE自带。
头像
qq420100523
帖子: 1684
注册时间: 2009-07-31 18:56
系统: windows、ubuntu
来自: 广东阳江

Re: 每次开机下载国家地理Photo of the Day作为桌面

#8

帖子 qq420100523 » 2013-01-08 18:50

这个支持一下。 :em11
头像
youzhiyili
帖子: 2422
注册时间: 2012-03-22 20:42
系统: ubuntu22.04

Re: 每次开机下载国家地理Photo of the Day作为桌面

#9

帖子 youzhiyili » 2013-01-08 21:27

标记一个
@自由建客 @qy117121 @枫叶饭团 @cikekid @YeLee @jtshs256 @eexpress @ljj_jjl2008 @zhw2101024 @TeliuTe @月下叹逍遥 @leeaman @懒蜗牛Gentoo @灰色小狼 @photor @adagio @JiangHui @phoenixlzx @oneleaf
回复