and now for conky & gremlins

View: New views
6 Messages — Rating Filter:   Alert me  

and now for conky & gremlins

by PJ-14 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

conky is still working ok...but the calendar is limping...
rather strange
here's the .conkyrc:
snip...
${color green}CALENDAR ${hr 2}$color
#${execi 300 ~/bin/calendar.sh}
${execi 300 cal | awk 'NR>1' | sed -e 's/   /    /g' -e 's/[^ ] /& /g'
-e 's/..*/  &/' -e "s/\ `date +%d`/\[`date +%d`\]/"}

output should be: 1  2  3 [4] 5 6 7 etc.
is:    1 2 3 4 5 6....

the calendar.sh is exactly:
#!/bin/sh
cal | awk 'NR>1' | sed -e 's/   /    /g' -e 's/[^ ] /& /g' -e 's/..*/
&/' -e "s/\ `date +%d`/\[`date +%d`\]/"

I upgraded ports and now the calendar.sh cannot be found - it exists;
bash no longer wishes to execute or recognize it...

I am puzzled as to what is going on? I seem to be chasing after gremlins
... again ... and again..
like, even firefox can't be upgraded on one system (identical) but can
on another... bugs & gremlins... oooooooh, gadzooks!
_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."

Re: and now for conky & gremlins

by Polytropon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 04 Nov 2009 18:25:58 -0400, PJ <af.gourmet@...> wrote:
> output should be: 1  2  3 [4] 5 6 7 etc.
> is:    1 2 3 4 5 6....
>
> the calendar.sh is exactly:
> #!/bin/sh
> cal | awk 'NR>1' | sed -e 's/   /    /g' -e 's/[^ ] /& /g' -e 's/..*/
> &/' -e "s/\ `date +%d`/\[`date +%d`\]/"

It's quite obviously. Let's try the last substitution
argument in plain shell:

        % date +%d
        05

But the command creates this:

         Su  Mo  Tu  We  Th  Fr  Sa
          1   2   3   4   5   6   7

The leading zero is missing, so there's no substition that
changes "5" into "[5]", because the search pattern is "05".



--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."

Re: and now for conky & gremlins

by PJ-14 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Polytropon wrote:

> On Wed, 04 Nov 2009 18:25:58 -0400, PJ <af.gourmet@...> wrote:
>  
>> output should be: 1  2  3 [4] 5 6 7 etc.
>> is:    1 2 3 4 5 6....
>>
>> the calendar.sh is exactly:
>> #!/bin/sh
>> cal | awk 'NR>1' | sed -e 's/   /    /g' -e 's/[^ ] /& /g' -e 's/..*/
>> &/' -e "s/\ `date +%d`/\[`date +%d`\]/"
>>    
>
> It's quite obviously. Let's try the last substitution
> argument in plain shell:
>
> % date +%d
> 05
>
> But the command creates this:
>
> Su  Mo  Tu  We  Th  Fr  Sa
>  1   2   3   4   5   6   7
>
> The leading zero is missing, so there's no substition that
> changes "5" into "[5]", because the search pattern is "05".
>  
Ok, I see... I'm not too good in programming. I guess I didn't notice
the previous to the first days of November the date was always 2
digits.. how do I get rid of the zero? Regex substitution or something
like that?
_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."

Re: and now for conky & gremlins

by PJ-14 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ruben de Groot wrote:

> On Thu, Nov 05, 2009 at 09:26:15AM -0400, PJ typed:
>  
>> Polytropon wrote:
>>    
>>> On Wed, 04 Nov 2009 18:25:58 -0400, PJ <af.gourmet@...> wrote:
>>>  
>>>      
>>>> output should be: 1  2  3 [4] 5 6 7 etc.
>>>> is:    1 2 3 4 5 6....
>>>>
>>>> the calendar.sh is exactly:
>>>> #!/bin/sh
>>>> cal | awk 'NR>1' | sed -e 's/   /    /g' -e 's/[^ ] /& /g' -e 's/..*/
>>>> &/' -e "s/\ `date +%d`/\[`date +%d`\]/"
>>>>    
>>>>        
>>> It's quite obviously. Let's try the last substitution
>>> argument in plain shell:
>>>
>>> % date +%d
>>> 05
>>>
>>> But the command creates this:
>>>
>>> Su  Mo  Tu  We  Th  Fr  Sa
>>>  1   2   3   4   5   6   7
>>>
>>> The leading zero is missing, so there's no substition that
>>> changes "5" into "[5]", because the search pattern is "05".
>>>  
>>>      
>> Ok, I see... I'm not too good in programming. I guess I didn't notice
>> the previous to the first days of November the date was always 2
>> digits.. how do I get rid of the zero? Regex substitution or something
>> like that?
>>    
>
> date "+%e" should do it.
>  
Sure did....  For the moment, I changed the [ ] to just plain >
maybe that will avoid the disjointed row.
But changing the color of the current date sure would be nice... but is
there a way to do that?

