Originally Posted by
Petro Dawg
Also @Jedcurtis, could you post your code for your calendar? I like that setup.
Sure here you go. It involves 3 files and some manual configuration on your part. In the timeconkyrc file you'll obviously need to change the paths to wherever you put your conkycal.sh script, as well as your day-night.template file. You'll also need to find your specific weather location code from either weather.com or intellicast.com. Sorry I can't remember which one I got mine from. Sector11 may be of help there as well as with other questions regarding this particular Conky. He has put a lot of time into it just for my benefit, so he knows a lot more about it than me!!! It also requires that conkyForecast be installed. Here's the 3 files you'll need;
The conkyrc file which I called timeconkyrc
Code:
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
# This has been around a while and I'm not sure who to credit. This one has
# edits made by Jed and Sector11
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
own_window_colour 000000
own_window_class Conky
own_window_title jedi-time.conky
# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes
### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type normal
# own_window_argb_visual yes
### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
# own_window_argb_value 0
minimum_size 1220 0 ## width, height
#maximum_width 1900 ## width, usually a good idea to equal minimum width
gap_x 180 # left-right
gap_y 30 # up-down
alignment top_left #bottom_left
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Santana:size=12
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0.8
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
draw_shades yes
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
default_color FFDEAD #255 222 173 NavajoWhite DCDCDC #220 220 220 Gainsboro
color0 8FBC8F #143 188 143 DarkSeaGreen
color1 778899 #119 136 153 LightSlateGray
color2 FF8C00 #255 140 0 DarkOrange
color3 62C2C2 #098 194 194 S11 Light Green #7FFF00 #127 255 0 Chartreuse
color4 FFA07A #255 160 122 LightSalmon
color5 FFDEAD #255 222 173 NavajoWhite
color6 00BFFF # 0 191 255 DeepSkyBlue
color7 00FFFF # 0 255 255 Cyan
color8 FFFF00 #255 255 0 Yellow
color9 B22222 #178 34 34 FireBrick
##################################################### End Color Settings ###
### Borders Section ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
#default_graph_size 15 40
##################################################### End Borders Secton ###
### Miscellaneous Section ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes
# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none
# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 1024
# Subtract (file system) buffers from used memory?
no_buffers yes
# change GiB to G and MiB to M
short_units yes
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
# Maximum size of user text buffer, i.e. layout below TEXT line in config file
# (default is 16384 bytes)
# max_user_text 16384
# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit
############################################## End Miscellaneous Section ###
update_interval 1
#This requires that conkyForecast be installed. Search the forums, they are your friend
TEXT
${font monofur:size=20}${execpi 60 /yourpathtoconkycal.sh/conkycal.sh|sed 's/^/\${goto 20}/'}${font}
${goto 60}${font CaviarDreams:size=20}${color 949494}${tztime US/Eastern %l:%M %P}${font}
${goto 60}${font CaviarDreams:size=20}${color 3881C7}${tztime US/Eastern %A %B %d %Y}${font}
#You'll have to look up your own location from weather.com or intellicast.com
${execpi 1800 conkyForecast --location=USME0330 --imperial --template=/yourpathtotheday-night.template/day-night.template}
conkycal.sh
Code:
#!/bin/bash
#cd ${0%/*}
# horizontal and vertical calendar for conky by ans
# Updated by: mobilediesel, dk75, Bruce, Crinos512, et al.
# This update by dk75 - 15 Feb 2011
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
# locale depend week day names
# The 'lang' file must be in the same directory as this script.
# Horizontal and English are the defaults:
# conkycal.sh
# Make it vertical:
# conkycal.sh -v
# Change the language to Spanish:
# conkycal.sh -l es
# Or both at once:
# conkycal.sh -v -l es
# The order of the arguments doesn't matter:
# conkycal.sh -l es -v
# Test other year and/or month, eg. February 2000
# conkycal.sh -d "2000 2"
# Need to use a goto:
# conkycal.sh -l es|sed 's/^/\${goto 240}/'
# or a goto and a tab:
# conkycal.sh |sed -e 's/^/\${goto 240}/' -e 's/$/\${tab 20}/'
DOW=("Mo" "Tu" "We" "Th" "Fr" "Sa" "Su")
while getopts ":vl:d:" opts; do
case "$opts" in
l) lang=$OPTARG;;
v) orientation="$opts";;
d) DATE=$OPTARG;;
esac
done
if [ -f conkycal.lang ]; then
. conkycal.lang
fi
COLOROLD="445566" #MidSlateGrey
COLORTODAY="00BFFF" #DeepSkyBlue
COLORREST="445566" #MidSlateGrey
COLORNEXT="778899" #LightSlateGrey
COLORSATURDAY="00BFFF" #DeepSkyBlue
COLORSUNDAY="00BFFF" #DeepSkyBlue
COLOR=("" "" "" "" "" "\${color $COLORSATURDAY}" "\${color $COLORSUNDAY}")
COLOREND="\${color}"
DAYS=( $(echo "" |gawk -v dateS="$DATE" 'END{
if (dateS) {
print strftime("%-u",mktime(dateS" 1 0 0 0")),strftime("%-d",mktime(dateS" 1 0 0 0")),strftime("%-d",mktime(strftime("%Y %m 0 0 0 0",mktime(dateS" 32 0 0 0"))))
}
else {
print strftime("%-u",mktime(strftime("%Y %m 1 0 0 0"))),strftime("%-d"),strftime("%-d",mktime(strftime("%Y %m 0 0 0 0",mktime(strftime("%Y %m 32 0 0 0")))))
}
}') )
k=${DAYS[0]}
for ((j=1; j<=${DAYS[2]}; j++)); do
days[$j]="${COLOR[k-1]}${DOW[k-1]}"
k=$((${k/#7/0}+1))
done
for ((j=$((${DAYS[2]}+1)); j<=31; j++)); do
days[$j]="${DOW[k-1]}"
k=$((${k/#7/0}+1))
done
# horizontal function
h () {
for ((i=1; i<=${DAYS[2]}; i++)); do
echo -n "${days[$i]/${DOW[6]}/${DOW[6]}$COLOREND} "
done
echo -n "\${color $COLORREST}"
for ((i=$((${DAYS[2]}+1)); i<=31; i++)); do
echo -n "${days[$i]} "
done
echo $'\n'"\${color $COLOROLD}$(a=; for ((x=1; x<=$[${DAYS[1]}-1]; x++));do printf "%02d " $x; done)\${color $COLORTODAY}$(printf "%02d" ${DAYS[1]})\${color $COLORREST} $(a=; for ((x=$[${DAYS[1]}+1];x<=${DAYS[2]};x++)); do printf "%02d " $x; done)\${color $COLORNEXT}$(a=; for ((x=1; x<=$((31-${DAYS[2]})); x++)); do printf "%02d " $x; done)" |sed -e 's/ *$//'
}
#vertical function
v () {
for ((i=1; i<=$((${DAYS[1]}-1)); i++)); do
TODAYC[$i]="\${color $COLOROLD}"
done
TODAYC[${DAYS[1]}]="\${color $COLORTODAY}"
for ((i=$((${DAYS[1]}+1)); i<=${DAYS[2]}; i++)); do
TODAYC[$i]="\${color $COLORREST}"
done
for ((j=1; j<=${DAYS[2]}; j++)); do
echo "${days[$j]} ${TODAYC[$j]}$(printf "%02d" $j)\${color}"
done
for ((j=1; j<=$((31-${DAYS[2]})); j++)); do
echo "\${color $COLORNEXT}${days[$j]} $(printf "%02d" $j)\${color}"
done
}
# call function based on "$orientation" - default is horizontal
${orientation:-h}
day-night.template
Code:
${if_match "${execi 1 conkyForecast-SunsetSunriseCountdown --location=USME0330 -t}"=="Sunrise"}${image [--datatype=WI] -p 380,60 -s 100x100}${else}${image [--datatype=WI --night] -p 380,60 -s 100x100}${endif}${image [--datatype=MI] -p 525,62 -s 100x100}
${font monofur:size=14}${color 3881C7}Sunrise: ${color 949494}[--location=USME0330 --datatype=SR] ${color 3881C7}Sunset: ${color 949494}[--location=USME0330 --datatype=SS]${font}
${color 3881C7}${font monofur:size=14}${execi 1 conkyForecast-SunsetSunriseCountdown --location=USME0330 -t} in: ${color 949494}${execi 1 conkyForecast-SunsetSunriseCountdown --location=USME0330 -L}${goto 650}${color 949494}[--datatype=MP]${color}${font}
You shouldn't have to make any changes to the conkycal.sh script, however, the day-night.template file will need you city's location code as mentioned above. Good luck!!!
Bookmarks