As some of you know from previous posts, I use JWM as my default window manager. I like to keep things simple and cut down on wasted resources. This helps a lot, as I often run Qemu, Aqemu, or compile Android variants on my older laptop, which is not exactly a resource gold mine. One of the things that I wanted, however, was a lightweight calendar that I could click on and bring up. The original solution was to open up a terminal and simply type “cal”, but that got a little tedious, especially when I already was using the terminal for compiling or something like that.
Eventually, I decided to instead add a shortcut to my JWM start bar, and have that open up a terminal that will run the calendar program for me. The great thing about using a script was that I could specify the colors of the calendar (changing the look), and then give myself an options menu. To make this work with the color, font, or other changes, I actually have the JWM button refer to this first script, by adding this to my .jwmrc file:
<TrayButton popup=”Calendar Script” icon=”web-google-calendar.png”>exec:/home/alaskalinuxuser/Documents/scripts/xcal.sh</TrayButton>
Then, at that location, I have this simple first script:
xterm -fg black -bg white -e sh /home/alaskalinuxuser/Documents/scripts/cal.sh
Which in turn runs this script:
read -p “Would you like a different month? Choose a number or choose (n): ” yn
case $yn in
* ) cal -m jan;;
* ) cal -m feb;;
* ) cal -m mar;;
* ) cal -m apr;;
* ) cal -m may;;
* ) cal -m jun;;
* ) cal -m jul;;
* ) cal -m aug;;
* ) cal -m sep;;
* ) cal -m oct;;
* ) cal -m nov;;
* ) cal -m dec;;
[n]* ) exit 0;;
* ) echo “Please choose 1-12.”;;
echo “I’ll give you 10 seconds to read it.”
Here is an example taken from one of the terminals after clicking on it.
Su Mo Tu We Th Fr Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
Would you like a different month? Choose a number or choose (n): 2
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
I’ll give you 10 seconds to read it.
I played around with the colors and settings for a while. I think that I have it tuned for what I like, but others may wish for something else. Essentially, I found that if I open the calendar, I almost always want to see the current month, so that is the default. Sometimes, however, I found that I wanted a different month. So the script asks you if you want a different month by month number. After choosing another month, or selecting no, the window will close after 10 seconds of viewing. Usually that is ample time for me to look at what I wanted to see. Obviously the time could be adjusted. Perhaps more obviously, there are GUI built in calendar applications that probably work 100 times better for the average person. This just works for me.
Linux – Keep it simple.