[Remind-Fans] A little script I use to put remind on the desktop
Shelagh Manton
shelagh.manton at gmail.com
Tue Aug 26 17:01:49 EDT 2008
On Tue, 26 Aug 2008 13:09:19 -0400 (EDT)
"Steven W. Orr" <steveo at syslang.net> wrote:
> 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.
>
Thanks for this. I'm always happy to learn new ways of doing things.
I'll look carefully at it to see how it works.
Shelagh
--
----------------------------------------------------------------
Jabber: shelagh.manton at gmail.com
----------------------------------------------------------------
More information about the Remind-fans
mailing list