You are not logged in.
Hi,
Just noticed this screenshot: http://lifehacker.com/5393804/the-ultim … en-desktop
To the right there is a very cool calendar running, does anyone know if it's a conky configuration. I like it alot!
Some of the settings is listed there but don't seem to find anything about this calendar.
Last edited by ftornell (2009-11-14 20:06:19)
[ logicspot.NET | mempad.org ]
Archlinux x64
Offline
Ummmmm......that would be a Windows screenshot
Ahhhh, ok...you know if there is anyhing like that for conky then? Think it was a cool.
[ logicspot.NET | mempad.org ]
Archlinux x64
Offline
firecat53 wrote:Ummmmm......that would be a Windows screenshot
Ahhhh, ok...you know if there is anyhing like that for conky then? Think it was a cool.
That's easy.
Here is an example for the text part:
${color3} ${time %A,}
${time %d. %B %Y}
${hr}
${exec cal}
Website: andrwe.org
Offline
ftornell wrote:firecat53 wrote:Ummmmm......that would be a Windows screenshot
Ahhhh, ok...you know if there is anyhing like that for conky then? Think it was a cool.
That's easy.
Here is an example for the text part:
${color3} ${time %A,}
${time %d. %B %Y}
${hr}
${exec cal}The result is:
http://omploader.org/vMnJjdQ
thx for the suggestion but i mean the layout aswell like on the right side of screen:
1
2
3
4
[5]
6
7
8
9
and so on...
[ logicspot.NET | mempad.org ]
Archlinux x64
Offline
Have a look at the bash script mentioned in the first post:
http://ubuntuforums.org/showthread.php?t=690753
Change the "second_part" a bit and you should be able to get such a layout.
Maybe I'll write a script later if you can't handle it.
Website: andrwe.org
Offline
Have a look at the bash script mentioned in the first post:
http://ubuntuforums.org/showthread.php?t=690753Change the "second_part" a bit and you should be able to get such a layout.
Maybe I'll write a script later if you can't handle it.
I now have:
${color0}${execi 1 ~/calendar1.sh first_part}${color1}${execi 1 ~/calendar1.sh today }${color0}${execi 1 ~/calendar1.sh second_part}
Its looking like a square:
Su Mo Tu We Th Fr Sa
1 2 3 4 5 [6] 7
8 9...
Would like it to look like
1
2
3
4
5
[6]
7
8
[ logicspot.NET | mempad.org ]
Archlinux x64
Offline
Here is a script which converts the output of cal into a vertical or horizontal direction just call it with the direction as parameter.
#!/bin/bash
# Possible color code are:
# Color Foreground Background
# black 30 40
# red 31 41
# green 32 42
# yellow 33 43
# blue 34 44
# magenta 35 45
# cyan 36 46
# white 37 47
# For more information have a look at http://tldp.org/LDP/abs/html/colorizing.html#AEN19813
# Set default background color
DFT_BG='\E[40m'
# Set default foreground color
DFT_FG='\E[32m'
# Set color for today marking
THIS_DAY_COLOR='\E[47m'
TODAY_DAY=`date | awk -F" " '{print $2}' | sed 's/\.//'`
days=`cal | sed 's/[a-zA-Z]//g' | sed 's/\S\S\S\S//g'`
case "$1" in
vertical)
echo -e ${DFT_BG}${DFT_FG}
for day in ${days}
do
[ ${day} -eq ${TODAY_DAY} ] && echo -e "${THIS_DAY_COLOR}${day}${DFT_BG}${DFT_FG}"
[ ! ${day} -eq ${TODAY_DAY} ] && echo -e ${day}
done
;;
horizontal)
echo -e ${DFT_BG}${DFT_FG}
for day in ${days}
do
[ ${day} -eq ${TODAY_DAY} ] && month="${month} ${THIS_DAY_COLOR}${day}${DFT_BG}${DFT_FG}"
[ ! ${day} -eq ${TODAY_DAY} ] && month="${month} ${day}"
done
echo -e ${month}
;;
esac
Website: andrwe.org
Offline
I think it's possible to reduce it to a few messy looking sed pipes and cal, but I'm not great with sed and can't remove a couple of extra newlines that appear, so went the script route instead.
#!/bin/sh
TODAY=`date +%e`
MONTHLENGTH=`cal | egrep -v '[A-Za-z]' | wc -w`
for i in $(seq 1 $MONTHLENGTH)
do
if [ $i == $TODAY ]; then
printf "\${color #e84448}%2d\${color}\n" $i
else
printf "%2d\n" $i
fi
done
Probably makes more sense to just build the list of dates then do a sed operation to mark today's date instead of constant if/then/else checking for each day, but it works.
Offline
for the really short variant without any loops and ifs you could use something like this:
1 line vertical:
#!/bin/sh
cal | sed -e "1,2d;s/^ *//g;s/ / /g;s/ /\n/g;s/$(date +%e)/$(echo -en '\e[30;47m')$(date +%e)$(echo -en '\e[00m')/"
1 line horizontal:
#!/bin/sh
echo $(cal | sed -e "1,2d;s/^ *//g;s/ / /g;s/ /\n/g;s/$(date +%e)/$(echo -en '\e[30;47m')$(date +%e)$(echo -en '\e[00m')/" | tr '\n' ' ')
Last edited by seiichiro0185 (2009-11-13 16:24:04)
My System: Dell XPS 13 | i7-7560U | 16GB RAM | 512GB SSD | FHD Screen | Arch Linux
My Workstation/Server: Supermicro X11SSZ-F | Xeon E3-1245 v6 | 64GB RAM | 1TB SSD Raid 1 + 6TB HDD ZFS Raid Z1 | Proxmox VE
My Stuff at Github: github
My Homepage: Seiichiros HP
Offline
Now just for pseup my script without if/else/for:
#!/bin/bash
# Possible color code are:
# Color Foreground Background
# black 30 40
# red 31 41
# green 32 42
# yellow 33 43
# blue 34 44
# magenta 35 45
# cyan 36 46
# white 37 47
# For more information have a look at http://tldp.org/LDP/abs/html/colorizing.html#AEN19813
# Set default background color
DFT_BG='\E[40m'
# Set default foreground color
DFT_FG='\E[32m'
# Set color for today marking
THIS_DAY_COLOR='\E[47m'
TODAY_DAY=`date +%e`
days=`cal | sed 's/[a-zA-Z]//g;s/\S\S\S\S//g'`
case "$1" in
vertical)
echo -e "${DFT_BG}${DFT_FG}$(echo ${days} | sed s/${TODAY_DAY}/\\${THIS_DAY_COLOR}${TODAY_DAY}\\${DFT_BG}\\${DFT_FG}/g | sed 's/ /\n/g')"
;;
horizontal)
echo -e "${DFT_BG}${DFT_FG}$(echo ${days} | sed s/${TODAY_DAY}/\\${THIS_DAY_COLOR}${TODAY_DAY}\\${DFT_BG}\\${DFT_FG}/g)"
;;
esac
@seiichiro0185:
My script uses variables.
Last edited by Andrwe (2009-11-13 15:56:52)
Website: andrwe.org
Offline
${execpi 60 DJS=`date +%_d`; cal | sed '1d' | sed '/./!d' | sed 's/$/ /' | fold -w 21 | sed -n '/^.\{21\}/p' | sed 's/^/${alignc} /' | sed /" $DJS "/s/" $DJS "/" "'${color2}'"$DJS"'${color white}'" "/}${color white}
Offline
for the really short variant without any loops and ifs you could use something like this:
1 line vertical:
#!/bin/sh cal | sed -e "1,2d;s/^ *//g;s/ / /g;s/ /\n/g;s/$(date +%e)/$(echo -en '\e[30;47m')$(date +%e)$(echo -en '\e[00m')/"
1 line horizontal:
#!/bin/sh echo $(cal | sed -e "1,2d;s/^ *//g;s/ / /g;s/ /\n/g;s/$(date +%e)/$(echo -en '\e[30;47m')$(date +%e)$(echo -en '\e[00m')/" | tr '\n' ' ')
Closest yet!
But something is wrong with the "today output".
1 2 3 4 5 6 7 8 9 10 11 12 13 >[30;47m14>[00m 15 16 17 18 19 ...
So the color or [ ] or whatefter that will hilight todays date is not working properly.
[ logicspot.NET | mempad.org ]
Archlinux x64
Offline
you should execp the script from within conkyrc and replace the bash color definitions with conky ones.
#!/bin/sh
cal | sed -e "1,2d;s/^ *//g;s/ / /g;s/ /\n/g;s/$(date +%e)/\$\{color1\}&\$color/" | tr '\n' ' '
# conkyrc
color1 #f0f0f0
TEXT
${execp /path/to/above.sh}
note: untested.
also: FYI, don't use #!/bin/sh and $( ) in the same script. #!/bin/bash and $( ) or #!/bin/sh and ` `.
Last edited by brisbin33 (2009-11-14 18:18:54)
//github/
Offline
you should execp the script from within conkyrc and replace the bash color definitions with conky ones.
#!/bin/sh cal | sed -e "1,2d;s/^ *//g;s/ / /g;s/ /\n/g;s/$(date +%e)/\$color1&\$color/" | tr '\n' ' '
# conkyrc color1 #f0f0f0 TEXT ${execp /path/to/above.sh}
note: untested.
also: FYI, don't use #!/bin/sh and $( ) in the same script. !/bin/bash and $( ) or #!/bin/sh and ` `.
hmm..
receive 12 13 $color114} 15 16...
.conkyrc
color1 1994d1
TEXT
${execp ~/calendar.sh}
calendar.sh
#!/bin/sh
cal | sed -e "1,2d;s/^ *//g;s/ / /g;s/ /\n/g;s/$(date +%e)/\$color1&\$color/" | tr '\n' ' '
[ logicspot.NET | mempad.org ]
Archlinux x64
Offline
sorry bout that, caught a small mistake and edited my above post.
//blue/0/~/ cal | sed -e "1,2d;s/^ *//g;s/ / /g;s/ /\n/g;s/$(date +%e)/\$\{color1\}&\$color/" | tr '\n' ' '
1 2 3 4 5 6 7 8 9 10 11 12 13 ${color1}14$color 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3
that should get parsed correctly by conky recoloring the 14 to color1
//github/
Offline
sorry bout that, caught a small mistake and edited my above post.
//blue/0/~/ cal | sed -e "1,2d;s/^ *//g;s/ / /g;s/ /\n/g;s/$(date +%e)/\$\{color1\}&\$color/" | tr '\n' ' ' 1 2 3 4 5 6 7 8 9 10 11 12 13 ${color1}14$color 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3
that should get parsed correctly by conky recoloring the 14 to color1
Works like a charm! thx m8!
possible to get it in vertical aswell?
btw, is this conky code or general programing?
[ logicspot.NET | mempad.org ]
Archlinux x64
Offline
for vertical just use my variant from above with the color corrections from brisbin33:
cal | sed -e "1,2d;s/^ *//g;s/ / /g;s/ /\n/g;s/$(date +%e)/\$\{color1\}&\$color/"
the color stuff is conky, the rest is bash/sed scripting
My System: Dell XPS 13 | i7-7560U | 16GB RAM | 512GB SSD | FHD Screen | Arch Linux
My Workstation/Server: Supermicro X11SSZ-F | Xeon E3-1245 v6 | 64GB RAM | 1TB SSD Raid 1 + 6TB HDD ZFS Raid Z1 | Proxmox VE
My Stuff at Github: github
My Homepage: Seiichiros HP
Offline
Thx guys! you made my day!
[ logicspot.NET | mempad.org ]
Archlinux x64
Offline
Thx guys! you made my day!
can you post a screenshot of what the final result looked like?
"I know what you're thinking, 'cause right now I'm thinking the same thing. Actually, I've been thinking it ever since I got here:
Why oh why didn't I take the BLUE pill?"
Offline
[ logicspot.NET | mempad.org ]
Archlinux x64
Offline
Nice desk ftornell, it always amazes me how helpful people on the forum are, Archlinux ftw
Cheers
Paul-S
Offline