[Remind-Fans] A little script I use to put remind on the desktop

Steven W. Orr steveo at syslang.net
Tue Aug 26 13:09:19 EDT 2008


On Tuesday, Aug 5th 2008 at 00:13 -0000, quoth Shelagh Manton:

=>As the subject says. This was devised for xfce4 but I'm sure that the
=>guts of the script would be useful for any desktop. At least on *nix
=>OSes.
=>
=>It does have three dependencies ssed imagemagick and enscript.
=>Most are available with distro package managers but may not be
=>installed by default. ssed (super sed) might be the only one that is
=>difficult to get. 
=>
=>8< -----------------------------------------------------------
=>#!/bin/bash
=>#dailypic: make a picture for desktop of the output of remind.
=>
=>empty='s/\e\[0m/@color{default}/g
=>s/\e\[0;31m/@color{1 0 0}/
=>s/\e\[0;32m/@color{0 1 0}/
=>s/\e\[0;33m/@color{1 1 0}/
=>s/\e\[0;34m/@color{0 0 1}/
=>s/\e\[0;35m/@color{1 0 1}/
=>s/\e\[0;36m/@color{0 1 1}/
=>s/\e\[0;37m/@color{0 0 0}/
=>s/\e\[31;1m/@color{1 0 0}/
=>s/\e\[32;1m/@color{0 1 0}/
=>s/\e\[33;1m/@color{1 1 0}/
=>s/\e\[34;1m/@color{0 0 1}/
=>s/\e\[35;1m/@color{1 0 1}/
=>s/\e\[36;1m/@color{0 1 1}/
=>s/\e\[37;1m/@color{0 0 0}/'
=>
=>picture="/path/to/your/wallpapers/daily.png"
=>
=>remind | ssed "$empty" \
	 | enscript --escapes=@ -Br -fPalatino-Bold16 -q -o -\
         | convert -trim -transparent white -rotate 90 - "$picture"
=>xfdesktop
=>
=>Shelagh

How about something like:

color[0]="\e[0;31m"	# Call is red blue green or whatever
tomap[0]='1 0 0'
color[1]="\e[0;32m"
tomap[1]='0 1 0'
etc
picture=/path/to/your/wallpapers/daily.png # No quotes needed.
remind | while read line
do
    for (( ii=0; ii < ${#color[@]}; ii++ ))
    do
        tmp="$line"
	line=${tmp/${color[ii]}/@color{"${tomap[ii]}"\}}
    done
    echo "${line}"
done | enscript --escapes=@ -Br -fPalatino-Bold16 -q -o - \
     | convert -trim -transparent white -rotate 90 - $picture
xfdesktop

It'll run faster, it'll eliminate a process, and it eliminates the need 
for supersed.
    
-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net



More information about the Remind-fans mailing list