UPDATE!!! 17 NOV 2010 - Recently, a change on the static.die.net site wget not downloading the actual world map, but just a black picture instead. It turns out that this only affected wget so to work around this, I've added the option of '-U "pwnd"' to the wget line to send a user-agent string and now it works again!
I read an article on Lifehacker yesterday about how you can set a day/night rotating map as your desktop background. At first I was like, "Hey, this is awesome!" Then I remembered my conky setup and realized that it wouldn't work as it requires a static color background behind the text in order to be visible and the world map is being constantly downloaded and over-writing the image so I was all, "Dangit, that would have been cool =(". Then I got an idea! I could use ImageMagick to glue the static conky background on to the world map so I high-fived myself and went, "pwnd!"
</valley_girl>
As the day progresses (and provided that you're connected to the internet), the day/night image will be updated every hour. Additionally, this script will draw a transparent gray band on the newly downloaded world map that you can overlay with your .conkyrc config.
Here's my setup:
.conkyrc
# This is my conky config, you'll need theanimated_background.sh
# Envy Code R VS font if you want to match my setup
# otherwise any monospaced font will do
alignment top_middle
border_width 0
default_color AAAAAA #white
draw_outline no
draw_shades no
use_xft yes
gap_x 0
gap_y 250
own_window yes
own_window_title conky
own_window_transparent yes
own_window_hints undecorated, sticky, below, skip_pager, skip_taskbar
double_buffer yes
update_interval 1.0
use_spacer none
short_units yes
draw_graph_borders no
default_outline_color black
use_spacer left
default_bar_size 250 5
TEXT
${font Envy Code R VS:size=40}${alignc}${time %R}${font Envy Code R VS:size=10}
${alignc}${time %A, %B %e}${font Envy Code R VS:size=8}
${voffset -50}${fs_bar 5, 250 /} sda${alignr}bat ${battery_bar}
${cpubar 5, 250} cpu${alignr}wlan ${wireless_link_bar 5, 250 wlan0}
${membar 5, 250} ram${alignr}${wireless_essid wlan0} ${addr wlan0} - ${upspeed wlan0} / ${downspeed wlan0}
${tab 775,0}${color black}.
#!/bin/bashThen you'll need to set the script to run hourly using either crontab or gnome-schedule as shown in the Lifehacker link.
# This will download the day/night map and apply the gray band to the top of it
# You'll need to 'sudo apt-get install imagemagick' and
# 'chmod +x ./animated_background.sh' for this script to work
wget -r -U "pwnd" -O 800.jpg http://static.die.net/earth/mercator/800.jpg
convert -size 800x70 xc:'#40404090' ./grey_stripe.png
convert -resize 800x480! ./800.jpg ./800.jpg
composite -geometry -0+255 ./grey_stripe.png 800.jpg ~/Pictures/world.png
rm ./grey_stripe.png ./800.jpg
Cheers!



0 comments:
Post a Comment