The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Little UF-Calendar Script by dg2fer 2006-11-19 12:55:59

I wrote a little bash script that displays the UF Calendar of the current month on your X11 root window (background). At the end of the month (starting at 28th), it also checks for the calendar of the next month and downloads it (once) automatically.

Just include it in your favourite window manager startup file. If you don't log out but use a screen saver or lock instead, you perhaps should make a cron job which calls that script at the first day of every month (and sets the DISPLAY variable).

#!/bin/bash
#
# Downloads and displays the UF Calendar, from Mirko Dölle <dg2fer@amsat.de>

# VERSION="NA"
VERSION="EU"

THISDAY=`date +"%e"`
THISMY=`LANG=C date +"%b%Y" | tr "[a-z]" "[A-Z]"`
NEXTMY=`LANG=C date -d "next month" +"%b%Y" | tr "[a-z]" "[A-Z]"`

if [ "${THISDAY}" -ge "28" ]; then
  if [ ! -e "UFCalendar_${NEXTMY}-${VERSION}.png" ]; then
    # try to download the calendar for the next month in background
    wget -o /dev/null -b -q \
  http://www.userfriendly.org/illiad/UFCalendar_${NEXTMY}-${VERSION}.png \
  >/dev/null 2>/dev/null
  fi
fi

if [ ! -e "UFCalendar_${THISMY}-${VERSION}.png" ]; then
  # we don't have the current calendar, so download it in foreground and
  # wait till download has finished
  wget -o /dev/null -q \
  http://www.userfriendly.org/illiad/UFCalendar_${THISMY}-${VERSION}.png \
  >/dev/null 2>/dev/null
fi

if [ -e "UFCalendar_${THISMY}-${VERSION}.png" ]; then
  # place here the command to display the calendar
  xv -root -quit UFCalendar_${THISMY}-${VERSION}.png
fi

You can get the script alternatively from http://www.mirko-doelle.de/uf-calendar.sh.

Best wishes for 2005, Mirko
[ Reply ]
  How about... by kibeha2006-11-19 12:55:59

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)