_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."

Re: and now for conky & gremlins

by Ruben de Groot :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Nov 05, 2009 at 09:26:15AM -0400, PJ typed:

> Polytropon wrote:
> > On Wed, 04 Nov 2009 18:25:58 -0400, PJ <af.gourmet@...> wrote:
> >  
> >> output should be: 1  2  3 [4] 5 6 7 etc.
> >> is:    1 2 3 4 5 6....
> >>
> >> the calendar.sh is exactly:
> >> #!/bin/sh
> >> cal | awk 'NR>1' | sed -e 's/   /    /g' -e 's/[^ ] /& /g' -e 's/..*/
> >> &/' -e "s/\ `date +%d`/\[`date +%d`\]/"
> >>    
> >
> > It's quite obviously. Let's try the last substitution
> > argument in plain shell:
> >
> > % date +%d
> > 05
> >
> > But the command creates this:
> >
> > Su  Mo  Tu  We  Th  Fr  Sa
> >  1   2   3   4   5   6   7
> >
> > The leading zero is missing, so there's no substition that
> > changes "5" into "[5]", because the search pattern is "05".
> >  
> Ok, I see... I'm not too good in programming. I guess I didn't notice
> the previous to the first days of November the date was always 2
> digits.. how do I get rid of the zero? Regex substitution or something
> like that?

date "+%e" should do it.

Ruben

_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."

Re: and now for conky & gremlins

by Walt Pawley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 10:41 AM -0400 11/5/09, PJ wrote:

>Ruben de Groot wrote:
>> On Thu, Nov 05, 2009 at 09:26:15AM -0400, PJ typed:
>>
>>> Polytropon wrote:
>>>
>>>> On Wed, 04 Nov 2009 18:25:58 -0400, PJ <af.gourmet@...> wrote:
>>>>
>>>>
>>>>> output should be: 1  2  3 [4] 5 6 7 etc.
>>>>> is:    1 2 3 4 5 6....
>>>>>
>>>>> the calendar.sh is exactly:
>>>>> #!/bin/sh
>>>>> cal | awk 'NR>1' | sed -e 's/   /    /g' -e 's/[^ ] /& /g' -e 's/..*/
>>>>> &/' -e "s/\ `date +%d`/\[`date +%d`\]/"
>>>>>
>>>>>
>>>> It's quite obviously. Let's try the last substitution
>>>> argument in plain shell:
>>>>
>>>> % date +%d
>>>> 05
>>>>
>>>> But the command creates this:
>>>>
>>>> Su  Mo  Tu  We  Th  Fr  Sa
>>>>  1   2   3   4   5   6   7
>>>>
>>>> The leading zero is missing, so there's no substition that
>>>> changes "5" into "[5]", because the search pattern is "05".
>>>>
>>>>
>>> Ok, I see... I'm not too good in programming. I guess I didn't notice
>>> the previous to the first days of November the date was always 2
>>> digits.. how do I get rid of the zero? Regex substitution or something
>>> like that?
>>>
>>
>> date "+%e" should do it.
>>
>Sure did....  For the moment, I changed the [ ] to just plain >
>maybe that will avoid the disjointed row.

Not quite what you're looking for but ...

 cal | perl -pe 's/^/ /;s/$/ /;s/ '"$(date "+%e")"' /\['"$(date "+%e")"']/'

... generated ...

    November 2009
  S  M Tu  W Th  F  S
  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

--

Walter M. Pawley <walt@...>
Wump Research & Company
676 River Bend Road, Roseburg, OR 97471
         541-672-8975
_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."