You are not logged in.
Hello,
Since nearly everything I have learned regarding conky is from this community, I thought maybe someone can help me.
I recently got the latest gcalcli (3.3.2) using pip, and have it working with conky, using the following commands in my conky file:
TEXT
*** Google Calendar Agenda ***
${execpi 300 gcalcli --conky agenda}
${execpi 300 gcalcli --nolineart --conky calw 2}
According to the gcalcli Python page, the --conky option allows using conky color sequences.
The problem is that I have no idea how to actually set custom colors that the gcalcli output can use. Basically, it is putting out cyan, yellow, magenta, etc, and I do not know how to convert those to hex values set in the conky configuration file.
I understand in conky, I can use colorN values and set a hex code and use those colorN variables throughout the code, but I do not know how to get these into the gcalcli output.
Is there a way to set the conky configuration files so that magenta defaults to some hex code, and cyan defaults to some other one, etc? Similar to an Xdefaults/Xresources file for uxrvt?
Thanks!
Last edited by oneleaf (2016-04-16 13:17:20)
Offline
The first part looks like a gcalcli problem and you'll need to talk to someone that uses that app. I don't, sorry.
But colour codes in conky is easy enough:
To set default and ten other colours above TEXT:
default_color DCDCDC #Gainsboro
color0 98FB98 #PaleGreen
color1 778899 #LightSlateGray
color2 FFD700 #Gold
color3 B0E0E6 #PowderBlue
color4 F4A460 #SandyBrown
color5 DEB887 #BurlyWood
color6 00BFFF #DeepSkyBlue
color7 5F9EA0 #CadetBlue
color8 FFA500 #Orange
color9 FF4500 #OrangeRed
TEXT
or if you wish use the websafe colour names:
ie...
color8 Orange
color9 OrangeRed
and under TEXT starting a colour will cause conky to display that colour until you change it or end colour all together with ${color} - this will invoke the default_color you have set above, or is none, your 'system default colour'.
ie:
TEXT
${time %T}${alignr}${utime %T}
${uptime}${alignr}${time %x}
${alignc}CPU Avg ${if_match ${cpu cpu0}<10}${color1}00${color6}${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100}${color1}0${color5}${cpu cpu0}\
${else}${color9}${cpu cpu0}${endif}${endif}${color5}%${color}
${alignc}Conky v${conky_version}
${execpi 86400 /media/5/Conky/scripts/366.sh | fold -sw35}
${alignc}${color9}${membar 0,25}${color} ↓ test code ↓ ${color9}${membar 0,25}${color}
${color9}${membar 0}${color}
Kernel:${alignr}${kernel}
Uptime:${alignr}${uptime}
UTC:${alignr}${utime %H:%M}
${color9}${membar 0}${color}
${alignc}${color9}${membar 0,25}${color} ↑ between lines ↑ ${color9}${membar 0,25}${color}
Or you can use the 'names' or hex codes:
${color9}${membar 0}${color}
${color FF4500}${membar 0}${color}
${color OrangeRed}${membar 0}${color}
Websafe colours:
Hex Decimal colours
code code HTML name
Red colors
0xCD5C5C #205 92 92 IndianRed
0xF08080 #240 128 128 LightCoral
0xFA8072 #250 128 114 Salmon
0xE9967A #233 150 122 DarkSalmon
0xFFA07A #255 160 122 LightSalmon
0xDC143C #220 20 60 Crimson
0xFF0000 #255 0 0 Red
0xB22222 #178 34 34 FireBrick
0x8B0000 #139 0 0 DarkRed
Pink colors
0xFFC0CB #255 192 203 Pink
0xFFB6C1 #255 182 193 LightPink
0xFF69B4 #255 105 180 HotPink
0xFF1493 #255 20 147 DeepPink
0xC71585 #199 21 133 MediumVioletRed
0xDB7093 #219 112 147 PaleVioletRed
Orange colors
0xFFA07A #255 160 122 LightSalmon
0xFF7F50 #255 127 80 Coral
0xFF6347 #255 99 71 Tomato
0xFF4500 #255 69 0 OrangeRed
0xFF8C00 #255 140 0 DarkOrange
0xFFA500 #255 165 0 Orange
Yellow colors
0xFFD700 #255 215 0 Gold
0xFFFF00 #255 255 0 Yellow
0xFFFFE0 #255 255 224 LightYellow
0xFFFACD #255 250 205 LemonChiffon
0xFAFAD2 #250 250 210 LightGoldenrodYellow
0xFFEFD5 #255 239 213 PapayaWhip
0xFFE4B5 #255 228 181 Moccasin
0xFFDAB9 #255 218 185 PeachPuff
0xEEE8AA #238 232 170 PaleGoldenrod
0xF0E68C #240 230 140 Khaki
0xBDB76B #189 183 107 DarkKhaki
Purple colors
0xE6E6FA #230 230 250 Lavender
0xD8BFD8 #216 191 216 Thistle
0xDDA0DD #221 160 221 Plum
0xEE82EE #238 130 238 Violet
0xDA70D6 #218 112 214 Orchid
0xFF00FF #255 0 255 Fuchsia
0xFF00FF #255 0 255 Magenta
0xBA55D3 #186 85 211 MediumOrchid
0x9370DB #147 112 219 MediumPurple
0x8A2BE2 #138 43 226 BlueViolet
0x9400D3 #148 0 211 DarkViolet
0x9932CC #153 50 204 DarkOrchid
0x8B008B #139 0 139 DarkMagenta
0x800080 #128 0 128 Purple
0x4B0082 # 75 0 130 Indigo
0x6A5ACD #106 90 205 SlateBlue
0x483D8B # 72 61 139 DarkSlateBlue
0x7B68EE #123 104 238 MediumSlateBlue
Green colors
0xADFF2F #173 255 47 GreenYellow
0x7FFF00 #127 255 0 Chartreuse
0x7CFC00 #124 252 0 LawnGreen
0x00FF00 # 0 255 0 Lime
0x32CD32 # 50 205 50 LimeGreen
0x98FB98 #152 251 152 PaleGreen
0x90EE90 #144 238 144 LightGreen
0x00FA9A # 0 250 154 MediumSpringGreen
0x00FF7F # 0 255 127 SpringGreen
0x3CB371 # 60 179 113 MediumSeaGreen
0x2E8B57 # 46 139 87 SeaGreen
0x228B22 # 34 139 34 ForestGreen
0x008000 # 0 128 0 Green
0x006400 # 0 100 0 DarkGreen
0x9ACD32 #154 205 50 YellowGreen
0x6B8E23 #107 142 35 OliveDrab
0x808000 #128 128 0 Olive
0x556B2F # 85 107 47 DarkOliveGreen
0x66CDAA #102 205 170 MediumAquamarine
0x8FBC8F #143 188 143 DarkSeaGreen
0x20B2AA # 32 178 170 LightSeaGreen
0x008B8B # 0 139 139 DarkCyan
0x008080 # 0 128 128 Teal
Blue/Cyan colors
0x00FFFF # 0 255 255 Aqua
0x00FFFF # 0 255 255 Cyan
0xE0FFFF #224 255 255 LightCyan
0xAFEEEE #175 238 238 PaleTurquoise
0x7FFFD4 #127 255 212 Aquamarine
0x40E0D0 # 64 224 208 Turquoise
0x48D1CC # 72 209 204 MediumTurquoise
0x00CED1 # 0 206 209 DarkTurquoise
0x5F9EA0 # 95 158 160 CadetBlue
0x4682B4 # 70 130 180 SteelBlue
0xB0C4DE #176 196 222 LightSteelBlue
0xB0E0E6 #176 224 230 PowderBlue
0xADD8E6 #173 216 230 LightBlue
0x87CEEB #135 206 235 SkyBlue
0x87CEFA #135 206 250 LightSkyBlue
0x00BFFF # 0 191 255 DeepSkyBlue
0x1E90FF # 30 144 255 DodgerBlue
0x6495ED #100 149 237 CornflowerBlue
0x7B68EE #123 104 238 MediumSlateBlue
0x4169E1 # 65 105 225 RoyalBlue
0x0000FF # 0 0 255 Blue
0x0000CD # 0 0 205 MediumBlue
0x00008B # 0 0 139 DarkBlue
0x000080 # 0 0 128 Navy
0x191970 # 25 25 112 MidnightBlue
Brown colors
0xFFF8DC #255 248 220 Cornsilk
0xFFEBCD #255 235 205 BlanchedAlmond
0xFFE4C4 #255 228 196 Bisque
0xFFDEAD #255 222 173 NavajoWhite
0xF5DEB3 #245 222 179 Wheat
0xDEB887 #222 184 135 BurlyWood
0xD2B48C #210 180 140 Tan
0xBC8F8F #188 143 143 RosyBrown
0xF4A460 #244 164 96 SandyBrown
0xDAA520 #218 165 32 Goldenrod
0xB8860B #184 134 11 DarkGoldenrod
0xCD853F #205 133 63 Peru
0xD2691E #210 105 30 Chocolate
0x8B4513 #139 69 19 SaddleBrown
0xA0522D #160 82 45 Sienna
0xA52A2A #165 42 42 Brown
0x800000 #128 0 0 Maroon
White colors
0xFFFFFF #255 255 255 White
0xFFFAFA #255 250 250 Snow
0xF0FFF0 #240 255 240 Honeydew
0xF5FFFA #245 255 250 MintCream
0xF0FFFF #240 255 255 Azure
0xF0F8FF #240 248 255 AliceBlue
0xF8F8FF #248 248 255 GhostWhite
0xF5F5F5 #245 245 245 WhiteSmoke
0xFFF5EE #255 245 238 Seashell
0xF5F5DC #245 245 220 Beige
0xFDF5E6 #253 245 230 OldLace
0xFFFAF0 #255 250 240 FloralWhite
0xFFFFF0 #255 255 240 Ivory
0xFAEBD7 #250 235 215 AntiqueWhite
0xFAF0E6 #250 240 230 Linen
0xFFF0F5 #255 240 245 LavenderBlush
0xFFE4E1 #255 228 225 MistyRose
Gray colors
0xDCDCDC #220 220 220 Gainsboro
0xD3D3D3 #211 211 211 LightGrey
0xC0C0C0 #192 192 192 Silver
0xA9A9A9 #169 169 169 DarkGray
0x808080 #128 128 128 Gray
0x696969 #105 105 105 DimGray
0x778899 #119 136 153 LightSlateGray
0x708090 #112 128 144 SlateGray
0x2F4F4F # 47 79 79 DarkSlateGray
0x000000 # 0 0 0 Black
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Thanks for the response!
Yea, I tried all sorts of settings but none of them seem to be able to pass through to the gcalcli output. I will see if anyone uses the application who has gotten this to work.
Offline
Well, I finally figured out what was going on. With my limited Python and Bash knowledge, I was able to finally see what was happening.
With gcalcli, the --conky option simply provides the color tags (i.e. ${color magenta}) in conky format, but you are still limited to the basic colors (red, green, magenta, cyan, etc). Any attempt to manually change the colors (using other gcalcli commandline options resulted in an error).
I finally accomplished what I wanted by doing the following:
Set color0 through color9 in conky to match what I want (basically what I have in .Xdefaults).
And then use sed to replace the color tags when running gcalcli. It works great:
#!/bin/sh
gcalcli --nolineart --conky calw 2 |
sed -e 's/color black/color0/g' \
-e 's/color red/color1/g' \
-e 's/color green/color2/g' \
-e 's/color yellow/color3/g' \
-e 's/color blue/color4/g' \
-e 's/color magenta/color5/g' \
-e 's/color cyan/color6/g' \
-e 's/color brightred/color9/g' \
-e 's/color white/color7/g'
And then call it in conky as follows:
${execpi 300 ~/.conky/GoogleCalendar/gcalw.sh}
Maybe there is a better way to achieve what I wanted?
Last edited by oneleaf (2016-04-16 05:08:27)
Offline
I was looking at the README file on github and I see these:
--[no]color: Enable/Disable all color output
(default: 'true')
--color_border: Color of line borders
(default: 'white')
--color_date: Color for the date
(default: 'yellow')
--color_freebusy: Color for free/busy calendars
(default: 'default')
--color_now_marker: Color for the now marker
(default: 'brightred')
--color_owner: Color for owned calendars
(default: 'cyan')
--color_reader: Color for read-only calendars
(default: 'magenta')
--color_writer: Color for writable calendars
(default: 'green')
So maybe this will work:
gcalcli --nolineart --conky calw 2 --color --color_freebusy orange
OFF TOPIC: I use "remind" (from the repos), it's really powerful and 'conky friendly' as well.
Description: sophisticated calendar and alarm program
Remind allows you to remind yourself of upcoming events and
appointments. Each reminder or alarm can consist of a message sent
to standard output, or a program to be executed.
.
It also features: sophisticated date calculation, moon phases,
sunrise/sunset, Hebrew calendar, alarms, PostScript output, tcl/tk
front-end and proper handling of holidays.
.
Reminders can be created by the remind scripting language or by using
the graphical frontend package "tkremind".
Notice the conky colour codes in there - I don't normally use it in the terminal, I use it as a "list" in conky that sits on my Desktop #2:
With a little TV guide at the bottom that shows today and tomorrow
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Thanks for the recommendation of remind. I will check it out!
As for the gcalcli syntax, that method works only among the limited basic colors... Like I could use --color_reader=white to change from magenta to white, but it would throw an error with any more advanced color or hex code.
Offline
OH! That's not good you're missing out on a lot of good colours.
I'm retired and don't need a heavy work agenda and didn't when I was working, but I am notorious for forgetting things; like birthdays, anniversaries, doctor appointments.
If you check it out join the mailing list, I get so many emails from them I once thought they forgot me, then after about 6 months of nothing, I get four or five and then silence again. Point being: They don't spam you.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
OH I should add this for you ... in conky:
${font Monofur:bold:size=12}${color6}${time %a %d %b}${color}${font}
${execpi 86400 remind -q -r ~/.reminders | sed -e "/.*(today):/d" -e '/^$/d'}
to get today only:
and for this and next month (the -s2) :
${font Monofur:bold:size=12}${color6}${time %b %Y} & ${execi 86400 date --date="+1 month" +"%b %Y"}${color}${font}
${execpi 86400 remind -s2 -r ~/.reminders | cut -c6-10,19-}
as seen in the image above.
Roll the dice - always a winner: Linux.die.net. Remind manpage
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline