# To use #! in a conky use: ${exec echo '#!'}
# ${font DS\-Digital:bold:size=24}
# OS: ${pre_exec lsb_release -d | cut -c14-50}
# killall conky && conky -c /media/5/Conky/Chronograph_mrpeachy.conky &
# Thank you - mrpeachy
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_colour gray
own_window_class Conky
own_window_title Chronograph mrpeachy
# 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 no # Options: yes or no
### 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 340 700 ##420 420 ## width, height
maximum_width 340 ##420 ## width
gap_x 10 ### left &right
gap_y 10 ### up & down
alignment tl #ml
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Monofur:bold:size=9
#xftfont CorporateMonoExtraBold:size=9
#xftfont White Rabbit:size=9
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
draw_shades no
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
default_color DCDCDC #220 220 220 Gainsboro ## CCAA7A # chronograph-mrpeachy
color0 8FBC8F #143 188 143 DarkSeaGreen
color1 778899 #119 136 153 LightSlateGray
color2 FF8C00 #255 140 0 DarkOrange
color3 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 yes #no
#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 256
# 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 ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.3}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#--------------------------------
lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.5
#lua_draw_hook_post draw_bg 20 0 0 0 0 0x000000 0.5
#
# TEXT
# ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.3}
##
#
################### chronograph-mrpeachy #######################################
#lua_load /media/5/Conky/LUA/chronograph-mrpeachy.lua
lua_load /media/5/Conky/LUA/chronograph-mrpeachy_24.lua
lua_draw_hook_post main
#lua_draw_hook_pre main
### v9000 Weather ############################################################
lua_load ~/v9000/v9000.lua
lua_draw_hook_pre weather
#lua_draw_hook_post weather
lua_load /media/5/Conky/LUA/crono_mrp.template.lua
############################################################ v9000 Weather ###
### mount.lua ################################################################
lua_load /media/5/Conky/LUA/mounted.lua
### mount.lua ### INSTRUCTIONS ##############################################
#load script
#lua_load ~/path_to/mounted.lua
# first lua command below text:
# ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
# to get output:
# ${lua mount partition_number data_type}, where partition number is a number
# data_type can be
# total - shows total number of partitions mounted, requires a partition_number
# - - also, use 1, could be used in an if_match
# fsys - shows filesystem
# size - shows space used in appropriate units
# free - shows free space in appropriate units
# use% - shows % used
# mount - shows mountpoint
# ${color6}${lua mount 7 fsys 9}${goto 100}${color8}${lua mount 7 size}${goto 150}${color7}${lua mount 7 free}${goto 200}${color1}${lua mount 7 use%}${goto 260}${color}${lua mount 7 mount}
# ${color6}${lua mount 8 fsys 9}${goto 100}${color8}${lua mount 8 size}${goto 150}${color7}${lua mount 8 free}${goto 200}${color1}${lua mount 8 use%}${goto 260}${color}${lua mount 8 mount}
################################################################ mount.lua ###
####################################################### End LUA Settings ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1
# ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.5}
TEXT
${lua get_mounted_data 3}${lua conky_draw_bg 20 0 0 0 0 0x000000 0.5}
${color1}${cpubar cpu4 1,340}${color}
${color3}Hosted by: ${color}${nodename}${goto 160}${color3}for the past: ${color}${uptime_short}
${alignc}${color3}Kernel: ${color}${kernel}
${alignc}${color3}CPU Usage ${color7}1: ${color}${if_match ${cpu cpu1} < 10} ${cpu cpu1}\
${else}${if_match ${cpu cpu1} < 100} ${cpu cpu1}\
${else}${cpu cpu1}\
${endif}${endif} %\
${color7}2: ${color}${if_match ${cpu cpu2} < 10} ${cpu cpu2}\
${else}${if_match ${cpu cpu2} < 100} ${cpu cpu2}\
${else}${cpu cpu2}\
${endif}${endif} %\
${color7}3: ${color}${if_match ${cpu cpu3} < 10} ${cpu cpu3}\
${else}${if_match ${cpu cpu3} < 100} ${cpu cpu3}\
${else}${cpu cpu3}\
${endif}${endif} %\
${color7}Avg: ${color}${if_match ${cpu cpu0} < 10} ${cpu cpu0}\
${else}${if_match ${cpu cpu0} < 100} ${cpu cpu0}\
${else}${cpu cpu0}\
${endif}${
~/.conkyrc
and that will be the conky that conky
runs. This is the case with VSIDO, the default conky is ~/.conkyrc#!/bin/sh
# click to start, click to stop
if pidof conky | grep [0-9] > /dev/null
then
exec killall conky
else
sleep 30 # sleep not required for xfce on startup - 30 or more for others
conky -c ~/Conky/conky1 &
conky -c ~/Conky/conky2 &
conky -c ~/Conky/conky3 &
conky -c ~/Conky/conky4 &
exit
fi
(sleep 30s && conky -c /Conky/conky1) &
(sleep 30s && conky -c /Conky/conky2) &
(sleep 30s && conky -c /Conky/conky3) &
(sleep 30s && conky -c /Conky/conky4) &
## Start conkys
(sleep 2s && /media/5/Conky/OBMenuS/ssc.sh) &
exit
clock_rclick_command = /media/5/Conky/OBMenuS/ssc.sh ## start/stop all my conkys
Label: ssc - SSC - Srart|Stop Conky or Bob's your Uncle (anything you want)
Execute: /media/5/Conky/OBMenuS/ssc.sh
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_hints undecorated,below,skip_taskbar,skip_pager
sudo apt-get install wmctrl
QuoteWmctrl is a command line tool to interact with an
EWMH/NetWM compatible X Window Manager (examples include
Enlightenment, icewm, kwin, metacity, and sawfish).
Wmctrl provides command line access to almost all the features
defined in the EWMH specification. For example it can maximize
windows, make them sticky, set them to be always on top. It can
switch and resize desktops and perform many other useful
operations.
sleep 10 ....
sleep 2 ...
#!/bin/bash
# click to start, click to stop
if pidof conky | grep [0-9] > /dev/null
then
exec killall conky
else
#conky -c /media/5/conky/test274.johnraff.conky &
#conky -c /media/5/conky/test275.johnraff.conky &
#conky -c /media/5/Conky/S11_v9_R.conky &
#conky -c /media/5/conky/test287.memory.conky &
# on desktop 4 only
(sleep 1s && wmctrl -s 3 && conky -c /media/5/conky/Didier-T/conkyrc_meteo_graph_baro) &
(sleep 1s && wmctrl -s 3 && conky -c /media/5/conky/Didier-T/conkyrc_meteo_lua) &
# on desktop 3 only
(sleep 10s && wmctrl -s 2 && conky -c /media/5/Conky/TeoWeatherClock/Teo_Clock_2.conky) &
(sleep 10s && wmctrl -s 2 && conky -c /media/5/Conky/jed_greyclock_conkyrc) &
#(sleep 10s && wmctrl -s 2 && conky -c /media/5/Conky/Chronograph_mrpeachy.conky) &
#(sleep 10s && wmctrl -s 2 && conky -c /media/5/conky/Didier-T/conkyrc_meteo_graph_baro) &
#(sleep 10s && wmctrl -s 2 && conky -c /media/5/conky/Didier-T/conkyrc_meteo_lua) &
# on desktop 2 only (change to 5s if using desktop 3)
(sleep 18s && wmctrl -s 1 && conky -c /media/5/Conky/S11_Dates.conky) &
(sleep 18s && wmctrl -s 1 && conky -c /media/5/Conky/S11_VNS.conky) &
(sleep 18s && wmctrl -s 1 && conky -c /media/5/Conky/S11_Rem_Cal.conky) &
(sleep 18s && wmctrl -s 1 && conky -c /media/5/Conky/S11_Disk_Activity.conky) &
#(sleep 18s && wmctrl -s 1 && conky -c /media/5/Conky/S11_v9_SM.conky) &
#(sleep 18s && wmctrl -s 1 && conky -c /media/5/Conky/S11_mrp_FSYS.conky) &
(sleep 18s && wmctrl -s 1 && conky -c /media/5/Conky/S11_v9_H.conky) &
(sleep 18s && wmctrl -s 1 && conky -c /media/5/Conky/S11_v9_R.conky) &
# on desktop 1 only (change to 10s if using desktop 3)
(sleep 25s && wmctrl -s 0 && conky -c /media/5/Conky/VO_Radiotray.conky) &
(sleep 25s && wmctrl -s 0 && conky -c /media/5/Conky/Chronograph_mrpeachy.conky) &
#(sleep 25s && wmctrl -s 0 && conky -c /media/5/Conky/TeoWeatherClock/Teo_Clock_2.conky) &
#(sleep 25s && wmctrl -s 0 && conky -c /media/5/Conky/S11_Chronograph.conky) &
#(sleep 25s && wmctrl -s 0 && conky -c /media/5/Conky/S11_coin.conky) &
# on all desktops
(sleep 15s && wmctrl -s 0 && conky -c /media/5/Conky/S11_email.conky) &
exit
fi
#!/bin/bash
# ----------
# Light backgrounds
(sleep 1s && killall tint2 && tint2) &
(sleep 1s && killall conky && conky) &
exit 0
#!/bin/bash
# ----------
# dark backgrounds
(sleep 1s && killall tint2 && tint2 -c ~/.config/tint2/t2launchrc) &
(sleep 1s && killall tint2 && tint2 -c ~/.config/tint2/tint2rc_bot) &
(sleep 1s && killall conky && conky -c ~/.conkyrc.vsido) &
exit 0
label: Dark
Execute ~/bin/dark
label: Light
Execute ~/bin/light
-- horizontal calc added to each days "X" values
dataxp=85 -- ???+(dataxp*1)
-- horizontal calc added to each days "X" values
dataxp=75 -- ???+(dataxp*1)
# killall conky && conky -c /media/5/conky/conkybarre_v9000 &
# by ragamatrix - Jan 2013
# -- Paramètres Conky Météo -- #
# Text alignment, other possible values are commented
alignment tl
#alignment top_right
#alignment bottom_left
#alignment bottom_right
# -- Conky settings -- #
background yes
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
double_buffer yes
no_buffers yes
text_buffer_size 265 #2048
imlib_cache_size 0
# -- Window specifications -- #
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,sticky,skip_taskbar,skip_pager,below
show_graph_range no
show_graph_scale no
short_units yes
own_window_class Conky
border_inner_margin 0
border_outer_margin 0
# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
# -- Colours -- #
default_color 00BFFF # 0 191 255 DeepSkyBlue
color0 FFDEAD #255 222 173 NavajoWhite
color1 7FFF00 #127 255 0 Chartreuse
color2 778899 #119 136 153 LightSlateGray
color3 FF8C00 #255 140 0 DarkOrange
color4 B0E0E6 #Powder Blue #F0FFFF #240 255 255 Azure
color5 FFDEAD #255 222 173 NavajoWhite
color6 7B68EE #123 104 238 MediumSlateBlue
color7 00FFFF # 0 255 255 Cyan
color8 FFFF00 #255 255 0 Yellow
color9 FF0000 #255 0 0 Red
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 5 # left-right
gap_y 5 # up-down
# Minimum size of text area
minimum_size 1900 86 #Taille minimum (px) ; largeur / hauteur
maximum_width 1900 #Largeur maximum (px)
#out_to_console no
# Force UTF8? note that UTF8 support required XFT
#override_utf8_locale yes
# Stippled borders?
#stippled_borders 0
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
#total_run_times 0
# set to yes if you want all text to be in uppercase
uppercase no
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer right #left right none
# -- Text settings -- #
# Use Xft?
use_xft yes
xftalpha 1.0
#xftfont DejaVu:style=Bold:size=6
xftfont Monofur:bold:size=12
# -- Lua load -- #
lua_load ~/v9000/v9000.lua
lua_draw_hook_pre weather
lua_load /media/5/conky/LUA/template_meteo_barre.lua
lua_load /media/5/Conky/LUA/draw-bg.lua
##############################################
TEXT
${lua conky_draw_bg 15 0 0 480 87 0x000000 0.5}\
${lua conky_draw_bg 15 482 0 75 87 0x000000 0.5}\
${lua conky_draw_bg 15 567 0 75 87 0x000000 0.5}\
${lua conky_draw_bg 15 652 0 75 87 0x000000 0.5}\
${lua conky_draw_bg 15 737 0 75 87 0x000000 0.5}\
${lua conky_draw_bg 15 822 0 75 87 0x000000 0.5}\
${lua conky_draw_bg 15 907 0 75 87 0x000000 0.5}\
${lua conky_draw_bg 15 992 0 75 87 0x000000 0.5}\
${lua conky_draw_bg 15 1076 0 75 87 0x000000 0.5}\
${lua conky_draw_bg 15 1160 0 75 87 0x000000 0.5}\
${lua conky_draw_bg 30 105 5 60 60 0xffffff 0.2}
--[[
The latest script is a lua only weather script. aka: v9000
http://crunchbang.org/forums/viewtopic.php?id=16100
the file:
http://dl.dropbox.com/u/19008369/weatheragain9000.lua.tar.gz
mrppeachys LUA Tutorial
http://crunchbang.org/forums/viewtopic.php?id=17246
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="Monofur"--font must be in quotes
default_font_size=12
default_color=0xB0E0E6 --Powder Blue
default_alpha=1 --fully opaque
default_image_width=40
default_image_height=40
-- ## New Options ###
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
-- ======================================================================
-- SUN & MOON RISE ------------------------------------------------------
out({fs=15,x=10,y=14,txt="Sun"})
out({fs=15,x=50,y=14,txt="|"})
out({fs=15,x=60,y=14,txt="Moon"})
out({c=0xF0FFFF,x=10,y=30,txt="Rise "})
out({c=0xF0FFFF,fs=15,x=50,y=30,txt="|"})
out({c=0xFFFF00,x=10,y=45,txt=sun_rise_24[1]})
out({c=0xF0FFFF,x=60,y=30,txt="Rise"})
out({c=0xFFFF00,fs=15,x=50,y=45,txt="|"})
out({c=0xFFFF00,x=60,y=45,txt=moon_rise_24[1]})
-- SUN & MOON SET -------------------------------------------------------
out({c=0xF0FFFF,x=10,y=65,txt="Set"})
out({c=0xF0FFFF,fs=15,x=50,y=65,txt="|"})
out({x=10,y=80,txt=sun_set_24[1]})
out({c=0xF0FFFF,x=60,y=65,txt="Set"})
out({fs=15,x=50,y=80,txt="|"})
out({x=60,y=80,txt=moon_set_24[1]})
-- ======================================================================
-- MOON PHASE - CENTRE --------------------------------------------------
image({x=105,y=05,w=60,h=60,file=moon_icon[1]})
-- image({x=105,y=05,w=60,h=60,file="/media/5/Conky/images/red+x.png"})
--out({c=0xF0FFFF.0,x=190,y=235,txt=moon_phase[1]})
-- ======================================================================
-- CURRENT FOR TODAY - SEE TOP LEFT -------------------------------------
image({x=170,y=05,w=60,h=60,file=now["weather_icon"]})
-- image({x=170,y=05,w=60,h=60,file="/media/5/Conky/images/red+x.png"})
out({x=170,y=70,txt="T"})
out({c=0xFF8C00,x=180,y=70,txt=now["temp"]})
out({x=205,y=70,txt="±"})
out({c=0xF0FFFF,x=215,y=70,txt=now["feels_like"]})
-- ======================================================================
-- FORECAST FOR TODAY ---------------------------------------------------
out({fs=15,x=240,y=14,txt="Forecast"})
image({x=300,y=20,w=50,h=50,file=weather_icon[1]})
-- image({x=300,y=20,w=50,h=50,file="/media/5/Conky/images/red+x.png"})
-- out({c=0xF0FFFF,x=300,y=23,txt="↑ "})
out({c=0xFF8C00,fs=14,x=300,y=23,txt=high_temp[1]})
-- out({c=0xF0FFFF,x=330,y=23,txt="↓ "})
out({c=0x00BFFF,fs=14,x=330,y=23,txt=low_temp[1]})
-- Humidity -------------------------------------------------------------
out({c=0xF0FFFF,x=240,y=30,txt="Hum"})
out({x=270,y=30,txt=now["humidity"].."%"})
-- Dew Point ------------------------------------------------------------
out({c=0xF0FFFF,x=240,y=42,txt="DP"})
out({x=270,y=42,txt=now["dew_point"].."°"})
-- Chance of Rain -------------------------------------------------------
out({c=0xF0FFFF,x=240,y=54,txt="CR?"})
out({x=270,y=54,txt=precipitation[1].."%"})
-- Cloud Cover
out({c=0xF0FFFF,x=240,y=66,txt="CC"})
out({x=270,y=66,txt=cloud_cover[1].."%"})
-- Ceiling
-- out({c=0xF0FFFF,x=240,y=65,txt="Ceil"})
-- out({x=270,y=65,txt=now["ceiling"]})
-- BOTTOM
-- UV -------------------------------------------------------------------
out({c=0xF0FFFF,x=100,y=82,txt="UVI"})
out({x=130,y=82,txt=uv_index_num[1]})
out({x=155,y=82,txt=uv_index_txt[1]})
-- Barometric Pressure --------------------------------------------------
out({c=0xF0FFFF,x=220,y=82,txt="BarP"})
out({x=260,y=82,txt=now["pressure_mb"].." mb"})
-- ======================================================================
-- FORECAST FOR NEXT 3 HOURS --------------------------------------------
-- 1st hour
image({w=30,h=30,x=360,y=10,file=now["fc_hour1_wicon"]})
-- image({w=30,h=30,x=360,y=10,file="/media/5/Conky/images/red+x.png"})
out({x=360,y=12,txt=now["fc_hour1_time_24"]..":00"})
out({c=0xF0FFFF,x=365,y=45,txt=now["fc_hour1_temp"]})
-- 2nd hour
image({w=30,h=30,x=400,y=10,file=now["fc_hour2_wicon"]})
-- image({w=30,h=30,x=400,y=10,file="/media/5/Conky/images/red+x.png"})
out({x=400,y=12,txt=now["fc_hour2_time_24"]..":00"})
out({c=0xF0FFFF,x=405,y=45,txt=now["fc_hour3_temp"]})
-- 3rd hour
image({w=30,h=30,x=440,y=10,file=now["fc_hour3_wicon"]})
-- image({w=30,h=30,x=440,y=10,file="/media/5/Conky/images/red+x.png"})
out({x=440,y=12,txt=now["fc_hour3_time_24"]..":00"})
out({c=0xF0FFFF,x=445,y=45,txt=now["fc_hour3_temp"]})
-- ======================================================================
-- WIND INFORMATION for today--------------------------------------------
image({w=30,h=30,x=360,y=50,file=now["wind_icon"]})
-- image({w=30,h=30,x=360,y=50,file="/media/5/Conky/images/red+x.png"})
out({fs=14,x=400,y=61,txt=now["wind_deg"]})
out({fs=14,x=442,y=62,txt=now["wind_nesw"]})
-- out({x=333,y=265,txt="@"})
out({fs=14,x=400,y=76,txt=now["wind_km"]})
---------------------------------------------- END FORECAST FOR TODAY ---
-- ======================================================================
-- forecast calculations
-- horizontal text calcs
dataxm=497
dataxn=527
dataxd=510
dataxt=535
dataxrs=503
-- vertical text calcs
dataymd=13
datayn=25
datayh=35
datayl=60
datayr=73
datays=83
-- image calcs
imx=490
imy=25
-- horizontal calc added to each days "X" values
dataxp=85 -- ???+(dataxp*1)
-- FORECAST for the next 9 days
-- Forecast day 2 -- x = l|r y = u|d
out({x=dataxm,y=dataymd,txt=forecast_month_short[2]})
out({x=dataxn,y=dataymd,txt=forecast_date[2]})
out({x=dataxd,y=datayn,txt=forecast_day_short[2]})
image({x=imx,y=imy,file=weather_icon[2]})
-- image({x=imx,y=imy,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,x=dataxt,y=datayh,txt=high_temp[2]})
out({c=0x00BFFF,x=dataxt,y=datayl,txt=low_temp[2]})
out({c=0xFFFF00,x=dataxrs,y=datayr,txt=sun_rise_24[2]})
out({x=dataxrs,y=datays,txt=sun_set_24[2]})
-- Forecast day 3 -- x = l|r y = u|d
out({x=dataxm+(dataxp*1),y=dataymd,txt=forecast_month_short[3]})
out({x=dataxn+(dataxp*1),y=dataymd,txt=forecast_date[3]})
out({x=dataxd+(dataxp+1),y=datayn,txt=forecast_day_short[3]})
image({x=imx+(dataxp*1),y=imy,file=weather_icon[3]})
-- image({x=imx+(dataxp*1),y=imy,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,x=dataxt+(dataxp*1),y=datayh,txt=high_temp[3]})
out({c=0x00BFFF,x=dataxt+(dataxp*1),y=datayl,txt=low_temp[3]})
out({c=0xFFFF00,x=dataxrs+(dataxp*1),y=datayr,txt=sun_rise_24[3]})
out({x=dataxrs+(dataxp*1),y=datays,txt=sun_set_24[3]})
-- Forecast day 4 -- x = l|r y = u|d
out({x=dataxm+(dataxp*2),y=dataymd,txt=forecast_month_short[4]})
out({x=dataxn+(dataxp*2),y=dataymd,txt=forecast_date[4]})
out({x=dataxd+(dataxp*2),y=datayn,txt=forecast_day_short[4]})
image({x=imx+(dataxp*2),y=imy,file=weather_icon[4]})
-- image({x=imx+(dataxp*2),y=imy,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,x=dataxt+(dataxp*2),y=datayh,txt=high_temp[4]})
out({c=0x00BFFF,x=dataxt+(dataxp*2),y=datayl,txt=low_temp[4]})
out({c=0xFFFF00,x=dataxrs+(dataxp*2),y=datayr,txt=sun_rise_24[4]})
out({x=dataxrs+(dataxp*2),y=datays,txt=sun_set_24[4]})
-- Forecast day 5 -- x = l|r y = u|d
out({x=dataxm+(dataxp*3),y=dataymd,txt=forecast_month_short[5]})
out({x=dataxn+(dataxp*3),y=dataymd,txt=forecast_date[5]})
out({x=dataxd+(dataxp*3),y=datayn,txt=forecast_day_short[5]})
image({x=imx+(dataxp*3),y=imy,file=weather_icon[5]})
-- image({x=imx+(dataxp*3),y=imy,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,x=dataxt+(dataxp*3),y=datayh,txt=high_temp[5]})
out({c=0x00BFFF,x=dataxt+(dataxp*3),y=datayl,txt=low_temp[5]})
out({c=0xFFFF00,x=dataxrs+(dataxp*3),y=datayr,txt=sun_rise_24[5]})
out({x=dataxrs+(dataxp*3),y=datays,txt=sun_set_24[5]})
-- Forecast day 6 -- x = l|r y = u|d
out({x=dataxm+(dataxp*4),y=dataymd,txt=forecast_month_short[6]})
out({x=dataxn+(dataxp*4),y=dataymd,txt=forecast_date[6]})
out({x=dataxd+(dataxp*4),y=datayn,txt=forecast_day_short[6]})
image({x=imx+(dataxp*4),y=imy,file=weather_icon[6]})
-- image({x=imx+(dataxp*4),y=imy,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,x=dataxt+(dataxp*4),y=datayh,txt=high_temp[6]})
out({c=0x00BFFF,x=dataxt+(dataxp*4),y=datayl,txt=low_temp[6]})
out({c=0xFFFF00,x=dataxrs+(dataxp*4),y=datayr,txt=sun_rise_24[6]})
out({x=dataxrs+(dataxp*4),y=datays,txt=sun_set_24[6]})
-- Forecast day 7 -- x = l|r y = u|d
out({x=dataxm+(dataxp*5),y=dataymd,txt=forecast_month_short[7]})
out({x=dataxn+(dataxp*5),y=dataymd,txt=forecast_date[7]})
out({x=dataxd+(dataxp*5),y=datayn,txt=forecast_day_short[7]})
image({x=imx+(dataxp*5),y=imy,file=weather_icon[7]})
-- image({x=imx+(dataxp*5),y=imy,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,x=dataxt+(dataxp*5),y=datayh,txt=high_temp[7]})
out({c=0x00BFFF,x=dataxt+(dataxp*5),y=datayl,txt=low_temp[7]})
out({c=0xFFFF00,x=dataxrs+(dataxp*5),y=datayr,txt=sun_rise_24[7]})
out({x=dataxrs+(dataxp*5),y=datays,txt=sun_set_24[7]})
-- Forecast day 8 -- x = l|r y = u|d
out({x=dataxm+(dataxp*6),y=dataymd,txt=forecast_month_short[8]})
out({x=dataxn+(dataxp*6),y=dataymd,txt=forecast_date[8]})
out({x=dataxd+(dataxp*6),y=datayn,txt=forecast_day_short[8]})
image({x=imx+(dataxp*6),y=imy,file=weather_icon[8]})
-- image({x=imx+(dataxp*6),y=imy,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,x=dataxt+(dataxp*6),y=datayh,txt=high_temp[8]})
out({c=0x00BFFF,x=dataxt+(dataxp*6),y=datayl,txt=low_temp[8]})
out({c=0xFFFF00,x=dataxrs+(dataxp*6),y=datayr,txt=sun_rise_24[8]})
out({x=dataxrs+(dataxp*6),y=datays,txt=sun_set_24[8]})
-- Forecast day 9 -- x = l|r y = u|d
out({x=dataxm+(dataxp*7),y=dataymd,txt=forecast_month_short[9]})
out({x=dataxn+(dataxp*7),y=dataymd,txt=forecast_date[9]})
out({x=dataxd+(dataxp*7),y=datayn,txt=forecast_day_short[9]})
image({x=imx+(dataxp*7),y=imy,file=weather_icon[9]})
-- image({x=imx+(dataxp*7),y=imy,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,x=dataxt+(dataxp*7),y=datayh,txt=high_temp[9]})
out({c=0x00BFFF,x=dataxt+(dataxp*7),y=datayl,txt=low_temp[9]})
out({c=0xFFFF00,x=dataxrs+(dataxp*7),y=datayr,txt=sun_rise_24[9]})
out({x=dataxrs+(dataxp*7),y=datays,txt=sun_set_24[9]})
-- Forecast day 10 -- x = l|r y = u|d
out({x=dataxm+(dataxp*8),y=dataymd,txt=forecast_month_short[10]})
out({x=dataxn+(dataxp*8),y=dataymd,txt=forecast_date[10]})
out({x=dataxd+(dataxp*8),y=datayn,txt=forecast_day_short[10]})
image({x=imx+(dataxp*8),y=imy,file=weather_icon[10]})
-- image({x=imx+(dataxp*8),y=imy,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,x=dataxt+(dataxp*8),y=datayh,txt=high_temp[10]})
out({c=0x00BFFF,x=dataxt+(dataxp*8),y=datayl,txt=low_temp[10]})
out({c=0xFFFF00,x=dataxrs+(dataxp*8),y=datayr,txt=sun_rise_24[10]})
out({x=dataxrs+(dataxp*8),y=datays,txt=sun_set_24[10]})
--]]
--#######################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
# killall conky && conky -c /media/5/Conky/S11_VSIDO.conkyrc &
# Original by: VastOne on VSIDO
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
use_spacer right
# Use Xft?
use_xft yes
xftfont Monofur:bold:size=12
xftalpha 1.0
# text_buffer_size 256
# Update interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
own_window yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_transparent yes
# own_window_argb_visual yes
own_window_class Conky
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
# border width
border_width 0
# Default colors and also border colors
default_color 00BFFF # 0 191 255 DeepSkyBlue
color0 FFDEAD #255 222 173 NavajoWhite
color1 7FFF00 #127 255 0 Chartreuse
color2 778899 #119 136 153 LightSlateGray
color3 FF8C00 #255 140 0 DarkOrange
color4 F0FFFF #240 255 255 Azure
color5 FFDEAD #255 222 173 NavajoWhite
color6 7B68EE #123 104 238 MediumSlateBlue
color7 00FFFF # 0 255 255 Cyan
color8 FFFF00 #255 255 0 Yellow
color9 FF0000 #255 0 0 Red
#default_shade_color black
#default_outline_color grey
own_window_colour 000000
# Text alignment, other possible values are commented
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 10
minimum_size 1150 0 ## width, height
#maximum_width 1000 ## width
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off (no).
short_units yes
lua_load /media/5/Conky/LUA/draw-bg.lua
# lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.2
#
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.3}\
${image /media/5/Conky/images/debian4.png -p 0,0 -s 50x50}\
${execi 600 bash /media/5/Conky/accuweather_conky/accuw_script}\
${color}Kernel ${color4}${kernel}\
${color}MEM${color4}${if_match ${memperc}<10} ${memperc}\
${else}${if_match ${memperc}<100} ${memperc}\
${else}${memperc}${endif}${endif}%\
${color}(${mem})\
${color}CPU${color4}${if_match ${platform f71882fg.2560 temp 1}<100} ${platform f71882fg.2560 temp 1}\
${else}${platform f71882fg.2560 temp 1}${endif}°\
${color}MB${color4}${if_match ${platform f71882fg.2560 temp 2}<100} ${platform f71882fg.2560 temp 2}\
${else}${platform f71882fg.2560 temp 2}${endif}°\
${color}HD${color4}${if_match ${execi 5 hddtemp -n /dev/sda}<100} ${execi 5 hddtemp -n /dev/sda}\
${else}${execi 5 hddtemp -n /dev/sda}${endif}${color1}°\
${color}${goto 680}Now\
${goto 760}${execi 600 sed -n '1p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 840}${execi 600 sed -n '6p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 920}${execi 600 sed -n '11p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 1000}${execi 600 sed -n '16p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 1080}${execi 600 sed -n '1p' /media/5/Conky/accuweather_conky/last_days}
${color}NET${color4} Dn: ${color2}${downspeedgraph eth0 12,150 00ff00 ff0000 -t -l} ${color}Up: ${color2}${upspeedgraph eth0 12,150 ff0000 00ff00 -t -l} ${color}Uptime ${color1}${uptime_short}\
${color3}${goto 680}↑ ${execi 600 sed -n '4p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 760}↑ ${execi 600 sed -n '9p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 840}↑ ${execi 600 sed -n '14p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 920}↑ ${execi 600 sed -n '19p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 1000}↑ ${execi 600 sed -n '24p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 1080}↑ ${execi 600 sed -n '4p' /media/5/Conky/accuweather_conky/last_days}°
${color}CPU: 1${color4}${if_match ${cpu cpu1}<10} ${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100} ${cpu cpu1}\
${else}${cpu cpu0}${endif}${endif}%\
${color}2${color4}${if_match ${cpu cpu0}<10} ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%\
${color}3${color4}${if_match ${cpu cpu0}<10} ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%\
${color}4${color4}${if_match ${cpu cpu0}<10} ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%\
${color}Fan ${color4}${platform f71882fg.2560 fan 1} rpm\
${goto 680}↓ ${execi 600 sed -n '5p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 760}↓ ${execi 600 sed -n '10p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 840}↓ ${execi 600 sed -n '15p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 920}↓ ${execi 600 sed -n '20p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 1000}↓ ${execi 600 sed -n '25p' /media/5/Conky/accuweather_conky/tod_ton}°\
${goto 1080}↓ ${execi 600 sed -n '5p' /media/5/Conky/accuweather_conky/last_days}°\
${voffset -20}${goto 725}${font conkyweather:size=20}${color4}${execi 600 sed -n '2p' /media/5/Conky/accuweather_conky/curr_cond}\
${goto 805}${execi 600 sed -n '2p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 885}${execi 600 sed -n '12p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 965}${execi 600 sed -n '17p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 1045}${execi 600 sed -n '22p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 1125}${execi 600 sed -n '2p' /media/5/Conky/accuweather_conky/last_days}${font}
# killall conky && conky -c /media/5/Conky/accuweather_conky/conkyrc_acc_int &
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_colour gray
own_window_class Conky
own_window_title Chronograph Full 2
# 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 100 735 ## width, height
maximum_width 100 ## width
gap_x 10 ### left &right
gap_y 10 ### up & down
alignment tl #ml
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont CorporateMonoExtraBold:size=9
xftfont monofur:bold:size=12
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
draw_shades no
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
default_color DCDCDC #220 220 220 Gainsboro
color0 8FBC8F #143 188 143 DarkSeaGreen
color1 C2CCFF #119 136 153 LightSlateGray
color2 FF8C00 #255 140 0 DarkOrange
color3 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 yes #no
#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 256
# 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
# If enabled, values which are in bytes will be printed in human readable
# format (i.e., KiB, MiB, etc). If disabled, bytes is printed instead
format_human_readable yes
# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off.
short_units yes
# 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 ###
### LUA Settings ###########################################################
### draw-bg.lua - Above and After TEXT - requires a composite manager ########
# ----------------------------------------------------------------------------
lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.3}
# ============================================================================
## OR Both above TEXT - No composite manager required.
# ----------------------------------------------------------------------------
#lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 12 0 0 0 0 0x000000 0.5
# TEXT
####################################################### End LUA Settings ###
update_interval 1
TEXT
${lua conky_draw_bg 12 0 0 0 0 0x000000 0.3}\
Looking Out${execi 600 bash /media/5/Conky/accuweather_conky/accuw_script}
Now\
${goto 50}${font conkyweather:size=40}${execi 600 sed -n '2p' /media/5/Conky/accuweather_conky/curr_cond}${font}
${voffset -40} ${execi 600 sed -n '4p' /media/5/Conky/accuweather_conky/curr_cond}°
${execi 600 sed -n '1p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 50}${font conkyweather:size=40}${execi 600 sed -n '2p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}↑ ${execi 600 sed -n '4p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execi 600 sed -n '5p' /media/5/Conky/accuweather_conky/tod_ton}°
${stippled_hr 5 1}
${execi 600 sed -n '6p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 50}${font conkyweather:size=40}${execi 600 sed -n '7p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}↑ ${execi 600 sed -n '9p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execi 600 sed -n '10p' /media/5/Conky/accuweather_conky/tod_ton}°
${stippled_hr 5 1}
${execi 600 sed -n '11p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 50}${font conkyweather:size=40}${execi 600 sed -n '12p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}↑ ${execi 600 sed -n '14p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execi 600 sed -n '15p' /media/5/Conky/accuweather_conky/tod_ton}°
${stippled_hr 5 1}
${execi 600 sed -n '16p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 50}${font conkyweather:size=40}${execi 600 sed -n '17p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}↑ ${execi 600 sed -n '19p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execi 600 sed -n '20p' /media/5/Conky/accuweather_conky/tod_ton}°
${stippled_hr 5 1}
${execi 600 sed -n '21p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 50}${font conkyweather:size=40}${execi 600 sed -n '22p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40}↑ ${execi 600 sed -n '24p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execi 600 sed -n '25p' /media/5/Conky/accuweather_conky/tod_ton}°
${stippled_hr 5 1}
${execi 600 sed -n '1p' /media/5/Conky/accuweather_conky/last_days}\
${goto 50}${font conkyweather:size=40}${execi 600 sed -n '2p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}↑ ${execi 600 sed -n '4p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execi 600 sed -n '5p' /media/5/Conky/accuweather_conky/last_days}°
${stippled_hr 5 1}
${execi 600 sed -n '6p' /media/5/Conky/accuweather_conky/last_days}\
${goto 50}${font conkyweather:size=40}${execi 600 sed -n '7p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}↑ ${execi 600 sed -n '9p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execi 600 sed -n '10p' /media/5/Conky/accuweather_conky/last_days}°
${stippled_hr 5 1}
${execi 600 sed -n '11p' /media/5/Conky/accuweather_conky/last_days}\
${goto 50}${font conkyweather:size=40}${execi 600 sed -n '12p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}↑ ${execi 600 sed -n '14p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execi 600 sed -n '15p' /media/5/Conky/accuweather_conky/last_days}°
${stippled_hr 5 1}
${execi 600 sed -n '16p' /media/5/Conky/accuweather_conky/last_days}\
${goto 50}${font conkyweather:size=40}${execi 600 sed -n '17p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}↑ ${execi 600 sed -n '19p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execi 600 sed -n '20p' /media/5/Conky/accuweather_conky/last_days}°
${stippled_hr 5 1}
${execi 600 sed -n '21p' /media/5/Conky/accuweather_conky/last_days}\
${goto 50}${font conkyweather:size=40}${execi 600 sed -n '22p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40}↑ ${execi 600 sed -n '24p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execi 600 sed -n '25p' /media/5/Conky/accuweather_conky/last_days}°
#!/bin/bash
#function: test_image_day
test_image_day () {
case $1 in
su)
echo a
;;
msu)
echo b
;;
psu)
echo c
;;
ic)
echo c
;;
h)
echo c
;;
mc)
echo d
;;
c)
echo e
;;
d)
echo e
;;
f)
echo 0
;;
s)
echo h
;;
mcs)
echo g
;;
psus)
echo g
;;
t)
echo l
;;
mct)
echo k
;;
psut)
echo k
;;
r)
echo i
;;
fl)
echo p
;;
mcfl)
echo o
;;
psfl)
echo o
;;
sn)
echo r
;;
mcsn)
echo o
;;
i)
echo E
;;
sl)
echo u
;;
fr)
echo i
;;
rsn)
echo v
;;
w)
echo 6
;;
ho)
echo 5
;;
co)
echo E
;;
cl)
echo A
;;
mcl)
echo B
;;
pc)
echo C
;;
pcs)
echo G
;;
pct)
echo K
;;
esac
}
#function: test_image_night
test_image_night () {
case $1 in
su)
echo a
;;
msu)
echo b
;;
psu)
echo c
;;
c)
echo f
;;
d)
echo f
;;
f)
echo f
;;
s)
echo h
;;
psus)
echo g
;;
t)
echo l
;;
psut)
echo k
;;
r)
echo i
;;
fl)
echo p
;;
psfl)
echo o
;;
sn)
echo r
;;
i)
echo E
;;
sl)
echo u
;;
fr)
echo i
;;
rsn)
echo v
;;
ho)
echo 5
;;
co)
echo E
;;
cl)
echo A
;;
w)
echo 6
;;
mcl)
echo B
;;
pc)
echo C
;;
ic)
echo B
;;
h)
echo B
;;
mc)
echo C
;;
pcs)
echo G
;;
mcs)
echo G
;;
pct)
echo K
;;
mct)
echo K
;;
mcfl)
echo O
;;
mcsn)
echo O
;;
esac
}
kill -STOP $(pidof conky)
killall wget
#put your Accuweather address here
## address="http://www.accuweather.com/en/gr/chania/182654/weather-forecast/182654"
## address="http://www.accuweather.com/en/gr/kastoria/178682/weather-forecast/178682"
## address="http://www.accuweather.com/en/ar/buenos-aires/7894/weather-forecast/7894"
address="http://www.accuweather.com/en/ar/general-urquiza/1228994/weather-forecast/1228994"
loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')
curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"
wget -O /media/5/Conky/accuweather_conky/curr_cond_raw "$curr_addr"
addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
wget -O /media/5/Conky/accuweather_conky/tod_ton_raw "$addr1"
addr2="$addr1"?day=6
wget -O /media/5/Conky/accuweather_conky/last_days_raw "$addr2"
#current conditions
if [[ -s /media/5/Conky/accuweather_conky/curr_cond_raw ]]; then
sed -i '/detail-now/,/#details/!d' /media/5/Conky/accuweather_conky/curr_cond_raw
egrep -i '"cond"|icon i-|detail-tab-panel' /media/5/Conky/accuweather_conky/curr_cond_raw > /media/5/Conky/accuweather_conky/curr_cond
sed -i -e 's/^.*detail-tab-panel //g' -e 's/^.*icon i-//g' -e 's/"><\/div>.*$//g' /media/5/Conky/accuweather_conky/curr_cond
sed -i -e 's/^.*"cond">//g' -e 's/°/\n/g' -e 's/<\/span>.*"temp">/\n/g' -e 's/<.*>//g' /media/5/Conky/accuweather_conky/curr_cond
sed -i -e 's/">//g' -e 's/-->//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' /media/5/Conky/accuweather_conky/curr_cond
time=$(sed -n 1p /media/5/Conky/accuweather_conky/curr_cond)
image=$(sed -n 2p /media/5/Conky/accuweather_conky/curr_cond)
if [[ $time == day ]]; then
sed -i 2s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/curr_cond
elif [[ $time == night ]]; then
sed -i 2s/$image/$(test_image_night $image)/ /media/5/Conky/accuweather_conky/curr_cond
fi
fi
#First 5 days
if [[ -s /media/5/Conky/accuweather_conky/tod_ton_raw ]]; then
sed -i '/feed-tabs/,/\.feed-tabs/!d' /media/5/Conky/accuweather_conky/tod_ton_raw
egrep -i 'Early AM|Today|Tonight|Overnight|icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' /media/5/Conky/accuweather_conky/tod_ton_raw > /media/5/Conky/accuweather_conky/tod_ton
sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' /media/5/Conky/accuweather_conky/tod_ton
sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' /media/5/Conky/accuweather_conky/tod_ton
sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' /media/5/Conky/accuweather_conky/tod_ton
sed -i -e 's/Early AM/E-AM/' -e 's/Today/Day/' -e 's/Tonight/Nite/' -e 's/Overnight/O-nite/' -e 's/Mon$/Mon/' -e 's/Tue$/Tue/' -e 's/Wed$/Wed/' -e 's/Thu$/Thu/' -e 's/Fri$/Fri/' -e 's/Sat$/Sat/' -e 's/Sun$/Sun/' /media/5/Conky/accuweather_conky/tod_ton
time=$(sed -n 1p /media/5/Conky/accuweather_conky/tod_ton)
image=$(sed -n 2p /media/5/Conky/accuweather_conky/tod_ton)
if [[ $time == Day ]]; then
sed -i 2s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/tod_ton
elif [[ $time == Nite || $time == O-nite || $time == "E-AM" ]]; then
sed -i 2s/$image/$(test_image_night $image)/ /media/5/Conky/accuweather_conky/tod_ton
sed -i 3a- /media/5/Conky/accuweather_conky/tod_ton
fi
for (( i=7; i<=22; i+=5 ))
do
image=$(sed -n "${i}"p /media/5/Conky/accuweather_conky/tod_ton)
sed -i ${i}s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/tod_ton
done
fi
#Next 5 days
if [[ -s /media/5/Conky/accuweather_conky/last_days_raw ]]; then
sed -i '/feed-tabs/,/\.feed-tabs/!d' /media/5/Conky/accuweather_conky/last_days_raw
egrep -i 'icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' /media/5/Conky/accuweather_conky/last_days_raw > /media/5/Conky/accuweather_conky/last_days
sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' /media/5/Conky/accuweather_conky/last_days
sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' /media/5/Conky/accuweather_conky/last_days
sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' /media/5/Conky/accuweather_conky/last_days
sed -i -e 's/Mon$/Mon/' -e 's/Tue$/Tue/' -e 's/Wed$/Wed/' -e 's/Thu$/Thu/' -e 's/Fri$/Fri/' -e 's/Sat$/Sat/' -e 's/Sun$/Sun/' /media/5/Conky/accuweather_conky/last_days
for (( i=2; i<=22; i+=5 ))
do
image=$(sed -n "${i}"p /media/5/Conky/accuweather_conky/last_days)
sed -i ${i}s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/last_days
done
fi
kill -CONT $(pidof conky)
minimum_size 140 735 ## width, height
maximum_width 140 ## width
# killall conky && conky -c /media/5/Conky/accuweather_conky/conkyrc_acc_int &
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_colour gray
own_window_class Conky
own_window_title Chronograph Full 2
# 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 140 735 ## width, height
maximum_width 140 ## width
gap_x 10 ### left &right
gap_y 10 ### up & down
alignment tl #ml
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont CorporateMonoExtraBold:size=9
xftfont monofur:bold:size=12
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
draw_shades no
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
default_color DCDCDC #220 220 220 Gainsboro
color0 8FBC8F #143 188 143 DarkSeaGreen
color1 C2CCFF #119 136 153 LightSlateGray
color2 FF8C00 #255 140 0 DarkOrange
color3 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 yes #no
#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 256
# 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
# If enabled, values which are in bytes will be printed in human readable
# format (i.e., KiB, MiB, etc). If disabled, bytes is printed instead
format_human_readable yes
# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off.
short_units yes
# 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 ###
### LUA Settings ###########################################################
### draw-bg.lua - Above and After TEXT - requires a composite manager ########
# ----------------------------------------------------------------------------
lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.3}
# ============================================================================
## OR Both above TEXT - No composite manager required.
# ----------------------------------------------------------------------------
#lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 12 0 0 0 0 0x000000 0.5
# TEXT
####################################################### End LUA Settings ###
update_interval 1
TEXT
${lua conky_draw_bg 12 0 0 0 0 0x000000 0.3}\
Looking Out ${hr 2}$color${execi 600 bash /media/5/Conky/accuweather_conky/accuw_script}
Now\
${goto 90}${font conkyweather:size=40}${execi 600 sed -n '2p' /media/5/Conky/accuweather_conky/curr_cond}${font}
${voffset -40} ${execpi 600 sed -n '4p' /media/5/Conky/accuweather_conky/curr_cond}°
${execpi 600 sed -n '1p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 90}${font conkyweather:size=40}${execi 600 sed -n '2p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40} ↑ ${execpi 600 sed -n '4p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execpi 600 sed -n '5p' /media/5/Conky/accuweather_conky/tod_ton}°
${stippled_hr 5 1}
${execpi 600 sed -n '6p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 90}${font conkyweather:size=40}${execi 600 sed -n '7p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40} ↑ ${execpi 600 sed -n '9p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execpi 600 sed -n '10p' /media/5/Conky/accuweather_conky/tod_ton}°
${stippled_hr 5 1}
${execpi 600 sed -n '11p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 90}${font conkyweather:size=40}${execi 600 sed -n '12p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40} ↑ ${execpi 600 sed -n '14p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execpi 600 sed -n '15p' /media/5/Conky/accuweather_conky/tod_ton}°
${stippled_hr 5 1}
${execpi 600 sed -n '16p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 90}${font conkyweather:size=40}${execi 600 sed -n '17p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40} ↑ ${execpi 600 sed -n '19p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execpi 600 sed -n '20p' /media/5/Conky/accuweather_conky/tod_ton}°
${stippled_hr 5 1}
${execpi 600 sed -n '21p' /media/5/Conky/accuweather_conky/tod_ton}\
${goto 90}${font conkyweather:size=40}${execi 600 sed -n '22p' /media/5/Conky/accuweather_conky/tod_ton}${font}
${voffset -40} ↑ ${execpi 600 sed -n '24p' /media/5/Conky/accuweather_conky/tod_ton}°
↓ ${execpi 600 sed -n '25p' /media/5/Conky/accuweather_conky/tod_ton}°
${stippled_hr 5 1}
${execpi 600 sed -n '1p' /media/5/Conky/accuweather_conky/last_days}\
${goto 90}${font conkyweather:size=40}${execi 600 sed -n '2p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40} ↑ ${execpi 600 sed -n '4p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execpi 600 sed -n '5p' /media/5/Conky/accuweather_conky/last_days}°
${stippled_hr 5 1}
${execpi 600 sed -n '6p' /media/5/Conky/accuweather_conky/last_days}\
${goto 90}${font conkyweather:size=40}${execi 600 sed -n '7p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40} ↑ ${execpi 600 sed -n '9p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execpi 600 sed -n '10p' /media/5/Conky/accuweather_conky/last_days}°
${stippled_hr 5 1}
${execpi 600 sed -n '11p' /media/5/Conky/accuweather_conky/last_days}\
${goto 90}${font conkyweather:size=40}${execi 600 sed -n '12p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40} ↑ ${execpi 600 sed -n '14p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execpi 600 sed -n '15p' /media/5/Conky/accuweather_conky/last_days}°
${stippled_hr 5 1}
${execpi 600 sed -n '16p' /media/5/Conky/accuweather_conky/last_days}\
${goto 90}${font conkyweather:size=40}${execi 600 sed -n '17p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40} ↑ ${execpi 600 sed -n '19p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execpi 600 sed -n '20p' /media/5/Conky/accuweather_conky/last_days}°
${stippled_hr 5 1}
${execpi 600 sed -n '21p' /media/5/Conky/accuweather_conky/last_days}\
${goto 90}${font conkyweather:size=40}${execi 600 sed -n '22p' /media/5/Conky/accuweather_conky/last_days}${font}
${voffset -40} ↑ ${execpi 600 sed -n '24p' /media/5/Conky/accuweather_conky/last_days}°
↓ ${execpi 600 sed -n '25p' /media/5/Conky/accuweather_conky/last_days}°
#!/bin/bash
#function: test_image_day
test_image_day () {
case $1 in
su)
echo a
;;
msu)
echo b
;;
psu)
echo c
;;
ic)
echo c
;;
h)
echo c
;;
mc)
echo d
;;
c)
echo e
;;
d)
echo e
;;
f)
echo 0
;;
s)
echo h
;;
mcs)
echo g
;;
psus)
echo g
;;
t)
echo l
;;
mct)
echo k
;;
psut)
echo k
;;
r)
echo i
;;
fl)
echo p
;;
mcfl)
echo o
;;
psfl)
echo o
;;
sn)
echo r
;;
mcsn)
echo o
;;
i)
echo E
;;
sl)
echo u
;;
fr)
echo i
;;
rsn)
echo v
;;
w)
echo 6
;;
ho)
echo 5
;;
co)
echo E
;;
cl)
echo A
;;
mcl)
echo B
;;
pc)
echo C
;;
pcs)
echo G
;;
pct)
echo K
;;
esac
}
#function: test_image_night
test_image_night () {
case $1 in
su)
echo a
;;
msu)
echo b
;;
psu)
echo c
;;
c)
echo f
;;
d)
echo f
;;
f)
echo f
;;
s)
echo h
;;
psus)
echo g
;;
t)
echo l
;;
psut)
echo k
;;
r)
echo i
;;
fl)
echo p
;;
psfl)
echo o
;;
sn)
echo r
;;
i)
echo E
;;
sl)
echo u
;;
fr)
echo i
;;
rsn)
echo v
;;
ho)
echo 5
;;
co)
echo E
;;
cl)
echo A
;;
w)
echo 6
;;
mcl)
echo B
;;
pc)
echo C
;;
ic)
echo B
;;
h)
echo B
;;
mc)
echo C
;;
pcs)
echo G
;;
mcs)
echo G
;;
pct)
echo K
;;
mct)
echo K
;;
mcfl)
echo O
;;
mcsn)
echo O
;;
esac
}
kill -STOP $(pidof conky)
killall wget
#put your Accuweather address here
address="http://www.accuweather.com/en/ar/general-urquiza/1228994/weather-forecast/1228994"
loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')
curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"
wget -O /media/5/Conky/accuweather_conky/curr_cond_raw "$curr_addr"
addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
wget -O /media/5/Conky/accuweather_conky/tod_ton_raw "$addr1"
addr2="$addr1"?day=6
wget -O /media/5/Conky/accuweather_conky/last_days_raw "$addr2"
#current conditions
if [[ -s /media/5/Conky/accuweather_conky/curr_cond_raw ]]; then
sed -i '/detail-now/,/#details/!d' /media/5/Conky/accuweather_conky/curr_cond_raw
egrep -i '"cond"|icon i-|detail-tab-panel' /media/5/Conky/accuweather_conky/curr_cond_raw > /media/5/Conky/accuweather_conky/curr_cond
sed -i -e 's/^.*detail-tab-panel //g' -e 's/^.*icon i-//g' -e 's/"><\/div>.*$//g' /media/5/Conky/accuweather_conky/curr_cond
sed -i -e 's/^.*"cond">//g' -e 's/°/\n/g' -e 's/<\/span>.*"temp">/\n/g' -e 's/<.*>//g' /media/5/Conky/accuweather_conky/curr_cond
sed -i -e 's/">//g' -e 's/-->//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' /media/5/Conky/accuweather_conky/curr_cond
time=$(sed -n 1p /media/5/Conky/accuweather_conky/curr_cond)
image=$(sed -n 2p /media/5/Conky/accuweather_conky/curr_cond)
if [[ $time == day ]]; then
sed -i 2s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/curr_cond
elif [[ $time == night ]]; then
sed -i 2s/$image/$(test_image_night $image)/ /media/5/Conky/accuweather_conky/curr_cond
fi
fi
#First 5 days
if [[ -s /media/5/Conky/accuweather_conky/tod_ton_raw ]]; then
sed -i '/feed-tabs/,/\.feed-tabs/!d' /media/5/Conky/accuweather_conky/tod_ton_raw
egrep -i 'Early AM|Today|Tonight|Overnight|icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' /media/5/Conky/accuweather_conky/tod_ton_raw > /media/5/Conky/accuweather_conky/tod_ton
sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' /media/5/Conky/accuweather_conky/tod_ton
sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' /media/5/Conky/accuweather_conky/tod_ton
sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' /media/5/Conky/accuweather_conky/tod_ton
sed -i -e 's/Early AM/Early AM/' -e 's/Today/Today/' -e 's/Tonight/Tonight/' -e 's/Overnight/Overnight/' -e 's/Mon$/Monday/' -e 's/Tue$/Tuesday/' -e 's/Wed$/Wednesday/' -e 's/Thu$/Thursday/' -e 's/Fri$/Friday/' -e 's/Sat$/Saturday/' -e 's/Sun$/Sunday/' /media/5/Conky/accuweather_conky/tod_ton
time=$(sed -n 1p /media/5/Conky/accuweather_conky/tod_ton)
image=$(sed -n 2p /media/5/Conky/accuweather_conky/tod_ton)
if [[ $time == Today ]]; then
sed -i 2s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/tod_ton
elif [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
sed -i 2s/$image/$(test_image_night $image)/ /media/5/Conky/accuweather_conky/tod_ton
sed -i 3a- /media/5/Conky/accuweather_conky/tod_ton
fi
for (( i=7; i<=22; i+=5 ))
do
image=$(sed -n "${i}"p /media/5/Conky/accuweather_conky/tod_ton)
sed -i ${i}s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/tod_ton
done
fi
#Next 5 days
if [[ -s /media/5/Conky/accuweather_conky/last_days_raw ]]; then
sed -i '/feed-tabs/,/\.feed-tabs/!d' /media/5/Conky/accuweather_conky/last_days_raw
egrep -i 'icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' /media/5/Conky/accuweather_conky/last_days_raw > /media/5/Conky/accuweather_conky/last_days
sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' /media/5/Conky/accuweather_conky/last_days
sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' /media/5/Conky/accuweather_conky/last_days
sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' /media/5/Conky/accuweather_conky/last_days
sed -i -e 's/Mon$/Monday/' -e 's/Tue$/Tuesday/' -e 's/Wed$/Wednesday/' -e 's/Thu$/Thursday/' -e 's/Fri$/Friday/' -e 's/Sat$/Saturday/' -e 's/Sun$/Sunday/' /media/5/Conky/accuweather_conky/last_days
for (( i=2; i<=22; i+=5 ))
do
image=$(sed -n "${i}"p /media/5/Conky/accuweather_conky/last_days)
sed -i ${i}s/$image/$(test_image_day $image)/ /media/5/Conky/accuweather_conky/last_days
done
fi
kill -CONT $(pidof conky)
Quote from: jedi@Sector11 an lwfitz, amazing stuff. I'm really hooked on the horizontal Conky's. Nice weather scheme in that one on Post # 5 Sector11!!! :D
# killall conky && conky -c /media/5/Conky/S11_VSIDO_v9.conkyrc &
# Original by: VastOne on VSIDO
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
use_spacer none #right
# Use Xft?
use_xft yes
xftfont Monofur:bold:size=12
xftalpha 1.0
# text_buffer_size 256
# Update interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
own_window yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_transparent yes
# own_window_argb_visual yes
own_window_class Conky
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 3
# border width
border_width 0
# Default colors and also border colors
default_color 00BFFF # 0 191 255 DeepSkyBlue
color0 FFDEAD #255 222 173 NavajoWhite
color1 7FFF00 #127 255 0 Chartreuse
color2 778899 #119 136 153 LightSlateGray
color3 FF8C00 #255 140 0 DarkOrange
color4 F0FFFF #240 255 255 Azure
color5 FFDEAD #255 222 173 NavajoWhite
color6 7B68EE #123 104 238 MediumSlateBlue
color7 00FFFF # 0 255 255 Cyan
color8 FFFF00 #255 255 0 Yellow
color9 FF0000 #255 0 0 Red
#default_shade_color black
#default_outline_color grey
own_window_colour 000000
# Text alignment, other possible values are commented
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 5 # left-right
gap_y 5 # up-down
minimum_size 1265 0 ## width, height
#maximum_width 1250 ## width
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off (no).
short_units yes
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load /media/5/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.4
# lua_draw_hook_post draw-bg 125 0 0 0 0 0x000000 0.01
#
# TEXT
#
############### V9000 ########################################################
#starts the lua weather data gathering function, call once at top of conkyrc
lua_load ~/v9000/v9000.lua
lua_draw_hook_post weather
lua_load /media/5/Conky/templates/VSIDO-v9-template.lua
####################################################### End LUA Settings ###
#
TEXT
${execi 600 bash /media/5/Conky/accuweather_conky/accuw_script}\
${color}Kernel ${color4}${kernel}\
${color}MEM${color4}${if_match ${memperc}<10} ${memperc}\
${else}${if_match ${memperc}<100} ${memperc}\
${else}${memperc}${endif}${endif}%\
${color}(${mem})\
${color}CPU${color4}${if_match ${platform f71882fg.2560 temp 1}<100} ${platform f71882fg.2560 temp 1}\
${else}${platform f71882fg.2560 temp 1}${endif}°\
${color}MB${color4}${if_match ${platform f71882fg.2560 temp 2}<100} ${platform f71882fg.2560 temp 2}\
${else}${platform f71882fg.2560 temp 2}${endif}°\
${color}HD${color4}${if_match ${execi 5 hddtemp -n /dev/sda}<100} ${execi 5 hddtemp -n /dev/sda}\
${else}${execi 5 hddtemp -n /dev/sda}${endif}°
${color}NET${color4} Dn: ${color2}${downspeedgraph eth0 12,150 00ff00 ff0000 -t -l} ${color}Up: ${color2}${upspeedgraph eth0 12,150 ff0000 00ff00 -t -l} ${color}Uptime ${color1}${uptime_short}
${color}CPU: 1${color4}${if_match ${cpu cpu1}<10} ${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100} ${cpu cpu1}\
${else}${cpu cpu0}${endif}${endif}%\
${color}2${color4}${if_match ${cpu cpu0}<10} ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%\
${color}3${color4}${if_match ${cpu cpu0}<10} ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%\
${color}4${color4}${if_match ${cpu cpu0}<10} ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%\
${color}Fan ${color4}${platform f71882fg.2560 fan 1} rpm\
${color}VRX·${color7}03 ${color4}04·${color1}${exec conkyDaysDiff 20130304} ${color4}11·${color7}${exec conkyDaysDiff 20130311} ${color4}16·${color3}${exec conkyDaysDiff 20130316}${color4}
--[[
The latest script is a lua only weather script. aka: v9000
http://crunchbanglinux.org/forums/topic/16100/weather-in-conky/
the file:
http://dl.dropbox.com/u/19008369/current%20v9000/v9000.tar.gz
mrppeachys LUA Tutorial
http://crunchbanglinux.org/forums/topic/17246/how-to-using-lua-scripts-in-conky/
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
-- default_font="CorporateMonoExtraBold"--font must be in quotes
-- default_font_size=10
default_font="monofur"--font must be in quotes
default_font_size=12
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=20
default_image_height=20
-- ## New Options ###
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
datax=670
dataxx=55
dataxx1=dataxx+30
datay1=13
datay2=25
datay3=40
datay4=55
datayy=13 --datay+(datayy*1)
imgx=687
imgx1=55 -- (imgx1*1)
imgyh=165
imgyf=190
imgyy=39 -- imgy+(imgyy*1)
-- out({c=0x00FFFF,,a=1,x=6,y=50,txt="cpu:"..conky_parse("${cpu}")})
-- VSIDO ICON ORB
image({w=55,h=55,x=5,y=5,file="/home/sector11/images/vsido/orbwallpaper3.png"})
-- today
out({c=0x00FFFF,a=1,x=datax,y=datay1,txt=forecast_day_short[1]})
out({c=0x00FFFF,a=1,x=datax+30,y=datay1,txt=forecast_date[1]})
image({x=imgx,y=17,h=25,w=25,file=weather_icon[1]})
--image({x=imgx,y=17,h=25,w=25,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=datax,y=datay2,txt=high_temp[1]})
out({c=0xF0FFFF,a=1,x=datax,y=datay3,txt=low_temp[1]})
out({c=0x00FFFF,a=1,x=datax+dataxx,y=datay1,txt="Current"})
out({c=0xF0FFFF,a=1,x=datax+dataxx,y=datay2,txt=now["temp"]})
out({c=0xFFDEAD,a=1,x=datax+dataxx,y=datay3,txt=now["feels_like"]})
image({x=imgx+(imgx1*1),y=17,h=25,w=25,file=now["weather_icon"]})
--image({x=imgx+(imgx1*1),y=17,h=25,w=25,file="/media/5/Conky/images/red+x.png"})
out({c=0x00FFFF,a=1,x=datax+(dataxx*2),y=datay1,txt=forecast_day_short[2]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*2+30),y=datay1,txt=forecast_date[2]})
image({x=imgx+(imgx1*2),y=17,h=25,w=25,file=weather_icon[2]})
--image({x=imgx+(imgx1*2),y=17,h=25,w=25,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=datax+(dataxx*2),y=datay2,txt=high_temp[2]})
out({c=0xF0FFFF,a=1,x=datax+(dataxx*2),y=datay3,txt=low_temp[2]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*3),y=datay1,txt=forecast_day_short[3]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*3+30),y=datay1,txt=forecast_date[3]})
image({x=imgx+(imgx1*3),y=17,h=25,w=25,file=weather_icon[3]})
--image({x=imgx+(imgx1*3),y=17,h=25,w=25,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=datax+(dataxx*3),y=datay2,txt=high_temp[3]})
out({c=0xF0FFFF,a=1,x=datax+(dataxx*3),y=datay3,txt=low_temp[3]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*4),y=datay1,txt=forecast_day_short[4]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*4+30),y=datay1,txt=forecast_date[4]})
image({x=imgx+(imgx1*4),y=17,h=25,w=25,file=weather_icon[4]})
--image({x=imgx+(imgx1*4),y=17,h=25,w=25,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=datax+(dataxx*4),y=datay2,txt=high_temp[4]})
out({c=0xF0FFFF,a=1,x=datax+(dataxx*4),y=datay3,txt=low_temp[4]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*5),y=datay1,txt=forecast_day_short[5]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*5+30),y=datay1,txt=forecast_date[5]})
image({x=imgx+(imgx1*5),y=17,h=25,w=25,file=weather_icon[5]})
--image({x=imgx+(imgx1*5),y=17,h=25,w=25,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=datax+(dataxx*5),y=datay2,txt=high_temp[5]})
out({c=0xF0FFFF,a=1,x=datax+(dataxx*5),y=datay3,txt=low_temp[5]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*6),y=datay1,txt=forecast_day_short[6]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*6+30),y=datay1,txt=forecast_date[6]})
image({x=imgx+(imgx1*6),y=17,h=25,w=25,file=weather_icon[6]})
--image({x=imgx+(imgx1*6),y=17,h=25,w=25,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=datax+(dataxx*6),y=datay2,txt=high_temp[6]})
out({c=0xF0FFFF,a=1,x=datax+(dataxx*6),y=datay3,txt=low_temp[6]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*7),y=datay1,txt=forecast_day_short[7]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*7+30),y=datay1,txt=forecast_date[7]})
image({x=imgx+(imgx1*7),y=17,h=25,w=25,file=weather_icon[7]})
--image({x=imgx+(imgx1*7),y=17,h=25,w=25,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=datax+(dataxx*7),y=datay2,txt=high_temp[7]})
out({c=0xF0FFFF,a=1,x=datax+(dataxx*7),y=datay3,txt=low_temp[7]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*8),y=datay1,txt=forecast_day_short[8]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*8+30),y=datay1,txt=forecast_date[8]})
image({x=imgx+(imgx1*8),y=17,h=25,w=25,file=weather_icon[8]})
--image({x=imgx+(imgx1*8),y=17,h=25,w=25,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=datax+(dataxx*8),y=datay2,txt=high_temp[8]})
out({c=0xF0FFFF,a=1,x=datax+(dataxx*8),y=datay3,txt=low_temp[8]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*9),y=datay1,txt=forecast_day_short[9]})
out({c=0x00FFFF,a=1,x=datax+(dataxx*9+30),y=datay1,txt=forecast_date[9]})
image({x=imgx+(imgx1*9),y=17,h=25,w=25,file=weather_icon[9]})
--image({x=imgx+(imgx1*9),y=17,h=25,w=25,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=datax+(dataxx*9),y=datay2,txt=high_temp[9]})
out({c=0xF0FFFF,a=1,x=datax+(dataxx*9),y=datay3,txt=low_temp[9]})
out({c=0x00FFFF,a=10,x=datax+(dataxx*10),y=datay1,txt=forecast_day_short[10]})
out({c=0x00FFFF,a=10,x=datax+(dataxx*10+30),y=datay1,txt=forecast_date[10]})
image({x=imgx+(imgx1*10),y=17,h=25,w=25,file=weather_icon[10]})
--image({x=imgx+(imgx1*10),y=17,h=25,w=25,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=datax+(dataxx*10),y=datay2,txt=high_temp[10]})
out({c=0xF0FFFF,a=1,x=datax+(dataxx*10),y=datay3,txt=low_temp[10]})
-- BOTTOM LINE
out({c=0xF0FFFF,a=1,x=datax,y=datay4,txt="Today's Weather:"})
out({c=0x00FFFF,a=1,x=datax+115,y=datay4,txt="Pressure"})
out({c=0xF0FFFF,a=1,x=datax+175,y=datay4,txt=now["pressure_mb"].." mb"})
out({c=0x00FFFF,a=1,x=datax+245,y=datay4,txt="Humidity"})
out({c=0xF0FFFF,a=1,x=datax+305,y=datay4,txt=now["humidity"].."%"})
out({c=0x00FFFF,a=1,x=datax+338,y=datay4,txt="Dew Point"})
out({c=0xF0FFFF,a=1,x=datax+405,y=datay4,txt=now["dew_point"].."°"})
out({c=0x00FFFF,a=1,x=datax+435,y=datay4,txt="UV Index"})
out({c=0xF0FFFF,a=1,x=datax+495,y=datay4,txt=uv_index_num[1]})
out({c=0xF0FFFF,a=1,x=datax+515,y=datay4,txt=uv_index_txt[1]})
-- yellow line
--image({w=45,h=1,x=5,y=550,file="/media/5/Conky/images/yellow_1.png"})
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
# killall conky && conky -c /media/5/Conky/Accuweather/Teo_Clock_Gen_Urquiza_AccuW.conky &
#
# Thank you:
# Chronograph LUA - mrpeachy (originally 4 clocks - tweaked by Sector11)
# v9000 LUA weather - mrpeachy
# background - londonali1010, mrpeachy, dk75
# TeoBigusGeekus - for the weather scripts
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_class Conky
own_window_title Teo Weather Clock General Urquiza
# 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 420 420 ## width, height
#maximum_width 420 ## width
### For use with The-Clock.lua
minimum_size 300 0 ## width, height
maximum_width 300 ## width
gap_x 10 #15 ### left &right
gap_y 10 ### up & down
### alignment values or top_left, bottom_right, etc
# tl, tm, tr
# ml, mm, mr
# bl, bm, br
alignment top_right
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont CorporateMonoExtraBold:size=9
xftfont monofur:bold:size=11
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
draw_shades no
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
default_color DCDCDC #220 220 220 Gainsboro
color0 8FBC8F #143 188 143 DarkSeaGreen
#color1 C2CCFF # Not a clue - a blue #778899 #119 136 153 LightSlateGray
color1 AFEEEE #175 238 238 PaleTurquoise
color2 FF8C00 #255 140 0 DarkOrange
color3 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 yes #no
#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 256
# 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
# If enabled, values which are in bytes will be printed in human readable
# format (i.e., KiB, MiB, etc). If disabled, bytes is printed instead
format_human_readable yes
# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off.
short_units yes
imlib_cache_size 0
# 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
## default bar size
default_bar_size 200 20
############################################## End Miscellaneous Section ###
### LUA Settings ###########################################################
## draw-bg.lua - Above and After TEXT - requires a composite manager.
##
lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.3}
#
# ----------------------------------------------------------------------------
## OR Both above TEXT - No composite manager required.
#
#lua_load ~/Conky_WeatherCom_metric/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.3
#
# TEXT
### Teo Weather Clock ########################################################
lua_load /media/5/Conky/LUA/Teo_Weather_Clock.lua
lua_draw_hook_post main
############################## End LUA Settings ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}\
${lua conky_draw_bg 123 30 30 246 246 0xffffff 0.2}\
${texeci 500 bash /media/5/Conky/Accuweather/acc_int_images}\
${font monofur:size=24}${color7}${execi 600 sed -n '29p' /media/5/Conky/Accuweather/curr_cond}°${alignr}${color5}${execi 600 sed -n '30p' /media/5/Conky/Accuweather/curr_cond}°${font}
${color7}Temp${alignr 15}${color5}±${font}
${image /media/5/Conky/Accuweather/cc.png -p 102,120 -s 90x54}
${color}Today${alignr}${color1}Tonight${color}
${color5}↑ ${color2}${execi 600 sed -n '26p' /media/5/Conky/Accuweather/first_days}°${alignr}${color5}↓ ${color7}${execi 600 sed -n '31p' /media/5/Conky/Accuweather/first_days}°
${image /media/5/Conky/Accuweather/tod.png -p 0,280 -s 120x72}${image /media/5/Conky/Accuweather/ton.png -p 180,280 -s 120x72}
${color5}± ${execi 600 sed -n '27p' /media/5/Conky/Accuweather/first_days}°${alignr}± ${execi 600 sed -n '32p' /media/5/Conky/Accuweather/first_days}°
${goto 60} ${color5}SUN${goto 100}${color}↑ ${execi 600 sed -n '39p' /media/5/Conky/Accuweather/curr_cond}${goto 180}${color1}↓ ${execi 600 sed -n '40p' /media/5/Conky/Accuweather/curr_cond}
${goto 60}${color5}MOON ${goto 100}${color}↑ ${execi 600 sed -n '41p' /media/5/Conky/Accuweather/curr_cond}${goto 180}${color1}↓ ${color1}${execi 600 sed -n '42p' /media/5/Conky/Accuweather/curr_cond}
${color5}Humidity ${color7}${execi 600 sed -n '33p' /media/5/Conky/Accuweather/curr_cond}${alignr 5}${color5}Dew Point ${color7}${execi 600 sed -n '37p' /media/5/Conky/Accuweather/curr_cond}°${color}
${color5}Pressure ${color7}${execi 600 sed -n '34p' /media/5/Conky/Accuweather/curr_cond}${alignr 5}${color5}UV Index ${color7}${execi 600 sed -n '36p' /media/5/Conky/Accuweather/curr_cond}
${color5}Wind ${color7}${execi 600 sed -n '31p' /media/5/Conky/Accuweather/curr_cond} ${execi 600 sed -n '32p' /media/5/Conky/Accuweather/curr_cond}\
${alignr 5}${color5}Cloud Cover ${color7}${execi 600 sed -n '35p' /media/5/Conky/Accuweather/curr_cond}
${alignc}${color5}Visibility ${color7}${execi 600 sed -n '38p' /media/5/Conky/Accuweather/curr_cond}
${color1}${stippled_hr 5 1}
${color5}${execi 600 sed -n '5p' /media/5/Conky/Accuweather/first_days}${goto 113}${execi 600 sed -n '10p' /media/5/Conky/Accuweather/first_days}${goto 217}${execi 600 sed -n '15p' /media/5/Conky/Accuweather/first_days}
${image /media/5/Conky/Accuweather/6.png -p 0,475 -s 90x54}${image /media/5/Conky/Accuweather/11.png -p 110,475 -s 90x54}${image /media/5/Conky/Accuweather/16.png -p 210,475 -s 90x54}
↑ ${color2}${execi 600 sed -n '8p' /media/5/Conky/Accuweather/first_days}${goto 55}${color5}↓ ${color1}${execi 600 sed -n '9p' /media/5/Conky/Accuweather/first_days}\
${goto 111}↑ ${color2}${execi 600 sed -n '13p' /media/5/Conky/Accuweather/first_days}${goto 160}${color5}↓ ${color1}${execi 600 sed -n '14p' /media/5/Conky/Accuweather/first_days}\
${goto 215}↑ ${color2}${execi 600 sed -n '18p' /media/5/Conky/Accuweather/first_days}${goto 264}${color5}↓ ${color1}${execi 600 sed -n '19p' /media/5/Conky/Accuweather/first_days}
${color5}${execi 600 sed -n '20p' /media/5/Conky/Accuweather/first_days}${goto 113}${execi 600 sed -n '1p' /media/5/Conky/Accuweather/last_days}${goto 217}${execi 600 sed -n '6p' /media/5/Conky/Accuweather/last_days}
${image /media/5/Conky/Accuweather/21.png -p 0,565 -s 90x54}${image /media/5/Conky/Accuweather/last_2.png -p 106,565 -s 90x54}${image /media/5/Conky/Accuweather/last_7.png -p 210,565 -s 90x54}
↑ ${color2}${execi 600 sed -n '23p' /media/5/Conky/Accuweather/first_days}${goto 55}${color5}↓ ${color1}${execi 600 sed -n '24p' /media/5/Conky/Accuweather/first_days}\
${goto 111}↑ ${color2}${execi 600 sed -n '4p' /media/5/Conky/Accuweather/last_days}${goto 160}${color5}↓ ${color1}${execi 600 sed -n '5p' /media/5/Conky/Accuweather/last_days}\
${goto 215}↑ ${color2}${execi 600 sed -n '9p' /media/5/Conky/Accuweather/last_days}${goto 264}${color5}↓ ${color1}${execi 600 sed -n '10p' /media/5/Conky/Accuweather/last_days}
${color5}${execi 600 sed -n '11p' /media/5/Conky/Accuweather/last_days}${goto 113}${execi 600 sed -n '16p' /media/5/Conky/Accuweather/last_days}${goto 217}${execi 600 sed -n '21p' /media/5/Conky/Accuweather/last_days}
${image /media/5/Conky/Accuweather/last_12.png -p 0,655 -s 90x54}${image /media/5/Conky/Accuweather/last_17.png -p 106,655 -s 90x54}${image /media/5/Conky/Accuweather/last_22.png -p 210,655 -s 90x54}
↑ ${color2}${execi 600 sed -n '14p' /media/5/Conky/Accuweather/last_days}${goto 55}${color5}↓ ${color1}${execi 600 sed -n '15p' /media/5/Conky/Accuweather/last_days}\
${goto 111}↑ ${color2}${execi 600 sed -n '19p' /media/5/Conky/Accuweather/last_days}${goto 160}${color5}↓ ${color1}${execi 600 sed -n '20p' /media/5/Conky/Accuweather/last_days}\
${goto 215}↑ ${color2}${execi 600 sed -n '24p' /media/5/Conky/Accuweather/last_days}${goto 264}${color5}↓ ${color1}${execi 600 sed -n '25p' /media/5/Conky/Accuweather/last_days}
${color1}${stippled_hr 5 1}
${color3}With ${color}${nodename} ${color3}for the past: ${color}${uptime_short}
${color3}Kernel: ${color}${kernel}
${color3}CPU ${color7}1: ${color}${if_match ${cpu cpu1}<10} ${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100} ${cpu cpu1}\
${else}${cpu cpu1}\
${endif}${endif} %\
${color7}2: ${color}${if_match ${cpu cpu2}<10} ${cpu cpu2}\
${else}${if_match ${cpu cpu2}<100} ${cpu cpu2}\
${else}${cpu cpu2}\
${endif}${endif} %\
${color7}3: ${color}${if_match ${cpu cpu3}<10} ${cpu cpu3}\
${else}${if_match ${cpu cpu3}<100} ${cpu cpu3}\
${else}${cpu cpu3}\
${endif}${endif} %\
${color7}Avg: ${color}${if_match ${cpu cpu0}<10} ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}\
${endif}${endif} %
${color3}CPU: ${color}${platform f71882fg.2560 temp 1}°${goto 90}${color3}SDA: ${color}${execi 15 hddtemp -n /dev/sda}°${goto 167}${color3}GPU: ${color}${nvidia temp}°${goto 245}${color3}MB: ${color}${platform f71882fg.2560 temp 2}°
${color3}RAM: ${color}${mem} / ${memmax} / ${memperc}% ${alignr 5}${color3}Swap: ${color}${swap} ${color}/ ${color}${swapmax}
${color3}eth-0 ${color7}Down: ${color}${downspeedf eth0}${goto 200}${color7}Up: ${color}${upspeedf eth0}
${color1}${stippled_hr 5 1}
--[[ multiple analogue clocks by mrpeachy - 18 Jun 2012
21 Jun 2012 - Chronograph modifications by Sector11
22 Jun 2012 - again with mrpeachy's help day names, numbers and month names
12 Nov 2012 - memory leak plugged - mrpeachy
14 Nov 2012 - Personnalisation - Didier-T (forum Ubuntu.fr)
26 Nov 2012 - The Clock - Sector11 (small version)
use in conkyrc
lua_load /path/Chronograph.lua
lua_draw_hook_pre main
TEXT
-- INDEX use search|find with: -- ### sonething ###
-- ### CLOCK POSITION - AND DEFAULTS ###
-- ### SET BORDER OPTIONS FOR "CLOCKS" ### -- I don't know how to remove this - NOT NEEDED
-- See lines 39 to 41 for overall size changes
-- ### START DIAL B ### Day Names Dial ###
-- See Lines 77 - 79 and 145 for changes
-- ### START DIAL C ### Month Names Dial ###
-- See Lines 143 -145 and 192 for changes
-- ### START DIAL D ### Day Numbers Dial ###
-- See Lines 226 & 257 for changes
-- ### START CLOCK A ###
-- See Lines & and 456 & 483 changes
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
-- CLOCK A HOUR HAND
-- CLOCK A MINUTE HAND SETUP
-- CLOCK A SECOND HAND SETUP
-- PART SECOND HAND Lines: 503 519, 531
NOTE: Putting ### CLOCK A ### last insures that it's functions are written
over the other dials.
]]
require 'cairo'
-- ### CLOCK POSITION - AND DEFAULTS ##########################################
local init={
center_x=153, --from 135 = +40
center_y=153, --from 135
radius=140,
lang="English", -- English French Greek Spanish
hour=24, -- 12 | 24
second=true, --true | false - Seconds: dots and numbers IF 12HR
line=true, -- true | false - Part Second Hand
handday=false, -- DAY NAME hand - true or false
--handdaynum=false, -- DAY NUMBER hand - true or false
handmonth=false, -- MONTH NAME hand - true or false
color=0xFF0000, --color for day, day number and month IF NO SECOND HAND
alpha=1 --alpha for day, day number and month IF NO SECOND HAND
}
-- ONLY NEED ONE COPY OF THIS FUNCTION
function rgb_to_r_g_b(col,alp)
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end
local colr, colg, colb, cola=rgb_to_r_g_b(init.color,init.alpha)
function conky_main()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
-- ### CLOCK 12|24 HR SELECTOR ############################
local clock_type_A=init.hour
-- ############################ CLOCK 12|24 HR SELECTOR ###
-- ### SET BORDER OPTIONS FOR "CLOCKS" ####################
--local clock_border_width=0
-- set color and alpha for clock border
--local cbr,cbg,cbb,cba=1,1,1,1 -- full opaque white
-- gap from clock border to minute marks
local b_to_m=0
-- #################### SET BORDER OPTIONS FOR "CLOCKS" ###
-- ### START DIAL B ### Day Names Dial ####################
-- DIAL POSITION
local center_x=init.center_x
local center_y=init.center_y
local radius=42
-- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
-- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Sun","Mon","Tue","Wed","Thr","Fri","Sat",} end
if init.lang == "French" then text_days={"dim","lun","mar","mer","jeu","ven","sam",} end
if init.lang == "Greek" then text_days={"ΔΕΥ","ΤΡΙ","ΤΕΤ","ΠΕΜ","ΠΑΡ","ΣΑΒ","ΚΥΡ",} end
if init.lang == "Spanish" then text_days={"dom","lun","mar","mie","jue","vie","sab",} end
local day_number=tonumber(os.date("%w"))
if init.handday == true then
for i=1,7 do
-- work out points
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
else
for i=1,7 do -- working out points
if day_number == i-1 then
cairo_set_source_rgba (cr,0,1,1,1) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.07) -- non-active day names
end
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=27
for i=1,7 do
if day_number == i-1 then
cairo_set_source_rgba (cr,0,1,1,1) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.07) -- non-active
end
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
-- ######################################### END DIAL B ###
-- ### START DIAL C ### Month Names Dial ##################
-- DIAL POSITION
local center_x=init.center_x --(+85)
local center_y=init.center_y
local radius=73
-- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
-- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",} end
if init.lang == "French" then text_days={"jan","fév","mar","avr","mai","jui","jul","aôu","sep","oct","nov","déc",} end
if init.lang == "Greek" then text_days={"ΙΑΝ","ΦΕΒ","ΜΑΡ","ΑΠΡ","ΜΑΙ","ΙΟΥ","ΙΟΥ","ΑΥΓ","ΣΕΠ","ΟΚΤ","ΝΟΕ","ΔΕΚ",} end
if init.lang == "Spanish" then text_days={"ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",} end
local this_month=tonumber(os.date("%m"))
if init.handmonth == true then
for i=1,12 do
-- OUTER POINTS POSTION FOR -- ### START DIAL C ## TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
else
for i=1,12 do
if this_month == i then
cairo_set_source_rgba (cr,0,1,1,1) -- active month colour
else
cairo_set_source_rgba (cr,1,1,1,0.07) -- non-active month names
end
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=58
for i=1,12 do
if this_month == i then
cairo_set_source_rgba (cr,0,1,1,1) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.07) -- non-active month names
end
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
-- ######################################### END DIAL C ###
-- ### START DIAL D ### Day Numbers Dial ##################
-- GET NUMBER OF DAYS IN CURRENT MONTH
-- calculate Feb, then set up table
year4num=os.date("%Y")
t1=os.time({year=year4num,month=03,day=01,hour=00,min=0,sec=0});
t2=os.time({year=year4num,month=02,day=01,hour=00,min=0,sec=0});
if init.hour == 12 then
febdaynum=tonumber((os.difftime(t1,t2))/(12*60*60))
else
febdaynum=tonumber((os.difftime(t1,t2))/(24*60*60))
end
-- MONTH TABLE to get number of days
monthdays={31,febdaynum,31,30,31,30,31,31,30,31,30,31}
this_month=tonumber(os.date("%m"))
number_days=monthdays[this_month]
-- TEXT positioning DAY #'s
local center_x=init.center_x
local center_y=init.center_y
local radius=105
cairo_select_font_face (cr, "Liquid Crystal", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 20)
local this_day=tonumber(os.date("%d"))
for i=1,number_days do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
--only print even numbers
if math.mod(i, 2) == 0 and math.mod(this_day, 2)==0 then
text=string.format("%02d",i) --formats numbers to double digits
elseif math.mod(i, 2) ~= 0 and math.mod(this_day, 2)~=0 then
text=string.format("%02d",i) --formats numbers to double digits
else
text=""
end --odd even matching
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
if i==this_day then
cairo_set_source_rgba (cr,0,1,1,1) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.35) -- dim inactive numbers
end
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=90
for i=1,number_days do
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
if i==this_day then
cairo_set_source_rgba (cr,0,1,1,1) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.35) -- dim the points
end
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
-- ######################################### END DIAL D ###
-- ### START CLOCK A ######################################
-- SET MARKS ###
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
local number_marks_A=init.hour
-- set mark length
local m_length_A=0 -- doesn't work but can't delete
-- set mark width
local m_width_A=0 -- doesn't work but can't delete
-- set mark line cap type
local m_cap=CAIRO_LINE_CAP_ROUND
-- set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,1,0 -- opaque white -- doesn't work but can't delete
-- SETUP HOUR HANDS ###
-- CLOCK A HOUR HAND
hh_length_A=90
-- set hour hand width
hh_width_A=4
-- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
-- set hour hand color
-- hhr,hhg,hhb,hha=1,0,1,0 -- fully opaque white --doesn't work
-- SETUP MINUTE HANDS ###
-- CLOCK A MINUTE HAND SETUP
-- set length of minute hand
mh_length_A=123
-- set minute hand width
mh_width_A=2
-- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
-- set minute hand color
--mhr,mhg,mhb,mha=1,1,1,0.5 -- fully opaque white --doesn't work
-- SETUP SECOND HAND ###
-- CLOCK A SECOND HAND SETUP -- DOESN'T WORK - Why ???????????????????????????
-- set length of seconds hand -- yes I know it is commented out!
--sh_length_A=150
-- set hour hand width
--sh_width_A=2
-- set hour hand line cap
--sh_cap=CAIRO_LINE_CAP_ROUND
-- set seconds hand color
--shr,shg,shb,sha=1,0,0,1 -- fully opaque red
-- PART SECOND HAND
--position
--get seconds value
local seconds=tonumber(os.date("%S"))
--calculate rotation of second hand in degrees
if init.line == true then
local arc=(math.pi/180)*((360/60)*seconds)
--calculate point 1
local radius1=120
local x1=0+radius1*math.sin(arc)
local y1=0-radius1*math.cos(arc)
--calculate point 2
local radius2=130
local x2=0+radius2*math.sin(arc)
local y2=0-radius2*math.cos(arc)
--draw line connecting points
cairo_move_to (cr, center_x+x1,center_y+y1)
cairo_line_to (cr, center_x+x2, center_y+y2)
cairo_set_source_rgba (cr,255/255,0/255,0/255,1) -- PART SECOND HAND
cairo_stroke (cr)
end
-- CLOCK A ### 12 HR TIME ###
-- CLOCK SETTINGS
clock_radius=0 --does not work
clock_centerx=init.center_x -- centre of Clock hands
clock_centery=init.center_y -- centre of Clock hands
-- DRAWING CODE
-- DRAW MARKS
-- stuff that can be moved outside of the loop, needs only be set once
-- calculate end and start radius for marks
m_end_rad=clock_radius-b_to_m
m_start_rad=m_end_rad-m_length_A -- WHAT IS THIS??
-- set line cap type
cairo_set_line_cap (cr, m_cap)
-- set line width
cairo_set_line_width (cr,m_width_A)
-- set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
-- START LOOP FOR HOUR MARKS
for i=1,number_marks_A do
-- drawing code using the value of i to calculate degrees
-- calculate start point for 12/24 hour mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set start point for line
cairo_move_to (cr,clock_centerx+x,clock_centery+y)
-- calculate end point for 12/24 hour mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set path for line
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- draw the line
cairo_stroke (cr)
end -- of for loop
-- HOUR MARKS -- ???????????????????????????????????????????????????????????????
-- TIME CALCULATIONS CLOCK A
if clock_type_A==12 then
hours=tonumber(os.date("%I"))
-- convert hours to seconds
h_to_s=hours*60*60
elseif clock_type_A==24 then
hours=tonumber(os.date("%H"))
-- convert hours to seconds
h_to_s=hours*60*60
end
minutes=tonumber(os.date("%M"))
-- convert minutes to seconds
m_to_s=minutes*60
-- get current seconds
seconds=tonumber(os.date("%S"))
-- DRAW HOUR HAND ###
-- get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
-- calculate degrees for each second
hsec_degs=hsecs*(360/(60*60*clock_type_A)) -- use equation ~ eliminate decimals
-- set radius to calculate hand points
radius=hh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of hour hand
point=(math.pi/180)*hsec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,hh_width_A)
cairo_set_source_rgba (cr,0,1,1,0.7) -- active colour Hour Hand ================
cairo_set_line_cap (cr, hh_cap)
cairo_stroke (cr)
-- DRAW MINUTE HAND
-- get minutes and seconds just as seconds
msecs=m_to_s+seconds
-- calculate degrees for each second
msec_degs=msecs*0.1
-- set radius to calculate hand points
radius=mh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of minute hand
point=(math.pi/180)*msec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,mh_width_A)
cairo_set_source_rgba (cr,0,1,1,0.7) -- active colour Minute Hand ==============
cairo_set_line_cap (cr, mh_cap)
cairo_stroke (cr)
-- ### CLOCK A ###
local center_x=init.center_x -- Centre of the HR / Min Numbers
local center_y=init.center_y -- Centre of the HR / Min Numbers
local radius=init.radius -- 12/24 HR CLOCK Hours/Minutes radius -- seeline 42
cairo_select_font_face (cr, "DS-Digital", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 22)
cairo_set_source_rgba (cr,1,1,1,1.0) -- HR Clock numbers
-- TABLE OF TEXT -- in order
if init.hour == 12 then
text_days={"12","01","02","03","04","05","06","07","08","09","10","11",}
for i=1,12 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_set_source_rgba (cr,1,1,1,1.0) -- colour of HR Numbers
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=124 -- 12 HR Clock
for i=1,12 do
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_set_source_rgba (cr,1,1,1,0.50)
cairo_stroke (cr)
end
end
if init.hour == 24 then
text_days={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23",}
for i=1,24 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/24)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=124 -- 24 HR Clock
for i=1,24 do
local point=(math.pi/180)*((360/24)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_set_source_rgba (cr,1,1,1,0.4)
cairo_stroke (cr)
end
end
-- ############################################################################
-- POSITION FOR TEXT HOUR NUMBERS
if init.hour == 12 and init.second == true then
text_days={"","01","02","03","04","","06","07","08","09","","11","12","13","14","","16","17","18","19","","21","22","23","24","","26","27","28","29","","31","32","33","34","","36","37","38","39","","41","42","43","44","","46","47","48","49","","51","52","53","54","","56","57","58","59","",}
-- INNER POINTS POSITION, radius smaller than text circle
cairo_set_source_rgba (cr,1,1,1,0.07) -- does not work -- settings moved
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
for i=1,60 do
local radius=124 -- dots for seconds Clock A (12 dial)
local point=(math.pi/180)*((360/60)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
if seconds == i-1 then
cairo_set_source_rgba (cr,255/255,0/255,0/255,0.07) -- does not work - settings moved
else
if i-1 == 0 or i-1 == 5 or i-1 == 10 or i-1 == 15 or i-1 == 25 or i-1 == 30 or i-1 == 35 or i-1 == 40 or i-1 == 45 or i-1 == 50 or i-1 == 55 then
cairo_set_source_rgba (cr,0,1,1,1) -- active colour
else
cairo_set_source_rgba (cr,0,1,1,0.0) -- dots for seconds A Clock
end
end
cairo_arc (cr,center_x+x,center_y+y,1/2,0,2*math.pi)
cairo_stroke (cr)
end
radius=radius-3
cairo_set_font_size (cr, 10)
for i=1,60 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/60)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
if seconds == tonumber(text) then
cairo_set_source_rgba (cr,0,1,1,1.0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.15) -- seconds numbers
end
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
end
-- ############################################################################
cairo_stroke (cr)
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end -- end main function
--[[ mrpeachy wrote:
the numbers are drawn using a for loop somewhere, like this
for i=1,12 do
calculate position of number
move_to(x,y)
show_text(i)
end
change it to something like this
for i=1,12 do
calculate position of number
if i==month_number then
move_to(x,y)
show_text(month_number)
else
move_to(x,y)
show_text(i)
end
end ]]
--[[Background originally by londonali1010 (2009)
ability to set any size for background mrpeachy 2011
ability to set variables for bg in conkyrc dk75
the change is that if you set width and/or height to 0
then it assumes the width and/or height of the conky window
so:
Above and After TEXT (requires a composite manager or it blinks!)
lua_load ~/wea_conky/draw_bg.lua
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}
OR Both above TEXT (no composite manager required - no blinking!)
@Mr Peachy
lua_load ~/wea_conky/draw_bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
TEXT
Note
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
See below: 1 2 3 4 5 6 7
${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
covers the whole window and will change if you change the minimum_size setting
1 = 20 corner_radius
2 = 0 x_position
3 = 0 y_position
3 = 0 width
5 = 0 height
6 = 0x000000 color
7 = 0.4 alpha
######### calendar function ##################################################
then to use it, you activate the calendar function BELOW TEXT like this
${lua luacal {settings}}
#${lua luacal {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gh=,gt=,gv=,sd=}}
# x=x position top left
# y=y position top left
# tf=title font, eg "mono" must be in quotes
# tfs=title font size
# tc=title color
# ta=title alpha
# bf=body font, eg "mono" must be in quotes
# bfs=body font size
# bc=body color
# ba=body alpha
# hf=highlight font, eg "mono" must be in quotes
# hfs=highlight font size
# hc=highlight color
# ha=highlight alpha
# sp=spacer, eg " " or sp="0"... 0,1 or 2 spaces can help with positioning of non-monospaced fonts
# gt=gap from title to body
# gh=gap horizontal between columns
# gv=gap vertical between rows
# sd=start day, 0=Sun, 1=Mon
# hstyle = heading style, 0=just days, 1=date insert
# tdf=title date font, eg "mono" must be in quotes
# tdfs=title date font size
# tdc=title date color
# tda=title date alpha
# test line
-- ${lua luacal {x=10,y=100,tf="Purisa",tfs=24,tc=0xf67e16,ta=1,bf="First Order",bfs=26,bc=0xecd32a,ba=1,hf="Purisa",hfs=18,hc=0xf67e16,ha=1,sp=" ",gh=40,gt=25,gv=20,sd=0,hstyle=1,tdf="First Order",tdfs=28,tdc=0xff0000,tda=1}}
]]
require 'cairo'
local cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
-- ###### calendar function ##################################################
function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=,hstyle=,tdf=,tdfs=,tdc=,tda=}
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--############################################################################
if caltab.x==nil then
caltab=loadstring("return" .. caltab)()
end
local cal_x=caltab.x
local cal_y=caltab.y
local tfont=caltab.tf or "mono"
local tfontsize=caltab.tfs or 12
local tc=caltab.tc or 0xffffff
local ta=caltab.ta or 1
local bfont=caltab.bf or "mono"
local bfontsize=caltab.bfs or 12
local bc=caltab.bc or 0xffffff
local ba=caltab.ba or 1
local hfont=caltab.hf or "mono"
local hfontsize=caltab.hfs or 12
local hc=caltab.hc or 0xff0000
local ha=caltab.ha or 1
local spacer=caltab.sp or " "
local gaph=caltab.gh or 20
local gapt=caltab.gt or 15
local gapl=caltab.gv or 15
local sday=caltab.sd or 0
local hstyle=caltab.hstyle or 0
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
--############################################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]=" "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
if hstyle==0 then
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
elseif hstyle==1 then
if tonumber(sday)==0 then
dys={"SU","MO"," "," "," ","FR","SA"}
cairo_text_extents(cr,"MO",extents)
local s=extents.x_advance+gaph
local f=gaph*5
local tdfont=caltab.tdf or "mono"
local tdfontsize=caltab.tdfs or 12
local tdc=caltab.tdc or 0xffffff
local tda=caltab.tda or 1
cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tdfontsize);
local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
local insert=os.date("%b %y")
cairo_text_extents(cr,insert,extents)
local w=extents.x_advance
cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
cairo_show_text (cr,insert)
cairo_stroke (cr)
else
dys={"MO","TU"," "," "," ","SA","SU"}
cairo_text_extents(cr,"TU",extents)
local s=extents.x_advance+gaph
local f=gaph*5
local tdfont=caltab.tdf or "mono"
local tdfontsize=caltab.tdfs or 12
local tdc=caltab.tdc or 0xffffff
local tda=caltab.tda or 1
cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tdfontsize);
local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
local insert=os.date("%b %y")
cairo_text_extents(cr,insert,extents)
local w=extents.x_advance
cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
cairo_show_text (cr,insert)
cairo_stroke (cr)
end
end
--draw calendar titles
for i=1,7 do
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--############################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function#######################################################
##### TEST #####
# killall conky && conky -c ~/.conkyrc.vsido &
# .conkyrc - Edited from various examples across the 'net
# Used by VastOne on #!
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Use Xft?
use_xft yes
xftfont Liberation Mono:bold:size=13.5
xftalpha 0.9
# Update interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area - not required unless you need to FORCE things
#minimum_size 1024 0
#maximum_width 1024
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window yes
own_window_transparent yes
own_window_class conky-semi
#own_window_argb_visual yes
# Stippled borders?
stippled_borders 0
# border margins
# border_inner_margin 0
# border_outer_margin 0
# border_width 1
# Default and border colors
default_color 73AEB4 ## VSIDO Light Blue
color0 7D8C93 ## VSIDO Light Grey
color1 32CD32 ## VSIDO Lime Green
#default_shade_color black
#default_outline_color grey
own_window_colour 000000
# Text alignment, other possible values are commented
alignment top_left
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 0
gap_y 5
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none
### Added
# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off.
short_units yes
# lua_load ~/Conky/LUA/draw-bg.lua
# lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.3
#
TEXT
${image $HOME/images/debian2.png -s 40x40 -p 1,0} ${color}Kernel ${color0}${kernel} ${color}Disk ${color0}${fs_used /} ${color1}/ ${color0}${fs_size /} ${color}Network ${color0}${downspeedgraph eth0 14,100 000000 ff0000} ${upspeedgraph eth0 14,100 000000 00ff00}
${color}CPU ${color0}${if_match ${cpu cpu0} < 10} ${cpu cpu0}${else}${cpu cpu0}${endif}${color1}% \
${color}RAM ${color0}${if_match ${memperc} < 10} ${memperc}${else}${memperc}${endif}${color1}% \
${color0}${mem} ${color1}/ ${color0}${memmax} ${color}SDA ${color0}${execi 5 hddtemp -n /dev/sda}${color1}°${goto 530}${color}Uptime ${color1}${uptime_short}${color}
${color 7D8C93} ${color 7D8C93}${color 73AEB4} ${color 73AEB4}Network${color 7D8C93}
##### TEST #####
# killall conky && conky -c ~/.conkyrc.vsido &
# .conkyrc - Edited from various examples across the 'net
# Used by VastOne on #!
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Use Xft?
use_xft yes
xftfont Liberation Sans:size=15
xftalpha 0.9
#text_buffer_size 2048
## text_buffer_size is not required by this conky:
## Size of the standard text buffer (default is 256 bytes). This buffer is used
## for intermediary text, such as individual lines, output from $exec vars, and
## various other variables. Increasing the size of this buffer can drastically
## reduce Conky's performance, but will allow for more text display per variable.
## The size of this buffer cannot be smaller than the default value of 256 bytes.
##
## The KEY: for more text display per variable.
# Update interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area - not required unless you need to FORCE things
#minimum_size 1024 0
#maximum_width 1024
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
own_window_type normal #desktop - to allow right clicks on the conky.
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window yes
own_window_transparent yes
own_window_class conky-semi
# own_window_argb_visual yes
# Stippled borders?
stippled_borders 0
# border margins
# border_margin 0 ## <<--- defunct now use below
# border_inner_margin 0
# border_outer_margin 0
# border width
# border_width 1 # above you have draw_borders no - this not required
# Default and border colors
default_color 73AEB4 ## VSIDO Light Blue
color0 7D8C93 ## VSIDO Light Grey
color1 32CD32 ## VSIDO Lime Green
#default_shade_color black
#default_outline_color grey
own_window_colour 000000
# Text alignment, other possible values are commented
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 0
gap_y 5
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none
### Added
# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off.
short_units yes
# lua_load ~/Conky/LUA/draw-bg.lua
# lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.3
#
TEXT
${image $HOME/images/debian2.png -s 40x40 -p 1,-1} ${color 7D8C93} ${color 73AEB4}Kernel${color 7D8C93} $kernel ${color 73AEB4} Uptime ${color lime green}${uptime_short} ${color 7D8C93} CPU ${color 73AEB4}${cpu cpu0}% ${color 7D8C93}RAM ${color 73AEB4}${memperc}% ${mem} / ${memmax} ${color 7D8C93} ${color 7D8C93}Disk ${color 73AEB4}${fs_used /}/${fs_size /} ${color 7D8C93}HD${color 73AEB4} ${execi 5 hddtemp -n /dev/sda}° ${color 7D8C93} ${color 7D8C93}${color 73AEB4} ${color 73AEB4}Network${color 7D8C93} ${voffset 3}${downspeedgraph eth0 14,100 000000 ff0000} ${upspeedgraph eth0 14,100 000000 00ff00}
${color white} Hardcoded kernels - original font|size:
${image $HOME/images/debian2.png -s 40x40 -p 1,78} ${color}Kernel ${color0}3.2.0-4-amd64 ${color}Disk ${color0}${fs_used /} ${color1}/ ${color0}${fs_size /} ${color}Network${color0} ${voffset 2}${downspeedgraph eth0 14,100 000000 ff0000} ${upspeedgraph eth0 14,100 000000 00ff00}
${color}CPU ${color0}${if_match ${cpu cpu0} < 10}0${cpu cpu0}${else}${cpu cpu0}${endif}${color1}% \
${color}RAM ${color0}${if_match ${memperc} < 10}0${memperc}${else}${memperc}${endif}${color1}% \
${color0}${mem} ${color1}/ ${color0}${memmax} ${color}SDA${color0} ${execi 5 hddtemp -n /dev/sda}${color1}°${goto 530}${color}Uptime ${color1}${uptime_short}
${image $HOME/images/debian2.png -s 40x40 -p 1,147} ${color}Kernel ${color0}3.6.0-3.dmz.2-liquorix-amd64 ${color}Disk ${color0}${fs_used /} ${color1}/ ${color0}${fs_size /} ${color}Network${color0} ${voffset 2}${downspeedgraph eth0 14,100 000000 ff0000} ${upspeedgraph eth0 14,100 000000 00ff00}
${color}CPU ${color0}${if_match ${cpu cpu0} < 10}0${cpu cpu0}${else}${cpu cpu0}${endif}${color1}% \
${color}RAM ${color0}${if_match ${memperc} < 10}0${memperc}${else}${memperc}${endif}${color1}% \
${color0}${mem} ${color1}/ ${color0}${memmax} ${color}SDA${color0} ${execi 5 hddtemp -n /dev/sda}${color1}°${goto 530}${color}Uptime ${color1}${uptime_short}${color}
${color white} real working code - no "0X%" just padded spaces - still moves around - not mono font:
${image $HOME/images/debian2.png -s 40x40 -p 1,257} ${color}Kernel ${color0}${kernel} ${color}Disk ${color0}${fs_used /} ${color1}/ ${color0}${fs_size /} ${color}Network${color0} ${voffset 2}${downspeedgraph eth0 14,100 000000 ff0000} ${upspeedgraph eth0 14,100 000000 00ff00}
${color}CPU ${color0}${if_match ${cpu cpu0} < 10} ${cpu cpu0}${else}${cpu cpu0}${endif}${color1}% \
${color}RAM ${color0}${if_match ${memperc} < 10} ${memperc}${else}${memperc}${endif}${color1}% \
${color0}${mem} ${color1}/ ${color0}${memmax} ${color}SDA ${color0}${execi 5 hddtemp -n /dev/sda}${color1}°${goto 530}${color}Uptime ${color1}${uptime_short}${color}
${font DejaVu Sans Mono:size=13}${color white} real working code - no "0X%" just padded spaces - DejaVu Sans Mono size 13
${image $HOME/images/debian2.png -s 40x40 -p 1,367} ${color}Kernel ${color0}${kernel} ${color}Disk ${color0}${fs_used /} ${color1}/ ${color0}${fs_size /} ${color}Network${color0} ${voffset 2}${downspeedgraph eth0 14,100 000000 ff0000} ${upspeedgraph eth0 14,100 000000 00ff00}
${color}CPU ${color0}${if_match ${cpu cpu0} < 10} ${cpu cpu0}${else}${cpu cpu0}${endif}${color1}% \
${color}RAM ${color0}${if_match ${memperc} < 10} ${memperc}${else}${memperc}${endif}${color1}% \
${color0}${mem} ${color1}/ ${color0}${memmax} ${color}SDA ${color0}${execi 5 hddtemp -n /dev/sda}${color1}°${goto 530}${color}Uptime ${color1}${uptime_short}${color}
${font Liberation Mono:bold:size=13}${color white} real working code - no "0X%" just padded spaces - Liberation Mono size 13 bold
${image $HOME/images/debian2.png -s 40x40 -p 1,467} ${color}Kernel ${color0}${kernel} ${color}Disk ${color0}${fs_used /} ${color1}/ ${color0}${fs_size /} ${color}Network${color0} ${voffset 2}${downspeedgraph eth0 14,100 000000 ff0000} ${upspeedgraph eth0 14,100 000000 00ff00}
${color}CPU ${color0}${if_match ${cpu cpu0} < 10} ${cpu cpu0}${else}${cpu cpu0}${endif}${color1}% \
${color}RAM ${color0}${if_match ${memperc} < 10} ${memperc}${else}${memperc}${endif}${color1}% \
${color0}${mem} ${color1}/ ${color0}${memmax} ${color}SDA ${color0}${execi 5 hddtemp -n /dev/sda}${color1}°${goto 530}${color}Uptime ${color1}${uptime_short}${color}
${font Liberation Mono:bold:size=13.5}${color white} real working code - no "0X%" just padded spaces - Liberation Mono size 13.5 bold
${image $HOME/images/debian2.png -s 40x40 -p 1,567} ${color}Kernel ${color0}${kernel} ${color}Disk ${color0}${fs_used /} ${color1}/ ${color0}${fs_size /} ${color}Network${color0} ${voffset 2}${downspeedgraph eth0 14,100 000000 ff0000} ${upspeedgraph eth0 14,100 000000 00ff00}
${color}CPU ${color0}${if_match ${cpu cpu0} < 10} ${cpu cpu0}${else}${cpu cpu0}${endif}${color1}% \
${color}RAM ${color0}${if_match ${memperc} < 10} ${memperc}${else}${memperc}${endif}${color1}% \
${color0}${mem} ${color1}/ ${color0}${memmax} ${color}SDA ${color0}${execi 5 hddtemp -n /dev/sda}${color1}°${goto 530}${color}Uptime ${color1}${uptime_short}${color}
minimum_size 160 0 ## width, height
#maximum_width 160 ## width
Quote%x Preferred date representation based on locale, without the time Example: 02/05/09 for February 5, 2009as you see in the image above, mine is 26/12/12 = 26 December 2012 as set by my LOCALE settings system wide
Quote%X Preferred time representation based on locale, without the date Example: 03:59:16 or 15:59:16Mine shows 03:37:20 PM as Argentina doesn't use 24HR time "officially" (so my local conky uses %T =24HR)
# CPU 1:${alignr 5}${cpu cpu1}%
# CPU 2:${alignr 5}${cpu cpu2}%
# CPU 3:${alignr 5}${cpu cpu3}%
# CPU 4:${alignr 5}${cpu cpu4}%
# CPU Avg:${alignr 5}${cpu cpu0}%
CPU:${alignr 5}${cpu cpu0}%
# killall conky && conky &
## VSIDO Default conky
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_colour gray
own_window_class Conky
own_window_title VSIDO Default 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 255
minimum_size 160 0 ## width, height
#maximum_width 160 ## width
gap_x 10 # left-right
gap_y 0 # up-down
alignment middle_right
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Monofont:bold:size=9
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
draw_shades no
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
default_shade_color gray
default_outline_color black
default_color DCDCDC #220 220 220 Gainsboro
color0 8FBC8F #143 188 143 DarkSeaGreen
color1 778899 #119 136 153 LightSlateGray
color2 FF8C00 #255 140 0 DarkOrange
color3 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 1
# graph borders
draw_graph_borders 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
0
# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 1028
# 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 ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load ~/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 15 0 0 0 0 0x000000 0.5
# lua_draw_hook_post draw-bg 125 0 0 0 0 0x000000 0.01
#
# TEXT
#
####################################################### End LUA Settings ###
update_interval 1
TEXT
${lua conky_draw_bg 15 0 0 0 0 0x000000 0.5}${image $HOME/Conky/images/VSIDO_Logo.png -s 60x60 -p 0,0}\
${alignr 5}${time %X}
${alignr 5}${time %x}
${alignr 5}${uptime_short}
${hr}
${alignc}${kernel}
${hr}
Host:${alignr 5}${nodename}
RAM:${alignr 5}${mem} / ${memmax}
Swap:${alignr 5}${swap} / ${swapmax}
Disk:${alignr 5}${fs_used /} / ${fs_size /}
# CPU 1:${alignr 5}${cpu cpu1}%
# CPU 2:${alignr 5}${cpu cpu2}%
# CPU 3:${alignr 5}${cpu cpu3}%
# CPU 4:${alignr 5}${cpu cpu4}%
# CPU Avg:${alignr 5}${cpu cpu0}%
CPU:${alignr 5}${cpu cpu0}%
/Root: ${fs_size /}${alignr 5}${fs_used_perc /}%${color}
/Home: ${fs_size /home}${alignr 5}${fs_used_perc /home}%
DISK ${hr}
Read:${alignr 5}${diskio_read /dev/sda}
Write:${alignr 5}${diskio_write /dev/sda}
NETWORK ${hr}
${alignc}${downspeedgraph eth0 14,140 000000 ff0000}
Down:${alignr 5}${downspeedf eth0}
${alignc}${upspeedgraph eth0 14,140 000000 00ff00}
Up:${alignr 5}${upspeedf eth0}
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_colour white
own_window_class Conky
own_window_title Chronograph TEST
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 5
minimum_size 275 675 ## width, height
maximum_width 275 ## width
gap_x 10
gap_y 40
# tl, tm, tr
# ml, mm, mr
# bl, bm, br
alignment tl
#alignment top_middle
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont CorporateMonoExtraBold:size=9
xftfont monofur:bold:size=14
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
draw_shades no
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
color1 000000 ## Black
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 yes #no
#default_graph_size 15 40
background yes
use_spacer none
text_buffer_size 256
no_buffers yes
short_units yes
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0
# 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
####### Load Lua #########
lua_load ~/Conky/s11_clock.lua
lua_draw_hook_post main
lua_load ~/Conky/rings.lua
lua_draw_hook_pre main_rings
############################## End LUA ###
TEXT
${voffset 12}${goto 127}${font BlackChancery:bold:size=15}${color1}${platform f71882fg.656 temp 1}${font BlackChancery:bold:size=15}F
${voffset -8}${goto 95}${font BlackChancery:bold:size=25}${color1}1${goto 181}2
${voffset -11}${goto 115}${font BlackChancery:bold:size=15}${color1}CPU
${voffset -4}${goto 93}${font BlackChancery:bold:size=25}${color1}3${goto 179}4
${voffset -10}${goto 127}${font BlackChancery:bold:size=20}${color1}${cpu cpu0}%
${voffset 20}${goto 110}${font BlackChancery:bold:size=15}${color1}RAM
${voffset -7}${goto 90}${font BlackChancery:bold:size=12}${mem}${goto 140}/ ${memmax}${voffset 7}
${goto 110}${font BlackChancery:bold:size=15}${color1}SWAP
${voffset -7}${goto 90}${font BlackChancery:bold:size=12}${swap}${goto 140}/ ${swapmax}
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_colour white
own_window_class Conky
own_window_title Chronograph TEST
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 5
minimum_size 275 1100 ## width, height
maximum_width 275 ## width
gap_x -165
gap_y 25
### alignment values or top_left, bottom_right, etc
# tl, tm, tr
# ml, mm, mr
# bl, bm, br
#alignment tl
alignment top_middle
use_xft yes
xftfont monofur:bold:size=14
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
draw_shades no
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
color1 000000 ## Black
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 yes #no
#default_graph_size 15 40
background yes
use_spacer none
text_buffer_size 256
no_buffers yes
short_units yes
pad_percents 2
format_human_readable yes
short_units yes
imlib_cache_size 0
temperature_unit Fahrenheit
update_interval 1
### Load Lua ###########################################################
lua_load ~/Conky/rings_2.lua
lua_draw_hook_pre main_rings
############################## End LUA Settings ###
TEXT
#${lua conky_draw_bg 132 3 3 264 264 0x000000 0.5}
#${lua conky_draw_bg 98 37 37 196 196 0xFFFFFF 0.2}
#${lua conky_draw_bg 68 67 67 136 136 0x000000 0.4}
#${lua conky_draw_bg 35 100 100 70 70 0x000000 0.3}
${voffset 10}${goto 150}${font BlackChancery:bold:size=15}${color1}/root
${voffset -10}${goto 125}${font BlackChancery:size=10}Used ${goto 190}${fs_used /}
${goto 125}Size ${goto 190}${fs_size /}
${goto 145}${font BlackChancery:bold:size=15}${color1}/home
${voffset -10}${goto 125}${font BlackChancery:size=10}Used ${goto 190}${fs_used /home}
${goto 125} Size${goto 190}${fs_size /home}
${goto 132}${font BlackChancery:bold:size=15}${color1}External
${voffset -5}${goto 122}${font BlackChancery:size=12}Used ${goto 190}${fs_used /media/external}
${goto 122}Size${goto 190}${fs_size /media/external}
${goto 138}${font BlackChancery:bold:size=15}${color1}Videos
${voffset -5}${goto 122}${font BlackChancery:size=12}Used ${goto 190}${fs_used /media/sdb1}
${goto 122}Size${goto 190}${fs_size /media/sdb1}
${goto 148}${font BlackChancery:size=20}${hddtemp /dev/sdb}F
${voffset -9}${goto 128}${font BlackChancery:bold:size=15}${color1}Software
${voffset -5}${goto 122}${font BlackChancery:size=12}Used ${goto 190}${fs_used /media/sdd1}
${goto 122}Size${goto 190}${fs_size /media/sdd1}
${goto 148}${font BlackChancery:size=20}${hddtemp /dev/sdd}F
${voffset -15}${goto 134}${font BlackChancery:bold:size=15}${color1}Storage
${voffset -5}${goto 122}${font BlackChancery:size=12}Used ${goto 190}${fs_used /media/storage}
${goto 122}Size${goto 190}${fs_size /media/storage}
${goto 148}${font BlackChancery:size=20}${hddtemp /dev/sdc}F
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
use_spacer yes
use_xft yes
# Update interval in seconds
update_interval 3
# Minimum size of text area
minimum_size 1100 200
maximum_width 1100
override_utf8_locale yes
# Draw shades?
draw_shades yes
# Text stuff
draw_outline yes # amplifies text if yes
draw_borders no
#font
xftfont Arial:size=9
uppercase no # set to yes if you want all text to be in uppercase
# Stippled borders?
stippled_borders 3
# border margins
border_margin 9
# border width
border_width 10
# Default colors and also border colors, grey90 == #e5e5e5
default_color cbcbcb
own_window_colour brown
own_window_transparent yes
# Text alignment, other possible values are commented
#alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
alignment top_middle
# Gap between borders of screen and text
gap_x -965
gap_y 30
imlib_cache_size 0
TEXT
${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 0,70 -s 180x108}
${font BlackChancery:bold:size=15}${execpi 600 sed -n '3p' $HOME/Accuweather_Conky_USA_Images/curr_cond}${font BlackChancery:bold:size=12}${goto 525}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/tod_ton} ${goto 750}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/tod_ton} ${goto 975} ${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${font BlackChancery:bold:size=10}
${goto 200}TEMP:$color${goto 325}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F (${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F)
${goto 200}WIND:$color${goto 325}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/curr_cond} ${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}HUM:$color${goto 325}${execpi 600 sed -n '7p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}DEW:$color${goto 325}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}SUNRISE:$color${goto 325}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}SUNSET:$color${goto 325}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${image $HOME/Accuweather_Conky_USA_Images/7.png -p 480,50 -s 180x108}
${image $HOME/Accuweather_Conky_USA_Images/12.png -p 705,50 -s 180x108}
${image $HOME/Accuweather_Conky_USA_Images/17.png -p 930,50 -s 180x108}
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_colour white
own_window_class Conky
own_window_title Chronograph TEST
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 5
minimum_size 270 260 ## width, height
maximum_width 270 ## width
gap_x 20
gap_y 20
# tl, tm, tr
# ml, mm, mr
# bl, bm, br
alignment tl
#alignment top_left
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont CorporateMonoExtraBold:size=9
xftfont monofur:bold:size=14
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
draw_shades no
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
color1 000000 ## Black
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 yes #no
#default_graph_size 15 40
background yes
use_spacer none
text_buffer_size 256
no_buffers yes
short_units yes
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0
# 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
####### Load Lua #########
lua_load ~/Conky/s11_clock.lua
lua_draw_hook_pre main
#lua_load ~/Conky/rings.lua
#lua_draw_hook_pre main_rings
############################## End LUA ###
TEXT
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_colour red
own_window_class Conky
own_window_title Chronograph TEST
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 5
minimum_size 530 300 ## width, height
maximum_width 530 ## width
gap_x 10
gap_y 150
# tl, tm, tr
# ml, mm, mr
# bl, bm, br
alignment bl
#alignment top_left
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont CorporateMonoExtraBold:size=9
xftfont WhiteRabbit:bold:size=20
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
draw_shades no
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
color1 000000 ## Black
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 yes #no
#default_graph_size 15 40
background yes
use_spacer none
text_buffer_size 256
no_buffers yes
short_units yes
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0
# 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
####### Load Lua #########
##load script
lua_load ~/Conky/mounted.lua
lua_load ~/Conky/allcombined_2.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type text_length}, where partition number is a number
## text_length is optional, lets you specify the max number of characters the function returns. only affects fsys and mount data options
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
############################## End LUA ###
TEXT
${lua get_mounted_data 10}${lua mount 1 fsys}${goto 175}${lua mount 1 size}${goto 275}${lua mount 1 use%}${goto 375}${lua mount 1 mount 10}
${lua gradbar {2,45,"${fs_used_perc /}",100,74,5,10,1,0xFFFFFF,.1,0xFFFFFF,.5,0x3366CC,.85,0x0000CC,1}}
${lua mount 7 fsys}${goto 175}${lua mount 7 size}${goto 275}${lua mount 7 use%}${goto 375}${lua mount 7 mount 10}
${lua gradbar
{2,106,"${fs_used_perc /home}",100,74,5,10,1,0xFFFFFF,.1,0xFFFFFF,.5,0x3366CC,.85,0x0000CC,1}}
${lua mount 2 fsys}${goto 175}${lua mount 2 size}${goto 275}${lua mount 2 use%}${goto 375}${lua mount 2 mount 10}
${lua gradbar {2,168,"${fs_used_perc /media/External}",100,74,5,10,1,0xFFFFFF,.1,0xFFFFFF,.5,0x3366CC,.85,0x0000CC,1}}
${lua mount 3 fsys}${goto 175}${lua mount 3 size}${goto 275}${lua mount 3 use%}${goto 375}${lua mount 3 mount 10}
${lua gradbar {2,230,"${fs_used_perc /media/sda5}",100,74,5,10,1,0xFFFFFF,.1,0xFFFFFF,.5,0x3366CC,.85,0x0000CC,1}}
${lua mount 4 fsys}${goto 175}${lua mount 4 size}${goto 275}${lua mount 4 use%}${goto 375}${lua mount 4 mount 10}
${lua gradbar {2,293,"${fs_used_perc /media/sdb5}",100,74,5,10,1,0xFFFFFF,.1,0xFFFFFF,.5,0x3366CC,.85,0x0000CC,1}}
${lua mount 5 fsys}${goto 175}${lua mount 5 size}${goto 275}${lua mount 5 use%}${goto 375}${lua mount 5 mount 10}
${lua gradbar {2,355,"${fs_used_perc /media/storage}",100,74,5,10,1,0xFFFFFF,.1,0xFFFFFF,.5,0x3366CC,.85,0x0000CC,1}}
${lua mount 6 fsys}${goto 175}${lua mount 6 size}${goto 275}${lua mount 6 use%}${goto 375}${lua mount 6 mount 10}
${lua gradbar {2,420,"${fs_used_perc /}",100,74,5,10,1,0xFFFFFF,.1,0xFFFFFF,.5,0x3366CC,.85,0x0000CC,1}}
background yes
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
double_buffer yes
no_buffers yes
text_buffer_size 2048
gap_x 10
gap_y 0
minimum_size 285 800
#maximum_width 190
own_window yes
own_window_type conky
own_window_transparent yes
#own_window_argb_visual
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment ml
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
temperature_unit fahrenheit
override_utf8_locale yes
use_xft yes
xftfont 6x10:size=8
xftalpha 0.5
uppercase no
default_color FFFFFF
color1 660000
color2 AAAAAA
color3 DDDDDD
color4 CC3333
## Lua ##
lua_load /home/luke/Conky/allcombined_2.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
TEXT
${goto 0}${color1}${font Pseudo APL:size=14,weight:bold}Motherboard ${goto 240}${hwmon temp 1}F
${goto 5}${color}${font Pseudo APL:size=11,weight:normal}${execi 1000 cat /sys/class/dmi/id/board_vendor} ${execi 1000 cat /sys/class/dmi/id/board_name}
${lua gradbar {5,55,"${hwmon temp 1}",210,150,1,17,1,0xFFFFFF,.1,0xFFFFFF,.5,0xFF3333,.85,0x990000,1}}
${voffset 5}
${goto 0}${color1}${font Pseudo APL:size=14,weight:bold}CPU${goto 240}${platform coretemp.0 temp 2}F
${goto 5}${color}${font Pseudo APL:size=11,weight:normal}${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //' | sort -u | cut -c1-60}
${lua gradbar {5,136,"${platform coretemp.0 temp 2}",220,150,1,17,1,0xFFFFFF,.1,0xFFFFFF,.5,0xFF3333,.85,0x990000,1}}
${voffset 5}
${goto 13}${color}${font Pseudo APL:size=11,weight:normal}CPU1 ${cpu cpu1}% CPU2 ${cpu cpu2}% CPU3 ${cpu cpu3} CPU4 ${cpu cpu4}%
${lua gradbar {5,190,"${cpu cpu1}",100,150,1,17,1,0xFFFFFF,.1,0xFFFFFF,.5,0xFF3333,.85,0x990000,1}}
${voffset 5}
${goto 0}${color1}${font Pseudo APL:size=14,weight:bold}Memory
${goto 5}${color}${font Pseudo APL:size=11,weight:normal}Total:${execi 1000 free -tm | grep -i mem |gawk '{ print $2}'}MB - Used: $mem - Free: $memfree
${lua gradbar {5,271,"${memperc}",100,150,1,17,1,0xFFFFFF,.1,0xFFFFFF,.5,0xFF3333,.85,0x990000,1}}
${voffset 3}
${goto 5}${color}${font Pseudo APL:size=11,weight:normal}Total:${execi 1000 free -tm | grep -i swap |gawk '{ print $2}'}MB - Used: $swap - Free: $swapfree
${lua gradbar {5,325,"${swapperc}",100,150,1,17,1,0xFFFFFF,.1,0xFFFFFF,.5,0xFF3333,.85,0x990000,1}}
${voffset 5}
${goto 0}${color1}${font Pseudo APL:size=14,weight:bold}Graphic Card${goto 240} ${hwmon 2 temp 1}F
${goto 5}${color}${font Pseudo APL:size=11,weight:normal}ATI XT Mobility Radeon HD 5870 1GB GDDR5
${lua gradbar {5,400,"${hwmon 2 temp 1}",200,150,1,17,1,0xFFFFFF,.1,0xFFFFFF,.5,0xFF3333,.85,0x990000,1}}
${voffset 0}
${goto 0}${color1}${font Pseudo APL:size=14,weight:bold}Network
${goto 5}${color}${font Pseudo APL:size=11,weight:normal}Intel Centrino Advanced-N + WiMAX 6250
${goto 5}${color}${font Pseudo APL:size=11,weight:normal}SSID: ${wireless_essid wlan0} ${goto 240}Speed: ${wireless_bitrate wlan0}
${goto 5}Mode: ${wireless_mode wlan0} ${goto 240}Quality: ${wireless_link_qual_perc wlan0}%
${goto 5}Down: ${downspeed wlan0} ${goto 240}Up: ${upspeed wlan0}
${goto 5}Total Down: ${totaldown wlan0}${goto 240}Total Up: ${totalup wlan0}
$${voffset -5}
${goto 5}${downspeedgraph wlan0 25,160 FFFFFF 990000}${goto 240}${upspeedgraph wlan0 25,160 FFFFFF 990000}
${goto 0}${color1}${font Pseudo APL:size=14,weight:bold}Storage${goto 240}${hddtemp /dev/sda}F
${goto 5}${color}${font Pseudo APL:size=11,weight:normal}500GB Seagate Momentus XT Hybrid @ 7200rpm
${goto 5}${color}${font Pseudo APL:size=11,weight:normal}/root${goto 240}${fs_size /}
${lua gradbar {5,656,"${fs_used_perc /}",100,150,1,17,1,0xFFFFFF,.1,0xFFFFFF,.5,0xFF3333,.85,0x990000,1}}
${voffset 8}${goto 5}${font Pseudo APL:size=11,weight:normal}${color}Used${goto 150}${fs_used /}
${goto 5}${font Pseudo APL:size=11,weight:normal}${color}Free${goto 150}${fs_free /}
${voffset 5}${goto 5}${color}${font Pseudo APL:size=11,weight:normal}/home${goto 240}${fs_size /home}
${lua gradbar {5,740,"${fs_used_perc /home}",100,150,1,17,1,0xFFFFFF,.1,0xFFFFFF,.5,0xFF3333,.85,0x990000,1}}
${voffset 8}${goto 5}${font Pseudo APL:size=11,weight:normal}${color}Used${goto 150}${fs_used /home}
${goto 5}${font Pseudo APL:size=11,weight:normal}${color}Free${goto 150}${fs_free /home}
# -- Conky settings -- #
#background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
double_buffer yes
no_buffers yes
text_buffer_size 2048
imlib_cache_size 0
# -- Window specifications -- #
own_window_class Conky
own_window yes
own_window_type desktop
own_window_argb_visual yes
own_window_argb_value 180
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
border_inner_margin 0
border_outer_margin 0
minimum_size 350 300
maximum_width 350
alignment tr
gap_x 10
gap_y 10
# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# -- Text settings -- #
use_xft yes
xftfont Ubuntu:size=9
xftalpha 1
uppercase no
default_color FFFFFF
# -- Lua Load -- #
lua_load ~/Conky/rings.lua
lua_draw_hook_pre clock_rings
lua_load ~/Conky/marks.lua
lua_draw_hook_post main
TEXT
${image ~/images/orb_red.png -s 150x150 -p 130,80}
${font Pseudo APL:size=13}${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p -15,290 -s 210x128}
${font Pseudo APL:size=13}${goto 165}TEMP${alignr 3}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F (${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F)
${goto 165}WIND${alignr 3}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/curr_cond} ${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 165}HUM${alignr 3}${execpi 600 sed -n '7p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}PRESS${alignr 3}${execpi 600 sed -n '8p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}CLOUD COVER${alignr 3}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}UV INDEX${alignr 10}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 165}DEW POINT${alignr 3}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}CEILING${alignr 3}${execpi 600 sed -n '12p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}VISIB.${alignr 3}${execpi 600 sed -n '13p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}SUNRISE${alignr 3}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}SUNSET${alignr 3}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${font WhiteRabbit:size=15}Current Weather ${alignr 3}${execpi 600 sed -n '3p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${font Pseudo APL:size=13}${goto 20}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 140}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 255}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/tod_ton}
${voffset -12}${font Pseudo APL:size=10}${goto 100}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${font Pseudo APL:size=10}${goto 100}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${image $HOME/Accuweather_Conky_USA_Images/7.png -p 10,430 -s 95x57}${image $HOME/Accuweather_Conky_USA_Images/12.png -p 125,430 -s 95x57}${image $HOME/Accuweather_Conky_USA_Images/17.png -p 250,430 -s 95x57}
--==============================================================================
-- multi_rings.lua
--
-- author : SLK
-- version : v2011011601
-- license : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================
require 'cairo'
--------------------------------------------------------------------------------
-- clock DATA
-- HOURS
clock_h = {
{
name='time', arg='%H', max_value=12,
x=200, y=150,
graph_radius=140,
graph_thickness=3,
graph_unit_angle=30, graph_unit_thickness=5,
graph_bg_colour=0xffffff, graph_bg_alpha=0.0,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0,
txt_radius=100,
txt_weight=1, txt_size=10.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=0,
graduation_radius=120,
graduation_thickness=10, graduation_mark_thickness=1,
graduation_unit_angle=30,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1,
},
}
-------------------------------------------------------------------------------
-- rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
-------------------------------------------------------------------------------
-- angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
local pos = current_angle + start_angle
return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end
-------------------------------------------------------------------------------
-- draw_clock_ring
-- displays clock
--
function draw_clock_ring(display, data, value)
local max_value = data['max_value']
local x, y = data['x'], data['y']
local graph_radius = data['graph_radius']
local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
local graph_unit_angle = data['graph_unit_angle']
local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
-- background ring
cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi)
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
cairo_set_line_width(display, graph_thickness)
cairo_stroke(display)
-- arc of value
local val = (value % max_value)
local i = 1
while i <= val do
cairo_arc(display, x, y, graph_radius,( ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360) )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2))
cairo_set_source_rgba(display,rgb_to_r_g_b(graph_fg_colour,graph_fg_alpha))
cairo_stroke(display)
i = i + 1
end
local angle = (graph_unit_angle * i) - graph_unit_thickness
-- graduations marks
local graduation_radius = data['graduation_radius']
local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
local graduation_unit_angle = data['graduation_unit_angle']
local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
local nb_graduation = 360 / graduation_unit_angle
local i = 1
while i <= nb_graduation do
cairo_set_line_width(display, graduation_thickness)
cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2))
cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
cairo_stroke(display)
cairo_set_line_width(display, graph_thickness)
i = i + 1
end
end
-- text
local txt_radius = data['txt_radius']
local txt_weight, txt_size = data['txt_weight'], data['txt_size']
local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
local movex = txt_radius * (math.cos((angle * 2 * math.pi / 360)-(math.pi/2)))
local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2)))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight);
cairo_set_font_size (display, txt_size);
cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha));
cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3);
cairo_show_text (display, value);
cairo_stroke (display);
end
-------------------------------------------------------------------------------
-- draw_gauge_ring
-- displays gauges
--
function draw_gauge_ring(display, data, value)
local max_value = data['max_value']
local x, y = data['x'], data['y']
local graph_radius = data['graph_radius']
local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
local graph_start_angle = data['graph_start_angle']
local graph_unit_angle = data['graph_unit_angle']
local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha']
local graph_end_angle = (max_value * graph_unit_angle) % 360
-- background ring
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
cairo_set_line_width(display, graph_thickness)
cairo_stroke(display)
-- arc of value
local val = value % (max_value + 1)
local start_arc = 0
local stop_arc = 0
local i = 1
while i <= val do
start_arc = (graph_unit_angle * i) - graph_unit_thickness
stop_arc = (graph_unit_angle * i)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
cairo_stroke(display)
i = i + 1
end
local angle = start_arc
-- hand
start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2)
stop_arc = (graph_unit_angle * val)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
cairo_stroke(display)
-- graduations marks
local graduation_radius = data['graduation_radius']
local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
local graduation_unit_angle = data['graduation_unit_angle']
local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
local nb_graduation = graph_end_angle / graduation_unit_angle
local i = 0
while i < nb_graduation do
cairo_set_line_width(display, graduation_thickness)
start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2)
stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2)
cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
cairo_stroke(display)
cairo_set_line_width(display, graph_thickness)
i = i + 1
end
end
-- text
local txt_radius = data['txt_radius']
local txt_weight, txt_size = data['txt_weight'], data['txt_size']
local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight)
cairo_set_font_size (display, txt_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
cairo_show_text (display, value)
cairo_stroke (display)
-- caption
local caption = data['caption']
local caption_weight, caption_size = data['caption_weight'], data['caption_size']
local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha']
local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight);
cairo_set_font_size (display, caption_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
cairo_move_to (display, x + tox + 5, y + toy + 1)
-- bad hack but not enough time !
if graph_start_angle < 105 then
cairo_move_to (display, x + tox - 30, y + toy + 1)
end
cairo_show_text (display, caption)
cairo_stroke (display)
end
-------------------------------------------------------------------------------
-- go_clock_rings
-- loads data and displays clock
--
function go_clock_rings(display)
local function load_clock_rings(display, data)
local str, value = '', 0
str = string.format('${%s %s}',data['name'], data['arg'])
str = conky_parse(str)
value = tonumber(str)
draw_clock_ring(display, data, value)
end
for i in pairs(clock_h) do
load_clock_rings(display, clock_h[i])
end
end
-------------------------------------------------------------------------------
-- go_gauge_rings
-- loads data and displays gauges
--
function go_gauge_rings(display)
local function load_gauge_rings(display, data)
local str, value = '', 0
str = string.format('${%s %s}',data['name'], data['arg'])
str = conky_parse(str)
value = tonumber(str)
draw_gauge_ring(display, data, value)
end
end
-------------------------------------------------------------------------------
-- MAIN
function conky_main()
if conky_window == nil then
return
end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local display = cairo_create(cs)
local updates = conky_parse('${updates}')
update_num = tonumber(updates)
if update_num > 5 then
go_clock_rings(display)
go_gauge_rings(display)
end
end
--[[
Clock Rings by londonali1010 (2009)
This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.
IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement near the end of the script uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.
To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
lua_load ~/scripts/clock_rings-v1.1.1.lua
lua_draw_hook_pre clock_rings
Changelog:
+ v1.1.1 -- Fixed minor bug that caused the script to crash if conky_parse() returns a nil value (20.10.2009)
+ v1.1 -- Added colour option for clock hands (07.10.2009)
+ v1.0 -- Original release (30.09.2009)
]]
settings_table = {
{
-- Edit this table to customise your rings.
-- You can create more rings simply by adding more elements to settings_table.
-- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
name='time',
-- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
arg='%I.%M',
-- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
max=12,
-- "bg_colour" is the colour of the base ring.
bg_colour=0xFFFFFF,
-- "bg_alpha" is the alpha value of the base ring.
bg_alpha=0,
-- "fg_colour" is the colour of the indicator part of the ring.
fg_colour=0xFFFFFF,
-- "fg_alpha" is the alpha value of the indicator part of the ring.
fg_alpha=0,
-- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
x=175, y=175,
-- "radius" is the radius of the ring.
radius=50,
-- "thickness" is the thickness of the ring, centred around the radius.
thickness=5,
-- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
start_angle=0,
-- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
end_angle=360
},
{
name='time',
arg='%M.%S',
max=60,
bg_colour=0xFFFFFF,
bg_alpha=0,
fg_colour=0xFFFFFF,
fg_alpha=0,
x=175, y=175,
radius=56,
thickness=5,
start_angle=0,
end_angle=360
},
{
name='time',
arg='%S',
max=60,
bg_colour=0xFFFFFF,
bg_alpha=0,
fg_colour=0xFFFFFF,
fg_alpha=0,
x=175, y=175,
radius=62,
thickness=5,
start_angle=0,
end_angle=360
},
}
-- Use these settings to define the origin and extent of your clock.
clock_r=125
-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.
clock_x=200
clock_y=150
-- Colour & alpha of the clock hands
clock_colour=0xFFFFFF
clock_alpha=1
-- Do you want to show the seconds hand?
show_seconds=true
require 'cairo'
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function draw_ring(cr,t,pt)
local w,h=conky_window.width,conky_window.height
local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
local angle_0=sa*(2*math.pi/360)-math.pi/2
local angle_f=ea*(2*math.pi/360)-math.pi/2
local t_arc=t*(angle_f-angle_0)
-- Draw background ring
cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
cairo_set_line_width(cr,ring_w)
cairo_stroke(cr)
-- Draw indicator ring
cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
cairo_stroke(cr)
end
function draw_clock_hands(cr,xc,yc)
local secs,mins,hours,secs_arc,mins_arc,hours_arc
local xh,yh,xm,ym,xs,ys
secs=os.date("%S")
mins=os.date("%M")
hours=os.date("%I")
secs_arc=(2*math.pi/60)*secs
mins_arc=(2*math.pi/60)*mins+secs_arc/60
hours_arc=(2*math.pi/12)*hours+mins_arc/12
-- Draw hour hand
xh=xc+0.7*clock_r*math.sin(hours_arc)
yh=yc-0.7*clock_r*math.cos(hours_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xh,yh)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_line_width(cr,5)
cairo_set_source_rgba(cr,rgb_to_r_g_b(clock_colour,clock_alpha))
cairo_stroke(cr)
-- Draw minute hand
xm=xc+clock_r*math.sin(mins_arc)
ym=yc-clock_r*math.cos(mins_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xm,ym)
cairo_set_line_width(cr,3)
cairo_stroke(cr)
-- Draw seconds hand
if show_seconds then
xs=xc+clock_r*math.sin(secs_arc)
ys=yc-clock_r*math.cos(secs_arc)
cairo_move_to(cr,xc,yc)
cairo_line_to(cr,xs,ys)
cairo_set_line_width(cr,1)
cairo_stroke(cr)
end
end
function conky_clock_rings()
local function setup_rings(cr,pt)
local str=''
local value=0
str=string.format('${%s %s}',pt['name'],pt['arg'])
str=conky_parse(str)
value=tonumber(str)
if value == nil then value = 0 end
pct=value/pt['max']
draw_ring(cr,pct,pt)
end
-- Check that Conky has been running for at least 5s
if conky_window==nil then return end
local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
local cr=cairo_create(cs)
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num>5 then
for i in pairs(settings_table) do
setup_rings(cr,settings_table[i])
end
end
draw_clock_hands(cr,clock_x,clock_y)
end
--[[ by mrpeachy -
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'
function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
function conky_gradbar(bartab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_draw_bg(bgtab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
if w==0 then
w=tonumber(conky_window.width)
end
if h==0 then
h=tonumber(conky_window.height)
end
cairo_set_source_rgba (cr,rgb_to_r_g_b({color,alpha}))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luacal(caltab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--####################################################################################################
local caltab=loadstring("return" .. caltab)()
local cal_x=caltab[1]
local cal_y=caltab[2]
local tfont=caltab[3]
local tfontsize=caltab[4]
local tc=caltab[5]
local ta=caltab[6]
local bfont=caltab[7]
local bfontsize=caltab[8]
local bc=caltab[9]
local ba=caltab[10]
local hfont=caltab[11]
local hfontsize=caltab[12]
local hc=caltab[13]
local ha=caltab[14]
local spacer=caltab[15]
local gaph=caltab[16]
local gapt=caltab[17]
local gapl=caltab[18]
local sday=caltab[19]
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b({tc,ta})
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b({bc,ba})
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b({hc,ha})
--###################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]=" "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
for i=1,7 do
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--#########################################################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luaimage(imtab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
local imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function
function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function
Quote from: Sector11That's one sweet setup Jed. You have yours on one large piece of real estate. Mine is smaller so I build on each Desktop. :DThank you kindly sir! Yes the (I know I shouldn't say it) 1920x1080 res is pretty sweet. One drawback on a laptop though is the smallness of the fonts. Also when I 'borrow' one of you guys' Conkys, there is always so much tweaking to do to make it big enough for my screen! Complain, complain, complain! Is this vsido build awesome or what? Lovin' it!!!
Quote from: VastOneGotta ask, OB or Xfce on that epic layout Jed?Sorry to disappoint guys, but it's Xfce4. I don't realy have anything against OB I just find that Xfce4 seems a little more polished and the ease of use, for me anyway, seems easier to tweak on. OB is really great though, and I have gone to the effort to get it totally tweaked this time as well. On the Conky's I post, if there is an Xfce menu button or logout button in the Tint2 panel, that'll be the giveaway that it's Xfce.
Quote from: falldown on January 15, 2013, 01:44:45 AM
Why thank you guys.. means a lot.
Peachy is the one that writes amazing lua scripts.. I just play with them. :)
--SETTINGS AND PREFERENCES--SETTINGS AND PREFERENCES--SETTINGS AND PREFERENCES
function weather_settings()--#### DO NOT EDIT THIS LINE #################
--#######################################################################
--[[set update interval. update interval is based on conky cycles
if your conkyrc has an update_interval of 1, ie updates every second
then if you enter 60 below, the script will update every 60 seconds
however, if your conkyrc update_interval is 10, then by setting 60 below,
v9000 will update every 600 seconds (10 minutes)]]
local update_interval=1800 --avoid an interval of 1
--get web address by going to the intellicast site and entering your location in the box
--click on "Extended Forecast" to get the necessary address
local web="http://www.intellicast.com/Local/Forecast.aspx?unit=F&location=USMO9688"--insert unit=C& after aspx? for C
--set location of weather images (replace "benjamin" with your own username)
local weathericons="/home/falldown/v9000/additional_files/weathericons_falldown/"
--short conditions setup
--this section allows you to set your own shorter terms to replace the terms foud in conditions
--to use for current: now["conditions_short"], now["conditions_short_caps"], now["conditions_short_lc"]
--to use for forecast: conditions_short[n], conditions_short_caps[n], conditions_short_lc[n]
--ALSO USE THIS TABLE TO ENTER CONDITIONS TRANSLATIONS
con_short={--start of table, put entries below in form eg: ["Thunderstorm"]="T.Strm",
["Wind Early"]="Wnd AM",
["Snow Showers"]="Sn Shws",
["Thunderstorm"]="T.Strm",--remember to put a comma at the end of every entry
["Scattered"]="Scat",
["Few Snow Showers"]="Fw Sn Shws",
["Wind"]="Wnd",
["Showers"]="Shws",
}--this bracket closes the table
--the script is capable of converting between several unit types
--set how many decimal places you want the conversions to show
local decimal_places=1
--some weather data options need to come with their own units attached as they can be NA on occasion
--set here what you want to have for units, or set "" for nothing
--include spaces, if desired, for formatting purposes.
--NOTE ALSO EDIT THESE SETTINGS FOR TRANSLATION PURPOSES
local visibility_unit=" mi"
local wind_mph_unit=" mph"
local wind_km_unit=" kmh"
local wind_kts_unit=" kts"
local ceiling_unit=" ft"
local wind_degrees_unit="°"
--do you want the script to use translation tables?
--set 1 if you want to translate, 0 if not.
--the translation tables are located below
local translate=0
--set alerts on or off, set to 0 so that the script does not check for alerts
--set 1 to check for alerts
local alert_check=1
--#######################################################################
--TRANSLATION TABLES, activate by setting translate=1 above
--use con_short table above to translate weather conditions
--edit units settings above to complete translation
--translate NESW text
neswtext={
S="t_S",
SSW="tsetSSW",
SW="t_SW",
WSW="t_WSW",
W="t_W",
WNW="t_WNW",
NW="t_NW",
NNW="t_NNW",
N="t_N",
NNE="t_NNE",
NE="t_NE",
ENE="t_ENE",
E="t_E",
ESE="t_ESE",
SE="t_SE",
SSE="t_SSE",
}--end of N E S W text table
--translate time suffix
tsuffix={
AM="t_AM",
PM="t_PM",
}--end of time suffix table
--enter translations for uv index text
uvindextext={
["Low"]="t_Low",
["Moderate"]="t_Moderate",
["High"]="t_High",
["Very High"]="t_Very High",--format is different because of the space in the text
["Extreme"]="t_Extreme",
}--end of uv text table
--enter translations for moonpahse
moonphases={
["New"]="t_New",
["Full"]="t_Full",
["First Quarter"]="t_First Quarter",
["Last Quarter"]="t_Last Quarter",
["Waning Gibbous"]="t_Waning Gibbous",
["Waning Crescent"]="t_Waning Crescent",
["Waxing Crescent"]="t_Waxing Crescent",
["Waxing Gibbous"]="t_Waxing Gibbous",
}--end of moon phase table
--enter translations for FULL day names
daynames={
Monday="t_Monday",
Tuesday="t_Tuesday",
Wednesday="t_Wednesday",
Thursday="t_Thursday",
Friday="t_Friday",
Saturday="t_Saturday",
Sunday="t_Sunday",
}--end day names table
--enter translations for SHORT day names
dayshort={
Monday="t_Mon",
Tuesday="t_Tue",
Wednesday="t_Wed",
Thursday="t_Thu",
Friday="t_Fri",
Saturday="t_Sat",
Sunday="t_Sun"
}--end short day names table
--enter translation for FULL month names
monthnames={
January="t_January",
February="t_February",
March="t_March",
April="t_April",
May="t_May",
June="t_June",
July="t_July",
August="t_August",
September="t_September",
October="t_October",
November="t_November",
December="t_December"
}--end of month name translations
--enter translations for SHORT month names
monthshort={
January="t_Jan",
February="t_Feb",
March="t_Mar",
April="t_Apr",
May="t_May",
June="t_Jun",
July="t_Jul",
August="t_Aug",
September="t_Sep",
October="t_Oct",
November="t_Nov",
December="t_Dec"
}--end of short month name translations
--enter some additional translations
additional={
NA="t_NA",
Unl="t_Unl"--for ceiling data option
}--end of additional translations
--END OF TRANSLATION TABLES
--#######################################################################
--NOTE if you make changes to these settings, they will only take effect at the next weather update
--or after killall conky and restart
--#######################################################################
if translate==1 then
return {update_interval,web,weathericons,con_short,decimal_places,visibility_unit,wind_mph_unit,wind_km_unit,wind_kts_unit,ceiling_unit,wind_degrees_unit,translate,alert_check,neswtext,tsuffix,uvindextext,moonphases,daynames,dayshort,monthnames,monthshort,additional}
else
return {update_interval,web,weathericons,con_short,decimal_places,visibility_unit,wind_mph_unit,wind_km_unit,wind_kts_unit,ceiling_unit,wind_degrees_unit,translate,alert_check}
end
end--OF SETTINGS AND PREFERENCES ########################################
--#######################################################################
##############################################
# Settings
##############################################
max_specials 10000
max_user_text 1500000
background no
use_xft yes
#xftfont Sans:size=12
#xftalpha 1
font Mono:size=8
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 230 750
maximum_width 230
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment middle_left
gap_x 10
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
color1 86acad #darker blue
color2 b1c9c9 #lighter blue
text_buffer_size 100000
top_name_width 10
update_interval 1
lua_load /home/falldown/v9000/bargraph.lua
lua_load /home/falldown/v9000/v9000.lua
lua_draw_hook_post weather
lua_load /home/falldown/v9000/config.lua
TEXT
--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION-
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--#######################################################################
--## CALL bargraph.lua ##################################################
function conky_main()
conky_main_bars()
end
--#######################################################################
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="LaudatioC"--font must be in quotes
default_font_size=12
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
--#######################################################################
--background start#######################################################
subtab={
{d="start",x=5.5,y=10.5},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=125},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=65,x=5,y=10,w=200,h=125,grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=5,y=10},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=125},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=80,x=5,y=10,w=200,h=125,grad={{c=0x000000,a=0.35,p=0.0},{c=0xffffff,a=0.35,p=0.71},{c=0xffffff,a=0.35,p=0.73},{c=0xffffff,a=0.35,p=0.75},{c=0x000000,a=0.0,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
subtab={
{d="start",x=5.5,y=165.5},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=5,y=165},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=80,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0.3,p=0.0},{c=0xffffff,a=0.35,p=0.67},{c=0xffffff,a=0.35,p=0.69},{c=0xffffff,a=0.35,p=0.71},{c=0x000000,a=0.2,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=10,y=200},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0.4,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
subtab={
{d="start",x=5.5,y=265.5},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=2,x=5,y=200,w=200,h=90,grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=5,y=265},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=80,x=5,y=200,w=200,h=90,grad={{c=0x000000,a=0.2,p=0.0},{c=0xffffff,a=0.35,p=0.63},{c=0xffffff,a=0.35,p=0.65},{c=0xffffff,a=0.35,p=0.67},{c=0x000000,a=0.3,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=10,y=297},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0.4,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
subtab={
{d="start",x=5.5,y=365.5},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=2,x=5,y=200,w=200,h=90,grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=5,y=365},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=80,x=5,y=200,w=200,h=90,grad={{c=0x000000,a=0.2,p=0.0},{c=0xffffff,a=0.35,p=0.59},{c=0xffffff,a=0.35,p=0.61},{c=0xffffff,a=0.35,p=0.63},{c=0x000000,a=0.3,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=10,y=397},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0.4,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
subtab={
{d="start",x=5.5,y=465.5},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=2,x=5,y=200,w=200,h=90,grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=5,y=465},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=80,x=5,y=200,w=200,h=90,grad={{c=0x000000,a=0.2,p=0.0},{c=0xffffff,a=0.35,p=0.55},{c=0xffffff,a=0.35,p=0.57},{c=0xffffff,a=0.35,p=0.59},{c=0x000000,a=0.3,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=10,y=497},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0.4,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
subtab={
{d="start",x=5.5,y=565.5},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=2,x=5,y=200,w=200,h=90,grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=5,y=565},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=80,x=5,y=200,w=200,h=90,grad={{c=0x000000,a=0.2,p=0.0},{c=0xffffff,a=0.35,p=0.51},{c=0xffffff,a=0.35,p=0.53},{c=0xffffff,a=0.35,p=0.55},{c=0x000000,a=0.3,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=10,y=597},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0.4,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
subtab={
{d="start",x=5.5,y=665.5},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=2,x=5,y=200,w=200,h=90,grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=5,y=665},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=80,x=5,y=200,w=200,h=90,grad={{c=0x000000,a=0.2,p=0.0},{c=0xffffff,a=0.35,p=0.47},{c=0xffffff,a=0.35,p=0.49},{c=0xffffff,a=0.35,p=0.51},{c=0x000000,a=0.3,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=10,y=697},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0.4,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--Background setup end ##################################################
--#######################################################################
--Config start###########################################################
starty=15
gap=15
ypos=0
ypos=starty+ypos
out({c=0xACACAC,a=1,f="LaudatioC",fs=18,x=60,y=ypos+4,txt=conky_parse"${sysname}/debian"})
ypos=gap+ypos
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+6,txt=conky_parse"${kernel}"})
image({x=145,y=37,h=75,w=75,file="/home/falldown/images/vsido-logo-rev4.png"})
--data titles
ypos=gap+ypos
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+10,txt="uptime:"})
ypos=gap+ypos
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+50,txt="MEM:"})
ypos=gap+ypos
ypos=0
ypos=starty+gap+gap+ypos
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=65,y=ypos+10,txt=conky_parse"${uptime}"})
ypos=gap+ypos
--## MEM BARGRAPH #########################################################
num=tonumber(conky_parse("${memperc}"))
--num=100--hard code num to see gradient on full bar
local num_max=100
local bar_ht=12
local crd=0--corner rad
local tht=bar_ht+(2*crd)--total length
local bar_wd=202--length of flat bar top/bottom
local twd=bar_wd+(2*crd)
local tlx=15--top left corner x
local tly=103--top left corner y
local bar=(bar_wd/num_max)*num
--gradient indicator
subtab={
{d="start",x=tlx+crd,y=tly+tht},
{d="rline",x=0,y=bar_ht},
{d="rline",x=200,y=0},
{d="rline",x=0,y=-bar_ht},
}
grec({g=2,x=tlx,y=tly,w=bar+(2*crd),h=tht,grad={{c=0x000000,a=0,p=0},{c=0xffffff,a=1,p=0.94},{c=0xffffff,a=1,p=0.99},{c=0x000000,a=0,p=1}},sub=1,db=0,subtab=subtab})
--######################################################################
--MEM SECTION
ypos=gap+ypos
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=65,y=ypos+66,txt=conky_parse"${mem}/${memmax}"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=65,y=ypos+35,txt=conky_parse"${memperc}%"})
ypos=gap+ypos
--CPU SECTION
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+80,txt="CPU1:"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=130,y=ypos+80,txt="TEMP:"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+132,txt="CPU2:"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=130,y=ypos+132,txt="TEMP:"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=170,y=ypos+80,txt=conky_parse"${hwmon 1 temp 2}°C"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=50,y=ypos+80,txt=conky_parse"${cpu cpu1}%"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=170,y=ypos+132,txt=conky_parse"${hwmon 1 temp 3}°C"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=50,y=ypos+132,txt=conky_parse"${cpu cpu2}%"})
--CPU BARGRAPH ########################################################
num=tonumber(conky_parse("${cpu cpu1}"))
--num=100--hard code num to see gradient on full bar
local num_max=100
local bar_ht=12
local crd=0--corner rad
local tht=bar_ht+(2*crd)--total length
local bar_wd=202--length of flat bar top/bottom
local twd=bar_wd+(2*crd)
local tlx=15--top left corner x
local tly=163--top left corner y
local bar=(bar_wd/num_max)*num
--gradient indicator
subtab={
{d="start",x=tlx+crd,y=tly+tht},
{d="rline",x=0,y=bar_ht},
{d="rline",x=200,y=0},
{d="rline",x=0,y=-bar_ht},
}
grec({g=2,x=tlx,y=tly,w=bar+(2*crd),h=tht,grad={{c=0x000000,a=0,p=0},{c=0xffffff,a=1,p=0.94},{c=0xffffff,a=1,p=0.99},{c=0x000000,a=0,p=1}},sub=1,db=0,subtab=subtab})
num=tonumber(conky_parse("${cpu cpu2}"))
--num=100--hard code num to see gradient on full bar
local num_max=100
local bar_ht=12
local crd=0--corner rad
local tht=bar_ht+(2*crd)--total length
local bar_wd=202--length of flat bar top/bottom
local twd=bar_wd+(2*crd)
local tlx=15--top left corner x
local tly=215--top left corner y
local bar=(bar_wd/num_max)*num
--gradient indicator
subtab={
{d="start",x=tlx+crd,y=tly+tht},
{d="rline",x=0,y=bar_ht},
{d="rline",x=200,y=0},
{d="rline",x=0,y=-bar_ht},
}
grec({g=2,x=tlx,y=tly,w=bar+(2*crd),h=tht,grad={{c=0x000000,a=0,p=0},{c=0xffffff,a=1,p=0.94},{c=0xffffff,a=1,p=0.99},{c=0x000000,a=0,p=1}},sub=1,db=0,subtab=subtab})
--######################################################################
--Net SECTION
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+180,txt="NET UP:"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+233,txt="NET DOWN:"})
--out({c=0xffffff,a=1,f="LaudatioC",fs=14,x=260,y=ypos+180,txt=conky_parse"${memperc}%"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=60,y=ypos+180,txt=conky_parse"${upspeed}"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=85,y=ypos+233,txt=conky_parse"${downspeed}"})
--NET BARGRAPH##########################################################
num=tonumber(conky_parse("${upspeedf}"))
--num=100--hard code num to see gradient on full bar
local num_max=100
local bar_ht=12
local crd=0--corner rad
local tht=bar_ht+(2*crd)--total length
local bar_wd=202--length of flat bar top/bottom
local twd=bar_wd+(2*crd)
local tlx=15--top left corner x
local tly=263--top left corner y
local bar=(bar_wd/num_max)*num
--gradient indicator
subtab={
{d="start",x=tlx+crd,y=tly+tht},
{d="rline",x=0,y=bar_ht},
{d="rline",x=200,y=0},
{d="rline",x=0,y=-bar_ht},
}
grec({g=2,x=tlx,y=tly,w=bar+(2*crd),h=tht,grad={{c=0x000000,a=0,p=0},{c=0xffffff,a=1,p=0.94},{c=0xffffff,a=1,p=0.99},{c=0x000000,a=0,p=1}},sub=1,db=0,subtab=subtab})
num=tonumber(conky_parse("${downspeedf}"))
--num=100--hard code num to see gradient on full bar
local num_max=100
local bar_ht=12
local crd=0--corner rad
local tht=bar_ht+(2*crd)--total length
local bar_wd=202--length of flat bar top/bottom
local twd=bar_wd+(2*crd)
local tlx=15--top left corner x
local tly=317--top left corner y
local bar=(bar_wd/num_max)*num
--gradient indicator
subtab={
{d="start",x=tlx+crd,y=tly+tht},
{d="rline",x=0,y=bar_ht},
{d="rline",x=200,y=0},
{d="rline",x=0,y=-bar_ht},
}
grec({g=2,x=tlx,y=tly,w=bar+(2*crd),h=tht,grad={{c=0x000000,a=0,p=0},{c=0xffffff,a=1,p=0.94},{c=0xffffff,a=1,p=0.99},{c=0x000000,a=0,p=1}},sub=1,db=0,subtab=subtab})
--######################################################################
--Last fm SECTION
image({x=45,y=655,h=48,w=125,file="/home/falldown/v9000/Lastfm/logo1.png"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=75,y=ypos+620,txt="PLAYING"})
out({c=0xffffff,a=1,f="LaudatioC",fs=10,x=10,y=ypos+640,txt=conky_parse"${rss http://ws.audioscrobbler.com/1.0/user/chris-falldown/recenttracks.rss 1 item_titles 1 }"})
--######################################################################
--Time and Date SECTION
out({c=0xffffff,a=1,f="LaudatioC",fs=24,x=55,y=ypos+340,txt=conky_parse"${time %I:%M:%S}"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=24,x=25,y=ypos+295,txt=conky_parse"${time %B %d %Y}"})
--######################################################################
--Weather SECTION
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=35,y=ypos+377,txt=weather_location})
image({x=170,y=475,h=50,w=50,file=now["weather_icon"]})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+390,txt="Conditions:"})
out({c=0xffffff,a=1,f="LaudatioC",fs=14,x=75,y=ypos+390,txt=now["conditions_short"]})
image({x=10,y=498,h=45,w=45,file=now["wind_icon"]})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=55,y=ypos+450,txt=now["wind_mph"]})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=30,y=ypos+405,txt="Temperature:"})
out({c=0xffffff,a=1,f="LaudatioC",fs=14,x=112,y=ypos+405,txt=now["temp"].."°F"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=65,y=ypos+420,txt="Feels Like:"})
out({c=0xffffff,a=1,f="LaudatioC",fs=14,x=130,y=ypos+421,txt=now["temp"].."°F"})
--out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=440,y=ypos-10,txt="Weather for "})
--######################################################################
--NEXT 3 HOUR SECTION
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=60,y=567,txt="NEXT 3 HOURS"})
image({w=30,h=30,x=40,y=570,file=now["fc_hour1_wicon"]})--good
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=10,y=584,txt=now["fc_hour1_time"].." "..now["fc_hour1_ampm"]})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=10,y=595,txt=now["fc_hour1_temp"].."°F"})
image({w=30,h=30,x=115,y=570,file=now["fc_hour2_wicon"]})--good
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=85,y=584,txt=now["fc_hour2_time"].." "..now["fc_hour2_ampm"]})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=85,y=595,txt=now["fc_hour2_temp"].."°F"})
image({w=30,h=30,x=185,y=570,file=now["fc_hour3_wicon"]})--good
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=155,y=584,txt=now["fc_hour3_time"].." "..now["fc_hour3_ampm"]})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=155,y=595,txt=now["fc_hour3_temp"].."°F"})
--ALERTS SECTION
--show alert icon
image({x=5,y=600,h=22,w=22,file=alert_icon})
--show number of alerts
out({x=24,y=618,fs=22,txt=alert_number})
--display alert information
display_alerts=2--set number of alerts to show,set 0 to show all
top_left_alert_x=40--set top left coordinates for entire alerts section
top_left_alert_y=615--^alerts will display in a single column
alert_gap=40--sets the gap between the TOP of one alert and the Top of the next alert
--#######################################################################################################################################
if alert_number==0 then noal=1 elseif alert_number~=0 and display_alerts>alert_number then noal=alert_number else noal=display_alerts end
for i=1,noal do--start of alerts display section. do not edit ###########################################################################
local tlx=top_left_alert_x--write output relative to tlx #################################
local tly=top_left_alert_y+((i-1)*alert_gap)--write output relative to tlx ###############
--########################################################################################
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=tlx,y=tly,txt=alert_type[i]})
out({c=0xffffff,a=1,f="LaudatioC",fs=10,x=tlx,y=tly+15,txt=alert_issued[i]})
--########################################################################################
end--of alert display section ############################################################
--########################################################################################
--#######################################################################
--END OF CODE ----END OF CODE ----END OF CODE ---
--#######################################################################
end--of function do not edit this line ##################################
--#######################################################################
Quote from: Sector11 on January 15, 2013, 08:21:32 PMAnd once Sector11 is done sewing, I'll try it on to see if fits me as well. Love *borrowing* from you guys!!!
I have to thank you too falldown.
I'm going to grab that and take it apart with toothpicks, then I'll grab my MIL's Singer and stitch it back together. Who know, it might work!
Quote from: falldown on January 15, 2013, 08:34:23 PM
:D Load it just as you would v9000.
Quote from: jst_joe on January 15, 2013, 11:35:24 PM
And all this time I thought you were from Monrovia. :o
Quote from: falldown on January 18, 2013, 03:31:16 AM
I am not sure.. The Intellicast show multiple advisories here.. for stagnant air conditions.
I will dig deeper into.
I think that is a word.. :D
subtab={
{d="start",x=5.5,y=10.5},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=125},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=65,x=5,y=10,w=200,h=125,grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=5,y=10},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=125},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=80,x=5,y=10,w=200,h=125,grad={{c=0x000000,a=0.35,p=0.0},{c=0xffffff,a=0.35,p=0.71},{c=0xffffff,a=0.35,p=0.73},{c=0xffffff,a=0.35,p=0.75},{c=0x000000,a=0.0,p=1}},lw=1,sub=1,db=0,subtab=subtab})
{d="arc_c",q=4,r=10,degs=90},
subtab={
{d="start",x=5.5,y=10.5},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=125},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=65,x=5,y=10,w=200,h=125,grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=5,y=10},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=125},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=80,x=5,y=10,w=200,h=125,grad={{c=0x000000,a=0.35,p=0.0},{c=0xffffff,a=0.35,p=0.71},{c=0xffffff,a=0.35,p=0.73},{c=0xffffff,a=0.35,p=0.75},{c=0x000000,a=0.0,p=1}},lw=1,sub=1,db=0,subtab=subtab})
Quote from: incognito on January 18, 2013, 07:15:41 AMHello incognito and welcome to VSIDO! I can't speak for "everyone", but I'd have to say that 99.999% of the users here use VSIDO! Conky comes with VSIDO by default as does Tint2 which you may have seen on some of the configs in the form of panels and or icons. In order to get and install VSIDO, just follow the instructions in the VSIDO Download link at the top of the page. We'd be glad to have you...
I see a lot of amazing work here. I have a couple of questions
Do all of you use VSIDO who has posted here? If so, was there anything else you need to install to run these configurations you are posting? I do not have much experience with Conky but I think I can learn by trying as long as cut copy and paste works and I can get some help if I need it
Thanks
# killall conky && conky -c /media/5/Conky/S11_Disk_Activity.conky &
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
# 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
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_class Conky
own_window_title Disk Activity
### 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 override
# 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 150
minimum_size 270 0 #225 ## width, height
maximum_width 270 ## width, usually a good idea to equal minimum width
gap_x 10 ### left &right
gap_y 10 ### up & down
alignment tl
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont monofur:bold:size=12
#xftfont WenQuanYi Micro Hei Mono:size=8
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
draw_shades no #### <<<<<<------------------To see it easier on light screens.
#default_shade_color black
draw_outline no #### <<<<<<---------------- Amplifies text if yes
default_outline_color black
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
default_shade_color gray
default_outline_color black
default_color DCDCDC #Gainsboro
color0 ffe595 #Teo Gold
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan #48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red #A52A2A #DarkRed
##################################################### 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 yes #no
##################################################### End Borders Secton ###
### Miscellaneous Section ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background no
# 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 256
# 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
## default bar size
default_bar_size 200 20
## Specify a default width and height for graphs.
## Example: 'default_graph_size 0 25'. This is particularly useful for execgraph
## and execigraph as they do not take size arguments
## default_graph_size 220 100
############################################## End Miscellaneous Section ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/dra2w-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load /media/5/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
### mount.lua ##################################################################
#
##instructions
##load script
##lua_load ~/path_to/mounted.lua
#lua_load /media/5/Conky/LUA/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type}, where partition number is a number
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
####################################################### End LUA Settings ###
#digiThe all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1 # in seconds
# stuff after 'TEXT' will be formatted on screen
TEXT
${color3}${alignc}${time %A %d %B %Y}
${color5}${time %T}${alignr 15}${uptime_short}
${alignc}${color3}Hosted by: ${color5}${nodename}
${alignc}${color}${kernel}
${color3} Disk Activity
${goto 10}${diskiograph 50,250 FF0000 0000FF -t -l}${goto 10}${color0}${cpubar cpu4 50,250}${color}\
${voffset -35}${goto 80}SDA: R: ${diskio_read /dev/sda}
${goto 80} W: ${diskio_write /dev/sda}
${voffset 5}${goto 60}${color1}${fs_bar /}${goto 60}${color0}${cpubar cpu4}${color}
${voffset -30}/Root ${fs_size /}${goto 170}Used${goto 220}${fs_used_perc /}%
${goto 60}${color1}${fs_bar_free /}${goto 60}${color0}${cpubar cpu4}${color}
${voffset -30}${goto 170}Free${goto 220}${fs_free_perc /}%
${goto 60}${color1}${fs_bar /home}${goto 60}${color0}${cpubar cpu4}${color}
${voffset -30}/Home ${fs_size /home}${goto 170}Used${goto 220}${fs_used_perc /home}%
${goto 60}${color1}${fs_bar_free /home}${goto 60}${color0}${cpubar cpu4}${color}
${voffset -30}${goto 170}Free${goto 220}${fs_free_perc /home}%
${goto 60}${color1}${fs_bar /media/5}${goto 60}${color0}${cpubar cpu4}${color}
${voffset -30} /M/5 ${fs_size /media/5}${goto 170}Used${goto 220}${fs_used_perc /media/5}%
${goto 60}${color1}${fs_bar_free /media/5}${goto 60}${color0}${cpubar cpu4}${color}
${voffset -30}${goto 170}Free${goto 220}${fs_free_perc /media/5}%
${color6}${hr}
${color3}CPU Frequency:${alignr 10}${color}${freq_g}Ghz
${goto 10}${color5}CPU1\
${voffset -8}${goto 60}${color1}${cpubar cpu1}${color5}${goto 60}${cpugraph cpu1 -t 20,200 FF0000 FFFF00}\
${voffset -12}${goto 70}${color}${if_match ${cpu cpu1}<10} ${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100} ${cpu cpu1}\
${else}${cpu cpu1}${endif}${endif}%
${goto 10}${color5}CPU2\
${voffset -8}${goto 60}${color1}${cpubar cpu2}${color5}${goto 60}${cpugraph cpu2 -t 20,200 FF0000 FFFF00}\
${voffset -12}${goto 70}${color}${if_match ${cpu cpu2}<10} ${cpu cpu2}\
${else}${if_match ${cpu cpu2}<100} ${cpu cpu2}\
${else}${cpu cpu2}${endif}${endif}%
${goto 10}${color5}CPU3\
${voffset -8}${goto 60}${color1}${cpubar cpu3}${color5}${goto 60}${cpugraph cpu3 -t 20,200 FF0000 FFFF00}\
${voffset -12}${goto 70}${color}${if_match ${cpu cpu3}<10} ${cpu cpu3}\
${else}${if_match ${cpu cpu3}<100} ${cpu cpu3}\
${else}${cpu cpu3}${endif}${endif}%
${goto 10}${color5}CPU0\
${voffset -8}${goto 60}${color1}${cpubar cpu0}${color5}${goto 60}${cpugraph cpu0 -t 20,200 FF0000 FFFF00}\
${voffset -12}${goto 70}${color}${if_match ${cpu cpu0}<10} ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%
${color3}RAM: ${color5}${mem}${color3}/${color5}${memmax}${alignr 5}${color3}Swap: ${color5}${swap}${color3}/${color5}${swapmax}
${color3}SDA: ${color7}Read: ${color5}${diskio_read /dev/sda}${goto 160}${color7}Write: ${color5}${diskio_write /dev/sda}
${alignc}${color3}Network speeds for eth0
${color7}Down:${goto 60}${color5}${downspeedf eth0}${goto 125}${color7}Up:${goto 160}${color5}${upspeedf eth0}
${color6}${hr}${color}
Quote from: Sector11 on January 18, 2013, 12:24:33 PM
Heeeerrrrrrrreeeeeees VSIDO Batman
(http://t.imgbox.com/ache4YPA.jpg) (http://imgbox.com/ache4YPA)
Quote from: lwfitz on January 18, 2013, 03:13:46 PM
??? ??? That looks awesome Sector11! WOW!
--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION-
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--#######################################################################
--## CALL bargraph.lua ##################################################
function conky_main()
conky_main_bars()
end
--#######################################################################
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="LaudatioC"--font must be in quotes
default_font_size=12
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
--#######################################################################
--background start#######################################################
subtab={
{d="start",x=10.5,y=15.5},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=203,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=727},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-203,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=2,x=5,y=10,w=210,h=727,grad={{c=0x000000,a=1,p=0},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=5.5,y=10.5},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=725},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=65,x=5,y=10,w=200,h=125,grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=30,y=0},
--{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=185,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=725},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-185,y=0},
--{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=80,x=30,y=0,w=195,h=745,grad={{c=0x000000,a=0,p=0.0},{c=0xffffff,a=0.20,p=0.5},{c=0x000000,a=0,p=1}},lw=1,sub=1,db=0,subtab=subtab})
subtab={
{d="start",x=5,y=10},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=15,y=0},
--{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=745},
--{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-15,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=2,x=5,y=0,w=25,h=745,grad={{c=0xffffff,a=0.2,p=0},{c=0xffffff,a=0.3,p=0.7}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
subtab={
{d="start",x=10,y=200},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
subtab={
{d="start",x=10,y=297},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
subtab={
{d="start",x=10,y=397},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
subtab={
{d="start",x=10,y=497},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
subtab={
{d="start",x=10,y=597},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
subtab={
{d="start",x=10,y=697},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--Background setup end ##################################################
--#######################################################################
--Config start###########################################################
starty=15
gap=15
ypos=0
ypos=starty+ypos
out({c=0xACACAC,a=1,f="LaudatioC",fs=18,x=60,y=ypos+4,txt=conky_parse"${sysname}/debian"})
ypos=gap+ypos
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+6,txt=conky_parse"${kernel}"})
image({x=145,y=37,h=75,w=75,file="/home/falldown/images/vsido-logo-rev4.png"})
--data titles
ypos=gap+ypos
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+10,txt="uptime:"})
ypos=gap+ypos
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+50,txt="MEM:"})
ypos=gap+ypos
ypos=0
ypos=starty+gap+gap+ypos
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=65,y=ypos+10,txt=conky_parse"${uptime}"})
ypos=gap+ypos
--## MEM BARGRAPH #########################################################
num=tonumber(conky_parse("${memperc}"))
--num=100--hard code num to see gradient on full bar
local num_max=100
local bar_ht=12
local crd=0--corner rad
local tht=bar_ht+(2*crd)--total length
local bar_wd=202--length of flat bar top/bottom
local twd=bar_wd+(2*crd)
local tlx=15--top left corner x
local tly=103--top left corner y
local bar=(bar_wd/num_max)*num
--gradient indicator
subtab={
{d="start",x=tlx+crd,y=tly+tht},
{d="rline",x=0,y=bar_ht},
{d="rline",x=200,y=0},
{d="rline",x=0,y=-bar_ht},
}
grec({g=2,x=tlx,y=tly,w=bar+(2*crd),h=tht,grad={{c=0x000000,a=0,p=0},{c=0xffffff,a=1,p=0.94},{c=0xffffff,a=1,p=0.99},{c=0x000000,a=0,p=1}},sub=1,db=0,subtab=subtab})
--######################################################################
--MEM SECTION
ypos=gap+ypos
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=65,y=ypos+66,txt=conky_parse"${mem}/${memmax}"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=65,y=ypos+35,txt=conky_parse"${memperc}%"})
ypos=gap+ypos
--CPU SECTION
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+80,txt="CPU1:"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=130,y=ypos+80,txt="TEMP:"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+132,txt="CPU2:"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=130,y=ypos+132,txt="TEMP:"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=170,y=ypos+80,txt=conky_parse"${hwmon 1 temp 2}°C"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=50,y=ypos+80,txt=conky_parse"${cpu cpu1}%"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=170,y=ypos+132,txt=conky_parse"${hwmon 1 temp 3}°C"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=50,y=ypos+132,txt=conky_parse"${cpu cpu2}%"})
--CPU BARGRAPH ########################################################
num=tonumber(conky_parse("${cpu cpu1}"))
--num=100--hard code num to see gradient on full bar
local num_max=100
local bar_ht=12
local crd=0--corner rad
local tht=bar_ht+(2*crd)--total length
local bar_wd=202--length of flat bar top/bottom
local twd=bar_wd+(2*crd)
local tlx=15--top left corner x
local tly=163--top left corner y
local bar=(bar_wd/num_max)*num
--gradient indicator
subtab={
{d="start",x=tlx+crd,y=tly+tht},
{d="rline",x=0,y=bar_ht},
{d="rline",x=200,y=0},
{d="rline",x=0,y=-bar_ht},
}
grec({g=2,x=tlx,y=tly,w=bar+(2*crd),h=tht,grad={{c=0x000000,a=0,p=0},{c=0xffffff,a=1,p=0.94},{c=0xffffff,a=1,p=0.99},{c=0x000000,a=0,p=1}},sub=1,db=0,subtab=subtab})
num=tonumber(conky_parse("${cpu cpu2}"))
--num=100--hard code num to see gradient on full bar
local num_max=100
local bar_ht=12
local crd=0--corner rad
local tht=bar_ht+(2*crd)--total length
local bar_wd=202--length of flat bar top/bottom
local twd=bar_wd+(2*crd)
local tlx=15--top left corner x
local tly=215--top left corner y
local bar=(bar_wd/num_max)*num
--gradient indicator
subtab={
{d="start",x=tlx+crd,y=tly+tht},
{d="rline",x=0,y=bar_ht},
{d="rline",x=200,y=0},
{d="rline",x=0,y=-bar_ht},
}
grec({g=2,x=tlx,y=tly,w=bar+(2*crd),h=tht,grad={{c=0x000000,a=0,p=0},{c=0xffffff,a=1,p=0.94},{c=0xffffff,a=1,p=0.99},{c=0x000000,a=0,p=1}},sub=1,db=0,subtab=subtab})
--######################################################################
--Net SECTION
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+180,txt="NET UP:"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+233,txt="NET DOWN:"})
--out({c=0xffffff,a=1,f="LaudatioC",fs=14,x=260,y=ypos+180,txt=conky_parse"${memperc}%"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=60,y=ypos+180,txt=conky_parse"${upspeed}"})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=85,y=ypos+233,txt=conky_parse"${downspeed}"})
--NET BARGRAPH##########################################################
num=tonumber(conky_parse("${upspeedf}"))
--num=100--hard code num to see gradient on full bar
local num_max=100
local bar_ht=12
local crd=0--corner rad
local tht=bar_ht+(2*crd)--total length
local bar_wd=202--length of flat bar top/bottom
local twd=bar_wd+(2*crd)
local tlx=15--top left corner x
local tly=263--top left corner y
local bar=(bar_wd/num_max)*num
--gradient indicator
subtab={
{d="start",x=tlx+crd,y=tly+tht},
{d="rline",x=0,y=bar_ht},
{d="rline",x=200,y=0},
{d="rline",x=0,y=-bar_ht},
}
grec({g=2,x=tlx,y=tly,w=bar+(2*crd),h=tht,grad={{c=0x000000,a=0,p=0},{c=0xffffff,a=1,p=0.94},{c=0xffffff,a=1,p=0.99},{c=0x000000,a=0,p=1}},sub=1,db=0,subtab=subtab})
num=tonumber(conky_parse("${downspeedf}"))
--num=100--hard code num to see gradient on full bar
local num_max=100
local bar_ht=12
local crd=0--corner rad
local tht=bar_ht+(2*crd)--total length
local bar_wd=202--length of flat bar top/bottom
local twd=bar_wd+(2*crd)
local tlx=15--top left corner x
local tly=317--top left corner y
local bar=(bar_wd/num_max)*num
--gradient indicator
subtab={
{d="start",x=tlx+crd,y=tly+tht},
{d="rline",x=0,y=bar_ht},
{d="rline",x=200,y=0},
{d="rline",x=0,y=-bar_ht},
}
grec({g=2,x=tlx,y=tly,w=bar+(2*crd),h=tht,grad={{c=0x000000,a=0,p=0},{c=0xffffff,a=1,p=0.94},{c=0xffffff,a=1,p=0.99},{c=0x000000,a=0,p=1}},sub=1,db=0,subtab=subtab})
--######################################################################
--Last fm SECTION
image({x=45,y=655,h=48,w=125,file="/home/falldown/v9000/Lastfm/logo1.png"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=75,y=ypos+620,txt="PLAYING"})
out({c=0xffffff,a=1,f="LaudatioC",fs=10,x=10,y=ypos+640,txt=conky_parse"${rss http://ws.audioscrobbler.com/1.0/user/chris-falldown/recenttracks.rss 1 item_titles 1 }"})
--######################################################################
--Time and Date SECTION
out({c=0xffffff,a=1,f="LaudatioC",fs=24,x=55,y=ypos+340,txt=conky_parse"${time %I:%M:%S}"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=24,x=25,y=ypos+295,txt=conky_parse"${time %B %d %Y}"})
--######################################################################
--Weather SECTION
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=35,y=ypos+377,txt=weather_location})
image({x=170,y=475,h=50,w=50,file=now["weather_icon"]})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=10,y=ypos+390,txt="Conditions:"})
out({c=0xffffff,a=1,f="LaudatioC",fs=14,x=75,y=ypos+390,txt=now["conditions_short"]})
image({x=10,y=498,h=45,w=45,file=now["wind_icon"]})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=55,y=ypos+450,txt=now["wind_mph"]})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=30,y=ypos+405,txt="Temperature:"})
out({c=0xffffff,a=1,f="LaudatioC",fs=14,x=112,y=ypos+405,txt=now["temp"].."°F"})
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=65,y=ypos+420,txt="Feels Like:"})
out({c=0xffffff,a=1,f="LaudatioC",fs=14,x=130,y=ypos+421,txt=now["temp"].."°F"})
--out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=440,y=ypos-10,txt="Weather for "})
--######################################################################
--NEXT 3 HOUR SECTION
out({c=0xACACAC,a=1,f="LaudatioC",fs=12,x=60,y=567,txt="NEXT 3 HOURS"})
image({w=30,h=30,x=40,y=570,file=now["fc_hour1_wicon"]})--good
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=10,y=584,txt=now["fc_hour1_time"].." "..now["fc_hour1_ampm"]})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=10,y=595,txt=now["fc_hour1_temp"].."°F"})
image({w=30,h=30,x=115,y=570,file=now["fc_hour2_wicon"]})--good
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=85,y=584,txt=now["fc_hour2_time"].." "..now["fc_hour2_ampm"]})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=85,y=595,txt=now["fc_hour2_temp"].."°F"})
image({w=30,h=30,x=185,y=570,file=now["fc_hour3_wicon"]})--good
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=155,y=584,txt=now["fc_hour3_time"].." "..now["fc_hour3_ampm"]})
out({c=0xffffff,a=1,f="LaudatioC",fs=12,x=155,y=595,txt=now["fc_hour3_temp"].."°F"})
--ALERTS SECTION
--show alert icon
image({x=5,y=600,h=22,w=22,file=alert_icon})
--show number of alerts
out({x=24,y=618,fs=22,txt=alert_number})
--display alert information
display_alerts=2--set number of alerts to show,set 0 to show all
top_left_alert_x=40--set top left coordinates for entire alerts section
top_left_alert_y=610--^alerts will display in a single column
alert_gap=15--sets the gap between the TOP of one alert and the Top of the next alert
--#######################################################################################################################################
if alert_number==0 then noal=1 elseif alert_number~=0 and display_alerts>alert_number then noal=alert_number else noal=display_alerts end
for i=1,noal do--start of alerts display section. do not edit ###########################################################################
local tlx=top_left_alert_x--write output relative to tlx #################################
local tly=top_left_alert_y+((i-1)*alert_gap)--write output relative to tlx ###############
--########################################################################################
out({c=0xffffff,a=1,f="LaudatioC",fs=10,x=tlx,y=tly,txt=alert_type[i]})
--out({c=0xffffff,a=1,f="LaudatioC",fs=10,x=tlx,y=tly+15,txt=alert_issued[i]})
--########################################################################################
end--of alert display section ############################################################
--########################################################################################
--#######################################################################
--END OF CODE ----END OF CODE ----END OF CODE ---
--#######################################################################
end--of function do not edit this line ##################################
--#######################################################################
subtab={
{d="start",x=10.5,y=15.5},
--######################################################################
--This is the base black box
subtab={
{d="start",x=5.5,y=165.5},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--This is the gradient overlay (transparency)
subtab={
{d="start",x=5,y=165},
{d="arc_c",q=4,r=10,degs=90},
{d="rline",x=200,y=0},
{d="arc_c",q=1,r=10,degs=90},
{d="rline",x=0,y=70},
{d="arc_c",q=2,r=10,degs=90},
{d="rline",x=-200,y=0},
{d="arc_c",q=3,r=10,degs=90},
}
grec({g=5,gan=80,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0.3,p=0.0},{c=0xffffff,a=0.35,p=0.67},{c=0xffffff,a=0.35,p=0.69},{c=0xffffff,a=0.35,p=0.71},{c=0x000000,a=0.2,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--this is the white separator
subtab={
{d="start",x=10,y=200},
{d="rline",x=180,y=0},
{d="rline",x=0,y=1.5},
{d="rline",x=-180,y=0},
}
grec({g=2,x=5,y=155,w=200,h=90,grad={{c=0x000000,a=0.4,p=0.0},{c=0xffffff,a=1,p=0.5},{c=0x000000,a=0.4,p=1}},lw=1,sub=1,db=0,subtab=subtab})
--######################################################################
Quote from: falldown on January 19, 2013, 01:32:33 AMWringing my hands in anticipation!!!
Working on a template for another one of MrPeachy's amazing scripts..
(http://s7.postimage.org/i3s1n68ef/2013_01_18_1358558763_1440x900_scrot.jpg) (http://postimage.org/image/i3s1n68ef/)
This is how the conky will look with the info windows closed.
I just started this so this is what I have completed.
More to come. ;D
Quote from: mrpeachy on January 19, 2013, 03:43:40 AM
Good day Sector11!
Quote from: mrpeachy on January 19, 2013, 03:43:40 AMHey mrpeachy! Good to see you here! Sorry I don't have a quick scrot to post... Conky, Conky, Conky....
Good day Sector11!
${time %T}
Time
====
%H Two digit representation of the hour in 24-hour format 00 through 23
%I Two digit representation of the hour in 12-hour format 01 through 12
%l (lower-case 'L') Hour in 12-hour format, with a space preceeding single digits 1 through 12
%M Two digit representation of the minute 00 through 59
%p UPPER-CASE 'AM' or 'PM' based on the given time Example: AM for 00:31, PM for 22:23
%P lower-case 'am' or 'pm' based on the given time Example: am for 00:31, pm for 22:23
%r Same as "%I:%M:%S %p" Example: 09:34:17 PM for 21:34:17
%R Same as "%H:%M" Example: 00:35 for 12:35 AM, 16:44 for 4:44 PM
%S Two digit representation of the second 00 through 59
%T Same as "%H:%M:%S" Example: 21:34:17 for 09:34:17 PM
%X Preferred time representation based on locale, without the date Example: 03:59:16 or 15:59:16
%z Either the time zone offset from UTC or the abbreviation (depends on operating system) Example: -0500 or EST for Eastern Time
%Z The time zone offset/abbreviation option NOT given by %z (depends on operating system) Example: -0500 or EST for Eastern Time
Day
===
%a An abbreviated textual representation of the day Sun through Sat
%A A full textual representation of the day Sunday through Saturday
%d Two-digit day of the month (with leading zeros) 01 to 31
%e Day of the month, with a space preceding single digits 1 to 31
%j Day of the year, 3 digits with leading zeros 001 to 366
%u ISO-8601 numeric representation of the day of the week 1 (for Monday) though 7 (for Sunday)
%w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)
Month
=====
%b Abbreviated month name, based on the locale Jan through Dec
%B Full month name, based on the locale January through December
%h Abbreviated month name, based on the locale (an alias of %b) Jan through Dec
%m Two digit representation of the month (with leading zeros) 01 to 12
Year
====
%y Two digit representation of the year Example: 09 for 2009, 79 for 1979
%Y Four digit representation for the year Example: 2038
Century
=======
%C Two digit representation of the century (year divided by 100, truncated to an integer) 19 for the 20th
Week
====
%g Two digit representation of the year going by ISO-8601:1988 standards (see Week: %V) Example: 09 for the week of January 6, 2009
%G The full four-digit version of %g Example: 2008 for the week of January 3, 2009
%U Week number of the given year, starting with the first Sunday as the first week
13 (for the 13th full week of the year)
%V ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with Monday being the start of the week 01 through 53 (where 53 accounts for an overlapping week)
%W A numeric representation of the week of the year, starting with the first Monday as the first week 46 (for the 46th week of the year beginning with a Monday)
Time and Date Stamps
====================
%c Preferred date and time stamp based on local Example: Tue Feb 4 00:45:10 2009 for February 4, 2009 at 12:45:10 AM
%D Same as "%m/%d/%y" Example: 02/05/09 for February 5, 2009
%F Same as "%Y-%m-%d" (commonly used in database datestamps) Example: 2009-02-05 for February 5, 2009
%s Unix Epoch Time timestamp (same as the time() function) Example: 305815200 for September 10, 1979 08:40:00 AM
%x Preferred date representation based on locale, without the time Example: 02/05/09 for February 5, 2009
Miscellaneous
=============
%n A newline character ("\n") ---
%t A Tab character ("\t") ---
%% A literal percentage character ("%") ---
Quote from: lwfitz on January 20, 2013, 09:18:27 AMLooks good lwfitz!!
(http://ompldr.org/taDViZQ) (http://ompldr.org/vaDViZQ)
Quote from: falldown on January 20, 2013, 07:21:22 PM
If you like you can go on over to the introductions (http://vsido.org/index.php/board,17.0.html) thread and meet the community.
g=2
grad={{c=0x000000,a=1,p=0},{c=0x000000,a=1,p=1}}
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 355 745
maximum_width 355
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment middle_middle
gap_x 190
gap_y 0
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0
# 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
####### Load Lua #########
lua_load ~/Conky/s11_clock.lua
lua_draw_hook_pre main
lua_load /home/luke/Conky/allcombined.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
############################## End LUA ###
${image ~/Conky/debian_horns.png -s 200x200 -p 85,75}
#${image ~/Conky/vsido_orb_blue.png -s 285x285 -p 25,10}
TEXT
${lua tex_bg {20,0,0,365,750,"/home/luke/Conky/brushed.png"}}${lua draw_bg {20,1,1,365,750,0x000000,1,2,1}}
${font WhiteRabbit:size=13}${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p -5,338 -s 190x165}
${font WhiteRabbit:size=13}${goto 165}TEMP${alignr 3}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F (${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F)
${goto 165}WIND${alignr 6}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/curr_cond} ${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}HUM${alignr 6}${execpi 600 sed -n '7p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}PRESS${alignr 3}${execpi 600 sed -n '8p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}CLOUD COVER${alignr 3}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}UV INDEX${alignr 10}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}DEW POINT${alignr 6}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}CEILING${alignr 3}${execpi 600 sed -n '12p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 200}VISIB.${alignr 3}${execpi 600 sed -n '13p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}SUNRISE${alignr 6}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 165}SUNSET${alignr 6}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${font WhiteRabbit:size=13}${goto 20}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 140}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 255}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/tod_ton}
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${image $HOME/Accuweather_Conky_USA_Images/7.png -p 20,477 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/12.png -p 135,477 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/17.png -p 255,477 -s 80x67}
${font WhiteRabbit:size=13}${goto 20}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 140}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 255}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/last_days}
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${image $HOME/Accuweather_Conky_USA_Images/22.png -p 20,573 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N2.png -p 135,573 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N7.png -p 255,573 -s 80x67}
${font WhiteRabbit:size=13}${goto 20}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 140}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 255}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/last_days}
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 210}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 210}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${image $HOME/Accuweather_Conky_USA_Images/N12.png -p 20,667 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N17.png -p 135,667 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N22.png -p 255,667 -s 80x67}
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 250 525
maximum_width 250
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment middle_left
gap_x 10
gap_y -10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
## Set the path to your script here.
lua_load /home/luke/Conky/allcombined.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
# not for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.5}}
TEXT
${lua tex_bg {20,0,0,260,970,"/home/luke/Conky/brushed.png"}}${lua draw_bg {20,1,1,258,970,0x000000,1,2,1}}${font OpenLogos:size=43} tJ^Jt${font}
${voffset 4}${font Sans:size=10}CPU Average ${lua gradbar {100,67,"${cpu cpu0}",100,33,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu0}%
#${font Sans:normal:size=10}${color1}k${voffset -1}${font}${color2} TEMP ${hwmon 1 temp 1}°C${lua gradbar {90,127,"${hwmon 1 temp 1}",100,50,2,10,1,0xFFFFFF,0.25,0x00FF00,1,0xFFFF00,1,0xFF0000,1}}
${font Sans:size=10}${voffset 1}CPU1 ${lua gradbar {50,82,"${cpu cpu1}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu1}%
${font Sans:size=10}CPU2 ${lua gradbar {50,97,"${cpu cpu2}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu2}%
${font Sans:size=10}CPU3 ${lua gradbar {50,112,"${cpu cpu3}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu3}%
${font Sans:size=10}CPU4 ${lua gradbar {50,127,"${cpu cpu4}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${cpu cpu4}%
${hr 2}
${font Sans:size=10}${voffset 10}RAM${goto 90}${mem}${goto 140} / ${memmax}
${lua gradbar {5,182,"${memperc}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${memperc}%
${font Sans:size=10}SWAP${goto 90}${swap}${goto 140} / ${swapmax}
${lua gradbar {5,213,"${swapperc}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${swapperc}%
${hr 2}
${font Sans:size=10}${voffset 10}/Root${goto 90}${fs_used /}${goto 140} / ${fs_size /}
${lua gradbar {5,267,"${fs_used_perc /}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /}%
${font Sans:size=10}/Home${goto 90}${fs_used /home}${goto 140} / ${fs_size /home}
${lua gradbar {5,298,"${fs_used_perc /home}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /home}%
${font Sans:size=10}External${goto 90}${fs_used /media/External}${goto 140} / ${fs_size /media/External}
${lua gradbar {5,328,"${fs_used_perc /media/External}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/External}%
${font Sans:size=10}Software${goto 90}${fs_used /media/sdd5}${goto 140} / ${fs_size /media/sdd5}
${lua gradbar {5,358,"${fs_used_perc /media/sdd5}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/sdd5}%
${font Sans:size=10}Music${goto 90}${fs_used /media/sda5}${goto 140} / ${fs_size /media/sda5}
${lua gradbar {5,388,"${fs_used_perc /media/sda5}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/sda5}%
${font Sans:size=10}Videos${goto 90}${fs_used /media/sdd1}${goto 140} / ${fs_size /media/sdd1}
${lua gradbar {5,418,"${fs_used_perc /media/sdd1}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/sdd1}%
${font Sans:size=10}Storage${goto 90}${fs_used /media/storage}${goto 140} / ${fs_size /media/storage}
${lua gradbar {5,448,"${fs_used_perc /media/storage}",100,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${fs_used_perc /media/storage}%
${hr 2}
${font Sans:size=10}CPU Temp
${lua gradbar {5,507,"${platform f71882fg.656 temp 1}",190,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 215}${platform f71882fg.656 temp 1}° F
${font Sans:size=10}System Temp
${lua gradbar {5,536,"${platform f71882fg.656 temp 2}",220,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 215}${platform f71882fg.656 temp 2}° F
${font Sans:size=10}GPU Temp
${lua gradbar {5,566,"${nvidia temp}",220,65,2,10,1,0xFFFFFF,0.25,0xFFFFFF,1,0xFFFF00,1,0xFF0000,1}}${goto 215}${nvidia temp}° F
${hr 2}
NAME ${alignr 5} PID CPU MEM
${top name 1} ${alignr 5} ${top pid 1} ${top cpu 1} ${top mem 1}
${top name 2} ${alignr 5} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${alignr 5} ${top pid 3} ${top cpu 3} ${top mem 3}
${top name 4} ${alignr 5} ${top pid 4} ${top cpu 4} ${top mem 4}
${top name 5} ${alignr 5} ${top pid 5} ${top cpu 5} ${top mem 5}
${top name 6} ${alignr 5} ${top pid 6} ${top cpu 6} ${top mem 6}
${top name 7} ${alignr 5} ${top pid 7} ${top cpu 7} ${top mem 7}
${top name 8} ${alignr 5} ${top pid 8} ${top cpu 8} ${top mem 8}
${hr 2}
#${voffset 10}${goto 50}${font Sans:size=22}${time %I:%M %p}
#${lua luacal {100,425,"Sans",10,0x00FF00,1,"Sans",10,0xFFFFF0,1,"Mono",14,0x00FF00,1," ",20,18,16,0}}
#${goto 15}${font Sans:bold:size=12}${time %d}${font}
#${goto 15}${time %B}
#${goto 15}${time %Y}
#${voffset 40}${hr 2}
#${voffset 10}${font Sans:size=10}Connection Type ${goto 220}${gw_iface}
#I.P${goto 173}${addr eth0}
${voffset 8}Down Speed${goto 100}${downspeed eth0} ${goto 175}${voffset -8}${color yellow}${downspeedgraph eth0 20,75}${color}
${voffset 8}Up Speed${goto 100}${upspeed eth0} ${goto 175}${voffset -8}${color yellow}${upspeedgraph eth0 20,75}${color}
Downloads
Today:${alignr 10}${execi 1 vnstat -i eth0 | grep "today" | awk '{print $2 $3}'}
Week:${alignr 5}${execi 1 vnstat -i eth0 -w | grep "current week" | awk '{print $3 $4}'}
Month:${alignr 10}${execi 1 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $3 $4}'}
Uploads
Today: ${alignr 10}${execi 1 vnstat -i eth0 | grep "today" | awk '{print $5 $6}'}
Week: ${alignr 5}${execi 1 vnstat -i eth0 -w | grep "current week" | awk '{print $6 $7}'}
Month: ${alignr 10}${execi 1 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $6 $7}'}
${voffset 5}
--[[ by mrpeachy -
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'
function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
function conky_gradbar(bartab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_draw_bg(bgtab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
local draw=bgtab[8]
local lwidth=bgtab[9]
local olcolor=bgtab[10]
local olalpha=bgtab[11]
if w==0 then
w=tonumber(conky_window.width)
end
if h==0 then
h=tonumber(conky_window.height)
end
cairo_set_source_rgba (cr,rgb_to_r_g_b({color,alpha}))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
if draw==1 then
cairo_fill (cr)
elseif draw==2 then
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
elseif draw==3 then
cairo_fill_preserve (cr)
cairo_set_source_rgba (cr,rgb_to_r_g_b({olcolor,olalpha}))
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
end
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luacal(caltab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--####################################################################################################
local caltab=loadstring("return" .. caltab)()
local cal_x=caltab[1]
local cal_y=caltab[2]
local tfont=caltab[3]
local tfontsize=caltab[4]
local tc=caltab[5]
local ta=caltab[6]
local bfont=caltab[7]
local bfontsize=caltab[8]
local bc=caltab[9]
local ba=caltab[10]
local hfont=caltab[11]
local hfontsize=caltab[12]
local hc=caltab[13]
local ha=caltab[14]
local spacer=caltab[15]
local gaph=caltab[16]
local gapt=caltab[17]
local gapl=caltab[18]
local sday=caltab[19]
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b({tc,ta})
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b({bc,ba})
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b({hc,ha})
--###################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]=" "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
for i=1,7 do
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--#########################################################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luaimage(imtab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
local imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function
function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function
--[[ multiple analogue clocks by mrpeachy - 18 Jun 2012
21 Jun 2012 - Chronograph modifications by Sector11
22 Jun 2012 - again with mrpeachy's help day names, numbers and month names
12 Nov 2012 - memory leak plugged - mrpeachy
14 Nov 2012 - Personnalisation - Didier-T (forum Ubuntu.fr)
26 Nov 2012 - The Clock - Sector11 (small version)
use in conkyrc
lua_load /path/Chronograph.lua
lua_draw_hook_pre main
TEXT
-- INDEX
-- ### CLOCK POSITION - AND DEFAULTS ###
-- ### SET BORDER OPTIONS FOR "CLOCKS" ### -- I don't know how to remove this - NOT NEEDED
-- See lines 39 to 41 for overall size changes
-- ### START DIAL B ### Day Names Dial ###
-- See Lines 84 - 87 and 131 for changes
-- ### START DIAL C ### Month Names Dial ###
-- See Lines 150 -153 and 198 for changes
-- ### START DIAL D ### Day Numbers Dial ###
-- See Lines 234 & 265 for changes
-- ### START CLOCK A ###
-- See Lines & and 441 & 467 changes
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
-- CLOCK A HOUR HAND
-- CLOCK A MINUTE HAND SETUP
-- CLOCK A SECOND HAND SETUP
NOTE: Putting ### CLOCK A ### last insures that it's functions are written
over the other dials.
]]
require 'cairo'
-- ### CLOCK POSITION - AND DEFAULTS ##########################################
local init={
center_x=178,
center_y=160,
radius=140,
lang="English", -- English French Greek Spanish
hour=12, -- 12 | 24
second=false, --true | false - Seconds: dots and numbers IF 12HR
line=false, -- true | false - Part Second Hand
color=0xFF0000, --color for day, day number and month IF NO SECOND HAND
alpha=1 --alpha for day, day number and month IF NO SECOND HAND
}
-- ONLY NEED ONE COPY OF THIS FUNCTION
function rgb_to_r_g_b(col,alp)
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end
local colr, colg, colb, cola=rgb_to_r_g_b(init.color,init.alpha)
function conky_main()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
-- ### CLOCK 12|24 HR SELECTOR ############################
local clock_type_A=init.hour
-- ############################ CLOCK 12|24 HR SELECTOR ###
-- ### SET BORDER OPTIONS FOR "CLOCKS" ####################
--local clock_border_width=0
-- set color and alpha for clock border
--local cbr,cbg,cbb,cba=1,1,1,1 -- full opaque white
-- gap from clock border to minute marks
local b_to_m=0
-- #################### SET BORDER OPTIONS FOR "CLOCKS" ###
-- ### START DIAL B ### Day Names Dial ####################
-- DIAL POSITION
local center_x=init.center_x
local center_y=init.center_y
local radius=22
-- FONT
cairo_select_font_face (cr, "CorporateMonoExtraBold", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
-- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Sun","Mon","Tue","Wed","Thr","Fri","Sat",} end
if init.lang == "French" then text_days={"dim","lun","mar","mer","jeu","ven","sam",} end
if init.lang == "Greek" then text_days={"ΔΕΥ","ΤΡΙ","ΤΕΤ","ΠΕΜ","ΠΑΡ","ΣΑΒ","ΚΥΡ",} end
if init.lang == "Spanish" then text_days={"dom","lun","mar","mie","jue","vie","sab",} end
local day_number=tonumber(os.date("%w"))
if init.handday == true then
for i=1,7 do
-- work out points
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
else
for i=1,7 do -- working out points
if day_number == i-1 then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active day names
end
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=7
for i=1,7 do
if day_number == i-1 then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active
end
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
-- ######################################### END DIAL B ###
-- ### START DIAL C ### Month Names Dial ##################
-- DIAL POSITION
local center_x=init.center_x --(+85)
local center_y=init.center_y
local radius=53
-- FONT
cairo_select_font_face (cr, "CorporateMonoExtraBold", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
-- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",} end
if init.lang == "French" then text_days={"jan","fév","mar","avr","mai","jui","jul","aôu","sep","oct","nov","déc",} end
if init.lang == "Greek" then text_days={"ΙΑΝ","ΦΕΒ","ΜΑΡ","ΑΠΡ","ΜΑΙ","ΙΟΥ","ΙΟΥ","ΑΥΓ","ΣΕΠ","ΟΚΤ","ΝΟΕ","ΔΕΚ",} end
if init.lang == "Spanish" then text_days={"ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",} end
local this_month=tonumber(os.date("%m"))
if init.handmonth == true then
for i=1,12 do
-- OUTER POINTS POSTION FOR -- ### START DIAL D ## TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
else
for i=1,12 do
if this_month == i then
cairo_set_source_rgba (cr,0,1,1,0) -- active month colour
else
cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active month names
end
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=38
for i=1,12 do
if this_month == i then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.0) -- dots for non-active month names
end
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
-- ######################################### END DIAL C ###
-- ### START DIAL D ### Day Numbers Dial ##################
-- GET NUMBER OF DAYS IN CURRENT MONTH
-- calculate Feb, then set up table
year4num=os.date("%Y")
t1=os.time({year=year4num,month=03,day=01,hour=00,min=0,sec=0});
t2=os.time({year=year4num,month=02,day=01,hour=00,min=0,sec=0});
if init.hour == 12 then
febdaynum=tonumber((os.difftime(t1,t2))/(12*60*60))
else
febdaynum=tonumber((os.difftime(t1,t2))/(24*60*60))
end
-- MONTH TABLE
monthdays={31,febdaynum,31,30,31,30,31,31,30,31,30,31}
this_month=tonumber(os.date("%m"))
number_days=monthdays[this_month]
-- TEXT positioning
local center_x=init.center_x
local center_y=init.center_y
local radius=85
cairo_select_font_face (cr, "Liquid Crystal", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 20)
local this_day=tonumber(os.date("%d"))
for i=1,number_days do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
--only print even numbers
if math.mod(i, 2) == 0 and math.mod(this_day, 2)==0 then
text=string.format("%02d",i) --formats numbers to double digits
elseif math.mod(i, 2) ~= 0 and math.mod(this_day, 2)~=0 then
text=string.format("%02d",i) --formats numbers to double digits
else
text=""
end --odd even matching
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
if i==this_day then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- dim inactive numbers
end
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=70
for i=1,number_days do
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
if i==this_day then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- dim the points
end
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
-- ######################################### END DIAL D ###
-- ### START CLOCK A ######################################
-- SET MARKS ###
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
local number_marks_A=init.hour
-- set mark length
local m_length_A=0 -- doesn't work but can't delete
-- set mark width
local m_width_A=0 -- doesn't work but can't delete
-- set mark line cap type
local m_cap=CAIRO_LINE_CAP_ROUND
-- set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,1,0 -- opaque white -- doesn't work but can't delete
-- SETUP HOUR HANDS ###
-- CLOCK A HOUR HAND
hh_length_A=95
-- set hour hand width
hh_width_A=6
-- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
-- set hour hand color
-- hhr,hhg,hhb,hha=1,0,1,0 -- fully opaque white --doesn't work
-- SETUP MINUTE HANDS ###
-- CLOCK A MINUTE HAND SETUP
-- set length of minute hand
mh_length_A=115
-- set minute hand width
mh_width_A=6
-- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
-- set minute hand color
--mhr,mhg,mhb,mha=1,1,1,0.5 -- fully opaque white --doesn't work
-- SETUP SECOND HAND ###
-- CLOCK A SECOND HAND SETUP -- DOESN'T WORK - Why ???????????????????????????
-- set length of seconds hand -- yes I know it is commented out!
--sh_length_A=150
-- set hour hand width
--sh_width_A=2
-- set hour hand line cap
--sh_cap=CAIRO_LINE_CAP_ROUND
-- set seconds hand color
--shr,shg,shb,sha=1,0,0,1 -- fully opaque red
-- PART SECOND HAND
--position
--get seconds value
local seconds=tonumber(os.date("%S"))
--calculate rotation of second hand in degrees
if init.line == true then
local arc=(math.pi/180)*((360/60)*seconds)
--calculate point 1
local radius1=100
local x1=0+radius1*math.sin(arc)
local y1=0-radius1*math.cos(arc)
--calculate point 2
local radius2=107
local x2=0+radius2*math.sin(arc)
local y2=0-radius2*math.cos(arc)
--draw line connecting points
cairo_move_to (cr, center_x+x1,center_y+y1)
cairo_line_to (cr, center_x+x2, center_y+y2)
cairo_set_source_rgba (cr,255/255,0/255,0/255,0) -- PART SECOND HAND
cairo_stroke (cr)
end
-- CLOCK A ### 12 HR TIME ###
-- CLOCK SETTINGS
clock_radius=0 --does not work
clock_centerx=init.center_x -- centre of Clock hands
clock_centery=init.center_y -- centre of Clock hands
-- DRAWING CODE
-- DRAW MARKS
-- stuff that can be moved outside of the loop, needs only be set once
-- calculate end and start radius for marks
m_end_rad=clock_radius-b_to_m
m_start_rad=m_end_rad-m_length_A -- WHAT IS THIS??
-- set line cap type
cairo_set_line_cap (cr, m_cap)
-- set line width
cairo_set_line_width (cr,m_width_A)
-- set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
-- START LOOP FOR HOUR MARKS
for i=1,number_marks_A do
-- drawing code using the value of i to calculate degrees
-- calculate start point for 12/24 hour mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set start point for line
cairo_move_to (cr,clock_centerx+x,clock_centery+y)
-- calculate end point for 12/24 hour mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set path for line
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- draw the line
cairo_stroke (cr)
end -- of for loop
-- HOUR MARKS -- ???????????????????????????????????????????????????????????????
-- TIME CALCULATIONS CLOCK A
if clock_type_A==12 then
hours=tonumber(os.date("%I"))
-- convert hours to seconds
h_to_s=hours*60*60
elseif clock_type_A==24 then
hours=tonumber(os.date("%H"))
-- convert hours to seconds
h_to_s=hours*60*60
end
minutes=tonumber(os.date("%M"))
-- convert minutes to seconds
m_to_s=minutes*60
-- get current seconds
seconds=tonumber(os.date("%S"))
-- DRAW HOUR HAND ###
-- get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
-- calculate degrees for each second
hsec_degs=hsecs*(360/(60*60*clock_type_A)) -- use equation ~ eliminate decimals
-- set radius to calculate hand points
radius=hh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of hour hand
point=(math.pi/180)*hsec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,hh_width_A)
cairo_set_source_rgba (cr,1,1,1,1) -- active colour Hour Hand ================
cairo_set_line_cap (cr, hh_cap)
cairo_stroke (cr)
-- DRAW MINUTE HAND
-- get minutes and seconds just as seconds
msecs=m_to_s+seconds
-- calculate degrees for each second
msec_degs=msecs*0.1
-- set radius to calculate hand points
radius=mh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of minute hand
point=(math.pi/180)*msec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,mh_width_A)
cairo_set_source_rgba (cr,1,1,1,1) -- active colour Minute Hand ==============
cairo_set_line_cap (cr, mh_cap)
cairo_stroke (cr)
-- ### CLOCK A ###
local center_x=init.center_x -- Centre of the HR / Min Numbers
local center_y=init.center_y -- Centre of the HR / Min Numbers
local radius=init.radius -- 12/24 HR CLOCK Hours/Minutes radius -- seeline 42
cairo_select_font_face (cr, "WhiteRabbit", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 25)
cairo_set_source_rgba (cr,1,1,1,1) -- HR Clock numbers
-- TABLE OF TEXT -- in order
if init.hour == 12 then
text_days={"12","01","02","03","04","05","06","07","08","09","10","11",}
for i=1,12 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_set_source_rgba (cr,1,1,1,1)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=111 -- 12 HR Clock
for i=1,12 do
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_set_source_rgba (cr,1,1,1,0)
cairo_stroke (cr)
end
end
if init.hour == 24 then
text_days={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23",}
for i=1,24 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/24)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=99 -- 24 HR Clock
for i=1,24 do
local point=(math.pi/180)*((360/24)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_set_source_rgba (cr,1,1,1,0)
cairo_stroke (cr)
end
end
-- ############################################################################
-- POSITION FOR TEXT HOUR NUMBERS
if init.hour == 12 and init.second == true then
text_days={"","01","02","03","04","","06","07","08","09","","11","12","13","14","","16","17","18","19","","21","22","23","24","","26","27","28","29","","31","32","33","34","","36","37","38","39","","41","42","43","44","","46","47","48","49","","51","52","53","54","","56","57","58","59","",}
-- INNER POINTS POSITION, radius smaller than text circle
cairo_set_source_rgba (cr,1,1,1,.5) -- does not work -- settings moved
cairo_select_font_face (cr, "WhiteRabbit", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
for i=1,60 do
local radius=99 -- dots for seconds A Clock
local point=(math.pi/180)*((360/60)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
if seconds == i-1 then
cairo_set_source_rgba (cr,255/255,0/255,0/255,0) -- does not work - settings moved
else
if i-1 == 0 or i-1 == 5 or i-1 == 10 or i-1 == 15 or i-1 == 25 or i-1 == 30 or i-1 == 35 or i-1 == 40 or i-1 == 45 or i-1 == 50 or i-1 == 55 then
cairo_set_source_rgba (cr,1,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- dots for seconds A Clock
end
end
cairo_arc (cr,center_x+x,center_y+y,1/2,0,2*math.pi)
cairo_stroke (cr)
end
radius=radius-3
cairo_set_font_size (cr, 9)
for i=1,60 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/60)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
if seconds == tonumber(text) then
cairo_set_source_rgba (cr,1,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- seconds numbers
end
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
end
-- ############################################################################
cairo_stroke (cr)
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end -- end main function
# killall conky && conky &
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_colour gray
own_window_class Conky
own_window_title VSIDO Default 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 255
minimum_size 235 0 ## width, height
#maximum_width 160 ## width
gap_x 10 # left-right
gap_y 0 # up-down
alignment middle_right
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Liberation Sans:size=15
xftfont Monofur:bold:size=13
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
draw_shades no
default_shade_color black
draw_outline yes # amplifies text if yes
default_outline_color black
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
default_shade_color gray
default_outline_color black
default_color DCDCDC #220 220 220 Gainsboro
color0 8FBC8F #143 188 143 DarkSeaGreen
color1 778899 #119 136 153 LightSlateGray
color2 FF8C00 #255 140 0 DarkOrange
color3 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 FF0000 #255 0 0 Red
##################################################### 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 1
# graph borders
draw_graph_borders 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
0
# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 1028
# 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 ###
### LUA ######################################################################
### draw-bg.lua ##############################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.3}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#--------------------------------
lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.5
#lua_draw_hook_post draw_bg 20 0 0 0 0 0x000000 0.5
#
# TEXT
# ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.3}
##
#
################################################################## End LUA ###
update_interval 1
TEXT
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.3}\
${image /media/5/Conky/images/orbwallpaperblack.png -s 60x60 -p 0,0}\
${image /media/5/Conky/images/S11_128.png -s 60x60 -p 0,100}\
${alignr 5}${time %T}
${alignr 5}${time %x}
${alignr 5}${uptime_short}${font Monofur:bold:size=11}
${alignc}${kernel}
${hr}${font}
${alignc}${nodename}
${alignr 5}% Used ↓ | Total
Root ${fs_used_perc /}${alignr 5}${fs_used /} | ${fs_size /}
Home ${fs_used_perc /home}${alignr 5}${fs_used /home} | ${fs_size /home}
RAM ${memperc}${alignr 5}${mem} | ${memmax}
Swap ${swapperc}${alignr 5}${swap} | ${swapmax}
CPU % in use ${alignr 5}Avg ${if_match ${cpu cpu0}<10}00${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100}0${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}
${alignc}1 ${if_match ${cpu cpu1}<10}00${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100}0${cpu cpu1}\
${else}${cpu cpu1}${endif}${endif}\
2 ${if_match ${cpu cpu2}<10}00${cpu cpu2}\
${else}${if_match ${cpu cpu2}<100}0${cpu cpu2}\
${else}${cpu cpu2}${endif}${endif}\
3 ${if_match ${cpu cpu3}<10}00${cpu cpu3}\
${else}${if_match ${cpu cpu3}<100}0${cpu cpu3}\
${else}${cpu cpu3}${endif}${endif}
CPU Fan${alignr 5}${platform f71882fg.2560 fan 1} rpm
Temperatures ${hr}
${alignc}CPU ${if_match ${platform f71882fg.2560 temp 1}<100} ${platform f71882fg.2560 temp 1}\
${else}${platform f71882fg.2560 temp 1}${endif}°\
MB ${if_match ${platform f71882fg.2560 temp 2}<100} ${platform f71882fg.2560 temp 2}\
${else}${platform f71882fg.2560 temp 2}${endif}°
${alignc}GPU ${if_match ${nvidia temp}<100} ${nvidia temp}\
${else}${nvidia temp}${endif}°\
HD ${if_match ${execi 5 hddtemp -n /dev/sda}<100} ${execi 5 hddtemp -n /dev/sda}\
${else}${execi 5 hddtemp -n /dev/sda}${endif}°
DISK Activity ${hr}
R${goto 40}${diskiograph_read /dev/sda 14,130 00ffff ff0000 5 -lt}${alignr 5}${diskio_read /dev/sda}
W${goto 40}${diskiograph_write /dev/sda 14,130 ff0000 00ffff 5 -lt}${alignr 5}${diskio_write /dev/sda}
NETWORK ${hr}
Dn${goto 40}${downspeedgraph eth0 14,130 00ffff ff0000 5 -lt}${alignr 5}${downspeedf eth0}
Up${goto 40}${upspeedgraph eth0 14,130 ff0000 00ffff 5 -lt}${alignr 5}${upspeedf eth0}
--[[Background originally by londonali1010 (2009)
ability to set any size for background mrpeachy 2011
ability to set variables for bg in conkyrc dk75
the change is that if you set width and/or height to 0
then it assumes the width and/or height of the conky window
so:
Above and After TEXT (requires a composite manager or it blinks!)
lua_load ~/wea_conky/draw_bg.lua
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}
OR Both above TEXT (no composite manager required - no blinking!)
lua_load ~/wea_conky/draw_bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
TEXT
Note
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
See below: 1 2 3 4 5 6 7
${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
covers the whole window and will change if you change the minimum_size setting
1 = 20 corner_radius
2 = 0 x_position
3 = 0 y_position
3 = 0 width
5 = 0 height
6 = 0x000000 color
7 = 0.4 alpha
######### calendar function ##################################################
then to use it, you activate the calendar function BELOW TEXT like this
${lua luacal {settings}}
#${lua luacal {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gh=,gt=,gv=,sd=}}
# x=x position top left
# y=y position top left
# tf=title font, eg "mono" must be in quotes
# tfs=title font size
# tc=title color
# ta=title alpha
# bf=body font, eg "mono" must be in quotes
# bfs=body font size
# bc=body color
# ba=body alpha
# hf=highlight font, eg "mono" must be in quotes
# hfs=highlight font size
# hc=highlight color
# ha=highlight alpha
# sp=spacer, eg " " or sp="0"... 0,1 or 2 spaces can help with positioning of non-monospaced fonts
# gt=gap from title to body
# gh=gap horizontal between columns
# gv=gap vertical between rows
# sd=start day, 0=Sun, 1=Mon
# hstyle = heading style, 0=just days, 1=date insert
# tdf=title date font, eg "mono" must be in quotes
# tdfs=title date font size
# tdc=title date color
# tda=title date alpha
# test line
-- ${lua luacal {x=10,y=100,tf="Purisa",tfs=24,tc=0xf67e16,ta=1,bf="First Order",bfs=26,bc=0xecd32a,ba=1,hf="Purisa",hfs=18,hc=0xf67e16,ha=1,sp=" ",gh=40,gt=25,gv=20,sd=0,hstyle=1,tdf="First Order",tdfs=28,tdc=0xff0000,tda=1}}
]]
require 'cairo'
local cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
-- ###### calendar function ##################################################
function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=,hstyle=,tdf=,tdfs=,tdc=,tda=}
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--############################################################################
if caltab.x==nil then
caltab=loadstring("return" .. caltab)()
end
local cal_x=caltab.x
local cal_y=caltab.y
local tfont=caltab.tf or "mono"
local tfontsize=caltab.tfs or 12
local tc=caltab.tc or 0xffffff
local ta=caltab.ta or 1
local bfont=caltab.bf or "mono"
local bfontsize=caltab.bfs or 12
local bc=caltab.bc or 0xffffff
local ba=caltab.ba or 1
local hfont=caltab.hf or "mono"
local hfontsize=caltab.hfs or 12
local hc=caltab.hc or 0xff0000
local ha=caltab.ha or 1
local spacer=caltab.sp or " "
local gaph=caltab.gh or 20
local gapt=caltab.gt or 15
local gapl=caltab.gv or 15
local sday=caltab.sd or 0
local hstyle=caltab.hstyle or 0
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
--############################################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]=" "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
if hstyle==0 then
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
elseif hstyle==1 then
if tonumber(sday)==0 then
dys={"SU","MO"," "," "," ","FR","SA"}
cairo_text_extents(cr,"MO",extents)
local s=extents.x_advance+gaph
local f=gaph*5
local tdfont=caltab.tdf or "mono"
local tdfontsize=caltab.tdfs or 12
local tdc=caltab.tdc or 0xffffff
local tda=caltab.tda or 1
cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tdfontsize);
local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
local insert=os.date("%b %y")
cairo_text_extents(cr,insert,extents)
local w=extents.x_advance
cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
cairo_show_text (cr,insert)
cairo_stroke (cr)
else
dys={"MO","TU"," "," "," ","SA","SU"}
cairo_text_extents(cr,"TU",extents)
local s=extents.x_advance+gaph
local f=gaph*5
local tdfont=caltab.tdf or "mono"
local tdfontsize=caltab.tdfs or 12
local tdc=caltab.tdc or 0xffffff
local tda=caltab.tda or 1
cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tdfontsize);
local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
local insert=os.date("%b %y")
cairo_text_extents(cr,insert,extents)
local w=extents.x_advance
cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
cairo_show_text (cr,insert)
cairo_stroke (cr)
end
end
--draw calendar titles
for i=1,7 do
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--############################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end
-- end main function #########################################################
${font StyleBats:size=10}${color2}4${font Droid Sans Mono:size=8}${color3} SWAP${goto 95}${swap}${goto 133}/ ${swapmax}${alignr}${swapperc}%
${font Droid Sans Mono:bold:size=8.25}${color4}Communications ${color8}${hr 2}
${font PizzaDudeBullets:size=9.5}${color2}T${font Droid Sans Mono:size=8}${color3} Down${alignr}${downspeed wlan0}
${font PizzaDudeBullets:size=9.5}${color2}N${font Droid Sans Mono:size=8}${color3} Up${alignr}${upspeed wlan0}
${font PizzaDudeBullets:size=9.5}${color2}T${font Droid Sans Mono:size=8}${color3} Downloaded${alignr}${totaldown wlan0}
${font PizzaDudeBullets:size=9.5}${color2}N${font Droid Sans Mono:size=8}${color3} Uploaded${alignr}${totalup wlan0}
${voffset 4}${font Sans:bold:size=8.25}${color4}${wireless_essid wlan0}${color8}${hr 2}
${goto 80}${font Droid Sans:size=38}${color4}${time %H:%M:%S}${font}
${font}${color3
#!/bin/bash
conky -c ~/lua/.conkyrcr &
sleep 2 &
conky -c ~/lua/.conkyrcl
Quote from: falldown on January 27, 2013, 01:09:18 AMFalldown, this is some beautiful work! The colors match my desktop perfectly!!! Everything works as it should, (had to change the Net settings as I have wireless which is easy stuff) however, if I click on them nothing happens. I'm using Xfce. When I go into the .lua code and edit the first 4 or 5 lines replacing the 0 with a 1, save and voila, the boxes are open. (obvious difference between 0 and 1 eh?) I get the following in a terminal on start of the Conky's;
Here is the interactive conky.
Just load it up as you would the v9000.
abstlx: 1655 abstly: 5 winNum: 13134456
abstlx: 5 abstly: 5 winNum: 13134492
abstlx: 1655 abstly: 5 winNum: 13134456
abstlx: 5 abstly: 5 winNum: 13134492
abstlx: 5 abstly: 5 winNum: 13134492
abstlx: 1655 abstly: 5 winNum: 13134456
abstlx: 5 abstly: 5 winNum: 13134492
abstlx: 1655 abstly: 5 winNum: 13134456
abstlx: 5 abstly: 5 winNum: 13134492
abstlx: 1655 abstly: 5 winNum: 13134456
own_window_type
Quote from: jedi on January 27, 2013, 04:17:56 AMand this is just the click function "print"Code Select
abstlx: 1655 abstly: 5 winNum: 13134456
abstlx: 5 abstly: 5 winNum: 13134492
abstlx: 1655 abstly: 5 winNum: 13134456
abstlx: 5 abstly: 5 winNum: 13134492
abstlx: 5 abstly: 5 winNum: 13134492
abstlx: 1655 abstly: 5 winNum: 13134456
abstlx: 5 abstly: 5 winNum: 13134492
abstlx: 1655 abstly: 5 winNum: 13134456
abstlx: 5 abstly: 5 winNum: 13134492
abstlx: 1655 abstly: 5 winNum: 13134456
Quote from: Theodore "Beaver" CleaverGee Wally, that's swell.
Quote" ... and over here we have Sector11's avatar. He was coding a new conky back in 2013 and hit the wrong key sequence and deleted himself!"
Quote from: falldownI don't like pony cars:'( :'( :'(
Quote from: falldown on February 12, 2013, 05:19:15 PM
Sorry that I have not posted on this panel for awhile, but I have hit a roadblock with one significant area..
Lua for some strange reason does not recognize "~/" as "/home/username". So I am thinking that all paths should be in our root directory. Which makes sense considering all other theming files are stored there.
Here are some examples:
x = string.gsub("hello world", "(%w+)", "%1 %1")
--> x="hello hello world world"
x = string.gsub("hello world", "(%w+)", "%1 %1", 1)
--> x="hello hello world"
x = string.gsub("hello world from Lua", "(%w+)%s*(%w+)", "%2 %1")
--> x="world hello Lua from"
x = string.gsub("home = $HOME, user = $USER", "%$(%w+)", os.getenv)
--> x="home = /home/roberto, user = roberto"
x = string.gsub("4+5 = $return 4+5$", "%$(.-)%$", function (s)
return loadstring(s)()
end)
--> x="4+5 = 9"
local t = {name="lua", version="5.0"}
x = string.gsub("$name_$version.tar.gz", "%$(%w+)", function (v)
return t[v]
end)
--> x="lua_5.0.tar.gz"
# killall conky && conky -c /media/5/Conky/S11_Disk_Activity-2.conky &
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
# 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
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_class Conky
own_window_title Disk Activity
### 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 override
# 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 150
minimum_size 270 0 #225 ## width, height
maximum_width 270 ## width, usually a good idea to equal minimum width
gap_x 10 ### left &right
gap_y 10 ### up & down
alignment tl
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont monofur:bold:size=12
#xftfont WenQuanYi Micro Hei Mono:size=8
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
draw_shades yes #### <<<<<<------------------To see it easier on light screens.
#default_shade_color black
draw_outline no #### <<<<<<---------------- Amplifies text if yes
default_outline_color black
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
default_shade_color 000000
default_outline_color 000000
#default_color 000000 # 0 0 0 Black
default_color DCDCDC #220 220 220 Gainsboro
color0 ffe595 #Teo Gold
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan #48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red #A52A2A #DarkRed
##################################################### 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 yes #no
##################################################### End Borders Secton ###
### Miscellaneous Section ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background no
# 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 256
# 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
## default bar size
default_bar_size 200 20
## Width for $top name value (defaults to 15 characters).
top_name_width 8
## Specify a default width and height for graphs.
## Example: 'default_graph_size 0 25'. This is particularly useful for execgraph
## and execigraph as they do not take size arguments
## default_graph_size 220 100
############################################## End Miscellaneous Section ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/dra2w-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load /media/5/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.1
### mount.lua ##################################################################
#
##instructions
##load script
##lua_load ~/path_to/mounted.lua
#lua_load /media/5/Conky/LUA/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type}, where partition number is a number
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
####################################################### End LUA Settings ###
#digiThe all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1 # in seconds
# stuff after 'TEXT' will be formatted on screen
TEXT
${alignc}${time %x}
${time %X}${alignr 15}${uptime_short}
${alignc}Hosted by: ${nodename}
${alignc}${color}${kernel}
${goto 10}${diskiograph_read 50,250 FFFF00 BBFF00 -t -l}${goto 10}${diskiograph_write 50,250 0000FF FF0000 -t -l}${goto 10}${color6}${cpubar cpu4 50,250}${color}\
${voffset -35}${goto 80}SDA: R: ${diskio_read /dev/sda}
${goto 80} W: ${diskio_write /dev/sda}
${voffset 5}${goto 60}${color1}${fs_bar /}${color}
${voffset -30}/Root ${fs_size /}${goto 170}Used${goto 220}${fs_used_perc /}%
${goto 60}${color1}${fs_bar_free /}${color}
${voffset -30}${goto 170}Free${goto 220}${fs_free_perc /}%
${goto 60}${color1}${fs_bar /home}${color}
${voffset -30}/Home ${fs_size /home}${goto 170}Used${goto 220}${fs_used_perc /home}%
${goto 60}${color1}${fs_bar_free /home}${color}
${voffset -30}${goto 170}Free${goto 220}${fs_free_perc /home}%${font monofur:pixelsize=3}
${font}${goto 60}${color1}${cpubar cpu1}${goto 60}${cpugraph cpu1 -t 20,200 FF0000 FFFF00}${color}
${voffset -30}${goto 10}CPU1${goto 70}${freq_g} GHz${goto 220}${color}${if_match ${cpu cpu1}<10} ${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100} ${cpu cpu1}\
${else}${cpu cpu1}${endif}${endif}%${font monofur:pixelsize=3}
${font}${goto 60}${color1}${cpubar cpu0}${goto 60}${cpugraph cpu0 -t 20,200 FF0000 FFFF00}${color}
${voffset -30}${goto 10}CPU0${goto 70}${freq} MHz${goto 220}${color}${if_match ${cpu cpu0}<10} ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%${font monofur:pixelsize=20}
${font}RAM: ${mem}/${memmax}${alignr 5}Swap: ${swap}/${swapmax}
SDA: Read: ${diskio_read /dev/sda}${goto 160}Write: ${diskio_write /dev/sda}
Memory ${color5}${hr}${color}
${goto 10}${color1}${membar 50,260}${color6}${goto 10}${memgraph 50,260 00BFFF FF0000}${goto 10}${color}${memgauge 50,260}${color}
${voffset -55} ${color5}Total ${memmax} ${goto 150}In Use ${mem}
Free ${memfree}${goto 150}Free Easy ${memeasyfree}${color}
Name${goto 120}PID CPU MEM
${color5}${stippled_hr 2}${color}
${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5}
${top name 6} ${top pid 6} ${top cpu 6} ${top mem 6}
${top name 7} ${top pid 7} ${top cpu 7} ${top mem 7}
${top name 8} ${top pid 8} ${top cpu 8} ${top mem 8}
${top name 9} ${top pid 9} ${top cpu 9} ${top mem 9}
${color9}${hr}${color}
${goto 40}${color5}open ports: ${tcp_portmon 1 65535 count}
${goto 40}IP${alignr 5}DPORT${color}
${goto 40}${tcp_portmon 1 65535 rip 0}${alignr 1}${tcp_portmon 1 65535 rport 0}
${tcp_portmon 1 65535 rhost 0}
${goto 40}${tcp_portmon 1 65535 rip 1}${alignr 1}${tcp_portmon 1 65535 rport 1}
${tcp_portmon 1 65535 rhost 1}
${goto 40}${tcp_portmon 1 65535 rip 2}${alignr 1}${tcp_portmon 1 65535 rport 2}
${tcp_portmon 1 65535 rhost 2}
${goto 40}${tcp_portmon 1 65535 rip 3}${alignr 1}${tcp_portmon 1 65535 rport 3}
${tcp_portmon 1 65535 rhost 3}
${goto 40}${tcp_portmon 1 65535 rip 4}${alignr 1}${tcp_portmon 1 65535 rport 4}
${tcp_portmon 1 65535 rhost 4}
${goto 40}${tcp_portmon 1 65535 rip 5}${alignr 1}${tcp_portmon 1 65535 rport 5}
${tcp_portmon 1 65535 rhost 5}
lua_load /media/5/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.1
### Thanks to everyone at the VSIDO Forums #####
### Thanks to TeoBigusGeekus for the accuweather script #####
### Accuweather images edited by lwfitz ####
### allcombined.lua written by mrpeachy ####
### clock background image by Doruletz ####
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 375 1020
maximum_width 375
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment top_left
gap_x 15
gap_y 20
no_buffers yes
uppercase no
cpu_avg_samples 6
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0
# 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
----------------------------
################### LUA #######################################
lua_load ~/Conky/allcombined_2.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
############################## End LUA ###
TEXT
${image $HOME/Conky/Clock-Flip.png -p 85,-5 -s 100x110}${image $HOME/Conky/Clock-Flip.png -p 185,-5 -s 100x110}
#########################################################################################################
# (RO) TIME
${font Helvetica LT Std :style=bold:size=58}${color 737373}${goto 100}${time %H}${goto 175}${goto 200}${color 737373}${time %M}${font}${color}
#########################################################################################################
# LOCATION (CITY NAMES) #
${voffset -10}${goto 85}${font Bitstream Vera Sans Mono:style=Bold:size=24:locale=ro}Monrovia,CA${font}${color}
#${lua tex_bg {20,4,20,365,540,"/home/luke/Conky/brushed.png"}}
${lua draw_bg {20,8,23,365,1020,0x737373,.15,2,8}}${voffset -10}${font WhiteRabbit:size=15}${goto 30}Temp ${goto 288}Feels${voffset 10}
${font WhiteRabbit:size=20}${goto 25}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F ${goto 286}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F
${font WhiteRabbit:size=11}${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 75,118 -s 240x225}
${font WhiteRabbit:size=15}${goto 30}Dawn ${goto 285}Dusk
${voffset 10}${font WhiteRabbit:size=17}${goto 15}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}${goto 262}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}${voffset -10}
${font WhiteRabbit:size=13}${goto 30}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 145}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 265}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/tod_ton}
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 215}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${voffset 5}${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 215}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${image $HOME/Accuweather_Conky_USA_Images/7.png -p 20,318 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/12.png -p 138,318 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/17.png -p 256,318 -s 80x67}${voffset -5}
${font WhiteRabbit:size=13}${goto 30}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 145}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 265}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/last_days}
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 215}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${voffset 5}${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 215}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${image $HOME/Accuweather_Conky_USA_Images/22.png -p 20,405 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N2.png -p 138,405 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N7.png -p 256,405 -s 80x67}${voffset -5}
#
#
#
#${font WhiteRabbit:size=13}${goto 30}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 145}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 265}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/last_days}
#
#${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 215}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
#${voffset 5}${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 215}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${image $HOME/Accuweather_Conky_USA_Images/N12.png -p 20,492 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N17.png -p 138,492 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N22.png -p 256,492 -s 80x67}${voffset -5}
${color 737373}${goto 15}${cpubar 1,350 cpu0}${color}
${font WhiteRabbit:size=25}${goto 80}Now Playing
${color 737373}${goto 15}${cpubar 1,350 cpu0}${color}
${image ~/Conky/grey_bar2.png -s 50x90 -p 168,660}
${voffset -30}${goto 15}${font WhiteRabbit:size=13}CPU1${goto 65}${cpu cpu1}%${goto 110}CPU2 ${cpu cpu2}%${goto 207}${font WhiteRabbit:size=20}Memory ${alignr 22}${memperc}%
${goto 15}${font WhiteRabbit:size=13}CPU3${goto 65}${cpu cpu3}%${goto 110}CPU4 ${cpu cpu4}%${voffset 20}${goto 207}${font WhiteRabbit:size=20}Swap ${alignr 22}${swapperc}%${voffset -20}
${goto 15}${font WhiteRabbit:size=13}CPU5${goto 65}${cpu cpu5}%${goto 110}CPU6 ${cpu cpu6}%
${color 737373}${goto 15}${cpubar 1,350 cpu0}${color}
#${font WhiteRabbit:size=25}${goto 125}Storage
${goto 15}${font WhiteRabbit:size=13}/Root${goto 130}${fs_used /}${goto 180} / ${fs_size /} ${alignr 25}${fs_used_perc /}%
${voffset 8}${goto 15}${font WhiteRabbit:size=13}/Home${goto 130}${fs_used /home}${goto 180} / ${fs_size /home} ${alignr 25}${fs_used_perc /home}%
${voffset 8}${goto 15}${font WhiteRabbit:size=13}Backup${goto 130}${fs_used /media/storage}${goto 180} / ${fs_size /media/storage} ${alignr 25}${fs_used_perc /media/storage}%
${voffset 8}${goto 15}${font WhiteRabbit:size=13}Music${goto 130}${fs_used /media/sde6}${goto 180} / ${fs_size /media/sde6} ${alignr 25}${fs_used_perc /media/sde6}%
${voffset 8}${goto 15}${font WhiteRabbit:size=13}External${goto 130}${fs_used /media/sde5}${goto 180} / ${fs_size /media/sde5} ${alignr 25}${fs_used_perc /media/sde5}%
${voffset 8}${goto 15}${font WhiteRabbit:size=13}Videos${goto 130}${fs_used /media/sdc1}${goto 180} / ${fs_size /media/sdc1} ${alignr 25}${fs_used_perc /media/sdc1}%
${voffset 8}${goto 15}${font WhiteRabbit:size=13}Software${goto 130}${fs_used /media/sdb1}${goto 180} / ${fs_size /media/sdb1} ${alignr 25}${fs_used_perc /media/sdb1}%
#${voffset 8}${goto 15}${font WhiteRabbit:size=13}/Home${goto 130}${fs_used /home}${goto 180} / ${fs_size /home} ${alignr 25}${fs_used_perc /home}%
${color 737373}${goto 15}${cpubar 1,350 cpu0}${color}
${goto 15}${voffset -3}Down Speed${goto 175}${downspeed eth0} ${goto 275}${voffset -8}${downspeedgraph eth0 20,75 99CCFF 000099}${color}
${goto 15}${voffset 8}Up Speed${goto 175}${upspeed eth0} ${goto 275}${voffset -8}${upspeedgraph eth0 20,75 99CCFF 000099}${color}
--[[ by mrpeachy -
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'
function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
function conky_gradbar(bartab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_draw_bg(bgtab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
if w==0 then
w=tonumber(conky_window.width)
end
if h==0 then
h=tonumber(conky_window.height)
end
cairo_set_source_rgba (cr,rgb_to_r_g_b({color,alpha}))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luacal(caltab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--####################################################################################################
local caltab=loadstring("return" .. caltab)()
local cal_x=caltab[1]
local cal_y=caltab[2]
local tfont=caltab[3]
local tfontsize=caltab[4]
local tc=caltab[5]
local ta=caltab[6]
local bfont=caltab[7]
local bfontsize=caltab[8]
local bc=caltab[9]
local ba=caltab[10]
local hfont=caltab[11]
local hfontsize=caltab[12]
local hc=caltab[13]
local ha=caltab[14]
local spacer=caltab[15]
local gaph=caltab[16]
local gapt=caltab[17]
local gapl=caltab[18]
local sday=caltab[19]
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b({tc,ta})
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b({bc,ba})
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b({hc,ha})
--###################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]=" "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
for i=1,7 do
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--#########################################################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luaimage(imtab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
local imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function
function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function
(http://t.imgbox.com/adm0oSbx.jpg) (http://imgbox.com/adm0oSbx) | From these, to this -> | (http://t.imgbox.com/advj3TbN.jpg) (http://imgbox.com/advj3TbN) |
background no
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
# own_window_colour black
own_window_title Conkymain
double_buffer yes
use_spacer left
override_utf8_locale yes
use_xft yes
xftfont Monofur:bold:size=11
xftalpha 2.5
update_interval 1.0
uppercase no # set to yes if you want all text to be in uppercase
stippled_borders 0
# border_inner_margin 0
# border_outer_margin 0
border_width 0
default_outline_color black
default_shade_color black
draw_borders no
draw_outline no #yes # amplifies text if yes
draw_shades yes # shadecolor black
default_color DCDCDC #Gainsboro
color0 7FFFD4 #Aquamarine
color1 00CED1 #DarkTurquoise #FFA07A LightSalmon #00FFFF Cyan
color2 DEB887 #BurlyWood
color3 7FFF00 #Chartreuse
color4 778899 #LightSlateGrey
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 CD5C5C #IndianRed FF0000 #Red
alignment tr # Aligned position on screen: tl, tr, tm, bl, br, bm, ml, mr
gap_x 10
gap_y 10
text_buffer_size 512 # use 1024 for the forecast
no_buffers yes # Subtract file system buffers from used memory?
short_units yes
pad_percents 2
#max_specials 512 ## new
#max_user_text 20000 ## new
minimum_size 260 0
maximum_width 260
TEXT
${font Woodbadge:size=15}${color2}Timeline:${color}${font WW Digital:size=15} ${uptime}${font}
${color7}${cpubar cpu0 1,255}${color}
${goto 115}${font LCDMono2:bold:size=15}:${time %S}${goto 35}${font LCDMono2:size=56}${time %R}${font}
${color7}${cpubar cpu0 1,255}${color}
${font LCDMono2:size=18}${goto 5}SU MO ${color6}${time %b %y}${color} FR SA
${goto 5}${execpi 3600 CPS=`date +%-d`; cal -h | sed '2d' | sed -e '1d' -e 's/\<'"$CPS"'\>/${color6}&${color}/'}${font}
${color7}${cpubar cpu0 1,255}${color}
${font Woodbadge:size=15}${color2}Kernel:${color}${font}
${alignc}${kernel}${font monofur:pixelsize=16}
${font Woodbadge:size=15}${color2}CPU Load:${color}${font}
${goto 20}${color3}CPU ${color}%${goto 84}${color3}1 ${color}${cpu cpu1}\
${goto 148}${color3}2 ${color}${cpu cpu2}\
${goto 212}${color3}3 ${color}${cpu cpu3}\
${goto 276}${color3}Avg ${color}${cpu cpu0}${font monofur:pixelsize=16}
${font Woodbadge:size=15}${color2}Temperatures:${color}${font}
${color3}CPU ${color}${platform f71882fg.2560 temp 1}°\
${color3}SDA ${color}${execi 15 hddtemp -n /dev/sda}°\
${color3}MB ${color}${platform f71882fg.2560 temp 2}°\
${color3}GPU ${color}${nvidia temp}°${color}${font monofur:pixelsize=16}
${font Woodbadge:size=15}${color2}Speeds:${font}
${color3}CPU ${color}${freq_g}GHz${goto 100}${color3}GPU ${color}${nvidia gpufreq}MHz${alignr 5}${color3}MEM ${color}${nvidia memfreq}MHz${font monofur:pixelsize=16}
${font Woodbadge:size=15}${color2}Processes:${color}${font} ${running_processes} of${processes}${color}
${color3}Load:${goto 70}${color}${loadavg 1}${goto 140}${loadavg 2}${alignr 5}${loadavg 3}${color}${font monofur:pixelsize=16}
${font Woodbadge:size=15}${color2}RAM:${font} ${color}${memmax}${goto 140}${color3}Used ${color}${mem}${alignr 5}${memperc}%
${color3}Buffered: ${color}${buffers}${alignr 5}${color3}Cached:${color} ${cached}${font monofur:pixelsize=16}
${font Woodbadge:size=15}${color2}SWAP:${font} ${color}${swapmax}${goto 140}${color3}Used ${color}${swap}${alignr 5}${swapperc}%${font monofur:pixelsize=16}
${font Woodbadge:size=15}${color2}HDD SDA:${color}${font}
Total${goto 100}Used${goto 195}Free
${color}Root ${color7}${fs_size /}${goto 100}${color9}${fs_used /} ${fs_used_perc /}%${goto 195}${color3}${fs_free /} ${fs_free_perc /}%
${color}Home ${color7}${fs_size /home}${goto 100}${color9}${fs_used /home} ${fs_used_perc /home}%${goto 195}${color3}${fs_free /home} ${fs_free_perc /home}%
${color}M/5 ${color7}${fs_size /media/5}${goto 100}${color9}${fs_used /media/5} ${fs_used_perc /media/5}%${goto 195}${color3}${fs_free /media/5} ${fs_free_perc /media/5}%
${color}Swap ${color7}${swapmax}${goto 100}${color9}${swap} ${swapperc}%${goto 195}${color3}${swapfree}
${color7}${cpubar cpu0 1,255}${color}
${font Woodbadge:size=15}${color2}NET:${font} ${color}In ${tcp_portmon 1 32767 count}${goto 125}Out ${tcp_portmon 32768 61000 count}${alignr 5}Total: ${tcp_portmon 1 65535 count}${font monofur:pixelsize=16}
${font}${alignc}${color3}Dn ${totaldown eth0} ${downspeed eth0} k/s
${alignc}${color9}Up ${totalup eth0} ${upspeed eth0} k/s${color}${font monofur:pixelsize=16}
${font Woodbadge:size=15}${color2}VNSTATS:${font}
${color} Down Up Total${font monofur:pixelsize=16}
${font}${color}${time %b %y} ${color3}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $3 $4}'}${goto 125}${color9}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $6 $7}'}${goto 200}${color}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $9 $10}'}${font monofur:pixelsize=16}
${font}${color}${exec date | awk '{print $3" "$2}'}${color3} ${execi 300 vnstat | grep "today" | awk '{print $2 $3}'}${goto 125}${color9}${execi 300 vnstat | grep "today" | awk '{print $5 $6}'}${goto 200}${color}${execi 300 vnstat | grep "today" | awk '{print $8 $9}'}
${color}${exec date --date="-1 day" | awk '{print $3" "$2}'}${color3} ${execi 300 vnstat | grep "yesterday" | awk '{print $2 $3}'}${goto 125}${color9}${execi 300 vnstat | grep "yesterday" | awk '{print $5 $6}'}${goto 200}${color}${execi 300 vnstat | grep "yesterday" | awk '{print $8 $9}'}
${color}Last 7 ${color3}${execi 300 vnstat -w | grep "last 7 days" | awk '{print $4 $5}'}${goto 125}${color9}${execi 300 vnstat -w | grep "last 7 days" | awk '{print $7 $8}'}${goto 200}${color}${execi 300 vnstat -w | grep "last 7 days" | awk '{print $10 $11}'}
## Conky Cairo Sidebar ##
## by jpope ##
## version 1.0.2011.09.30 ##
## ##
#################################
# . Conky settings . #
background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
double_buffer yes
no_buffers yes
text_buffer_size 2048
imlib_cache_size 0
imlib_cache_flush_interval 60
max_specials 1024
max_user_text 1024
#temperature_unit fahrenheit
# . Window specifications . #
own_window yes
own_window_type desktop
own_window_argb_visual yes
own_window_argb_value 0
own_window_hints undecorated,sticky,skip_taskbar,skip_pager,below
own_window_title ConkySidebar
own_window_class ConkySidebar
border_inner_margin 0
border_outer_margin 0
minimum_size 568 568
maximum_width 180
alignment top_right #Choices are: top_left, top_right, top_middle, bottom_left, bottom_right, bottom_middle, middle_left, middle_middle,
middle_right
gap_x 8
gap_y 16
# . Graphics settings . #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# . Text settings . #
use_xft yes
xftfont droid sans:size=8
xftalpha 0
use_spacer left
uppercase no
# . Color settings . #
default_color ffffff
# . Lua Load . #
lua_load ~/conky/sidebar.lua
lua_draw_hook_pre widgets
TEXT
${execi 3600 aptitude search '~U' | wc -l | tail > ~/conky/upd}
--[[ CairoSideBar by jpope
Most work here done by other conky masters with some slight modifications. ;)
v1.0.2011.09.30
]]
--[[
Conky Widgets by londonali1010 (2009)
This script is meant to be a "shell" to hold a suite of widgets for use in Conky.
To configure:
+ Copy the widget's code block (will be framed by --(( WIDGET NAME )) and --(( END WIDGET NAME )), with "[" instead of "(") somewhere between
"require 'cairo'" and "function conky_widgets()", ensuring not to paste into another widget's code block
+ To call the widget, add the following between "cr = cairo_create(cs)" and "cairo_destroy(cr)" at the end of the script:
NAME_OF_FUNCTION(cr, OPTIONS)
+ Replace OPTIONS with the options for your widget (should be specified in the widget's code block)
Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/conky_widgets.lua):
lua_load ~/scripts/conky_widgets.lua
lua_draw_hook_pre widgets
Changelog:
+ v1.1 -- Simplified calls to widgets by implementing a global drawing surface, and included imlib2 by default (03.11.2009)
+ v1.0 -- Original release (17.10.2009)
]]
require 'cairo'
require 'imlib2'
usrhome = os.getenv("HOME")
--[[ USER OPTIONS ]]
clockface=3
color01=0x000000 --original 0x909090
color02=0xFFFFFF --original 0xFFFFFF
color03=0xFF0000 --original 0xFF0000
color04=0x606060 --original 0x707070
--[[ END USER OPTIONS ]]
--[[ ROUNDED RECTANGLE WIDGET ]]
--[[ v1.0 by londonali1010 (2009) ]]
--[[ Options (x0, y0, width, height, radius, colour, alpha):
"x0" and "y0" are the coordinates (in pixels) of the top left of the rectangle, relative to the top left of the Conky window.
"width" and "height" are the width and height of the rectangle, respectively.
"radius" is the rounding radius of the corners, in pixels.
"colour" is the colour of the rectangle, in format 0xRRGGBB.
"alpha" is the transparency of the rectangle, from 0.0 (transparent) -> 1.0 (opaque) ]]
function round_rect(x0, y0, w, h, r, colour, alpha)
local function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num>5 then
cairo_move_to(cr, x0, y0)
cairo_rel_move_to(cr, r, 0)
cairo_rel_line_to(cr, w-2*r, 0)
cairo_rel_curve_to(cr, r, 0, r, 0, r, r)
cairo_rel_line_to(cr, 0, h-2*r)
cairo_rel_curve_to(cr, 0, r, 0, r, -r, r)
cairo_rel_line_to(cr, -(w-2*r), 0)
cairo_rel_curve_to(cr, -r, 0, -r, 0, -r, -r)
cairo_rel_line_to(cr, 0, -(h-2*r))
cairo_rel_curve_to(cr, 0, -r, 0, -r, r, -r)
cairo_close_path(cr)
cairo_set_source_rgba(cr, rgb_to_r_g_b(colour, alpha))
cairo_fill(cr)
end
end
--[[ END ROUNDED RECTANGLE WIDGET ]]
--[[ PRINT TEXT ]]
--[[ jpope 2011.09.30 ]]
--[[ based on SHINY CALENDAR PAGE WIDGET v1.0 by londonali1010 (2009) ]]
--[[ Options (xcc, ycc, size, bg_colour, fg_colour, alpha)
-- "xcc" and "ycc" are the x and y coordinates of the centre of the widget, in pixels, relative to the top left of the Conky window.
-- "size" is the width of the widget (which is square).
-- "bg_colour" is the colour, in format 0xRRGGBB, of the widget's background.
-- "fg_colour" is the colour of the widget's text.
-- "alpha" is the opacity (0.0 -> 1.0) of the widget. ]]
function printtext(xcc, ycc, size, bgc, fgc, alpha)
local function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num>5 then
local function set_font_sizes()
day_size = 1.0
date_size = 1.0
month_size = 1.0
var_size = 1.0
data_size = 1.0
local extents = cairo_text_extents_t:create()
cairo_select_font_face(cr, "Droid Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
cairo_set_font_size(cr, day_size)
cairo_text_extents(cr, day, extents)
local w = math.abs(extents.width)
local h = math.abs(extents.y_bearing)
local scale_w = 0.8*size / w
local scale_h = 0.1*size / h
local scale
if scale_w < scale_h then scale = scale_w else scale = scale_h end
day_size = scale * day_size
cairo_set_font_size(cr, date_size)
cairo_text_extents(cr, date, extents)
w = math.abs(extents.width)
h = math.abs(extents.y_bearing)
scale_w = 0.6*size / w
scale_h = 0.6*size / h
if scale_w < scale_h then scale = scale_w else scale = scale_h end
date_size = scale * date_size
cairo_set_font_size(cr, month_size)
cairo_text_extents(cr, month, extents)
w = math.abs(extents.width)
h = math.abs(extents.y_bearing)
scale_w = 0.8*size / w
scale_h = 0.1*size / h
if scale_w < scale_h then scale = scale_w else scale = scale_h end
month_size = scale * month_size
cairo_set_font_size(cr, var_size)
cairo_text_extents(cr, var, extents)
w = math.abs(extents.width)
h = math.abs(extents.y_bearing)
scale_w = 0.9*size / w
scale_h = 0.09*size / h
if scale_w < scale_h then scale = scale_w else scale = scale_h end
var_size = scale * var_size
cairo_set_font_size(cr, data_size)
cairo_text_extents(cr, data, extents)
w = math.abs(extents.width)
h = math.abs(extents.y_bearing)
scale_w = 0.9*size / w
scale_h = 0.06*size / h
if scale_w < scale_h then scale = scale_w else scale = scale_h end
data_size = scale * data_size
return day_size, date_size, month_size, var_size, data_size
end
local function draw_text()
local extents = cairo_text_extents_t:create()
cairo_set_source_rgba(cr, rgb_to_r_g_b(fgc, alpha))
cairo_set_font_size(cr, day_size)
cairo_text_extents(cr, day, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 0.35*size)
cairo_show_text(cr, day)
cairo_set_font_size(cr, date_size)
cairo_text_extents(cr, date, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 0.5*size - extents.y_bearing/2)
cairo_show_text(cr, date)
cairo_set_font_size(cr, month_size)
cairo_text_extents(cr, month, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 0.70*size)
cairo_show_text(cr, month)
var = "CPU"
cairo_set_font_size(cr, var_size)
cairo_text_extents(cr, var, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 0.95*size)
cairo_show_text(cr, var)
data = conky_parse('${cpu cpu0}%')
cairo_set_font_size(cr, data_size)
cairo_text_extents(cr, data, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 1.02*size)
cairo_show_text(cr, data)
data = conky_parse('${hwmon temp 3}C')
cairo_set_font_size(cr, data_size)
cairo_text_extents(cr, data, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2 - 2, y0 + 1.09*size)
cairo_show_text(cr, data)
var = "MEM"
cairo_set_font_size(cr, var_size)
cairo_text_extents(cr, var, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 1.2*size)
cairo_show_text(cr, var)
data = conky_parse('${memperc}%')
cairo_set_font_size(cr, data_size)
cairo_text_extents(cr, data, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 1.27*size)
cairo_show_text(cr, data)
data = conky_parse('${mem}')
cairo_set_font_size(cr, data_size)
cairo_text_extents(cr, data, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2 - 2, y0 + 1.34*size)
cairo_show_text(cr, data)
var = "Battery"
cairo_set_font_size(cr, var_size)
cairo_text_extents(cr, var, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 1.57*size)
cairo_show_text(cr, var)
data = conky_parse('${battery_percent BAT1}%')
cairo_set_font_size(cr, data_size)
cairo_text_extents(cr, data, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 1.64*size)
cairo_show_text(cr, data)
data = conky_parse('${battery_time BAT1}')
cairo_set_font_size(cr, data_size)
cairo_text_extents(cr, data, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 1.71*size)
cairo_show_text(cr, data)
var = "Wireless"
cairo_set_font_size(cr, var_size)
cairo_text_extents(cr, var, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 1.82*size)
cairo_show_text(cr, var)
data = conky_parse('${wireless_link_qual_perc wlan0}%')
cairo_set_font_size(cr, data_size)
cairo_text_extents(cr, data, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2 - 2, y0 + 1.89*size)
cairo_show_text(cr, data)
data = conky_parse('u:${upspeed wlan0}|d:${downspeed wlan0}')
cairo_set_font_size(cr, data_size)
cairo_text_extents(cr, data, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 1.96*size)
cairo_show_text(cr, data)
var = "VSIDO XFCE"
cairo_set_font_size(cr, var_size)
cairo_text_extents(cr, var, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 2.19*size)
cairo_show_text(cr, var)
data = conky_parse("Updates: ${execi 1 cat ~/conky/upd}")
cairo_set_font_size(cr, data_size)
cairo_text_extents(cr, data, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 2.26*size)
cairo_show_text(cr, data)
cairo_select_font_face(cr, "OpenLogos", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
var = "J"
cairo_set_font_size(cr, var_size*2)
cairo_text_extents(cr, var, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 2.44*size)
cairo_show_text(cr, var)
end
x0, y0 = xcc - size/2, ycc - size/2
day = os.date("%A")
date = os.date("%d")
month = os.date("%B")
day_size, date_size, month_size = set_font_sizes()
draw_text(day_size, date_size, month_size)
end
end
--[[ END PRINT TEXT ]]
--[[ GUAGE CLOCK WIDGET VERSION 2 ]]
--[[ Options (xc, yc, size, rpt, clr, alp, hrt, mst, thck):
"xc" and "yc" are the x and y coordinates of the centre of the clock, in pixels, relative to the top left of the Conky window
"size" is the total size of the widget, in pixels
"rpt" is the number of times to repeat the clock hands
"clr" = color
"alp" = alpha
"hrt" is the amount of space between the repeating hands for the hours
"mst" is the number of space between the repeating hands for seconds & minutes
"thck" is the starting thickness ]]
function guage_clockv2(cr, xc, yc, size, rpt, clr, clr2, alp, hrt, mst, thck)
local function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num>5 then
local offset = 0
local clock_r = (size - 2 * offset) / (2 * 1.25)
show_seconds=true
-- Grab time
local hours=os.date("%I")
local mins=os.date("%M")
local secs=os.date("%S")
secs_arc=(2*math.pi/60)*secs
mins_arc=(2*math.pi/60)*mins--+secs_arc/60
hours_arc=(2*math.pi/12)*hours+mins_arc/12
-- Background
lp=0
mark=(2*math.pi)/12
repeat
xss=xc+0.80*clock_r*math.sin(mark+mark*lp)
yss=yc-0.80*clock_r*math.cos(mark+mark*lp)
xs=xc+1.04*clock_r*math.sin(mark+mark*lp)
ys=yc-1.04*clock_r*math.cos(mark+mark*lp)
cairo_move_to(cr,xss,yss)
cairo_line_to(cr,xs,ys)
tck=thck
cairo_set_line_width(cr,tck)
cairo_set_source_rgba(cr,rgb_to_r_g_b(clr,(alp*0.1)))
cairo_stroke(cr)
lp = lp + 1
until lp >= 12
lp=0
mark=(2*math.pi)/60
repeat
xss=xc+0.84*clock_r*math.sin(mark+mark*lp)
yss=yc-0.84*clock_r*math.cos(mark+mark*lp)
xs=xc+1*clock_r*math.sin(mark+mark*lp)
ys=yc-1*clock_r*math.cos(mark+mark*lp)
cairo_move_to(cr,xss,yss)
cairo_line_to(cr,xs,ys)
tck=thck
cairo_set_line_width(cr,tck)
cairo_set_source_rgba(cr,rgb_to_r_g_b(clr,(alp*0.1)))
cairo_stroke(cr)
lp = lp + 1
until lp >= 60
-- Draw hour hand
th=2*math.pi/hrt
xhs=xc+0*clock_r*math.sin(hours_arc-th)
yhs=yc-0*clock_r*math.cos(hours_arc-th)
xh=xc+0.70*clock_r*math.sin(hours_arc-th)
yh=yc-0.70*clock_r*math.cos(hours_arc-th)
cairo_move_to(cr,xhs,yhs)
cairo_line_to(cr,xh,yh)
cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
cairo_set_line_width(cr,thck+thck*0.5)
al=alp*0.5
cairo_set_source_rgba(cr,rgb_to_r_g_b(clr,(al)))
cairo_stroke(cr)
-- Draw minute hand
tm=(2*math.pi)/mst
xms=xc+0*clock_r*math.sin(mins_arc-tm)
yms=yc-0*clock_r*math.cos(mins_arc-tm)
xm=xc+0.95*clock_r*math.sin(mins_arc-tm)
ym=yc-0.95*clock_r*math.cos(mins_arc-tm)
cairo_move_to(cr,xms,yms)
cairo_line_to(cr,xm,ym)
tk=thck/2
cairo_set_line_width(cr,tk)
cairo_set_source_rgba(cr,rgb_to_r_g_b(clr,(alp)))
cairo_stroke(cr)
-- Draw seconds hand
if show_seconds then
ts=(2*math.pi)/mst
xss=xc+0*clock_r*math.sin(secs_arc-ts)
yss=yc-0*clock_r*math.cos(secs_arc-ts)
xs=xc+1.05*clock_r*math.sin(secs_arc-ts)
ys=yc-1.05*clock_r*math.cos(secs_arc-ts)
cairo_move_to(cr,xss,yss)
cairo_line_to(cr,xs,ys)
tck=thck/3
cairo_set_line_width(cr,tck)
cairo_set_source_rgba(cr,rgb_to_r_g_b(clr2,(alp)))
cairo_stroke(cr)
end
end
end
--[[ END GUAGE CLOCK WIDGET VERSION 2 ]]
--[[ RING WIDGET ]]
--[[ v1.1 by londonali1010 (2009) ]]
--[[ Options (name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle):
"name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
"arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not
use an argument in the Conky variable, use ''.
"max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
"bg_colour" is the colour of the base ring.
"bg_alpha" is the alpha value of the base ring.
"fg_colour" is the colour of the indicator part of the ring.
"fg_alpha" is the alpha value of the indicator part of the ring.
"x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
"radius" is the radius of the ring.
"thickness" is the thickness of the ring, centred around the radius.
"start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
"end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be
larger (e.g. more clockwise) than start_angle. ]]
function ring(name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
local function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
local function draw_ring(pct)
local angle_0 = sa * (2 * math.pi/360) - math.pi/2
local angle_f = ea * (2 * math.pi/360) - math.pi/2
local pct_arc = pct * (angle_f - angle_0)
-- Draw background ring
cairo_arc(cr, xc, yc, r, angle_0, angle_f)
cairo_set_source_rgba(cr, rgb_to_r_g_b(bgc, bga))
cairo_set_line_width(cr, t)
cairo_stroke(cr)
-- Draw indicator ring
cairo_arc(cr, xc, yc, r, angle_0, angle_0 + pct_arc)
cairo_set_source_rgba(cr, rgb_to_r_g_b(fgc, fga))
cairo_stroke(cr)
end
local function setup_ring()
local str = ''
local value = 0
str = string.format('${%s %s}', name, arg)
str = conky_parse(str)
value = tonumber(str)
if value == nil then value = 0 end
pct = value/max
draw_ring(pct)
end
local updates = conky_parse('${updates}')
update_num = tonumber(updates)
if update_num > 5 then setup_ring() end
end
--[[ END RING WIDGET ]]
--[[ RING (COUNTER-CLOCKWISE) WIDGET ]]
--[[ v1.1 by londonali1010 (2009) ]]
--[[ Options (name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle):
"name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
"arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not
use an argument in the Conky variable, use ''.
"max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
"bg_colour" is the colour of the base ring.
"bg_alpha" is the alpha value of the base ring.
"fg_colour" is the colour of the indicator part of the ring.
"fg_alpha" is the alpha value of the indicator part of the ring.
"x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
"radius" is the radius of the ring.
"thickness" is the thickness of the ring, centred around the radius.
"start_angle" is the starting angle of the ring, in degrees, counter-clockwise from top. Value can be either positive or negative.
"end_angle" is the ending angle of the ring, in degrees, counter-clockwise from top. Value can be either positive or negative, but must
be larger (e.g. more counter-clockwise) than start_angle. ]]
function ring_ccw(name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
local function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
local function draw_ring(pct)
local angle_0 = sa * (2 * math.pi/360) - math.pi/2
local angle_f = ea * (2 * math.pi/360) - math.pi/2
local pct_arc = pct * (angle_f - angle_0)
-- Draw background ring
cairo_arc_negative(cr, xc, yc, r, angle_0, angle_f)
cairo_set_source_rgba(cr, rgb_to_r_g_b(bgc, bga))
cairo_set_line_width(cr, t)
cairo_stroke(cr)
-- Draw indicator ring
cairo_arc_negative(cr, xc, yc, r, angle_0, angle_0 - pct_arc)
cairo_set_source_rgba(cr, rgb_to_r_g_b(fgc, fga))
cairo_stroke(cr)
end
local function setup_ring()
local str = ''
local value = 0
str = string.format('${%s %s}', name, arg)
str = conky_parse(str)
value = tonumber(str)
if value == nil then value = 0 end
pct = value/max
draw_ring(pct)
end
local updates = conky_parse('${updates}')
update_num = tonumber(updates)
if update_num > 5 then setup_ring() end
end
--[[ END RING (COUNTER-CLOCKWISE) WIDGET ]]
function conky_widgets()
if conky_window == nil then return end
if cs == nil or cairo_xlib_surface_get_width(cs) ~= conky_window.width or cairo_xlib_surface_get_height(cs) ~= conky_window.height then
if cs then cairo_surface_destroy(cs) end
cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width,
conky_window.height)
end
if cr then cairo_destroy(cr) end
cr = cairo_create(cs)
round_rect(0, 0, 180, 568, 5, color01, 0.3)
round_rect(5, 5, 170, 170, 10, color01, 0.3)--(x0, y0, width, height, radius, colour, alpha)
round_rect(10, 10, 160, 160, 20, color04, 0.3)
round_rect(5, 180, 170, 100, 10, color01, 0.3)
round_rect(10, 185, 160, 90, 20, color04, 0.3)
round_rect(5, 285, 170, 100, 10, color01, 0.3)
round_rect(10, 290, 160, 90, 20, color04, 0.3)
round_rect(5, 390, 170, 100, 10, color01, 0.3)
round_rect(10, 395, 160, 90, 20, color04, 0.3)
round_rect(5, 495, 170, 68, 10, color01, 0.3)
round_rect(10, 500, 160, 58, 20, color04, 0.3)
guage_clockv2(cr, 90, 90, 170, 1, color02, color03, 0.98, 1, 1, 2)
printtext(90, 230, 170, color01, color02, 0.5)
cairo_destroy(cr)
cr = cairo_create(cs)
ring('cpu', 'cpu0', 100, color01, 0.1, color02, 0.2, 10, 336, 37, 5, 0, 180)
ring_ccw('memperc', '', 100, color01, 0.1, color02, 0.2, 170, 336, 37, 5, 0, 180)
ring('battery_percent', 'BAT1', 100, color01, 0.1, color02, 0.2, 10, 441, 37, 5, 0, 180)
ring_ccw('wireless_link_qual_perc', 'wlan0', 100, color01, 0.1, color02, 0.2, 170, 441, 37, 5, 0, 180)
cairo_destroy(cr)
cr = nil
end
function conky_cairo_cleanup()
cairo_surface_destroy(cs)
cs = nil
end
######################
# - Conky settings - #
# -Based on a conky- #
# -by McLovins Bars- #
######################
background no
update_interval 1
cpu_avg_samples 2
total_run_times 0
override_utf8_locale yes
double_buffer yes
#no_buffers yes
text_buffer_size 10240
imlib_cache_size 10240
minimum_size 300 1080
maximum_width 300
gap_x 15
gap_y 5
#####################
# - Text settings - #
#####################
use_xft yes
xftfont Santana:size=10
xftalpha .8
uppercase no
# Text alignment, other possible values are commented
#alignment middle_left
#alignment middle_middle
#alignment middle_right
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment bottom_middle
######################
# - Color settings - #
######################
color0 c3c3c3 #mid gray
color1 FF0000 #red
color2 A4FFA4 #light green
color3 007EFF #bright blue
color4 E3E3E3 #very light gray
color5 c6771a #an orange shade
color6 CA8718 #a dust like color
color7 FFE500 #a darker yellow color
color8 C3FF00 #lime green
color9 227992 #bars-blue #another blue 48a3fd
default_color c3c3c3
default_shade_color gray
default_outline_color black
#############################
# - Window specifications - #
#############################
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class conky-semi
own_window_title clicky
#own_window_argb_visual yes
#own_window_argb_value 255
border_inner_margin 0
border_outer_margin 0
#########################
# - Graphics settings - #
#########################
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
draw_graph_borders no
####
## Load Lua for bargraphs (required)
## Set the path to your script here.
#
#lua_load ~/conky/draw-bg.lua
lua_load ~/conky/bargraph.lua
lua_draw_hook_pre main_bars
lua_load ~/conky/LUA/mounted.lua
TEXT
${lua get_mounted_data 3}#${lua conky_draw_bg 10 0 0 0 0 0x363636 0.4}
#${alignc}SYSTEM
${goto 6}${voffset 4}${color 547EC8}${font xspiralmental:size=14}G${color}${font}${voffset -4}${goto 32}Distro:${alignr}${execi 2600 cat /etc/issue.net}-VSIDO
${goto 6}${voffset 4}${color 547EC8}${font xspiralmental:size=14}Z${color}${font}${voffset -4}${goto 32}Kernel:${alignr}${kernel} (${execi 3600 uname -m})
${goto 6}${voffset 4}${color 547EC8}${font StyleBats:size=14}o${color}${font}${voffset -4}${goto 32}Uptime:${alignr}${uptime}
${goto 6}${voffset 4}${color 547EC8}${font StyleBats:size=16}q${color}${font}${voffset -4}${goto 32}Processes:${alignr}${processes} ($running_processes running)
#${goto 6}${voffset 5}${font PizzaDude Bullets:size=14}J${font}${voffset -4}${goto 32}${voffset -4}Security updates: ${goto 285}${execi 600 /usr/lib/update-notifier/apt-check 2>&1 |cut -d ';' -f 1}
#${goto 32}Normal updates: ${goto 285}${execi 600 /usr/lib/update-notifier/apt-check 2>&1 |cut -d ';' -f 2}
${color 547EC8}${hr}${color}
${goto 6}${color 951C1C}${font Weather:size=22}x${color}${font}${goto 32}${voffset -2}Motherboard Temp: ${alignr}${hwmon temp 1}º C${font}
${goto 6}${color 951C1C}${font Weather:size=22}x${color}${font}${goto 32}${voffset -2}CPU Socket Temp: ${alignr}${hwmon temp 2}º C${font}
#${goto 6}${color 547EC8}${font PizzaDude Bullets:size=16}e${color}${font}${goto 32}${voffset -2}Physical CPU Temp: ${alignr}${hwmon temp 3}º C${font}
${color 547EC8}${hr}${color}
${goto 46}${color 547EC8}${font Poky:size=14}P${color}${voffset}${font}${voffset -4}${goto 28}${alignc}${execi 1000 cat /proc/cpuinfo | egrep -m 'model name' | sed -e 's/model name.*: //' | cut -c41-47} ${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c1-5} ${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c10-13}-${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c19-20} ${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c28-49}
${goto 70}${color 951C1C}${font Weather:size=22}x${color}${font}${voffset -4}${goto 85}Physical CPU Temp: ${alignr}${goto 200}${hwmon temp 3}º C${font}
${alignc}Avg Usage of Quad Core CPU: ${cpu cpu0}%
${alignc}Load: ${loadavg}
${goto 83}${color 951C1C}${font Weather:size=22}x${color}${font}${goto 32}${voffset -4}${alignc}Core 1 Temp: ${execi 10 sensors | grep "Core 1" | cut -d "+" -f2 | cut -c1-2}º C
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU1: ${freq_g 1}Gh ${alignr}${cpu cpu1}%
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU2: ${freq_g 2}Gh ${alignr}${cpu cpu2}%
${goto 83}${color 951C1C}${font Weather:size=22}x${color}${font}${goto 32}${voffset -4}${alignc}Core 2 Temp: ${execi 10 sensors | grep "Core 2" | cut -d "+" -f2 | cut -c1-2}º C
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU3: ${freq_g 3}Gh ${alignr}${cpu cpu3}%
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU4: ${freq_g 4}Gh ${alignr}${cpu cpu4}%
${goto 83}${color 951C1C}${font Weather:size=22}x${color}${font}${goto 32}${voffset -4}${alignc}Core 3 Temp: ${execi 10 sensors | grep "Core 3" | cut -d "+" -f2 | cut -c1-2}º C
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU5: ${freq_g 5}Gh ${alignr}${cpu cpu5}%
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU6: ${freq_g 6}Gh ${alignr}${cpu cpu6}%
${goto 83}${color 951C1C}${font Weather:size=22}x${color}${font}${goto 32}${voffset -4}${alignc}Core 4 Temp: ${execi 10 sensors | grep "Core 0" | cut -d "+" -f2 | cut -c1-2}º C
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU7: ${freq_g 7}Gh ${alignr}${cpu cpu7}%
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU8: ${freq_g 8}Gh ${alignr}${cpu cpu8}%
${goto 66}${voffset 4}${color 547EC8}${font Poky:size=14}M${color}${font}${voffset -8}${goto 32}${alignc}Used RAM: ${mem}${voffset -4}
${voffset 4}${goto 32}${alignc}Total RAM: ${memmax}
${voffset}${goto 32}${alignc}Swap: ${swap} ${color}/ ${color}${swapmax}
${goto 7.5}${voffset 4}${color 547EC8}${font Poky:size=15}a${color}${font}${goto 32}${voffset -10}Highest:${goto 153}CPU${alignr}RAM
${goto 32}${voffset -5.5}${color 547EC8}${hr}${color}
${voffset -1}${goto 32}${top name 1} ${goto 150}${top cpu 1}${alignr }${top mem 1}
${voffset -1}${goto 32}${top name 2} ${goto 150}${top cpu 2}${alignr }${top mem 2}
${voffset -1}${goto 32}${top name 3} ${goto 150}${top cpu 3}${alignr }${top mem 3}
${voffset -1}${goto 32}${top name 4} ${goto 150}${top cpu 4}${alignr }${top mem 4}
#${voffset -1}${alignc} SSD
FSYS${color} = ${lua mount 1 total}${goto 100}${color8}SIZE${goto 150}${color7}FREE${goto 200}${color1}USED${goto 255}${color}MOUNT
${voffset -5} ${color 547EC8}${stippled_hr 5 1}${color}
${color6}${lua mount 1 fsys 9}${goto 100}${color8}${lua mount 1 size}${goto 150}${color7}${lua mount 1 free}${goto 200}${color1}${lua mount 1 use%}${goto 260}${color}${lua mount 1 mount}
${color6}${lua mount 2 fsys 9}${goto 100}${color8}${lua mount 2 size}${goto 150}${color7}${lua mount 2 free}${goto 200}${color1}${lua mount 2 use%}${goto 260}${color}${lua mount 2 mount}
${color6}${lua mount 3 fsys 9}${goto 100}${color8}${lua mount 3 size}${goto 150}${color7}${lua mount 3 free}${goto 200}${color1}${lua mount 3 use%}${goto 260}${color}${lua mount 3 mount}
${color6}${lua mount 4 fsys 9}${goto 100}${color8}${lua mount 4 size}${goto 150}${color7}${lua mount 4 free}${goto 200}${color1}${lua mount 4 use%}${goto 260}${color}${lua mount 4 mount}
${goto 3}${color 547EC8}${font Martin Vogel's Symbols:size=20}h${color}${font}${voffset -4}${goto 32}Disk I/O: ${diskio}${alignr}${voffset -10}${diskiograph 18,160 00D7FF FF452A -l -t}
${alignc} NETWORK ${alignr}${gw_iface} ${voffset -3}
${color 547EC8}${font PizzaDude Bullets:size=16}M${color}${font}${goto 32}${voffset -4}Upload Speed: ${upspeedf wlan0}${font}${alignr}Total: ${totalup wlan0}
${color 547EC8}${font PizzaDude Bullets:size=16}S${color}${font}${goto 32}${voffset -4}Download Speed: ${downspeedf wlan0}${font}${goto 32}${alignr}Total: ${totaldown wlan0}
${color 547EC8}${font Poky:size=16}w${color}${font}${goto 32}${voffset -20}Router IP: ${alignr}${gw_ip}
${goto 32}Local IP: ${alignr}${addr wlan0}
${goto 32}Public IP: ${alignr}${execi 300 wget -q -O - checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'}
${goto 32}Signal : ${alignr}${wireless_link_qual_perc wlan0}%
${color 547EC8}${font Poky:size=19}Q${color}${font}${goto 32}${voffset -9}Battery${alignr}${battery_percent BAT1}%
${alignc}${battery_time BAT1}
${color 547EC8}${stippled_hr 5 1}${color}
${color 547EC8}${font Poky:size=16}q${color}${font}${goto 32}${voffset -4}Updates${execpi 3600 ~/conky/header.sh}
${color 547EC8}${hr}${color}
${alignc}${color 547EC8}Live: ${color}${execpi 900 conkyEmail --servertype=POP --servername=pop3.live.com --ssl --username=youremail --password=yourpassword --mailinfo=0}
${alignc}${color 547EC8}Hotmail: ${color}${execpi 900 conkyEmail --servertype=POP --servername=pop3.live.com --ssl --username=youremail --password=yourpassword --mailinfo=0}
--[[partitions for conky by mrpeachy
##instructions
##load script
lua_load ~/lua/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type text_length}, where partition number is a number
## text_length is optional, lets you specify the max number of characters the function returns. only affects fsys and mount data options
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
TEXT
CPU %: ${cpu cpu0} ${lua get_mounted_data 10}
TOTAL PARTITIONS MOUNTED: ${lua mount 1 total}
FSYS${goto 100}SIZE${goto 200}USED%${goto 300}MOUNT
${lua mount 1 fsys}${goto 100}${lua mount 1 size}${goto 200}${lua mount 1 use%}${goto 300}${lua mount 1 mount 10}
${lua mount 2 fsys}${goto 100}${lua mount 2 size}${goto 200}${lua mount 2 use%}${goto 300}${lua mount 2 mount 10}
${lua mount 3 fsys}${goto 100}${lua mount 3 size}${goto 200}${lua mount 3 use%}${goto 300}${lua mount 3 mount 10}
${lua mount 4 fsys}${goto 100}${lua mount 4 size}${goto 200}${lua mount 4 use%}${goto 300}${lua mount 4 mount 10}
]]
conky_start=1
function conky_get_mounted_data(interval)
local updates=tonumber(conky_parse("${updates}"))
timer=(updates % interval)
if timer==0 or conky_start==1 then
fsys={}
size={}
used={}
avail={}
uperc={}
mount={}
local file = io.popen("df -h")
for line in file:lines() do
if string.find(line,"/dev/")~=nil then
local s,f,fs=string.find(line,"^([%d%a%p]*)%s")
table.insert(fsys,fs)
local s,f,sz=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(size,sz)
local s,f,us=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(used,us)
local s,f,av=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(avail,av)
local s,f,up=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(uperc,up)
local s,f,mn=string.find(line,"%s*([%d%a%p]*)%s*$",f)
table.insert(mount,mn)
end
end
file:close()
conky_start=nil
end--timed section
return ""
end
function conky_mount(n,d,c)--n=partition_number,d=data_type,c=number of characters to return
d=tostring(d)
n=tonumber(n)
c=tonumber(c) or 0
if d=="total" then
data=#fsys or 1
elseif d=="fsys" then
data=fsys[n] or ""
if c~=0 then
data=string.sub(data,1,c) or ""
end
elseif d=="size" then
data=size[n] or ""
elseif d=="used" then
data=used[n] or ""
elseif d=="free" then
data=avail[n] or ""
elseif d=="use%" then
data=uperc[n] or ""
elseif d=="mount" then
data=mount[n] or ""
if c~=0 then
data=string.sub(data,1,c) or ""
end
else
data="check data type"
end
return data
end--end main function
--[[ BARGRAPH WIDGET
To call the script in a conky, use, before TEXT
lua_load /path/to/the/script/bargraph.lua
lua_draw_hook_pre main_rings
and add one line (blank or not) after TEXT
Parameters are :
3 parameters are mandatory
name - the name of the conky variable to display, for example for {$cpu cpu0}, just write name="cpu"
arg - the argument of the above variable, for example for {$cpu cpu0}, just write arg="cpu0"
arg can be a numerical value if name=""
max - the maximum value the above variable can reach, for example, for {$cpu cpu0}, just write max=100
Optional parameters:
x,y - coordinates of the starting point of the bar, default = middle of the conky window
cap - end of cap line, ossibles values are r,b,s (for round, butt, square), default="b"
http://www.cairographics.org/samples/set_line_cap/
angle - angle of rotation of the bar in degress, default = 0 (i.e. a vertical bar)
set to 90 for an horizontal bar
skew_x - skew bar around x axis, default = 0
skew_y - skew bar around y axis, default = 0
blocks - number of blocks to display for a bar (values >0) , default= 10
height - height of a block, default=10 pixels
width - width of a block, default=20 pixels
space - space between 2 blocks, default=2 pixels
angle_bar - this angle is used to draw a bar on a circular way (ok, this is no more a bar !) default=0
radius - for cicular bars, internal radius, default=0
with radius, parameter width has no more effect.
Colours below are defined into braces {colour in hexadecimal, alpha}
fg_colour - colour of a block ON, default= {0x00FF00,1}
bg_colour - colour of a block OFF, default = {0x00FF00,0.5}
alarm - threshold, values after this threshold will use alarm_colour colour , default=max
alarm_colour - colour of a block greater than alarm, default=fg_colour
smooth - (true or false), create a gradient from fg_colour to bg_colour, default=false
mid_colour - colours to add to gradient, with this syntax {position into the gradient (0 to1), colour hexa, alpha}
for example, this table {{0.25,0xff0000,1},{0.5,0x00ff00,1},{0.75,0x0000ff,1}} will add
3 colurs to gradient created by fg_colour and alarm_colour, default=no mid_colour
led_effect - add LED effects to each block, default=no led_effect
if smooth=true, led_effect is not used
possibles values : "r","a","e" for radial, parallelel, perdendicular to the bar (just try!)
led_effect has to be used with theses colours :
fg_led - middle colour of a block ON, default = fg_colour
bg_led - middle colour of a block OFF, default = bg_colour
alarm_led - middle colour of a block > ALARM, default = alarm_colour
reflection parameters, not avaimable for circular bars
reflection_alpha - add a reflection effect (values from 0 to 1) default = 0 = no reflection
other values = starting opacity
reflection_scale - scale of the reflection (default = 1 = height of text)
reflection_length - length of reflection, define where the opacity will be set to zero
calues from 0 to 1, default =1
reflection - position of reflection, relative to a vertical bar, default="b"
possibles values are : "b","t","l","r" for bottom, top, left, right
draw_me - if set to false, text is not drawn (default = true or 1)
it can be used with a conky string, if the string returns 1, the text is drawn :
example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",
]]
require 'cairo'
----------------START OF PARAMETERS ----------
function conky_main_bars()
local bars_settings={
{ --[ Graph for MOBO Temp ]--
name="hwmon temp 1",
arg="hwmon temp 1",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=35,
x=158, y=106,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU Socket Temp ]--
name="hwmon temp 2",
arg="hwmon temp 2",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=35,
x=158, y=133,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
--[[ { --[ Graph for Physical CPU Temp ]--
name="hwmon temp 3",
arg="hwmon temp 3",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=35,
x=158, y=133,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
]] { --[ Graph for CPU1 Left ]--
name="cpu",
arg="cpu1",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},--color was 2a95b4
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=187, y=275,
height=3,width=7,
angle=273,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU1 Right ]--
name="cpu",
arg="cpu1",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=185, y=268,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU2 Left]--
name="cpu",
arg="cpu2",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=187, y=292,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU2 Right]--
name="cpu",
arg="cpu2",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=185, y=285,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU3 Left ]--
name="cpu",
arg="cpu3",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=187, y=337,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU3 Right ]--
name="cpu",
arg="cpu3",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=185, y=330,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU4 Left ]--
name="cpu",
arg="cpu4",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=187, y=356,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU4 Right ]--
name="cpu",
arg="cpu4",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=185, y=349,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU5 Left ]--
name="cpu",
arg="cpu5",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=187, y=401,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU5 Right ]--
name="cpu",
arg="cpu5",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=185, y=394,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU6 Left ]--
name="cpu",
arg="cpu6",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=187, y=420,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU6 Right ]--
name="cpu",
arg="cpu6",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=185, y=413,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU7 Left ]--
name="cpu",
arg="cpu7",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=187, y=466,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU7 Right ]--
name="cpu",
arg="cpu7",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=185, y=459,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU8 Left ]--
name="cpu",
arg="cpu8",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=187, y=485,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU8 Right ]--
name="cpu",
arg="cpu8",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=185, y=478,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for Memory ]--
name="memperc",
arg="",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
x=63,y=550,
blocks=89,
space=0,
height=2,width=12,
angle=90,
led_effect="e",
cap="r",
},
--[[ { --[ Graph for Root ]--
name="fs_used_perc",
arg="/",
max=100,
alarm=75,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=92,
x=65, y=500,
height=2,width=10,
angle=90,
led_effect="e",
space=0,
cap="r",
},
{ --[ Graph for Home ]--
name="fs_used_perc",
arg="/home",
max=100,
alarm=75,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=92,
x=65, y=557,
height=2,width=10,
angle=90,
led_effect="e",
space=0,
cap="r",
},
]] { --[ Graph for WiFi Signal strength ]--
name="wireless_link_qual_perc",
arg="wlan0",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=62,
x=78, y=880,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for Battery power ]--
name="battery_percent",
arg="BAT1",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=60,
x=80, y=916,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
}
-----------END OF PARAMETERS--------------
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
--prevent segmentation error when reading cpu state
if tonumber(conky_parse('${updates}'))>3 then
for i in pairs(bars_settings) do
draw_multi_bar_graph(bars_settings[i])
end
end
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end
function draw_multi_bar_graph(t)
cairo_save(cr)
--check values
if t.draw_me == true then t.draw_me = nil end
if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end
if t.name==nil and t.arg==nil then
print ("No input values ... use parameters 'name' with 'arg' or only parameter 'arg' ")
return
end
if t.max==nil then
print ("No maximum value defined, use 'max'")
return
end
if t.name==nil then t.name="" end
if t.arg==nil then t.arg="" end
--set default values
if t.x == nil then t.x = conky_window.width/2 end
if t.y == nil then t.y = conky_window.height/2 end
if t.blocks == nil then t.blocks=10 end
if t.height == nil then t.height=10 end
if t.angle == nil then t.angle=0 end
t.angle = t.angle*math.pi/180
--line cap style
if t.cap==nil then t.cap = "b" end
local cap="b"
for i,v in ipairs({"s","r","b"}) do
if v==t.cap then cap=v end
end
local delta=0
if t.cap=="r" or t.cap=="s" then delta = t.height end
if cap=="s" then cap = CAIRO_LINE_CAP_SQUARE
elseif cap=="r" then
cap = CAIRO_LINE_CAP_ROUND
elseif cap=="b" then
cap = CAIRO_LINE_CAP_BUTT
end
--end line cap style
--if t.led_effect == nil then t.led_effect="r" end
if t.width == nil then t.width=20 end
if t.space == nil then t.space=2 end
if t.radius == nil then t.radius=0 end
if t.angle_bar == nil then t.angle_bar=0 end
t.angle_bar = t.angle_bar*math.pi/360 --halt angle
--colours
if t.bg_colour == nil then t.bg_colour = {0x00FF00,0.5} end
if #t.bg_colour~=2 then t.bg_colour = {0x00FF00,0.5} end
if t.fg_colour == nil then t.fg_colour = {0x00FF00,1} end
if #t.fg_colour~=2 then t.fg_colour = {0x00FF00,1} end
if t.alarm_colour == nil then t.alarm_colour = t.fg_colour end
if #t.alarm_colour~=2 then t.alarm_colour = t.fg_colour end
if t.mid_colour ~= nil then
for i=1, #t.mid_colour do
if #t.mid_colour[i]~=3 then
print ("error in mid_color table")
t.mid_colour[i]={1,0xFFFFFF,1}
end
end
end
if t.bg_led ~= nil and #t.bg_led~=2 then t.bg_led = t.bg_colour end
if t.fg_led ~= nil and #t.fg_led~=2 then t.fg_led = t.fg_colour end
if t.alarm_led~= nil and #t.alarm_led~=2 then t.alarm_led = t.fg_led end
if t.led_effect~=nil then
if t.bg_led == nil then t.bg_led = t.bg_colour end
if t.fg_led == nil then t.fg_led = t.fg_colour end
if t.alarm_led == nil then t.alarm_led = t.fg_led end
end
if t.alarm==nil then t.alarm = t.max end --0.8*t.max end
if t.smooth == nil then t.smooth = false end
if t.skew_x == nil then
t.skew_x=0
else
t.skew_x = math.pi*t.skew_x/180
end
if t.skew_y == nil then
t.skew_y=0
else
t.skew_y = math.pi*t.skew_y/180
end
if t.reflection_alpha==nil then t.reflection_alpha=0 end
if t.reflection_length==nil then t.reflection_length=1 end
if t.reflection_scale==nil then t.reflection_scale=1 end
--end of default values
local function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
--functions used to create patterns
local function create_smooth_linear_gradient(x0,y0,x1,y1)
local pat = cairo_pattern_create_linear (x0,y0,x1,y1)
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
if t.mid_colour ~=nil then
for i=1, #t.mid_colour do
cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
end
end
return pat
end
local function create_smooth_radial_gradient(x0,y0,r0,x1,y1,r1)
local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
if t.mid_colour ~=nil then
for i=1, #t.mid_colour do
cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
end
end
return pat
end
local function create_led_linear_gradient(x0,y0,x1,y1,col_alp,col_led)
local pat = cairo_pattern_create_linear (x0,y0,x1,y1) ---delta, 0,delta+ t.width,0)
cairo_pattern_add_color_stop_rgba (pat, 0.0, rgb_to_r_g_b(col_alp))
cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
cairo_pattern_add_color_stop_rgba (pat, 1.0, rgb_to_r_g_b(col_alp))
return pat
end
local function create_led_radial_gradient(x0,y0,r0,x1,y1,r1,col_alp,col_led,mode)
local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
if mode==3 then
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_alp))
cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))
else
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_led))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))
end
return pat
end
local function draw_single_bar()
--this fucntion is used for bars with a single block (blocks=1) but
--the drawing is cut in 3 blocks : value/alarm/background
--not zvzimzblr for circular bar
local function create_pattern(col_alp,col_led,bg)
local pat
if not t.smooth then
if t.led_effect=="e" then
pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
elseif t.led_effect=="a" then
pat = create_led_linear_gradient (t.width/2, 0,t.width/2,-t.height,col_alp,col_led)
elseif t.led_effect=="r" then
pat = create_led_radial_gradient (t.width/2, -t.height/2, 0, t.width/2,-t.height/2,t.height/1.5,col_alp,col_led,2)
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(col_alp))
end
else
if bg then
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(t.bg_colour))
else
pat = create_smooth_linear_gradient(t.width/2, 0, t.width/2,-t.height)
end
end
return pat
end
local y1=-t.height*pct/100
local y2,y3
if pct>(100*t.alarm/t.max) then
y1 = -t.height*t.alarm/100
y2 = -t.height*pct/100
if t.smooth then y1=y2 end
end
if t.angle_bar==0 then
--block for fg value
local pat = create_pattern(t.fg_colour,t.fg_led,false)
cairo_set_source(cr,pat)
cairo_rectangle(cr,0,0,t.width,y1)
cairo_fill(cr)
cairo_pattern_destroy(pat)
-- block for alarm value
if not t.smooth and y2 ~=nil then
pat = create_pattern(t.alarm_colour,t.alarm_led,false)
cairo_set_source(cr,pat)
cairo_rectangle(cr,0,y1,t.width,y2-y1)
cairo_fill(cr)
y3=y2
cairo_pattern_destroy(pat)
else
y2,y3=y1,y1
end
-- block for bg value
cairo_rectangle(cr,0,y2,t.width,-t.height-y3)
pat = create_pattern(t.bg_colour,t.bg_led,true)
cairo_set_source(cr,pat)
cairo_pattern_destroy(pat)
cairo_fill(cr)
end
end --end single bar
local function draw_multi_bar()
--function used for bars with 2 or more blocks
for pt = 1,t.blocks do
--set block y
local y1 = -(pt-1)*(t.height+t.space)
local light_on=false
--set colors
local col_alp = t.bg_colour
local col_led = t.bg_led
if pct>=(100/t.blocks) or pct>0 then --ligth on or not the block
if pct>=(pcb*(pt-1)) then
light_on = true
col_alp = t.fg_colour
col_led = t.fg_led
if pct>=(100*t.alarm/t.max) and (pcb*pt)>(100*t.alarm/t.max) then
col_alp = t.alarm_colour
col_led = t.alarm_led
end
end
end
--set colors
--have to try to create gradients outside the loop ?
local pat
if not t.smooth then
if t.angle_bar==0 then
if t.led_effect=="e" then
pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
elseif t.led_effect=="a" then
pat = create_led_linear_gradient (t.width/2, -t.height/2+y1,t.width/2,0+t.height/2+y1,col_alp,col_led)
elseif t.led_effect=="r" then
pat = create_led_radial_gradient (t.width/2, y1, 0, t.width/2,y1,t.width/1.5,col_alp,col_led,2)
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(col_alp))
end
else
if t.led_effect=="a" then
pat = create_led_radial_gradient (0, 0, t.radius+(t.height+t.space)*(pt-1),
0, 0, t.radius+(t.height+t.space)*(pt),
col_alp,col_led,3)
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(col_alp))
end
end
else
if light_on then
if t.angle_bar==0 then
pat = create_smooth_linear_gradient(t.width/2, t.height/2, t.width/2,-(t.blocks-0.5)*(t.height+t.space))
else
pat = create_smooth_radial_gradient(0, 0, (t.height+t.space), 0,0,(t.blocks+1)*(t.height+t.space),2)
end
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(t.bg_colour))
end
end
cairo_set_source (cr, pat)
cairo_pattern_destroy(pat)
--draw a block
if t.angle_bar==0 then
cairo_move_to(cr,0,y1)
cairo_line_to(cr,t.width,y1)
else
cairo_arc( cr,0,0,
t.radius+(t.height+t.space)*(pt)-t.height/2,
-t.angle_bar -math.pi/2 ,
t.angle_bar -math.pi/2)
end
cairo_stroke(cr)
end
end
local function setup_bar_graph()
--function used to retrieve the value to display and to set the cairo structure
if t.blocks ~=1 then t.y=t.y-t.height/2 end
local value = 0
if t.name ~="" then
value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
--$to_bytes doesn't work when value has a decimal point,
--https://garage.maemo.org/plugins/ggit/browse.php/?p=monky;a=commitdiff;h=174c256c81a027a2ea406f5f37dc036fac0a524b;hp=d75e2db5ed3fc788fb8514121f67316ac3e5f29f
--http://sourceforge.net/tracker/index.php?func=detail&aid=3000865&group_id=143975&atid=757310
--conky bug?
--value = (conky_parse(string.format('${%s %s}', t.name, t.arg)))
--if string.match(value,"%w") then
-- value = conky_parse(string.format('${to_bytes %s}',value))
--end
else
value = tonumber(t.arg)
end
if value==nil then value =0 end
pct = 100*value/t.max
pcb = 100/t.blocks
cairo_set_line_width (cr, t.height)
cairo_set_line_cap (cr, cap)
cairo_translate(cr,t.x,t.y)
cairo_rotate(cr,t.angle)
local matrix0 = cairo_matrix_t:create()
tolua.takeownership(matrix0)
cairo_matrix_init (matrix0, 1,t.skew_y,t.skew_x,1,0,0)
cairo_transform(cr,matrix0)
--call the drawing function for blocks
if t.blocks==1 and t.angle_bar==0 then
draw_single_bar()
if t.reflection=="t" or t.reflection=="b" then cairo_translate(cr,0,-t.height) end
else
draw_multi_bar()
end
--dot for reminder
--[[
if t.blocks ~=1 then
cairo_set_source_rgba(cr,1,0,0,1)
cairo_arc(cr,0,t.height/2,3,0,2*math.pi)
cairo_fill(cr)
else
cairo_set_source_rgba(cr,1,0,0,1)
cairo_arc(cr,0,0,3,0,2*math.pi)
cairo_fill(cr)
end]]
--call the drawing function for reflection and prepare the mask used
if t.reflection_alpha>0 and t.angle_bar==0 then
local pat2
local matrix1 = cairo_matrix_t:create()
tolua.takeownership(matrix1)
if t.angle_bar==0 then
pts={-delta/2,(t.height+t.space)/2,t.width+delta,-(t.height+t.space)*(t.blocks)}
if t.reflection=="t" then
cairo_matrix_init (matrix1,1,0,0,-t.reflection_scale,0,-(t.height+t.space)*(t.blocks-0.5)*2*(t.reflection_scale+1)/2)
pat2 = cairo_pattern_create_linear (t.width/2,-(t.height+t.space)*(t.blocks),t.width/2,(t.height+t.space)/2)
elseif t.reflection=="r" then
cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,delta+2*t.width,0)
pat2 = cairo_pattern_create_linear (delta/2+t.width,0,-delta/2,0)
elseif t.reflection=="l" then
cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,-delta,0)
pat2 = cairo_pattern_create_linear (-delta/2,0,delta/2+t.width,-0)
else --bottom
cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(t.height+t.space)*(t.reflection_scale+1)/2)
pat2 = cairo_pattern_create_linear (t.width/2,(t.height+t.space)/2,t.width/2,-(t.height+t.space)*(t.blocks))
end
end
cairo_transform(cr,matrix1)
if t.blocks==1 and t.angle_bar==0 then
draw_single_bar()
cairo_translate(cr,0,-t.height/2)
else
draw_multi_bar()
end
cairo_set_line_width(cr,0.01)
cairo_pattern_add_color_stop_rgba (pat2, 0,0,0,0,1-t.reflection_alpha)
cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)
if t.angle_bar==0 then
cairo_rectangle(cr,pts[1],pts[2],pts[3],pts[4])
end
cairo_clip_preserve(cr)
cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
cairo_stroke(cr)
cairo_mask(cr,pat2)
cairo_pattern_destroy(pat2)
cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
end --reflection
pct,pcb=nil
end --setup_bar_graph()
--start here !
setup_bar_graph()
cairo_restore(cr)
end
#!/bin/sh
# conkyheader.sh
# by Crinos512
# Usage:
# ${execp ~/conky/Manuel318/conkyheader.sh}
#OSVer=""`lsb_release -i | cut -f 2| tr "[:upper:]" "[:lower:]"`" ( "`lsb_release -r | cut -f 2`" )"
#WMVer=`Xfwm --version`
Updates=`aptitude search "~U" | wc -l | tail`
#Conky=`\{conky_version\}}`
#echo "\${voffset -20}\${font Diamond Fantasy:style=Bold:pixelsize=20}\${alignc}\${color}\$nodename\${font}"
#echo "\${font Liberation Sans:style=Bold:pixelsize=11}\${alignc}~ \$kernel \$machine ~"
#echo "\${alignc}~ $OSVer ~ $WMVer ~"
echo "\${alignr} $Updates System Updates"
#echo "\${alignc}~ $Conky ~"
#echo "\${alignc}~ Uptime: \$uptime_short ~\${color}\${font}"
#echo "\${voffset 0} \${color}( Conky \${conky_version}\${alignr}\${exec conkyForecast -V} )\${color} "
#echo "\${font Diamond Fantasy:style=Bold:pixelsize=14}\${offset 10}NUM: \${exec xset q | grep Num |awk '{print " "\$8}'}\${alignr}CAPS \${exec xset q | grep Caps |awk '{print " "\$4}'}\${font} "
exit 0
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type desktop
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 1825 100
maximum_width 1825
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment tl
gap_x 57
gap_y -10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
TEXT
${image /home/luke/Conky/amd_fx.png -s 75x75 -p 15,20}${image /home/luke/Conky/thermometer.png -s 68x83 -p 275,20}${image /home/luke/Conky/vengance.png -s 185x55 -p 365,35}${image /home/luke/Conky/ssd.png -s 90x65 -p 725,30}${image /home/luke/Conky/nvidia.png -s 70x75 -p 1340,27}${image /home/luke/Conky/router.png -s 90x65 -p 1500,25}
${voffset 8}${font WhiteRabbit:size=12}${goto 110}CPU1 ${goto 155}${cpu cpu1}% ${goto 200}CPU2 ${goto 245}${cpu cpu2}%
${voffset 5}${goto 110}CPU3 ${goto 155}${cpu cpu3}% ${goto 200}CPU4 ${goto 245}${cpu cpu4}%${voffset 6}${goto 335}${hwmon 3 temp 1}F${voffset -9}${goto 530}${mem}${goto 600} /${memmax}${voffset 12}${goto 850}/root${voffset -7}${goto 920}${fs_used /}${goto 1000} -Used${goto 1090}${voffset 7}/home${voffset -7}${goto 1165}${fs_used /home} ${goto 1242} -Used ${voffset 5}${goto 1425}${nvidia temp}F${voffset -5}${goto 1630}Download ${goto 1730}${downspeed eth0}
${voffset 3}${goto 110}CPU5 ${goto 155}${cpu cpu5}% ${goto 200}CPU6 ${goto 245}${cpu cpu6}%${voffset -3}${goto 530}${swap}${goto 600} /${swapmax}${voffset 3} ${font WhiteRabbit:size=18}${voffset -7}${font WhiteRabbit:size=12}${goto 920}${fs_size /}${goto 1000} -Total${voffset 2}${font WhiteRabbit:size=12}${goto 1165}${fs_size /home} ${goto 1242} -Total ${goto 1630}Upload ${goto 1730}${upspeed eth0}
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 165 225
maximum_width 165
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment middle_left
gap_x 10
gap_y 150
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
short_units yes
TEXT
${image /home/luke/Conky/drive.png -s 40x45 -p 2,10}
${font WhiteRabbit:size=14}${goto 50}Software
${voffset 3}${font WhiteRabbit:size=12}${goto 50}${fs_used /media/sdb1} ${goto 108}/${fs_size /media/sdb1}${voffset -3}
${image /home/luke/Conky/drive.png -s 40x45 -p 2,65}
${font WhiteRabbit:size=14}${goto 50}External
${voffset 3}${font WhiteRabbit:size=12}${goto 50}${fs_used /media/sde5} ${goto 108}/${fs_size /media/sde5}${voffset -3}
${image /home/luke/Conky/drive.png -s 40x45 -p 2,120}
${font WhiteRabbit:size=14}${goto 50}Music
${voffset 3}${font WhiteRabbit:size=12}${goto 50}${fs_used /media/sde6} ${goto 108}/${fs_size /media/sde6}${voffset -3}
${image /home/luke/Conky/drive.png -s 40x45 -p 2,177}
${font WhiteRabbit:size=14}${goto 50}Storage
${voffset 3}${font WhiteRabbit:size=12}${goto 50}${fs_used /media/storage} ${goto 108}/${fs_size /media/storage}${voffset -3}
${image /home/luke/Conky/drive.png -s 40x45 -p 2,233}
${font WhiteRabbit:size=14}${goto 50}Videos
${voffset 3}${font WhiteRabbit:size=12}${goto 50}${fs_used /media/sdc1} ${goto 108}/${fs_size /media/sdc1}
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 350 360
maximum_width 350
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment bottom_left
gap_x 10
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 6
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0
# 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
TEXT
${font WhiteRabbit:size=15}${goto 30}Temp ${goto 288}Feels${voffset 10}
${font WhiteRabbit:size=20}${goto 25}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F ${goto 286}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F
${font WhiteRabbit:size=11}${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 75,10 -s 240x225}
${font WhiteRabbit:size=15}${goto 30}Dawn ${goto 285}Dusk
${voffset 10}${font WhiteRabbit:size=17}${goto 15}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}${goto 262}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}${voffset -10}
${font WhiteRabbit:size=13}${goto 30}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 145}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 265}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/tod_ton}
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 215}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${voffset 5}${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 215}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${image $HOME/Accuweather_Conky_USA_Images/7.png -p 20,212 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/12.png -p 138,212 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/17.png -p 256,212 -s 80x67}${voffset -5}
${font WhiteRabbit:size=13}${goto 30}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 145}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 265}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/last_days}
${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 215}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${voffset 5}${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 215}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${image $HOME/Accuweather_Conky_USA_Images/22.png -p 20,299 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N2.png -p 138,299 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N7.png -p 256,299 -s 80x67}${voffset -5}
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 275 250
maximum_width 275
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment middle_middle
gap_x 140
gap_y 250
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
#### Load Lua #####
lua_load ~/Conky/chrono.lua
lua_draw_hook_pre main
TEXT
${image /home/luke/Conky/ClockFace.png -s 225x225 -p 0,0}
--[[ multiple analogue clocks by mrpeachy - 18 Jun 2012
21 Jun 2012 - Chronograph modifications by Sector11
22 Jun 2012 - again with mrpeachy's help day names, numbers and month names
12 Nov 2012 - memory leak plugged - mrpeachy
14 Nov 2012 - Personnalisation - Didier-T (forum Ubuntu.fr)
26 Nov 2012 - The Clock - Sector11 (small version)
use in conkyrc
lua_load /path/Chronograph.lua
lua_draw_hook_pre main
TEXT
-- INDEX
-- ### CLOCK POSITION - AND DEFAULTS ###
-- ### SET BORDER OPTIONS FOR "CLOCKS" ### -- I don't know how to remove this - NOT NEEDED
-- See lines 39 to 41 for overall size changes
-- ### START DIAL B ### Day Names Dial ###
-- See Lines 84 - 87 and 131 for changes
-- ### START DIAL C ### Month Names Dial ###
-- See Lines 150 -153 and 198 for changes
-- ### START DIAL D ### Day Numbers Dial ###
-- See Lines 234 & 265 for changes
-- ### START CLOCK A ###
-- See Lines & and 441 & 467 changes
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
-- CLOCK A HOUR HAND
-- CLOCK A MINUTE HAND SETUP
-- CLOCK A SECOND HAND SETUP
NOTE: Putting ### CLOCK A ### last insures that it's functions are written
over the other dials.
]]
require 'cairo'
-- ### CLOCK POSITION - AND DEFAULTS ##########################################
local init={
center_x=117,
center_y=112,
radius=80,
lang="English", -- English French Greek Spanish
hour=12, -- 12 | 24
second=true, --true | false - Seconds: dots and numbers IF 12HR
line=true, -- true | false - Part Second Hand
color=0xFF0000, --color for day, day number and month IF NO SECOND HAND
alpha=1 --alpha for day, day number and month IF NO SECOND HAND
}
-- ONLY NEED ONE COPY OF THIS FUNCTION
function rgb_to_r_g_b(col,alp)
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end
local colr, colg, colb, cola=rgb_to_r_g_b(init.color,init.alpha)
function conky_main()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
-- ### CLOCK 12|24 HR SELECTOR ############################
local clock_type_A=init.hour
-- ############################ CLOCK 12|24 HR SELECTOR ###
-- ### SET BORDER OPTIONS FOR "CLOCKS" ####################
--local clock_border_width=0
-- set color and alpha for clock border
--local cbr,cbg,cbb,cba=1,1,1,1 -- full opaque white
-- gap from clock border to minute marks
local b_to_m=0
-- #################### SET BORDER OPTIONS FOR "CLOCKS" ###
-- ### START DIAL B ### Day Names Dial ####################
-- DIAL POSITION
local center_x=init.center_x
local center_y=init.center_y
local radius=22
-- FONT
cairo_select_font_face (cr, "CorporateMonoExtraBold", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
-- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Sun","Mon","Tue","Wed","Thr","Fri","Sat",} end
if init.lang == "French" then text_days={"dim","lun","mar","mer","jeu","ven","sam",} end
if init.lang == "Greek" then text_days={"ΔΕΥ","ΤΡΙ","ΤΕΤ","ΠΕΜ","ΠΑΡ","ΣΑΒ","ΚΥΡ",} end
if init.lang == "Spanish" then text_days={"dom","lun","mar","mie","jue","vie","sab",} end
local day_number=tonumber(os.date("%w"))
if init.handday == true then
for i=1,7 do
-- work out points
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
else
for i=1,7 do -- working out points
if day_number == i-1 then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active day names
end
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=7
for i=1,7 do
if day_number == i-1 then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active
end
local point=(math.pi/180)*((360/7)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
-- ######################################### END DIAL B ###
-- ### START DIAL C ### Month Names Dial ##################
-- DIAL POSITION
local center_x=init.center_x --(+85)
local center_y=init.center_y
local radius=53
-- FONT
cairo_select_font_face (cr, "CorporateMonoExtraBold", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
-- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",} end
if init.lang == "French" then text_days={"jan","fév","mar","avr","mai","jui","jul","aôu","sep","oct","nov","déc",} end
if init.lang == "Greek" then text_days={"ΙΑΝ","ΦΕΒ","ΜΑΡ","ΑΠΡ","ΜΑΙ","ΙΟΥ","ΙΟΥ","ΑΥΓ","ΣΕΠ","ΟΚΤ","ΝΟΕ","ΔΕΚ",} end
if init.lang == "Spanish" then text_days={"ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",} end
local this_month=tonumber(os.date("%m"))
if init.handmonth == true then
for i=1,12 do
-- OUTER POINTS POSTION FOR -- ### START DIAL D ## TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
else
for i=1,12 do
if this_month == i then
cairo_set_source_rgba (cr,0,1,1,0) -- active month colour
else
cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active month names
end
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=38
for i=1,12 do
if this_month == i then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0.0) -- dots for non-active month names
end
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
end
-- ######################################### END DIAL C ###
-- ### START DIAL D ### Day Numbers Dial ##################
-- GET NUMBER OF DAYS IN CURRENT MONTH
-- calculate Feb, then set up table
year4num=os.date("%Y")
t1=os.time({year=year4num,month=03,day=01,hour=00,min=0,sec=0});
t2=os.time({year=year4num,month=02,day=01,hour=00,min=0,sec=0});
if init.hour == 12 then
febdaynum=tonumber((os.difftime(t1,t2))/(12*60*60))
else
febdaynum=tonumber((os.difftime(t1,t2))/(24*60*60))
end
-- MONTH TABLE
monthdays={31,febdaynum,31,30,31,30,31,31,30,31,30,31}
this_month=tonumber(os.date("%m"))
number_days=monthdays[this_month]
-- TEXT positioning
local center_x=init.center_x
local center_y=init.center_y
local radius=85
cairo_select_font_face (cr, "Liquid Crystal", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 20)
local this_day=tonumber(os.date("%d"))
for i=1,number_days do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
--only print even numbers
if math.mod(i, 2) == 0 and math.mod(this_day, 2)==0 then
text=string.format("%02d",i) --formats numbers to double digits
elseif math.mod(i, 2) ~= 0 and math.mod(this_day, 2)~=0 then
text=string.format("%02d",i) --formats numbers to double digits
else
text=""
end --odd even matching
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
if i==this_day then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- dim inactive numbers
end
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=70
for i=1,number_days do
local point=(math.pi/180)*((360/number_days)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
if i==this_day then
cairo_set_source_rgba (cr,0,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,0,0,1,.0) -- dim the points
end
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
-- ######################################### END DIAL D ###
-- ### START CLOCK A ######################################
-- SET MARKS ###
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
local number_marks_A=init.hour
-- set mark length
local m_length_A=0 -- doesn't work but can't delete
-- set mark width
local m_width_A=0 -- doesn't work but can't delete
-- set mark line cap type
local m_cap=CAIRO_LINE_CAP_ROUND
-- set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,1,0 -- opaque white -- doesn't work but can't delete
-- SETUP HOUR HANDS ###
-- CLOCK A HOUR HAND
hh_length_A=65
-- set hour hand width
hh_width_A=4
-- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
-- set hour hand color
-- hhr,hhg,hhb,hha=1,0,1,0 -- fully opaque white --doesn't work
-- SETUP MINUTE HANDS ###
-- CLOCK A MINUTE HAND SETUP
-- set length of minute hand
mh_length_A=85
-- set minute hand width
mh_width_A=4
-- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
-- set minute hand color
--mhr,mhg,mhb,mha=1,1,1,0.5 -- fully opaque white --doesn't work
-- SETUP SECOND HAND ###
-- CLOCK A SECOND HAND SETUP -- DOESN'T WORK - Why ???????????????????????????
-- set length of seconds hand -- yes I know it is commented out!
--sh_length_A=150
-- set hour hand width
--sh_width_A=2
-- set hour hand line cap
--sh_cap=CAIRO_LINE_CAP_ROUND
-- set seconds hand color
--shr,shg,shb,sha=1,0,0,1 -- fully opaque red
-- PART SECOND HAND
--position
--get seconds value
local seconds=tonumber(os.date("%S"))
--calculate rotation of second hand in degrees
if init.line == true then
local arc=(math.pi/180)*((360/60)*seconds)
--calculate point 1
local radius1=100
local x1=0+radius1*math.sin(arc)
local y1=0-radius1*math.cos(arc)
--calculate point 2
local radius2=107
local x2=0+radius2*math.sin(arc)
local y2=0-radius2*math.cos(arc)
--draw line connecting points
cairo_move_to (cr, center_x+x1,center_y+y1)
cairo_line_to (cr, center_x+x2, center_y+y2)
cairo_set_source_rgba (cr,255/255,255/255,255/255,1) -- PART SECOND HAND
cairo_stroke (cr)
end
-- CLOCK A ### 12 HR TIME ###
-- CLOCK SETTINGS
clock_radius=0 --does not work
clock_centerx=init.center_x -- centre of Clock hands
clock_centery=init.center_y -- centre of Clock hands
-- DRAWING CODE
-- DRAW MARKS
-- stuff that can be moved outside of the loop, needs only be set once
-- calculate end and start radius for marks
m_end_rad=clock_radius-b_to_m
m_start_rad=m_end_rad-m_length_A -- WHAT IS THIS??
-- set line cap type
cairo_set_line_cap (cr, m_cap)
-- set line width
cairo_set_line_width (cr,m_width_A)
-- set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
-- START LOOP FOR HOUR MARKS
for i=1,number_marks_A do
-- drawing code using the value of i to calculate degrees
-- calculate start point for 12/24 hour mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set start point for line
cairo_move_to (cr,clock_centerx+x,clock_centery+y)
-- calculate end point for 12/24 hour mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- set path for line
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- draw the line
cairo_stroke (cr)
end -- of for loop
-- HOUR MARKS -- ???????????????????????????????????????????????????????????????
-- TIME CALCULATIONS CLOCK A
if clock_type_A==12 then
hours=tonumber(os.date("%I"))
-- convert hours to seconds
h_to_s=hours*60*60
elseif clock_type_A==24 then
hours=tonumber(os.date("%H"))
-- convert hours to seconds
h_to_s=hours*60*60
end
minutes=tonumber(os.date("%M"))
-- convert minutes to seconds
m_to_s=minutes*60
-- get current seconds
seconds=tonumber(os.date("%S"))
-- DRAW HOUR HAND ###
-- get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
-- calculate degrees for each second
hsec_degs=hsecs*(360/(60*60*clock_type_A)) -- use equation ~ eliminate decimals
-- set radius to calculate hand points
radius=hh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of hour hand
point=(math.pi/180)*hsec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,hh_width_A)
cairo_set_source_rgba (cr,1,1,1,.75) -- active colour Hour Hand ================
cairo_set_line_cap (cr, hh_cap)
cairo_stroke (cr)
-- DRAW MINUTE HAND
-- get minutes and seconds just as seconds
msecs=m_to_s+seconds
-- calculate degrees for each second
msec_degs=msecs*0.1
-- set radius to calculate hand points
radius=mh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of minute hand
point=(math.pi/180)*msec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
-- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
-- set up line attributes and draw line
cairo_set_line_width (cr,mh_width_A)
cairo_set_source_rgba (cr,1,1,1,.75) -- active colour Minute Hand ==============
cairo_set_line_cap (cr, mh_cap)
cairo_stroke (cr)
-- ### CLOCK A ###
local center_x=init.center_x -- Centre of the HR / Min Numbers
local center_y=init.center_y -- Centre of the HR / Min Numbers
local radius=init.radius -- 12/24 HR CLOCK Hours/Minutes radius -- seeline 42
cairo_select_font_face (cr, "WhiteRabbit", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 25)
cairo_set_source_rgba (cr,1,1,1,0) -- HR Clock numbers
-- TABLE OF TEXT -- in order
if init.hour == 12 then
text_days={"12","01","02","03","04","05","06","07","08","09","10","11",}
for i=1,12 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_set_source_rgba (cr,1,1,1,0)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=111 -- 12 HR Clock
for i=1,12 do
local point=(math.pi/180)*((360/12)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_set_source_rgba (cr,1,1,1,0)
cairo_stroke (cr)
end
end
if init.hour == 24 then
text_days={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23",}
for i=1,24 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/24)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
-- INNER POINTS POSITION, radius smaller than text circle
local radius=99 -- 24 HR Clock
for i=1,24 do
local point=(math.pi/180)*((360/24)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_set_source_rgba (cr,1,1,1,0)
cairo_stroke (cr)
end
end
-- ############################################################################
-- POSITION FOR TEXT HOUR NUMBERS
if init.hour == 12 and init.second == true then
text_days={"","01","02","03","04","","06","07","08","09","","11","12","13","14","","16","17","18","19","","21","22","23","24","","26","27","28","29","","31","32","33","34","","36","37","38","39","","41","42","43","44","","46","47","48","49","","51","52","53","54","","56","57","58","59","",}
-- INNER POINTS POSITION, radius smaller than text circle
cairo_set_source_rgba (cr,1,1,1,.5) -- does not work -- settings moved
cairo_select_font_face (cr, "WhiteRabbit", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
for i=1,60 do
local radius=99 -- dots for seconds A Clock
local point=(math.pi/180)*((360/60)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
if seconds == i-1 then
cairo_set_source_rgba (cr,255/255,0/255,0/255,0) -- does not work - settings moved
else
if i-1 == 0 or i-1 == 5 or i-1 == 10 or i-1 == 15 or i-1 == 25 or i-1 == 30 or i-1 == 35 or i-1 == 40 or i-1 == 45 or i-1 == 50 or i-1 == 55 then
cairo_set_source_rgba (cr,1,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- dots for seconds A Clock
end
end
cairo_arc (cr,center_x+x,center_y+y,1/2,0,2*math.pi)
cairo_stroke (cr)
end
radius=radius-3
cairo_set_font_size (cr, 9)
for i=1,60 do
-- OUTTER POINTS POSTION FOR TEXT
local point=(math.pi/180)*((360/60)*(i-1))
local x=0+radius*(math.sin(point))
local y=0-radius*(math.cos(point))
-- CALCULATE CENTRE OF TEXT
local text=text_days[i]--gets text from table
if seconds == tonumber(text) then
cairo_set_source_rgba (cr,1,1,1,0) -- active colour
else
cairo_set_source_rgba (cr,1,1,1,0) -- seconds numbers
end
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
cairo_show_text (cr, text)
cairo_stroke (cr)
end
end
-- ############################################################################
cairo_stroke (cr)
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end -- end main function
# killall conky && conky -c /media/5/Conky/S11_HUD3.conky &
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
#own_window_colour black
own_window_class Conky
own_window_title HUD 3
### 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 override
#own_window_argb_visual yes
### When ARGB visuals are enabled, this use this to modify the alpha value
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 200
# 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
minimum_size 250 910 ## width, height
maximum_width 250 ## width
gap_x 10 # left-right
gap_y 10 # up-down
alignment top_left
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Monofur:bold:size=10
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
draw_shades no # amplifies text if yes
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
default_color DCDCDC #220 220 220 Gainsboro
color0 8FBC8F #143 188 143 DarkSeaGreen
color1 778899 #119 136 153 LightSlateGray
color2 FF8C00 #255 140 0 DarkOrange
color3 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 0
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders yes
#default_graph_size 15 40
##################################################### End Borders Secton ###
### Miscellaneous Section ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background no
# 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 510
# 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
############################################## End Miscellaneous Section ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load ~/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 15 0 0 0 0 0x000000 0.2
#
lua_load /media/5/Conky/LUA/HUD3.lua
lua_draw_hook_post main
#
####################################################### End LUA Settings ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.3}\
${image /media/5/Conky/images/VSIDO_ORB_black.png -p 82,45 -s 75x75}\
${image /media/5/Conky/images/4.250.374_2.png -p 0,200 -s 250x374}\
${color7}CPU Fan${alignr 5}${platform f71882fg.2560 fan 1} rpm
${color6}Freq${alignr 5}${freq_g} GHz
${color7}Temp${alignr 5}${platform f71882fg.2560 temp 1}°
${color6}Mobo${alignr 5}${platform f71882fg.2560 temp 2}°
${color7}SDA ${alignr 5}${platform f71882fg.2560 temp 2}°
${color6}GPU ${alignr 5}${nvidia temp}°
${color7}Freq${alignr 5}${nvidia gpufreq} MHz${color}
${color6}Mem${alignr 5}${nvidia memfreq} MHz${color}
${goto 60}${execpi 600 /media/5/Conky/scripts/week-2.sh}\
${voffset -4}${goto 5}${font Digital tech:size=25}${color7}${time %a}${goto 190}${time %b}${color}\
${font digitalk:bold:size=13}${goto 65}${color8}${time %C}${goto 165}${time %y}${color}${font}
${goto 50}${color}MEM${goto 125}${color}SDA
${goto 120}/ &${goto 165}${color}CPU
${goto 120}/h${goto 160}${color}% ${color6}Nº${goto 197}1${goto 207}2${goto 217}3${goto 227}${color8}A${color}${font monofur:pixelsize=24}
${font} /${goto 40}${color5}${fs_size /}${goto 100}${color9}${fs_used /}${goto 160}${color6}${fs_free /}${color}${font monofur:pixelsize=27}
${font} /h${goto 40}${color5}${fs_size /home}${goto 100}${color9}${fs_used /home}${goto 160}${color6}${fs_free /home}${color}${font monofur:pixelsize=28}
${font} m/5${goto 40}${color5}${fs_size /media/5}${goto 100}${color9}${fs_used /media/5}${goto 160}${color6}${fs_free /media/5}${color}${font monofur:pixelsize=28}
${font} m/6${goto 40}${color5}${fs_size /media/6}${goto 100}${color9}${fs_used /media/6}${goto 160}${color6}${fs_free /media/6}${color}${font monofur:pixelsize=28}
${font} m/7${goto 40}${color5}${fs_size /media/7}${goto 100}${color9}${fs_used /media/7}${goto 160}${color6}${fs_free /media/7}${color}${font monofur:pixelsize=27}
${font} ext${goto 40}${color5}${if_mounted /media/disk}\
${fs_size /media/disk}${goto 100}${color9}${fs_used /media/disk}\
${goto 160}${color6}${fs_free /media/disk}\
${image /media/5/Conky/images/4-blue.png -p 213,494}\
${else}${goto 90}Not Mounted${endif}${color}${font monofur:pixelsize=27.5}
${font} usb${goto 40}${color5}${if_mounted /media/VSIDO_LiveCD}\
${fs_size /media/VSIDO_LiveCD}${goto 100}${color9}${fs_used /media/VSIDO_LiveCD}\
${goto 160}${color6}25${fs_free /media/VSIDO_LiveCD}\
${image /media/5/Conky/images/4-blue.png -p 213,534}\
${else}${goto 90}Not Mounted${endif}${color}
${alignc}${kernel}
${color6}Processes ${color}${running_processes} of${processes} ${color7}${hr}${color}
Load${goto 70}${loadavg 1}${goto 140}${loadavg 2}${alignr 5}${loadavg 3}
${color6}RAM ${color}${memmax} ${color7}${hr}${color}
${alignc}Used ${memperc}% for ${mem}
Buffered ${buffers}${alignr 5}Cached ${cached}
${color6}DISK Activity ${color7}${hr}${color}
${font Monofur:bold:size=13}R${goto 40}${diskiograph_read /dev/sda 14,130 00ffff ff0000 5 -lt}${alignr 5}${diskio_read /dev/sda}
W${goto 40}${diskiograph_write /dev/sda 14,130 ff0000 00ffff 5 -lt}${alignr 5}${diskio_write /dev/sda}${font}
${color6}NETWORK ${color7}${hr}${color}
${font Monofur:bold:size=13}Dn${goto 40}${downspeedgraph eth0 14,130 00ffff ff0000 5 -lt}${alignr 5}${downspeedf eth0}
Up${goto 40}${upspeedgraph eth0 14,130 ff0000 00ffff 5 -lt}${alignr 5}${upspeedf eth0}
${font}${color0} Down Up Total${font monofur:pixelsize=16}
${font}${color}${time %b %y}${goto 50}${color6}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $3 $4}'}${goto 125}${color7}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $6 $7}'}${goto 200}${color}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $9 $10}'}${font monofur:pixelsize=16}
${font}${color}${exec date | awk '{print $3" "$2}'}${goto 50}${color6}${execi 300 vnstat | grep "today" | awk '{print $2 $3}'}${goto 125}${color7}${execi 300 vnstat | grep "today" | awk '{print $5 $6}'}${goto 200}${color}${execi 300 vnstat | grep "today" | awk '{print $8 $9}'}
${exec date --date="-1 day" | awk '{print $3" "$2}'}${goto 50}${color6}${execi 300 vnstat | grep "yesterday" | awk '{print $2 $3}'}${goto 125}${color7}${execi 300 vnstat | grep "yesterday" | awk '{print $5 $6}'}${goto 200}${color}${execi 300 vnstat | grep "yesterday" | awk '{print $8 $9}'}
${color}Last 7${goto 50}${color6}${execi 300 vnstat -w | grep "last 7 days" | awk '{print $4 $5}'}${goto 125}${color7}${execi 300 vnstat -w | grep "last 7 days" | awk '{print $7 $8}'}${goto 200}${color}${execi 300 vnstat -w | grep "last 7 days" | awk '{print $10 $11}'}
--==============================================================================
-- Origianl by: SLK
-- license : Distributed under the terms of GNU GPL version 2 or later
-- modified by Sector11 - Feb 2013
--==============================================================================
require 'cairo'
--------------------------------------------------------------------------------
-- gauge DATA
gauge = {
{
name='cpu', arg='cpu0', max_value=100,
x=170, y=270, --180,150
graph_radius=60,
graph_thickness=5,
graph_start_angle=0,
graph_unit_angle=0.9, graph_unit_thickness=0.9,
graph_bg_colour=0xFFFF00, graph_bg_alpha=0.3,
graph_fg_colour=0xFFFF00, graph_fg_alpha=0.0,
hand_fg_colour=0xFFFF00, hand_fg_alpha=1.0,
txt_radius=60, -- yellow
txt_weight=1, txt_size=10.0,
txt_fg_colour=0xFFFF00, txt_fg_alpha=0.8,
graduation_radius=30,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFF00, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='cpu', arg='cpu1', max_value=100,
x=170, y=270, --180,150
graph_radius=50,
graph_thickness=5,
graph_start_angle=0,
graph_unit_angle=0.9, graph_unit_thickness=0.9,
graph_bg_colour=0x00BFFF, graph_bg_alpha=0.3,
graph_fg_colour=0x00BFFF, graph_fg_alpha=0.0,
hand_fg_colour=0x00BFFF, hand_fg_alpha=1.0,
txt_radius=50, -- green
txt_weight=1, txt_size=10.0,
txt_fg_colour=0x00BFFF, txt_fg_alpha=0.8,
graduation_radius=55,
graduation_thickness=5, graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='cpu', arg='cpu2', max_value=100,
x=170, y=270, --180,150
graph_radius=40,
graph_thickness=5,
graph_start_angle=0,
graph_unit_angle=0.9, graph_unit_thickness=0.9,
graph_bg_colour=0x00BFFF, graph_bg_alpha=0.3,
graph_fg_colour=0x00BFFF, graph_fg_alpha=0.0,
hand_fg_colour=0x00BFFF, hand_fg_alpha=1.0,
txt_radius=40,
txt_weight=1, txt_size=10.0,
txt_fg_colour=0x00BFFF, txt_fg_alpha=0.8,
graduation_radius=30,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='cpu', arg='cpu3', max_value=100,
x=170, y=270, --180,150
graph_radius=30,
graph_thickness=5,
graph_start_angle=0,
graph_unit_angle=0.9, graph_unit_thickness=0.9,
graph_bg_colour=0x00BFFF, graph_bg_alpha=0.3,
graph_fg_colour=0x00BFFF, graph_fg_alpha=0.0,
hand_fg_colour=0x00BFFF, hand_fg_alpha=1.0,
txt_radius=30,
txt_weight=1, txt_size=10.0,
txt_fg_colour=0x00BFFF, txt_fg_alpha=0.8,
graduation_radius=35,
graduation_thickness=5, graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='memperc', arg='', max_value=100,
x=60, y=245, --40,115
graph_radius=34,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2, graph_unit_thickness=2,
graph_bg_colour=0x00BFFF, graph_bg_alpha=0.3,
graph_fg_colour=0x00BFFF, graph_fg_alpha=0.0,
hand_fg_colour=0x00BFFF, hand_fg_alpha=1.0,
txt_radius=20,
txt_weight=1, txt_size=10.0,
txt_fg_colour=0x00BFFF, txt_fg_alpha=0.8,
graduation_radius=24,
graduation_thickness=6, graduation_mark_thickness=2,
graduation_unit_angle=10,
graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=10.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
{
name='fs_used_perc', arg='/', max_value=100,
x=130, y=250, --120,70
graph_radius=25, --40,
graph_thickness=4,
graph_start_angle=210,
graph_unit_angle=2, graph_unit_thickness=2,
graph_bg_colour=0x00BFFF, graph_bg_alpha=0.3,
graph_fg_colour=0x00BFFF, graph_fg_alpha=0.0,
hand_fg_colour=0x00BFFF, hand_fg_alpha=1.0,
txt_radius=17, --32,
txt_weight=1, txt_size=10.0,
txt_fg_colour=0xffffff, txt_fg_alpha=1.0,
graduation_radius=31, --46,
graduation_thickness=0, graduation_mark_thickness=2,
graduation_unit_angle=20,
graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
{
name='fs_used_perc', arg='/home/', max_value=100,
x=130, y=250, --120,70
graph_radius=35, --50,
graph_thickness=8,
graph_start_angle=210,
graph_unit_angle=2, graph_unit_thickness=2,
graph_bg_colour=0x00BFFF, graph_bg_alpha=0.3,
graph_fg_colour=0x00BFFF, graph_fg_alpha=0.0,
hand_fg_colour=0x00BFFF, hand_fg_alpha=1.0,
txt_radius=50, --65,
txt_weight=1, txt_size=10.0,
txt_fg_colour=0xffffff, txt_fg_alpha=1.0,
graduation_radius=43, --58,
graduation_thickness=4, graduation_mark_thickness=2,
graduation_unit_angle=20,
graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.6,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
}
-------------------------------------------------------------------------------
-- rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
-------------------------------------------------------------------------------
-- angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
local pos = current_angle + start_angle
return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end
-------------------------------------------------------------------------------
-- draw_gauge_ring
-- displays gauges
--
function draw_gauge_ring(display, data, value)
local max_value = data['max_value']
local x, y = data['x'], data['y']
local graph_radius = data['graph_radius']
local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
local graph_start_angle = data['graph_start_angle']
local graph_unit_angle = data['graph_unit_angle']
local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha']
local graph_end_angle = (max_value * graph_unit_angle) % 360
-- background ring
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
cairo_set_line_width(display, graph_thickness)
cairo_stroke(display)
-- arc of value
local val = (value or 0) % (max_value +1)
local start_arc = 0
local stop_arc = 0
local i = 1
while i <= val do
start_arc = (graph_unit_angle * i) - graph_unit_thickness
stop_arc = (graph_unit_angle * i)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
cairo_stroke(display)
i = i + 1
end
local angle = start_arc
-- hand
start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2)
stop_arc = (graph_unit_angle * val)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
cairo_stroke(display)
-- graduations marks
local graduation_radius = data['graduation_radius']
local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
local graduation_unit_angle = data['graduation_unit_angle']
local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
local nb_graduation = graph_end_angle / graduation_unit_angle
local i = 0
while i < nb_graduation do
cairo_set_line_width(display, graduation_thickness)
start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2)
stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2)
cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
cairo_stroke(display)
cairo_set_line_width(display, graph_thickness)
i = i + 1
end
end
-- text
local txt_radius = data['txt_radius']
local txt_weight, txt_size = data['txt_weight'], data['txt_size']
local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight)
cairo_set_font_size (display, txt_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
cairo_show_text (display, value)
cairo_stroke (display)
-- caption
local caption = data['caption']
local caption_weight, caption_size = data['caption_weight'], data['caption_size']
local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha']
local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight);
cairo_set_font_size (display, caption_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
cairo_move_to (display, x + tox + 5, y + toy + 1)
-- bad hack but not enough time !
if graph_start_angle < 105 then
cairo_move_to (display, x + tox - 30, y + toy + 1)
end
cairo_show_text (display, caption)
cairo_stroke (display)
end
-------------------------------------------------------------------------------
-- go_gauge_rings
-- loads data and displays gauges
--
function go_gauge_rings(display)
local function load_gauge_rings(display, data)
local str, value = '', 0
str = string.format('${%s %s}',data['name'], data['arg'])
str = conky_parse(str)
value = tonumber(str)
draw_gauge_ring(display, data, value)
end
for i in pairs(gauge) do
load_gauge_rings(display, gauge[i])
end
end
--------------------------------------------------------------------------------
-- clock DATA
-- HOURS
clock_h = {
{
name='time', arg='%H', max_value=12,
x=120, y=85,
graph_radius=62, --58, --53,
graph_thickness=3,
graph_unit_angle=30, graph_unit_thickness=30,
graph_bg_colour=0x00BFFF, graph_bg_alpha=0.0,
graph_fg_colour=0x00BFFF, graph_fg_alpha=0.3,
txt_radius=70, --39, --34,
txt_weight=1, txt_size=15.0,
txt_fg_colour=0xFFDEAD, txt_fg_alpha=1.0,
graduation_radius=58, --53,
graduation_thickness=6, graduation_mark_thickness=2,
graduation_unit_angle=30,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
},
}
-- MINUTES
clock_m = {
{
name='time', arg='%M', max_value=60,
x=120, y=85,
graph_radius=58, --62, --57,
graph_thickness=2,
graph_unit_angle=6, graph_unit_thickness=6,
graph_bg_colour=0x00BFFF, graph_bg_alpha=0.2,
graph_fg_colour=0x00BFFF, graph_fg_alpha=0.7,
txt_radius=47, --39, --70, --65,
txt_weight=1, txt_size=15.0,
txt_fg_colour=0xFFDEAD, txt_fg_alpha=1.0,
graduation_radius=62, --57,
graduation_thickness=0, graduation_mark_thickness=2,
graduation_unit_angle=30,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
},
}
-- SECONDS
clock_s = {
{
name='time', arg='%S', max_value=60,
x=120, y=85,
graph_radius=55, --50,
graph_thickness=2,
graph_unit_angle=6, graph_unit_thickness=2,
graph_bg_colour=0xFFDEAD, graph_bg_alpha=0.0,
graph_fg_colour=0xFFDEAD, graph_fg_alpha=0.7,
txt_radius=47, --42,
txt_weight=0, txt_size=8.0,
txt_fg_colour=0xFFDEAD, txt_fg_alpha=1.0,
graduation_radius=0,
graduation_thickness=0, graduation_mark_thickness=0,
graduation_unit_angle=0,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0,
},
}
--------------------------------------------------------------------------------
-- rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
-------------------------------------------------------------------------------
-- angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
local pos = current_angle + start_angle
return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end
-------------------------------------------------------------------------------
-- draw_clock_ring
-- displays clock
--
function draw_clock_ring(display, data, value)
local max_value = data['max_value']
local x, y = data['x'], data['y']
local graph_radius = data['graph_radius']
local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
local graph_unit_angle = data['graph_unit_angle']
local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
-- background ring
cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi)
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
cairo_set_line_width(display, graph_thickness)
cairo_stroke(display)
-- arc of value
local val = (value % max_value)
local i = 1
while i <= val do
cairo_arc(display, x, y, graph_radius,( ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360) )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2))
cairo_set_source_rgba(display,rgb_to_r_g_b(graph_fg_colour,graph_fg_alpha))
cairo_stroke(display)
i = i + 1
end
local angle = (graph_unit_angle * i) - graph_unit_thickness
-- graduations marks
local graduation_radius = data['graduation_radius']
local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
local graduation_unit_angle = data['graduation_unit_angle']
local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
local nb_graduation = 360 / graduation_unit_angle
local i = 1
while i <= nb_graduation do
cairo_set_line_width(display, graduation_thickness)
cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2))
cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
cairo_stroke(display)
cairo_set_line_width(display, graph_thickness)
i = i + 1
end
end
-- text
local txt_radius = data['txt_radius']
local txt_weight, txt_size = data['txt_weight'], data['txt_size']
local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
local movex = txt_radius * (math.cos((angle * 2 * math.pi / 360)-(math.pi/2)))
local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2)))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight);
cairo_set_font_size (display, txt_size);
cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha));
cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3);
cairo_show_text (display, value);
cairo_stroke (display);
end
-------------------------------------------------------------------------------
-- go_clock_rings
-- loads data and displays clock
--
function go_clock_rings(display)
local function load_clock_rings(display, data)
local str, value = '', 0
str = string.format('${%s %s}',data['name'], data['arg'])
str = conky_parse(str)
value = tonumber(str)
draw_clock_ring(display, data, value)
end
for i in pairs(clock_h) do
load_clock_rings(display, clock_h[i])
end
for i in pairs(clock_m) do
load_clock_rings(display, clock_m[i])
end
for i in pairs(clock_s) do
load_clock_rings(display, clock_s[i])
end
end
-------------------------------------------------------------------------------
-- MAIN
function conky_main()
if conky_window == nil then
return
end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local display = cairo_create(cs)
local updates = conky_parse('${updates}')
update_num = tonumber(updates)
if update_num > 5 then
go_gauge_rings(display)
go_clock_rings(display)
end
cairo_surface_destroy(cs)
cairo_destroy(display)
end
#!/bin/bash
# By: mobilediesel
font=("\${voffset -10}\${font digitalk:size=4}" "\${voffset -0}\${font digitalk:size=8}" "\${voffset -0}\${font digitalk:size=12}" "\${voffset -3}\${font digitalk:size=30}\${color 00FFFF}" "\${voffset -15}\${font digitalk:size=12}" "\${voffset -4}\${font digitalk:size=7}" "\${voffset -2}\${font digitalk:size=4}")
color=("" "" "" "\${color}" "" "" "")
for i in $(seq -3 3); do
echo -n "${font[$[i+3]]}$(date '+%d' -d "$i days")${color[3]}\${offset 3}"
done
--[[Background originally by londonali1010 (2009)
ability to set any size for background mrpeachy 2011
ability to set variables for bg in conkyrc dk75
the change is that if you set width and/or height to 0
then it assumes the width and/or height of the conky window
so:
Above and After TEXT (requires a composite manager or it blinks!)
lua_load ~/wea_conky/draw_bg.lua
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}
OR Both above TEXT (no composite manager required - no blinking!)
lua_load ~/wea_conky/draw_bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
TEXT
Note
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
See below: 1 2 3 4 5 6 7
${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
covers the whole window and will change if you change the minimum_size setting
1 = 20 corner_radius
2 = 0 x_position
3 = 0 y_position
3 = 0 width
5 = 0 height
6 = 0x000000 color
7 = 0.4 alpha
######### calendar function ##################################################
then to use it, you activate the calendar function BELOW TEXT like this
${lua luacal {settings}}
#${lua luacal {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gh=,gt=,gv=,sd=}}
# x=x position top left
# y=y position top left
# tf=title font, eg "mono" must be in quotes
# tfs=title font size
# tc=title color
# ta=title alpha
# bf=body font, eg "mono" must be in quotes
# bfs=body font size
# bc=body color
# ba=body alpha
# hf=highlight font, eg "mono" must be in quotes
# hfs=highlight font size
# hc=highlight color
# ha=highlight alpha
# sp=spacer, eg " " or sp="0"... 0,1 or 2 spaces can help with positioning of non-monospaced fonts
# gt=gap from title to body
# gh=gap horizontal between columns
# gv=gap vertical between rows
# sd=start day, 0=Sun, 1=Mon
# hstyle = heading style, 0=just days, 1=date insert
# tdf=title date font, eg "mono" must be in quotes
# tdfs=title date font size
# tdc=title date color
# tda=title date alpha
# test line
-- ${lua luacal {x=10,y=100,tf="Purisa",tfs=24,tc=0xf67e16,ta=1,bf="First Order",bfs=26,bc=0xecd32a,ba=1,hf="Purisa",hfs=18,hc=0xf67e16,ha=1,sp=" ",gh=40,gt=25,gv=20,sd=0,hstyle=1,tdf="First Order",tdfs=28,tdc=0xff0000,tda=1}}
]]
require 'cairo'
local cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
-- ###### calendar function ##################################################
function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=,hstyle=,tdf=,tdfs=,tdc=,tda=}
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--############################################################################
if caltab.x==nil then
caltab=loadstring("return" .. caltab)()
end
local cal_x=caltab.x
local cal_y=caltab.y
local tfont=caltab.tf or "mono"
local tfontsize=caltab.tfs or 12
local tc=caltab.tc or 0xffffff
local ta=caltab.ta or 1
local bfont=caltab.bf or "mono"
local bfontsize=caltab.bfs or 12
local bc=caltab.bc or 0xffffff
local ba=caltab.ba or 1
local hfont=caltab.hf or "mono"
local hfontsize=caltab.hfs or 12
local hc=caltab.hc or 0xff0000
local ha=caltab.ha or 1
local spacer=caltab.sp or " "
local gaph=caltab.gh or 20
local gapt=caltab.gt or 15
local gapl=caltab.gv or 15
local sday=caltab.sd or 0
local hstyle=caltab.hstyle or 0
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
--############################################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]=" "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
if hstyle==0 then
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
elseif hstyle==1 then
if tonumber(sday)==0 then
dys={"SU","MO"," "," "," ","FR","SA"}
cairo_text_extents(cr,"MO",extents)
local s=extents.x_advance+gaph
local f=gaph*5
local tdfont=caltab.tdf or "mono"
local tdfontsize=caltab.tdfs or 12
local tdc=caltab.tdc or 0xffffff
local tda=caltab.tda or 1
cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tdfontsize);
local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
local insert=os.date("%b %y")
cairo_text_extents(cr,insert,extents)
local w=extents.x_advance
cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
cairo_show_text (cr,insert)
cairo_stroke (cr)
else
dys={"MO","TU"," "," "," ","SA","SU"}
cairo_text_extents(cr,"TU",extents)
local s=extents.x_advance+gaph
local f=gaph*5
local tdfont=caltab.tdf or "mono"
local tdfontsize=caltab.tdfs or 12
local tdc=caltab.tdc or 0xffffff
local tda=caltab.tda or 1
cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tdfontsize);
local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
local insert=os.date("%b %y")
cairo_text_extents(cr,insert,extents)
local w=extents.x_advance
cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
cairo_show_text (cr,insert)
cairo_stroke (cr)
end
end
--draw calendar titles
for i=1,7 do
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--############################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end
-- end main function #########################################################
Quotevrkalak wrote:
^ paolo . . . very nice.
When it comes to designing your own Conky (or the OS for that matter) . . . you build what works for you.
What matters is that 'you' like it and it does what 'you' want it to do or look like.
And with GNU/Linux and Open Source . . . there is no such thing as 'stealing' tongue
Hopefully, everything we do with the program/application only makes it better and easier for someone else to configure and add to.
lol just don't play with your Conky, too much ... it'll make you go blind
=====
Agree 100% I saw it said once that it was CCCC - not sure what it means but it was something like (if not) Co-operative Collective Conky Community - I just call it "Cloned"
EDIT: I went looking, the quote comes from londonali1010:
londonali1010 wrote:
The Collaborative Creative Conky Community
=====
arpinux wrote:
The Collaborative Creative Conky Community
la Communauté Coopérante Créatrice de Conky <<<<<<--- CCCC works in french too ;D
=====
proxess wrote:
A Comunidade Criativa Colaborativa de Conky
Works in Portuguese too!
=====
And I do believe Spanish as well: La Colaboración de la Comunidad Creativa de Conky
Commonly referred to as: Your conky has been C4'd
And I'd like to add that conky is like disto-hopping, once you've got the bug there is no stopping without the aid of a "1100 Step Program"
Can I play with my conky until I needed glasse?
=====
paolo wrote:
and also in italian is CCCC !
La Comunità Cooperativa Creatrice di Conky
# To use #! in a conky use: ${exec echo '#!'}
# conky -c /media/5/Conky/S11_Connections.conky &
# Original by: Habitual
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
# 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
own_window_type normal
own_window_transparent yes
own_window_hints skip_taskbar,skip_pager
own_window_class Conky
own_window_title Connections
### 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 override
# 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 150
minimum_size 600 190 # width, height
maximum_width 600 # width
gap_x 0 ### left &right
gap_y 50 ### up & down
alignment tm
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont monofur:bold:size=10
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
## see: Color Settings for colours ##
draw_shades yes #### <-- To see it easier on light screens.
draw_outline no #### <-- Amplifies text if yes
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
default_shade_color 000000
default_outline_color 000000
#default_color 000000 # 0 0 0 Black
default_color DCDCDC #220 220 220 Gainsboro
color0 FFE595 #Teo Gold
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan #48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red #A52A2A #DarkRed
##################################################### End Color Settings ###
### Borders Section ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 10
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders yes #no
##################################################### End Borders Secton ###
### Miscellaneous Section ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background no
# 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 256
# 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
## default bar size
default_bar_size 200 20
## Width for $top name value (defaults to 15 characters).
top_name_width 8
## Specify a default width and height for graphs.
## Example: 'default_graph_size 0 25'. This is particularly useful for execgraph
## and execigraph as they do not take size arguments
## default_graph_size 220 100
############################################## End Miscellaneous Section ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/dra2w-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 0 0 0 0 0 0x000000 0.5
### mount.lua ##################################################################
#
##instructions
##load script
##lua_load ~/path_to/mounted.lua
#lua_load /media/5/Conky/LUA/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type}, where partition number is a number
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
####################################################### End LUA Settings ###
#digiThe all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1 # in seconds
# stuff after 'TEXT' will be formatted on screen
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.5}\
${color5}IP (${color}${addr eth0}${color5})${image /media/5/Conky/images/deep_skyblue_1.png -p 14,56 -s 55x1}\
${goto 150}${color5}Down: ${color}${downspeedf eth0}${image /media/5/Conky/images/deep_skyblue_1.png -p 310,56 -s 60x1}\
${goto 240}${color5}Inbound: ${color}${tcp_portmon 1 32767 count}${image /media/5/Conky/images/deep_skyblue_1.png -p 415,56 -s 34x1}\
${goto 330}| ${color5}Up: ${color}${upspeedf eth0}${image /media/5/Conky/images/deep_skyblue_1.png -p 470,56 -s 34x1}\
${goto 430}${color5}Outbound: ${color}${tcp_portmon 32768 65535 count}${image /media/5/Conky/images/deep_skyblue_1.png -p 525,56 -s 39x1}\
${goto 530}${color5}Total: ${color}${tcp_portmon 1 65535 count}${color}
${color6}${hr}${color}
${color5}${goto 480}Local${goto 535}Remote
Hostname${goto 320}Remote IP ${goto 425}Proto${goto 480}Port${goto 535}Port${color}
${color5}1 ${color}${tcp_portmon 1 65535 rhost 0}${goto 320}${tcp_portmon 1 65535 rip 0}${goto 428}${tcp_portmon 1 65535 rservice 0}${goto 478}${tcp_portmon 1 65535 lport 0}${goto 535}${tcp_portmon 1 65535 rport 0}
${color5}2 ${color}${tcp_portmon 1 65535 rhost 1}${goto 320}${tcp_portmon 1 65535 rip 1}${goto 428}${tcp_portmon 1 65535 rservice 1}${goto 478}${tcp_portmon 1 65535 lport 1}${goto 535}${tcp_portmon 1 65535 rport 1}
${color5}3 ${color}${tcp_portmon 1 65535 rhost 2}${goto 320}${tcp_portmon 1 65535 rip 2}${goto 428}${tcp_portmon 1 65535 rservice 2}${goto 478}${tcp_portmon 1 65535 lport 2}${goto 535}${tcp_portmon 1 65535 rport 2}
${color5}4 ${color}${tcp_portmon 1 65535 rhost 3}${goto 320}${tcp_portmon 1 65535 rip 3}${goto 428}${tcp_portmon 1 65535 rservice 3}${goto 478}${tcp_portmon 1 65535 lport 3}${goto 535}${tcp_portmon 1 65535 rport 3}
${color5}5 ${color}${tcp_portmon 1 65535 rhost 4}${goto 320}${tcp_portmon 1 65535 rip 4}${goto 428}${tcp_portmon 1 65535 rservice 4}${goto 478}${tcp_portmon 1 65535 lport 4}${goto 535}${tcp_portmon 1 65535 rport 4}
${color5}6 ${color}${tcp_portmon 1 65535 rhost 5}${goto 320}${tcp_portmon 1 65535 rip 5}${goto 428}${tcp_portmon 1 65535 rservice 5}${goto 478}${tcp_portmon 1 65535 lport 5}${goto 535}${tcp_portmon 1 65535 rport 5}
${color5}7 ${color}${tcp_portmon 1 65535 rhost 6}${goto 320}${tcp_portmon 1 65535 rip 6}${goto 428}${tcp_portmon 1 65535 rservice 6}${goto 478}${tcp_portmon 1 65535 lport 6}${goto 535}${tcp_portmon 1 65535 rport 6}
${color5}8 ${color}${tcp_portmon 1 65535 rhost 7}${goto 320}${tcp_portmon 1 65535 rip 7}${goto 428}${tcp_portmon 1 65535 rservice 7}${goto 478}${tcp_portmon 1 65535 lport 7}${goto 535}${tcp_portmon 1 65535 rport 7}
${color5}9 ${color}${tcp_portmon 1 65535 rhost 8}${goto 320}${tcp_portmon 1 65535 rip 8}${goto 428}${tcp_portmon 1 65535 rservice 8}${goto 478}${tcp_portmon 1 65535 lport 8}${goto 535}${tcp_portmon 1 65535 rport 8}
${color5}0 ${color}${tcp_portmon 1 65535 rhost 9}${goto 320}${tcp_portmon 1 65535 rip 9}${goto 428}${tcp_portmon 1 65535 rservice 9}${goto 478}${tcp_portmon 1 65535 lport 9}${goto 535}${tcp_portmon 1 65535 rport 9}
${color6}Port(s)${alignr}Connections${color}
Inbound: ${tcp_portmon 1 32767 count} Outbound: ${tcp_portmon 32768 61000 count}${alignr}ALL: ${tcp_portmon 1 65535 count}
${color6}Inbound Connection ${alignr} Local Service/Port$color
${color5}1 ${color}${tcp_portmon 1 32767 lhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
${color5}2 ${color}${tcp_portmon 1 32767 lhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
${color5}3 ${color}${tcp_portmon 1 32767 lhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
${color5}4 ${color}${tcp_portmon 1 32767 lhost 3} ${alignr} ${tcp_portmon 1 32767 lservice 3}
${color5}5 ${color}${tcp_portmon 1 32767 lhost 4} ${alignr} ${tcp_portmon 1 32767 lservice 4}
${color5}6 ${color}${tcp_portmon 1 32767 lhost 5} ${alignr} ${tcp_portmon 1 32767 lservice 5}
${color5}7 ${color}${tcp_portmon 1 32767 lhost 6} ${alignr} ${tcp_portmon 1 32767 lservice 6}
${color5}8 ${color}${tcp_portmon 1 32767 lhost 7} ${alignr} ${tcp_portmon 1 32767 lservice 7}
${color5}9 ${color}${tcp_portmon 1 32767 lhost 8} ${alignr} ${tcp_portmon 1 32767 lservice 8}
${color5}0 ${color}${tcp_portmon 1 32767 lhost 9} ${alignr} ${tcp_portmon 1 32767 lservice 9}
${color6}Outbound Connection ${alignr} Remote Service/Port$color
${color5}1 ${color}${tcp_portmon 32768 61000 lhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
${color5}2 ${color}${tcp_portmon 32768 61000 lhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
${color5}3 ${color}${tcp_portmon 32768 61000 lhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
${color5}4 ${color}${tcp_portmon 32768 61000 lhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
${color5}5 ${color}${tcp_portmon 32768 61000 lhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
${color5}6 ${color}${tcp_portmon 32768 61000 lhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
${color5}7 ${color}${tcp_portmon 32768 61000 lhost 6} ${alignr} ${tcp_portmon 32768 61000 rservice 6}
${color5}8 ${color}${tcp_portmon 32768 61000 lhost 7} ${alignr} ${tcp_portmon 32768 61000 rservice 7}
${color5}9 ${color}${tcp_portmon 32768 61000 lhost 8} ${alignr} ${tcp_portmon 32768 61000 rservice 8}
${color5}0 ${color}${tcp_portmon 32768 61000 lhost 9} ${alignr} ${tcp_portmon 32768 61000 rservice 9}
sector11 @ sector11
02 Mar 13 | 19:14:41 ~
$ Conky: desktop window (260) is root window
Conky: window type - normal
Conky: drawing to created window (0x3a00001)
Conky: drawing to double buffer
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
after 375382 requests (375375 known processed) with 0 events remaining.
[1]+ Exit 1 conky -c /media/5/Conky/S11_Connections.conky
sector11 @ sector11
02 Mar 13 | 19:28:08 ~
$
# killall conky && conky -c /media/5/Conky/S11_VSIDO.conkyrc &
# Original by: VastOne on VSIDO
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
use_spacer right
# Use Xft?
use_xft yes
xftfont Monofur:bold:size=12
xftalpha 1.0
# text_buffer_size 256
# Update interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
own_window yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
# own_window_argb_visual yes
own_window_class Conky
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
# border width
border_width 0
# Default colors and also border colors
default_color 00BFFF # 0 191 255 DeepSkyBlue
color0 FFDEAD #255 222 173 NavajoWhite
color1 7FFF00 #127 255 0 Chartreuse
color2 778899 #119 136 153 LightSlateGray
color3 A5A7B7 #255 140 0 BlueGreyLight
color4 F0FFFF #240 255 255 Azure
color5 FFDEAD #255 222 173 NavajoWhite
color6 7B68EE #123 104 238 MediumSlateBlue
color7 00FFFF # 0 255 255 Cyan
color8 FFFF00 #255 255 0 Yellow
color9 FF0000 #255 0 0 Red
#default_shade_color black
#default_outline_color grey
own_window_colour 000000
# Text alignment, other possible values are commented
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 20
minimum_size 1310 0 ## width, height
#maximum_width 1000 ## width
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off (no).
short_units yes
# Forces Conky not to cache images
imlib_cache_size 0
#lua_load /home/jed/conky/draw-bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x2B4287 0.2
#
TEXT
#${lua conky_draw_bg 10 0 20 0 80 0x0A111F 0.6}\
${color5} JedsDesk logged into ${color3}${execi 2600 cat /etc/issue.net}-VSIDO-1_2 ${color1}Success! ${color5}Kernel Currently in use - ${color3}${kernel}, ${color5}System Online for ${color3}${uptime}, ${color5}Current Mem use${color3}${if_match ${memperc}<10} ${memperc}${else}${if_match ${memperc}<100}${memperc}${else}${memperc}${endif}${endif}% ${color5}or ${color3}(${mem}/${memmax}), ${color5}Avg Quad Core Usage: ${color3}${cpu cpu0}% ${color5}Avg Load: ${color3}${loadavg},
${color5} Socket Temp (all temps Celsius):${color9}${hwmon temp 3}${color}${font} Core 1 Temp: ${color9}${execi 10 sensors | grep "Core 1" | cut -d "+" -f2 | cut -c1-2}º ${color5}CPU1: ${color3}${freq_g 1}Gh ${cpu cpu1}% ${color5}CPU2: ${color3}${freq_g 2}Gh ${cpu cpu2}% ${color}Core 2 Temp: ${color9}${execi 10 sensors | grep "Core 2" | cut -d "+" -f2 | cut -c1-2}º ${color5}CPU3: ${color3}${freq_g 3}Gh ${cpu cpu3}% ${color5}CPU4: ${color3}${freq_g 4}Gh ${cpu cpu4}% ${color}Core 3 Temp: ${color9}${execi 10 sensors | grep "Core 3" | cut -d "+" -f2 | cut -c1-2}º ${color5}CPU5: ${color3}${freq_g 5}Gh ${cpu cpu5}% ${color5}CPU6:${color3} ${freq_g 6}Gh ${cpu cpu6}% ${color}Core 4 Temp: ${color9}${execi 10 sensors | grep "Core 0" | cut -d "+" -f2 | cut -c1-2}º ${color5}CPU7: ${color3}${freq_g 7}Gh ${cpu cpu7}% ${color5}CPU8: ${color3}${freq_g 8}Gh ${cpu cpu8}%\
${color5} Internal Laptop Temp:${color9}${hwmon temp 1} ${color5}Motherboard Temp:${color9}${hwmon temp 2} ${color5}Network Status:${color7}(System Online)${color1} Dn:${color3}${downspeed wlan0} ${color7}Up:${color3}${upspeed wlan0}${color5} Wireless Signal${color3} ${wireless_link_qual_perc wlan0}${color5}Battery ${color3}${battery_percent BAT1}% ${battery_time BAT1} ${color5}jedsdesk: ${color3}${execi 90 conkyEmail --servertype=POP --servername=mail.yourmailserver.com --ssl --username=yours --password=drowssapton --mailinfo=0}${color5} live: ${color3}${execi 900 conkyEmail --servertype=POP --servername=pop3.live.com --ssl --username=yours@live.com --password=drowssapton --mailinfo=0}${color5} hotmail: ${color3}${execi 900 conkyEmail --servertype=POP --servername=pop3.live.com --ssl --username=yours@hotmail.com --password=drowssapton --mailinfo=0}
--[[
The latest script is a lua only weather script. aka: v9000
http://crunchbanglinux.org/forums/topic/16100/weather-in-conky/
the file:
http://dl.dropbox.com/u/19008369/current%20v9000/v9000.tar.gz
mrppeachys LUA Tutorial
http://crunchbanglinux.org/forums/topic/17246/how-to-using-lua-scripts-in-conky/
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
-- default_font="CorporateMonoExtraBold"--font must be in quotes
-- default_font_size=10
default_font="monofur"--font must be in quotes
default_font_size=12
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=20
default_image_height=20
-- ## New Options ###
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
datay=15 -- ↑↓
datayh=55
datayf=75
datayy=13 --datay+(datayy*1)
imgyh=165
imgyf=190
imgyy=39 -- imgy+(imgyy*1)
out({c=0x00FFFF,a=1,x=12,y=15,txt="PQI"})
-- today is
out({c=0x00FFFF,a=1,x=5,y=28,txt=forecast_day_short[1]})
out({c=0x00FFFF,a=1,x=35,y=datay+datayy,txt=forecast_date[1]})
-- out({c=0x00FFFF,,a=1,x=6,y=50,txt="cpu:"..conky_parse("${cpu}")})
out({c=0xF0FFFF,a=1,x=5,y=datay+(datayy*2),txt=low_temp[1]})
out({c=0xFF8C00,a=1,x=30,y=datay+(datayy*2),txt=high_temp[1]})
image({x=5,y=45,h=45,w=45,file=weather_icon[1]})
--image({x=5,y=45,h=45,w=45,file="/media/5/Conky/images/red+x.png"})
out({c=0xFFDEAD,a=1,x=15,y=datay+(datayy*7),txt="NOW"})
out({c=0xF0FFFF,a=1,x=7,y=datay+(datayy*8),txt=now["temp"]})
out({c=0xFFDEAD,a=1,x=30,y=datay+(datayy*8),txt=now["feels_like"]})
image({x=5,y=120,h=45,w=45,file=now["weather_icon"]})
--image({x=5,y=120,h=45,w=45,file="/media/5/Conky/images/red+x.png"})
out({c=0x00FFFF,a=1,x=5,y=datay+(datayy*12.5),txt="B.P."})
out({c=0xF0FFFF,a=1,x=5,y=datay+(datayy*13.4),txt=now["pressure_mb"]})
out({c=0x00FFFF,a=1,x=5,y=datay+(datayy*14.5),txt="Hum"})
out({c=0xF0FFFF,a=1,x=30,y=datay+(datayy*14.5),txt=now["humidity"].."%"})
out({c=0x00FFFF,a=1,x=5,y=datay+(datayy*15.5),txt="DP"})
out({c=0xF0FFFF,a=1,x=30,y=datay+(datayy*15.5),txt=now["dew_point"].."°"})
out({c=0x00FFFF,a=1,x=5,y=datay+(datayy*16.5),txt="UV"})
out({c=0xF0FFFF,a=1,x=30,y=datay+(datayy*16.5),txt=uv_index_num[1]})
out({c=0xF0FFFF,a=1,x=5,y=datay+(datayy*17.5),txt=uv_index_txt[1]})
-- yellow line
--image({w=45,h=1,x=5,y=datayh+(datayy*15),file="/media/5/Conky/images/yellow_1.png"})
out({c=0xFFDEAD,a=1,x=10,y=datayh+(datayy*16),txt="3 HRS"})
-- 3 hour output
-- 1st hour
out({c=0x00FFFF,a=1,x=11,y=datayh+(datayy*17),txt=now["fc_hour1_time"].." "..now["fc_hour1_ampm"]})
image({x=25,y=imgyh+(imgyy*3),file=now["fc_hour1_wicon"]})
--image({x=25,y=imgyh+(imgyy*3),file="/media/5/Conky/images/red+x.png"})
out({c=0xF0FFFF,a=1,x=5,y=datayh+(datayy*18.5),txt=now["fc_hour1_temp"]})
-- 2nd hour
out({c=0x00FFFF,a=1,x=11,y=datayh+(datayy*20),txt=now["fc_hour2_time"].." "..now["fc_hour2_ampm"]})
image({x=25,y=imgyh+(imgyy*4),file=now["fc_hour2_wicon"]})
--image({x=25,y=imgyh+(imgyy*4),file="/media/5/Conky/images/red+x.png"})
out({c=0xF0FFFF,a=1,x=5,y=datayh+(datayy*21.5),txt=now["fc_hour2_temp"]})
-- 3rd hour
out({c=0x00FFFF,a=1,x=11,y=datayh+(datayy*23),txt=now["fc_hour3_time"].." "..now["fc_hour3_ampm"]})
image({x=25,y=imgyh+(imgyy*5),file=now["fc_hour3_wicon"]})
--image({x=25,y=imgyh+(imgyy*5),file="/media/5/Conky/images/red+x.png"})
out({c=0xF0FFFF,a=1,x=5,y=datayh+(datayy*24.5),txt=now["fc_hour3_temp"]})
-- start of forcast days
-- yellow line
--image({w=45,h=1,x=5,y=datayf+(datayy*24.5),file="/media/5/Conky/images/yellow_1.png"})
out({c=0xFFDEAD,a=1,x=10,y=datayf+(datayy*25.5),txt="9 DAY"})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*26.5),txt=forecast_day_short[2]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*26.5),txt=forecast_date[2]})
image({x=25,y=imgyf+(imgyy*6),file=weather_icon[2]})
--image({x=25,y=imgyf+(imgyy*6),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*27.5),txt=high_temp[2]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*28.5),txt=low_temp[2]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*29.5),txt=forecast_day_short[3]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*29.5),txt=forecast_date[3]})
image({x=25,y=imgyf+(imgyy*7),file=weather_icon[3]})
--image({x=25,y=imgyf+(imgyy*7),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*30.5),txt=high_temp[3]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*31.5),txt=low_temp[3]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*32.5),txt=forecast_day_short[4]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*32.5),txt=forecast_date[4]})
image({x=25,y=imgyf+(imgyy*8),file=weather_icon[4]})
--image({x=25,y=imgyf+(imgyy*8),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*33.5),txt=high_temp[4]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*34.5),txt=low_temp[4]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*35.5),txt=forecast_day_short[5]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*35.5),txt=forecast_date[5]})
image({x=25,y=imgyf+(imgyy*9),file=weather_icon[5]})
--image({x=25,y=imgyf+(imgyy*9),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*36.5),txt=high_temp[5]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*37.5),txt=low_temp[5]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*38.5),txt=forecast_day_short[6]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*38.5),txt=forecast_date[6]})
image({x=25,y=imgyf+(imgyy*10),file=weather_icon[6]})
--image({x=25,y=imgyf+(imgyy*10),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*39.5),txt=high_temp[6]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*40.5),txt=low_temp[6]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*41.5),txt=forecast_day_short[7]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*41.5),txt=forecast_date[7]})
image({x=25,y=imgyf+(imgyy*11),file=weather_icon[7]})
--image({x=25,y=imgyf+(imgyy*11),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*42.5),txt=high_temp[7]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*43.5),txt=low_temp[7]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*44.5),txt=forecast_day_short[8]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*44.5),txt=forecast_date[8]})
image({x=25,y=imgyf+(imgyy*12),file=weather_icon[8]})
--image({x=25,y=imgyf+(imgyy*12),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*45.5),txt=high_temp[8]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*46.5),txt=low_temp[8]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*47.5),txt=forecast_day_short[9]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*47.5),txt=forecast_date[9]})
image({x=25,y=imgyf+(imgyy*13),file=weather_icon[9]})
--image({x=25,y=imgyf+(imgyy*13),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*48.5),txt=high_temp[9]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*49.5),txt=low_temp[9]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*50.5),txt=forecast_day_short[10]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*50.5),txt=forecast_date[10]})
image({x=25,y=imgyf+(imgyy*14),file=weather_icon[10]})
--image({x=25,y=imgyf+(imgyy*14),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*51.5),txt=high_temp[10]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*52.5),txt=low_temp[10]})
-- yellow line
--image({w=45,h=1,x=5,y=550,file="/media/5/Conky/images/yellow_1.png"})
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
--[[
The latest script is a lua only weather script. aka: v9000
http://crunchbanglinux.org/forums/topic/16100/weather-in-conky/
the file:
http://dl.dropbox.com/u/19008369/v9000.tar.gz
mrppeachys LUA Tutorial
http://crunchbanglinux.org/forums/topic/17246/how-to-using-lua-scripts-in-conky/
The "red+x.png" and "cyan_1.png" images, with others are available here:
http://tiny.cc/gbuqtw - 1_pixel_images.tar.gz (3.3KB)
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="Monofur"--font must be in quotes
default_font_size=14
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
out({c=0x00BFFF,a=1,x=10,y=15,txt=now["date"].." "..now["month_short"].." "..now["year"].." @ "..now["time"]})
image({x=10,y=20,h=70,w=70,file=now["weather_icon"]})
-- image({x=10,y=20,h=70,w=70,file="/media/5/Conky/images/red+x.png"})
-- Temp / FeelsLike & CONDITIONS TEXT
out({c=0x48D1CC,a=1,f="DS-Digital",fs=50,x=80,y=60,txt=now["temp"]})
out({c=0x00BFFF,a=1,f="DS-Digital",fs=50,x=140,y=60,txt=now["feels_like"]})
out({c=0xA4FFA4,a=1,x=81,y=72,txt="Temp WC·HI"})
-- WC = Wind Chill · HI = Heat Index
out({c=0x48D1CC,a=1,f="Zekton",fs=18,x=10,y=105,txt=now["conditions"]})
image({x=205,y=110,h=60,w=60,file=now["wind_icon"]})
-- image({x=205,y=110,h=60,w=60,file="/media/5/Conky/images/red+x.png"})
image({x=205,y=200,h=50,w=50,file=moon_icon[1]})
-- image({x=205,y=200,h=60,w=60,file="/media/5/Conky/images/red+x.png"})
-- data titles
-- data output
datay=110 -- y=datay or
datayy=15 -- y=datay+(datayy*1) use 1 or more
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*1),txt="Today's Hi·Lo:"})
out({c=0xFF8C00,a=1,x=115,y=datay+(datayy*1),txt=high_temp[1].."°"})
out({c=0x48D1CC,a=1,x=150,y=datay+(datayy*1),txt=low_temp[1].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*2),txt="Wind:"})
out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*2),txt=now["wind_km"]})
out({c=0x48D1CC,a=1,x=120,y=datay+(datayy*2),txt=now["wind_nesw"]})
out({c=0xFAFAEC,a=1,x=150,y=datay+(datayy*2),txt="@"})
out({c=0x48D1CC,a=1,x=165,y=datay+(datayy*2),txt=now["wind_deg"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*3),txt="Hum:"})
out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*3),txt=now["humidity"].."%"})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*3),txt="DP:"})
out({c=0x48D1CC,a=1,x=145,y=datay+(datayy*3),txt=now["dew_point"].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*4),txt="Bar:"})
out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*4),txt=now["pressure_mb"]})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*4),txt="Vis:"})
out({c=0x48D1CC,a=1,x=145,y=datay+(datayy*4),txt=now["visibility"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*5),txt="Ceil:"})
out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*5),txt=now["ceiling"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*6),txt="Precip:"})
out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*6),txt=precipitation[1].."%"})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*6),txt="Cloud:"})
out({c=0x48D1CC,a=1,x=155,y=datay+(datayy*6),txt=cloud_cover[1].."%"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*7),txt="UV:"})
out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*7),txt=uv_index_num[1]})
out({c=0x48D1CC,a=1,x=110,y=datay+(datayy*7),txt=uv_index_txt[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*8),txt="Sun:"})
out({c=0xFAFAEC,a=1,x=60,y=datay+(datayy*8),txt=sun_rise_24[1]})
out({c=0x48D1CC,a=1,x=120,y=datay+(datayy*8),txt=sun_set_24[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*9),txt="Moon:"})
out({c=0xFAFAEC,a=1,x=60,y=datay+(datayy*9),txt=moon_rise_24[1]})
out({c=0x48D1CC,a=1,x=120,y=datay+(datayy*9),txt=moon_set_24[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*10),txt="Phase:"})
out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*10),txt=moon_phase[1]})
-- line
image({x=205,y=5,w=1,h=90,file="/media/5/Conky/images/cyan_1.png"})
-- 3 hour output
out({c=0x48D1CC,a=1,x=265,y=15,txt="Next 3 Hours"})
-- 1st hour
image({w=45,h=45,x=220,y=32,file=now["fc_hour1_wicon"]})
-- image({w=45,h=45,x=220,y=32,file="/media/5/Conky/images/red+x.png"})
out({c=0xA4FFA4,a=1,x=225,y=30,txt=now["fc_hour1_time_24"]..":00"})
out({a=1,x=228,y=90,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
image({w=45,h=45,x=280,y=32,file=now["fc_hour2_wicon"]})
-- image({w=45,h=45,x=280,y=32,file="/media/5/Conky/images/red+x.png"})
out({c=0xA4FFA4,a=1,x=285,y=30,txt=now["fc_hour2_time_24"]..":00"})
out({a=1,x=290,y=90,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
image({w=45,h=45,x=340,y=32,file=now["fc_hour3_wicon"]})
-- image({w=45,h=45,x=340,y=32,file="/media/5/Conky/images/red+x.png"})
out({c=0xA4FFA4,a=1,x=345,y=30,txt=now["fc_hour3_time_24"]..":00"})
out({a=1,x=352,y=90,txt=now["fc_hour3_temp"] .."°"})
-- line
image({x=205,y=95,w=190,h=1,file="/media/5/Conky/images/cyan_1.png"})
-- line
image({x=5,y=270,w=390,h=1,file="/media/5/Conky/images/cyan_1.png"})
--start or weather forecast table section
--set start forecast day
start_day=1
--set total forecast days you want to display
number_of_days=10
topy=15
topyy=135 -- topy+(topyy*1)
topx=285
topxx=137.5
--set coordinates for top lef corners for each repeat
top_left_x_coordinate[1],top_left_y_coordinate[1] =topx ,150
top_left_x_coordinate[2],top_left_y_coordinate[2] =10 ,290
top_left_x_coordinate[3],top_left_y_coordinate[3] =10+(topxx*1) ,290
top_left_x_coordinate[4],top_left_y_coordinate[4] =10+(topxx*2) ,290
top_left_x_coordinate[5],top_left_y_coordinate[5] =10 ,440
top_left_x_coordinate[6],top_left_y_coordinate[6] =10+(topxx*1) ,440
top_left_x_coordinate[7],top_left_y_coordinate[7] =10+(topxx*2) ,440
top_left_x_coordinate[8],top_left_y_coordinate[8] =10 ,590
top_left_x_coordinate[9],top_left_y_coordinate[9] =10+(topxx*1) ,590
top_left_x_coordinate[10],top_left_y_coordinate[10] =10+(topxx*2) ,590
--########################################################################################
for i=start_day,number_of_days-(start_day-1) do --start of day repeat, do not edit #######
tlx=top_left_x_coordinate[i] --sets top left x position for each repeat ##################
tly=top_left_y_coordinate[i] --sets top left y position for each repeat ##################
--########################################################################################
out({c=0xA4FFA4,a=1,x=tlx,y=tly,txt=forecast_day_short[i].." "..forecast_date[i].." "..forecast_month_short[i]})
image({x=tlx+40,y=tly+2,h=45,w=45,file=weather_icon[i]})
-- image({x=tlx+40,y=tly+2,h=45,w=45,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=tlx+0,y=tly+20,txt=high_temp[i].."°"})
out({c=0x48D1CC,a=1,x=tlx+0,y=tly+35,txt=low_temp[i].."°"})
out({c=0x48D1CC,a=1,x=tlx,y=tly+60,txt=conditions_short[i]})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+80,txt="P: "..precipitation[i].."%"})
out({c=0xFAFAEC,a=1,x=tlx+60,y=tly+80,txt="H: "..humidity[i].."%"})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+95,txt="S: "..sun_rise_24[i]})
out({c=0x48D1CC,a=1,x=tlx+73,y=tly+95,txt=sun_set_24[i]})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+110,txt="M: "..moon_rise_24[i]})
out({c=0x48D1CC,a=1,x=tlx+73,y=tly+110,txt=moon_set_24[i]})
--########################################################################################
end--of forecast repeat section ##########################################################
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
10 Mar 13 | 18:47:42 ~
$ conkyForecast-SunsetSunriseCountdown
00:30:16
10 Mar 13 | 18:47:43 ~
$ conkyForecast-SunsetSunriseCountdown
00:30:16
10 Mar 13 | 18:47:43 ~
$ conkyForecast-SunsetSunriseCountdown
00:30:15
10 Mar 13 | 18:47:44 ~
$ conkyForecast-SunsetSunriseCountdown
00:30:14
10 Mar 13 | 18:47:45 ~
$ conkyForecast-SunsetSunriseCountdown
00:30:14
10 Mar 13 | 18:47:45 ~
$
BAT ${if_existing /sys/class/power_supply/AC0/online 0}${if_match ${battery_percent BAT1} <= 20}${if_match ${battery_percent BAT1} <= 17}${if_match ${battery_percent BAT1} <= 15}${color red}${exec /home/mini/.scripts/pm-suspend}$else${color red}${execi 60 /home/mini/.scripts/criticalbat.py}$endif$else${color orange}${execi 120 /home/mini/.scripts/lowbat.py}$endif$endif$endif${battery_percent BAT1}%$color
#!/bin/bash
gksu /usr/sbin/pm-suspend
#!/usr/bin/env python2
import pynotify
pynotify.init("foo")
pynotify.Notification("Power warning", "Battery capacity is low.", "battery-low").show()
#!/usr/bin/env python2
import pynotify
pynotify.init("foo")
pynotify.Notification("POWER WARNING!", "Battery capacity is critically low!", "battery-caution").show()
#!/usr/bin/python
import urllib
from xml.etree.cElementTree import parse
from datetime import datetime, timedelta
import os
from os.path import join
from sys import argv
try:
import cPickle as pickle
except ImportError:
import pickle
#Usage: yweather.py AYXX0001 Celsius
if len(argv) != 3:
raise Exception('Usage: yweather.py zip_code units. zip_code is your city code in Yahoo Weather, units can be Celsius or Fahrenheit.')
else:
zip_code = argv[1]
if argv[2] == 'Fahrenheit' or argv[2] == 'fahrenheit':
units = 'f'
else:
units = 'c'
CACHE_HOURS = 1
#http://weather.yahooapis.com/forecastrss
WEATHER_URL = 'http://xml.weather.yahoo.com/forecastrss?p=%s&u=%s'
WEATHER_NS = 'http://xml.weather.yahoo.com/ns/rss/1.0'
def weather_for_zip(zip_code, units):
url = WEATHER_URL % (zip_code, units)
rss = parse(urllib.urlopen(url)).getroot()
forecasts = []
for element in rss.findall('channel/item/{%s}forecast' % WEATHER_NS):
forecasts.append(dict(element.items()))
ycondition = rss.find('channel/item/{%s}condition' % WEATHER_NS)
return {
'current_condition': dict(ycondition.items()),
'forecasts': forecasts,
'title': rss.findtext('channel/title'),
'pubDate': rss.findtext('channel/item/pubDate'), #rss.findtext('channel/lastBuildDate'),
'location': dict(rss.find('channel/{%s}location' % WEATHER_NS).items()),
'wind': dict(rss.find('channel/{%s}wind' % WEATHER_NS).items()),
'atmosphere': dict(rss.find('channel/{%s}atmosphere' % WEATHER_NS).items()),
'astronomy': dict(rss.find('channel/{%s}astronomy' % WEATHER_NS).items()),
'units': dict(rss.find('channel/{%s}units' % WEATHER_NS).items())
}
def print_openbox_pipe_menu(weather):
print '<openbox_pipe_menu>'
print '<separator label="%s %s" />' % (weather['location']['city'],weather['pubDate'])
print '<separator label="Current conditions" />'
print '<item label="Weather: %s" />' % weather['current_condition']['text']
print '<item label="Temperature: %s %s" />' % ( weather['current_condition']['temp'],
weather['units']['temperature'] )
print '<item label="Humidity: %s%%" />' % weather['atmosphere']['humidity']
print '<item label="Visibility: %s %s" />' % ( weather['atmosphere']['visibility'],
weather['units']['distance'] )
#pressure: steady (0), rising (1), or falling (2)
if weather['atmosphere']['rising'] == 0:
pressure_state = 'steady'
elif weather['atmosphere']['rising'] == 1:
pressure_state = 'rising'
else:
pressure_state = 'falling'
print '<item label="Pressure: %s %s (%s)" />' % ( weather['atmosphere']['pressure'],
weather['units']['pressure'], pressure_state )
print '<item label="Wind chill: %s %s" />' % ( weather['wind']['chill'],
weather['units']['temperature'] )
print '<item label="Wind direction: %s degrees" />' % weather['wind']['direction']
print '<item label="Wind speed: %s %s" />' % ( weather['wind']['speed'],
weather['units']['speed'] )
print '<item label="Sunrise: %s" />' % weather['astronomy']['sunrise']
print '<item label="Sunset: %s" />' % weather['astronomy']['sunset']
for forecast in weather['forecasts']:
print '<separator label="Forecast: %s" />' % forecast['day']
print '<item label="Weather: %s" />' % forecast['text']
print '<item label="Min temperature: %s %s" />' % ( forecast['low'],
weather['units']['temperature'] )
print '<item label="Max temperature: %s %s" />' % ( forecast['high'],
weather['units']['temperature'] )
print '</openbox_pipe_menu>'
cache_file = join(os.getenv("HOME"), '.yweather.cache')
try:
f = open(cache_file,'rb')
cache = pickle.load(f)
f.close()
except IOError:
cache = None
if cache == None or (zip_code, units) not in cache or (
cache[(zip_code, units)]['date'] + timedelta(hours=CACHE_HOURS) < datetime.utcnow()):
# The cache is outdated
weather = weather_for_zip(zip_code, units)
if cache == None:
cache = dict()
cache[(zip_code, units)] = {'date': datetime.utcnow(), 'weather': weather}
#Save the data in the cache
try:
f = open(cache_file, 'wb')
cache = pickle.dump(cache, f, -1)
f.close()
except IOError:
raise
else:
weather = cache[(zip_code, units)]['weather']
print_openbox_pipe_menu(weather)
<menu execute="python ~/.config/openbox/scripts/yweather.py ARDF0127 Celsius" id="pipe-weather-bsas1" label="Buenos Aires"/>
<menu execute="python ~/.config/openbox/scripts/yweather.py ARBA0009 Celsius" id="pipe-weather-bsas2" label="Ezeiza"/>
exec /usr/sbin/pm-suspend
BAT ${if_existing /sys/class/power_supply/AC0/online 0}${if_match ${battery_percent BAT1} <= 20}${if_match ${battery_percent BAT1} <= 17}${if_match ${battery_percent BAT1} <= 15}${color red}${exec /usr/sbin/pm-suspend}$else${color red}${execi 60 /home/mini/.scripts/criticalbat.py}$endif$else${color
Quote from: Sector11 on March 11, 2013, 11:03:35 AM
↑ Funny - and thanks ... from S12 too.
She smiled a big one!
# .conkyrc - Edited from various examples across the 'net
# Used by VastOne on #!
# Create own window instead of using desktop (required in nautilus)
#own_window yes
#own_window_type normal
#own_window_transparent no
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
# use_spacer right
# Use Xft?
use_xft yes
xftfont Liberation Sans:size=16
xftalpha 0.9
text_buffer_size 2048
# Update interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
#minimum_size 1024 0
#maximum_width 1024
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
own_window_argb_visual no
own_window_type panel
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window yes
own_window_transparent yes
own_window_class conky
# Stippled borders?
stippled_borders 0
# border margins
# border_margin 0
# border width
border_width 1
# Default colors and also border colors
#default_color grey
#color2=white
#color3=grey
#default_shade_color black
#default_outline_color grey
own_window_colour 000000
# Text alignment, other possible values are commented
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 0
gap_y 5
minimum_size 1700 29
maximum_width 1700
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
imlib_cache_size 0
# number of cpu samples to average set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none
#lua_load ~/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.3
#
TEXT
${image /home/vastone/images/vsidoorb.png -s 31x31 -p 1,-1} ${color 7D8C93}Kernel${color 55688A} $kernel ${color 7D8C93} Uptime ${color lime green}${uptime_short} ${color 7D8C93} CPU ${color 55688A}${cpu cpu0}% ${color 7D8C93}MEM ${color 55688A}${memperc}% ${mem} / ${memmax} ${color 7D8C93} CPU ${color 55688A}${platform it87.552 temp 2}° ${color 7D8C93} MB ${color 55688A}${platform it87.552 temp 1}° ${color 7D8C93}GPU ${color 55688A}${nvidia temp}° ${color 7D8C93}HD${color 55688A} ${execi 5 hddtemp -n /dev/sda}° ${color 7D8C93}NET${color 55688A} ${voffset 3}${downspeedgraph eth0 14,100 000000 ff0000} ${upspeedgraph eth0 14,100 000000 00ff00} ${voffset -11} ${color 55688A} ${time %I:%M}${time %P} ${color 7D8C93}Gmail ${color lime green} ${execi 60 ~/.scripts/gmail.sh YOURGMAILUSERNAME YOURPASSWORD} ${offset -192} ${voffset 18} ${color 55688A} ${time %a %b %d %Y}
#!/bin/bash
wget -q -O - [url]https://mail.google.com/mail/feed/atom[/url] --http-user="$1"@gmail.com --http-password="$2" - | grep fullcount | sed 's/[^0-9]//g'
exit
# .conkyrc - Edited from various examples across the 'net
# Used by VastOne on #!
# Create own window instead of using desktop (required in nautilus)
#own_window yes
#own_window_type normal
#own_window_transparent no
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
use_spacer right
# Use Xft?
use_xft yes
xftfont liberation sans:size=13
xftalpha 0.9
text_buffer_size 2048
# Update interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
#minimum_size 1024 0
#maximum_width 1024
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
own_window_argb_visual yes
own_window_type panel
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window yes
own_window_transparent yes
own_window_class conky-semi
# Stippled borders?
stippled_borders 0
# border margins
# border_margin 0
# border width
border_width 1
# Default colors and also border colors
#default_color grey
#color2=white
#color3=grey
#default_shade_color black
#default_outline_color grey
own_window_colour 000000
# Text alignment, other possible values are commented
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 0
gap_y 5
minimum_size 1700 29
maximum_width 1700
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none
# lua_load ~/Conky/LUA/draw-bg.lua
# lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.3
#
TEXT
${image $HOME/images/vsidoorb.png -s 34x34 -p 1,-1} ${color 73AEB4}Kernel${color 7D8C93} $kernel ${color 73AEB4} Uptime ${color lime green}${uptime_short} ${color 73AEB4} CPU ${color 7D8C93}${cpu cpu0}% ${color 73AEB4}MEM ${color 7D8C93}${memperc}% ${mem} / ${memmax} ${color 73AEB4} HD ${color 7D8C93} ${execi 5 hddtemp -n /dev/sda}° ${color 73AEB4}NET${color 7D8C93} ${voffset 1}${downspeedgraph eth0 12,70 000000 ff0000} ${upspeedgraph eth0 12,70 000000 00ff00} ${color 7D8C93} Gmail ${color lime green} ${execi 10 ~/.scripts/gmail.sh YOURGMAILUSERNAME YOURPASSWORD}
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type desktop
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 275 1000
maximum_width 275
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment tl
gap_x 15
gap_y 45
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
short_units yes
### LUA Load ###
lua_load /home/luke/Conky/allcombined_2.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
TEXT
${image /home/luke/Conky/CPU.png -s 150x75 -p 65,5}${lua draw_bg {25,0,0,0,0,0x000000,0.3}}
${goto 5}${font Pseudo APL:Bold:size=14} Core1${goto 90}${cpu cpu1}${font SansMono:Bold:size=11}%${goto 150}Core2${goto 235}${cpu cpu2}${font SansMono:Bold:size=11}%
${goto 5}${font Pseudo APL:Bold:size=14} Core3${goto 90}${cpu cpu3}${font SansMono:Bold:size=11}%${goto 150}Core4${goto 235}${cpu cpu4}${font SansMono:Bold:size=11}%
${goto 5}${font Pseudo APL:Bold:size=14} Core5${goto 90}${cpu cpu5}${font SansMono:Bold:size=11}%${goto 150}Core6${goto 235}${cpu cpu6}${font SansMono:Bold:size=11}%
#${goto 15}${cpubar cpu0 30,245}
${lua gradbar {15,143,"${cpu cpu0}",100,63,2,30,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 20}${font Pseudo APL:Bold:size=12}${top name 1} ${goto 115}${top pid 1} ${goto 185}${top cpu 1}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top name 2} ${goto 115}${top pid 2} ${goto 185}${top cpu 2}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top name 3} ${goto 115}${top pid 3} ${goto 185}${top cpu 3}${font SansMono:Bold:size=11}%
${image /home/luke/Conky/memory.png -s 225x90 -p 30,215}
${goto 5}${font Pseudo APL:Bold:size=14} RAM ${goto 110}${mem}${goto 190}/${memmax}
#${goto 15}${membar 30,245}
${lua gradbar {15,321,"${memperc}",100,63,2,30,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} SWAP ${goto 110}${swap}${goto 190}/${swapmax}
#${goto 15}${swapbar 30,245}
${lua gradbar {15,381,"${swapperc}",100,63,2,30,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 20}${font Pseudo APL:Bold:size=12}${top_mem name 1} ${goto 115}${top_mem pid 1} ${goto 185}${top_mem mem 1}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top_mem name 2} ${goto 115}${top_mem pid 2} ${goto 185}${top_mem mem 2}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top_mem name 3} ${goto 115}${top_mem pid 3} ${goto 185}${top_mem mem 3}${font SansMono:Bold:size=11}%
${image /home/luke/Conky/Storage.png -s 225x90 -p 29,453}
${goto 5}${font Pseudo APL:Bold:size=14} / ${goto 120}${fs_used /}${goto 205}/15G
${lua gradbar {15,555,"${fs_used_perc /}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} /home ${goto 120}${fs_used /home}${goto 205}/37G
${lua gradbar {15,595,"${fs_used_perc /home}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} Storage ${goto 120}${fs_used /media/storage}${goto 205}/${fs_size /media/storage}
${lua gradbar {15,635,"${fs_used_perc /media/storage}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} Music ${goto 120}${fs_used /media/sde6}${goto 205}/${fs_size /media/sde6}
${lua gradbar {15,675,"${fs_used_perc /media/sde6}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} External ${goto 120}${fs_used /media/sde5}${goto 205}/${fs_size /media/sde5}
${lua gradbar {15,715,"${fs_used_perc /media/sde5}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} Videos ${goto 120}${fs_used /media/sdc1}${goto 205}/${fs_size /media/sdc1}
${lua gradbar {15,755,"${fs_used_perc /media/sdc1}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} Software ${goto 120}${fs_used /media/sdb1}${goto 205}/${fs_size /media/sdb1}
${lua gradbar {15,795,"${fs_used_perc /media/sdb1}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${image /home/luke/Conky/temps.png -s 225x90 -p 23,798}
${goto 5}${font Pseudo APL:Bold:size=14} CPU ${goto 225}${platform it87.656 temp 1}F
${lua gradbar {15,893,"${platform it87.656 temp 1}",195,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} Motherboard ${goto 225}${platform it87.656 temp 2}F
${lua gradbar {15,935,"${platform it87.656 temp 2}",200,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} GPU ${goto 225}${nvidia temp}F
${lua gradbar {15,975,"${platform it87.656 temp 2}",200,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 350 360
maximum_width 350
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment top_middle
gap_x 200
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 6
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0
# 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
### LUA Load ###
lua_load /home/luke/Conky/allcombined_2.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
${lua draw_bg {25,0,0,0,0,0x000000,0.3}}
TEXT
${image /home/luke/Conky/weather.png -s 225x90 -p 75,5}${lua draw_bg {25,0,0,0,0,0x000000,0.3}}
${image /home/luke/Conky/thermometer.png -s 50x50 -p 20,90}
${voffset 7}${goto 70}${font Pseudo APL:Bold:size=20}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F ${voffset -5}
${font Pseudo APL:Bold:size=14}${goto 10}Dawn ${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 185,90 -s 140x125}
${goto 10}Dusk ${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${font Pseudo APL:Bold:size=12}${goto 25}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 140}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 260}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/tod_ton}
${font Pseudo APL:Bold:size=11}${goto 90}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 205}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 320}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${voffset 5}${font Pseudo APL:Bold:size=11}${goto 90}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 205}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 320}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${image $HOME/Accuweather_Conky_USA_Images/7.png -p 10,225 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/12.png -p 128,225 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/17.png -p 246,225 -s 80x67}${voffset -5}
${font Pseudo APL:Bold:size=50}${alignc}${time %I}:${time %M}${time %P}
${voffset -35}${font Pseudo APL:Bold:size=31}${alignc}${time %a} ${time %D}${voffset 35}
${image /home/luke/Conky/network.png -s 225x90 -p 75,405}${image /home/luke/Conky/up.png -s 30x30 -p 20,495}
${goto 70}${font Pseudo APL:Bold:size=16}${upspeed eth0} ${voffset -8}${goto 163}${upspeedgraph 23,165 666666 000066}${voffset 8}
${image /home/luke/Conky/down.png -s 30x30 -p 20,548}
${goto 70}${font Pseudo APL:Bold:size=16}${downspeed eth0} ${voffset -8}${goto 163}${downspeedgraph 23,165 666666 000066}${voffset 8}
--[[ by mrpeachy -
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'
function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
function conky_gradbar(bartab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_draw_bg(bgtab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
if w==0 then
w=tonumber(conky_window.width)
end
if h==0 then
h=tonumber(conky_window.height)
end
cairo_set_source_rgba (cr,rgb_to_r_g_b({color,alpha}))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luacal(caltab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--####################################################################################################
local caltab=loadstring("return" .. caltab)()
local cal_x=caltab[1]
local cal_y=caltab[2]
local tfont=caltab[3]
local tfontsize=caltab[4]
local tc=caltab[5]
local ta=caltab[6]
local bfont=caltab[7]
local bfontsize=caltab[8]
local bc=caltab[9]
local ba=caltab[10]
local hfont=caltab[11]
local hfontsize=caltab[12]
local hc=caltab[13]
local ha=caltab[14]
local spacer=caltab[15]
local gaph=caltab[16]
local gapt=caltab[17]
local gapl=caltab[18]
local sday=caltab[19]
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b({tc,ta})
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b({bc,ba})
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b({hc,ha})
--###################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]=" "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
for i=1,7 do
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--#########################################################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luaimage(imtab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
local imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function
function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type override
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 275 1000
maximum_width 275
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment tl
gap_x 15
gap_y 30
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
short_units yes
### LUA Load ###
lua_load /home/luke/Conky/allcombined.lua
#lua_load /home/luke/Conky/draw_bg.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
#${lua draw_bg {25,0,0,0,0,0x333333,0.4}}
TEXT
#${image /home/luke/Conky/CPU.png -s 150x75 -p 65,5}
${lua tex_bg {30,2,1,281,1029,"/home/luke/Conky/brushed2.png"}}${lua draw_bg {30,0,0,285,1030,0x000000,.75,2,2}}
${goto 5}${font jimi:size=40}cpu ${lua gradbar {0,78,"${memperc}",100,100,1,3,0,0xFFFFFF,1,0x999999,0,0x333333,0,0x000000,0}}
${voffset -22}${goto 5}${font jimi:size=15} Core1${goto 90}${font Pseudo APL:Bold:size=14}${cpu cpu1}${font SansMono:Bold:size=11}%${goto 150}${font jimi:size=15}Core2${goto 235}${font Pseudo APL:Bold:size=14}${cpu cpu2}${font SansMono:Bold:size=11}%
${goto 5}${font jimi:size=15} Core3${goto 90}${font Pseudo APL:Bold:size=14}${cpu cpu3}${font SansMono:Bold:size=11}%${goto 150}${font jimi:size=15}Core4${goto 235}${font Pseudo APL:Bold:size=14}${cpu cpu4}${font SansMono:Bold:size=11}%
${goto 5}${font jimi:size=15} Core5${goto 90}${font Pseudo APL:Bold:size=14}${cpu cpu5}${font SansMono:Bold:size=11}%${goto 150}${font jimi:size=15}Core6${goto 235}${font Pseudo APL:Bold:size=14}${cpu cpu6}${font SansMono:Bold:size=11}%${voffset 22}
${lua gradbar {11,155,"${cpu cpu0}",100,250,1,30,0,0xCCCCCC,.0,0x999999,1,0x333333,.5,0x000000,1}}
${goto 20}${font Pseudo APL:Bold:size=12}${top name 1} ${goto 115}${top pid 1} ${goto 185}${top cpu 1}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top name 2} ${goto 115}${top pid 2} ${goto 185}${top cpu 2}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top name 3} ${goto 115}${top pid 3} ${goto 185}${top cpu 3}${font SansMono:Bold:size=11}%
#${image /home/luke/Conky/memory.png -s 225x90 -p 30,215}
${goto 5}${font jimi:size=40}Memory${lua gradbar {-15,300,"${memperc}",100,235,1,3,0,0xFFFFFF,1,0x999999,0,0x333333,0,0x000000,0}}
${voffset -25}${goto 5}${font jimi:size=15} RAM ${goto 110}${font Pseudo APL:Bold:size=14}${mem}${goto 190}/${memmax}${voffset 25}
${lua gradbar {11,329,"${memperc}",100,250,1,30,0,0x000000,.0,0x999999,1,0x333333,.5,0x000000,1}}
${voffset -25}${goto 5}${font jimi:size=15} SWAP ${goto 110}${font Pseudo APL:Bold:size=14}${swap}${goto 190}/${swapmax}${voffset 25}
${lua gradbar {11,389,"${swapperc}",100,250,1,30,0,0x000000,.0,0x999999,1,0x333333,.5,0x000000,1}}
${voffset -13}${goto 20}${font Pseudo APL:Bold:size=12}${top_mem name 1} ${goto 115}${top_mem pid 1} ${goto 185}${top_mem mem 1}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top_mem name 2} ${goto 115}${top_mem pid 2} ${goto 185}${top_mem mem 2}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top_mem name 3} ${goto 115}${top_mem pid 3} ${goto 185}${top_mem mem 3}${font SansMono:Bold:size=11}%${voffset 13}
#${image /home/luke/Conky/Storage.png -s 225x90 -p 29,453}
#
#
${color }${goto 5}${font jimi:size=40}Storage ${color}${lua gradbar {-17,529,"${memperc}",100,250,1,3,0,0xFFFFFF,1,0x999999,0,0x333333,0,0x000000,0}}
${voffset -20}${goto 5}${font jimi:size=15} / ${font Pseudo APL:Bold:size=14}${goto 120}${fs_used /}${goto 205}/15G
${lua gradbar {11,557,"${fs_used_perc /}",100,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} /home ${font Pseudo APL:Bold:size=14}${goto 120}${fs_used /home}${goto 205}/37G
${lua gradbar {11,597,"${fs_used_perc /home}",100,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} storage ${font Pseudo APL:Bold:size=14}${goto 120}${fs_used /media/storage}${goto 205}/${fs_size /media/storage}
${lua gradbar {11,637,"${fs_used_perc /media/storage}",100,250,1,15,0,0x000000,0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} music ${font Pseudo APL:Bold:size=14}${goto 120}${fs_used /media/sde6}${goto 205}/${fs_size /media/sde6}
${lua gradbar {11,677,"${fs_used_perc /media/sde6}",100,250,1,15,0,0x000000,0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} external ${font Pseudo APL:Bold:size=14}${goto 120}${fs_used /media/sde5}${goto 205}/${fs_size /media/sde5}
${lua gradbar {11,717,"${fs_used_perc /media/sde5}",100,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} videos ${font Pseudo APL:Bold:size=14} ${goto 120}${fs_used /media/sdc1}${goto 205}/${fs_size /media/sdc1}
${lua gradbar {11,757,"${fs_used_perc /media/sdc1}",100,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} software ${font Pseudo APL:Bold:size=14}${goto 120}${fs_used /media/sdb1}${goto 205}/${fs_size /media/sdb1}${voffset 20}
${lua gradbar {11,797,"${fs_used_perc /media/sdb1}",100,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.75,0x000000,1}}
#
#
${voffset -10}${color }${goto 5}${font jimi:size=40}Temps ${color}${lua gradbar {-4,874,"${memperc}",100,170,1,3,0,0xFFFFFF,1,0x999999,0,0x333333,0,0x000000,0}}${voffset 10}
${voffset -25}${goto 5}${font jimi:size=15} cpu ${font Pseudo APL:Bold:size=14} ${goto 225}${platform it87.656 temp 1}F
${lua gradbar {15,907,"${platform it87.656 temp 1}",195,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} motherboard ${font Pseudo APL:Bold:size=14} ${goto 225}${platform it87.656 temp 2}F
${lua gradbar {15,947,"${platform it87.656 temp 2}",200,250,1,15,0,0x000000,.01,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} gpu ${font Pseudo APL:Bold:size=14} ${goto 225}${nvidia temp}F${voffset 25}
${lua gradbar {15,987,"${platform it87.656 temp 2}",200,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.5,0x000000,1}}
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type desktop
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 350 700
maximum_width 350
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment top_middle
gap_x 200
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 6
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0
# 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
### LUA Load ###
lua_load /home/luke/Conky/allcombined.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
${lua draw_bg {25,0,0,0,0,0x000000,0.3}}
TEXT
#${image /home/luke/Conky/weather.png -s 225x90 -p 75,5}${lua draw_bg {25,0,0,0,0,0xFFFFFF,0.05}}
${lua tex_bg {30,2,1,358,700,"/home/luke/Conky/brushed2.png"}}${lua draw_bg {30,0,0,360,702,0x000000,.75,2,2}}${image /home/luke/Conky/thermometer.png -s 50x50 -p 20,18}
${goto 70}${font Pseudo APL:Bold:size=20}${texeci 500 bash $HOME/1b1_accuweather_images/1b1}${execpi 600 sed -n '29p' $HOME/1b1_accuweather_images/curr_cond}°F
${font jimi:size=15}${goto 10}Dawn${font Pseudo APL:bold:size=14} ${execpi 600 sed -n '39p' $HOME/1b1_accuweather_images/curr_cond}${image /home/luke/1b1_accuweather_images/cc.png -p 110,5 -s 260x180}
${font jimi:size=15}${goto 10}Dusk${font Pseudo APL:bold:size=14} ${execpi 600 sed -n '40p' $HOME/1b1_accuweather_images/curr_cond}
${font jimi:size=15}${goto 10}Rain${font Pseudo APL:bold:size=14} ${alignc 37}${font Sans:size=11}${execpi 600 sed -n '28p' $HOME/1b1_accuweather_images/first_days}
${font jimi:size=15}${goto 10}Clouds${font Pseudo APL:bold:size=14} ${alignc 37}${font Sans:size=11}${execpi 600 sed -n '35p' $HOME/1b1_accuweather_images/curr_cond}
#${font Pseudo APL:Bold:size=14}${goto 10}Wind ${alignc 37}${font Sans:size=11}${execpi 600 sed -n '31p' $HOME/1b1_accuweather_images/curr_cond} ${execpi 600 sed -n '32p' $HOME/1b1_accuweather_images/curr_cond}
${font Pseudo APL:Bold:size=12}${goto 25}${execpi 600 sed -n '5p' $HOME/1b1_accuweather_images/first_days}${goto 140}${execpi 600 sed -n '10p' $HOME/1b1_accuweather_images/first_days}${goto 260}${execpi 600 sed -n '15p' $HOME/1b1_accuweather_images/first_days}
${image $HOME/1b1_accuweather_images/6.png -p 0,180 -s 115x79}${image $HOME/1b1_accuweather_images/11.png -p 122,180 -s 115x79}${image $HOME/1b1_accuweather_images/16.png -p 242,180 -s 115x79}
${voffset 9}${font Pseudo APL:Bold:size=13}${goto 40}${execpi 600 sed -n '8p' $HOME/1b1_accuweather_images/first_days}°F${goto 160}${execpi 600 sed -n '13p' $HOME/1b1_accuweather_images/first_days}°F${goto 280}${execpi 600 sed -n '18p' $HOME/1b1_accuweather_images/first_days}°F${voffset -9}
${font Pseudo APL:Bold:size=12}${goto 25}${execpi 600 sed -n '20p' $HOME/1b1_accuweather_images/first_days}${goto 140}${execpi 600 sed -n '1p' $HOME/1b1_accuweather_images/last_days}${goto 260}${execpi 600 sed -n '6p' $HOME/1b1_accuweather_images/last_days}
${image $HOME/1b1_accuweather_images/21.png -p 0,300 -s 115x79}${image $HOME/1b1_accuweather_images/last_2.png -p 122,300 -s 115x79}${image $HOME/1b1_accuweather_images/last_7.png -p 242,300 -s 115x79}
${voffset 9}${font Pseudo APL:Bold:size=13}${goto 40}${execpi 600 sed -n '23p' $HOME/1b1_accuweather_images/first_days}°F${goto 160}${execpi 600 sed -n '4p' $HOME/1b1_accuweather_images/last_days}°F${goto 280}${execpi 600 sed -n '9p' $HOME/1b1_accuweather_images/last_days}°F${voffset -9}
${font Pseudo APL:bold:size=50}${alignc}${time %I}:${time %M}${time %P}
${voffset -35}${font Pseudo APL:Bold:size=31}${alignc}${time %a} ${time %D}${voffset 35}${color}
${voffset -25}${goto 5}${font jimi:size=40}Network${voffset 25}${lua gradbar {-15,572,"${memperc}",100,257,1,3,0,0xFFFFFF,1,0x999999,0,0x333333,0,0x000000,0}}${image /home/luke/Conky/up.png -s 30x30 -p 20,582}
${voffset -35}${goto 70}${font Pseudo APL:Bold:size=16}${upspeed eth0} ${voffset -8}${goto 163}${upspeedgraph 23,165 666666 000066}${voffset 8}
${image /home/luke/Conky/down.png -s 30x30 -p 20,630}
${goto 70}${font Pseudo APL:Bold:size=16}${downspeed eth0} ${voffset -8}${goto 163}${downspeedgraph 23,165 666666 000066}${voffset -75}
--[[ by mrpeachy -
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'
function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
function conky_gradbar(bartab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_draw_bg(bgtab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
local draw=bgtab[8]
local lwidth=bgtab[9]
local olcolor=bgtab[10]
local olalpha=bgtab[11]
if w==0 then
w=tonumber(conky_window.width)
end
if h==0 then
h=tonumber(conky_window.height)
end
cairo_set_source_rgba (cr,rgb_to_r_g_b({color,alpha}))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
if draw==1 then
cairo_fill (cr)
elseif draw==2 then
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
elseif draw==3 then
cairo_fill_preserve (cr)
cairo_set_source_rgba (cr,rgb_to_r_g_b({olcolor,olalpha}))
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
end
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luacal(caltab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--####################################################################################################
local caltab=loadstring("return" .. caltab)()
local cal_x=caltab[1]
local cal_y=caltab[2]
local tfont=caltab[3]
local tfontsize=caltab[4]
local tc=caltab[5]
local ta=caltab[6]
local bfont=caltab[7]
local bfontsize=caltab[8]
local bc=caltab[9]
local ba=caltab[10]
local hfont=caltab[11]
local hfontsize=caltab[12]
local hc=caltab[13]
local ha=caltab[14]
local spacer=caltab[15]
local gaph=caltab[16]
local gapt=caltab[17]
local gapl=caltab[18]
local sday=caltab[19]
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b({tc,ta})
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b({bc,ba})
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b({hc,ha})
--###################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]=" "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
for i=1,7 do
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--#########################################################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luaimage(imtab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
local imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function
function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function
31 Mar 13 | 11:27:47 ~
$ vid
Graphics: Card: NVIDIA GT218 [GeForce 210] bus-ID: 02:00.0 chip-ID: 10de:0a65
X.Org: 1.12.4 driver: nvidia Resolution: 1920x1080@60.0hz
GLX Renderer: GeForce 210/PCIe/SSE2 GLX Version: 3.3.0 NVIDIA 313.26 Direct Rendering: Yes
31 Mar 13 | 11:28:02 ~
$
Graphics: Card: NVIDIA GK107 [GeForce GT 640] X.Org: 1.12.4 driver: nvidia Resolution: 1920x1080@60.0hz
Graphics: Card: NVIDIA G80 [GeForce 8800 GTS] X.org: 1.12.4 driver: nvidia tty size: 80x24 Advanced Data: N/A out of X
Graphics: Card: Intel 2nd Generation Core Processor Family Integrated Graphics Controller X.org: 1.12.4 driver: intel tty size: 80x24 Advanced Data: N/A out of X
Quote
#==============================================================================
# Conky thingamabob
#
# Date : 03/08/2011
# author : dizzie & original by xeNULL
# version : v0.2
# license : Distributed under the terms of GNU GPL version 2 or later
#
#==============================================================================
background yes
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius
short_units yes
double_buffer yes
no_buffers yes
text_buffer_size 2048
gap_x 25
gap_y 40
minimum_size 180 750
maximum_width 180
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment tr
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_bar_size 150 20
override_utf8_locale yes
use_xft yes
xftfont Pragmata:9
xftalpha 0.5
uppercase no
default_color FFFFFF
color1 DDDDDD
color2 AAAAAA
color3 888888
color4 FFFFFF
lua_load ~/.config/conky/ConkyHXR.lua
lua_draw_hook_post main
TEXT
${voffset 25}${font Pragmata:size=9} /// S Y S T E M ///
${voffset 25}${color4}${offset 55}${cpugraph 20,115 999999 ffffff}${color}
${voffset -20}${offset 45}${font Pragmata:size=9}${color}CPU${offset 65}
${offset 55}${font Pragmata:size=8,weight:normal}${color4}${top name 1}${alignr}${top cpu 1}%
${offset 55}${font Pragmata:size=8,weight:normal}${color1}${top name 2}${alignr}${top cpu 2}%
${offset 55}${font Pragmata:size=8,weight:normal}${color2}${top name 3}${alignr}${top cpu 3}%
${offset 55}${font Pragmata:size=8,weight:normal}${color3}${top name 4}${alignr}${top cpu 4}%
${offset 55}${font Pragmata:size=8,weight:normal}${color3}${top name 5}${alignr}${top cpu 5}%
${voffset 30}${color4}${offset 55}${memgraph 5,115 999999 ffffff -l}${color}
${voffset -15}${offset 45}${font Pragmata:size=9}${color}MEM
${offset 55}${font Pragmata:size=8,weight:normal}${color4}${top_mem name 1}${alignr}${top_mem mem 1}%
${offset 55}${font Pragmata:size=8,weight:normal}${color1}${top_mem name 2}${alignr}${top_mem mem 2}%
${offset 55}${font Pragmata:size=8,weight:normal}${color2}${top_mem name 3}${alignr}${top_mem mem 3}%
${offset 55}${font Pragmata:size=8,weight:normal}${color3}${top_mem name 4}${alignr}${top_mem mem 4}%
${offset 55}${font Pragmata:size=8,weight:normal}${color3}${top_mem name 4}${alignr}${top_mem mem 5}%
${voffset 25}${offset 55}${diskiograph 20,115 999999 ffffff}
${voffset -20}${offset 45}${font Pragmata:size=9}${color}DISK
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}- ${fs_used /} - ${fs_size /}
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}~ ${fs_used /home} - ${fs_size /home}
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}@ ${fs_used /mnt/srv} - ${fs_size /mnt/srv}
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}¥ ${fs_used /mnt/backup} - ${fs_size /mnt/backup}
${voffset 5}${color4}${offset 10}${upspeedgraph eth0 20,70 999999 ffffff}${alignr}${offset 0}${upspeedgraph wlan0 20,70 999999 ffffff}${color}
${color4}${offset 10}${downspeedgraph eth0 20,70 999999 ffffff}${alignr}${offset 0}${downspeedgraph wlan0 20,70 999999 ffffff}${color}
${voffset 8}${offset 10}${font Pragmata:size=9}${color}ETHERNET IP ROUTER IP
${offset 10}${color2}${font Pragmata:size=8,weight:normal}${addr eth0}${alignr}${offset -10}${gw_ip}
${voffset 42}${offset 45}${font Pragmata:size=9}${color4}MUSIC${color}
${offset 55}${hr}
${font Pragmata:size=8}${offset 55}${color4}Song${color}
${offset 55}${color3}${exec mocp -Q %song}${color}
${offset 55}${color4}Artist${color}
${offset 55}${color3}${exec mocp -Q %artist}${color}
${offset 55}${color4}Album${color}
${offset 55}${color3}${exec mocp -Q %album}${color}
${offset 55}${hr}
${offset 55}${alignr}${color3}${exec mocp -Q %ct} - ${exec mocp -Q %tt}${color}
${voffset -12}${offset 55}${blink ${color4}${exec mocp -Q %state}${color}
${image ~/.config/conky/rin.png -p 70,655 -s 100x100}
Quote
--==============================================================================
-- ConkyHXR.lua
--
-- Date : 03/08/2011
-- Author : xeNULL
-- Version : v0.1
-- License : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================
require 'cairo'
--------------------------------------------------------------------------------
-- gauge DATA
gauge = {
{
name='cpu', arg='cpu0', max_value=100,
x=40, y=90,
graph_radius=24,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.3,
graph_fg_colour=0x111111, graph_fg_alpha=0.5,
hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0,
txt_radius=34,
txt_weight=0, txt_size=8.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='cpu', arg='cpu1', max_value=100,
x=40, y=90,
graph_radius=18,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.3,
graph_fg_colour=0x111111, graph_fg_alpha=0.5,
hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0,
txt_radius=10,
txt_weight=0, txt_size=8.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='memperc', arg='', max_value=100,
x=40, y=210,
graph_radius=24,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.3,
graph_fg_colour=0x111111, graph_fg_alpha=0.5,
hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0,
txt_radius=34,
txt_weight=0, txt_size=8.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=1.0,
graduation_radius=23,
graduation_thickness=0, graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.5,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='fs_used_perc', arg='/', max_value=100,
x=40, y=340,
graph_radius=24,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.3,
graph_fg_colour=0x111111, graph_fg_alpha=0.5,
hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0,
txt_radius=34,
txt_weight=0, txt_size=8.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=1.0,
graduation_radius=23,
graduation_thickness=0, graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
{
name='downspeedf', arg='eth0', max_value=100,
x=40, y=425,
graph_radius=24,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.3,
graph_fg_colour=0x111111, graph_fg_alpha=0.5,
hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0,
txt_radius=34,
txt_weight=0, txt_size=8.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='Down',
caption_weight=1, caption_size=6.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
{
name='upspeedf', arg='eth0', max_value=100,
x=40, y=425,
graph_radius=18,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.3,
graph_fg_colour=0x111111, graph_fg_alpha=0.5,
hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0,
txt_radius=10,
txt_weight=0, txt_size=8.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='Up',
caption_weight=1, caption_size=6.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
{
name='downspeedf', arg='wlan0', max_value=100,
x=135, y=425,
graph_radius=24,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.3,
graph_fg_colour=0x111111, graph_fg_alpha=0.5,
hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0,
txt_radius=34,
txt_weight=0, txt_size=8.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='Down',
caption_weight=1, caption_size=6.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
{
name='upspeedf', arg='wlan0', max_value=100,
x=135, y=425,
graph_radius=18,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.3,
graph_fg_colour=0x111111, graph_fg_alpha=0.5,
hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0,
txt_radius=10,
txt_weight=0, txt_size=8.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='Up',
caption_weight=1, caption_size=6.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.5,
},
{
name='mixer', arg='Master', max_value=100,
x=40, y=542,
graph_radius=24,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.3,
graph_fg_colour=0x111111, graph_fg_alpha=0.5,
hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0,
txt_radius=34,
txt_weight=0, txt_size=8.0,
txt_fg_colour=0xFFFFFF, txt_fg_alpha=1.0,
graduation_radius=23,
graduation_thickness=0, graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.5,
caption='',
caption_weight=1, caption_size=8.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
}
-------------------------------------------------------------------------------
-- rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
-------------------------------------------------------------------------------
-- angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
local pos = current_angle + start_angle
return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end
-------------------------------------------------------------------------------
-- draw_gauge_ring
-- displays gauges
--
function draw_gauge_ring(display, data, value)
local max_value = data['max_value']
local x, y = data['x'], data['y']
local graph_radius = data['graph_radius']
local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
local graph_start_angle = data['graph_start_angle']
local graph_unit_angle = data['graph_unit_angle']
local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha']
local graph_end_angle = (max_value * graph_unit_angle) % 360
-- background ring
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
cairo_set_line_width(display, graph_thickness)
cairo_stroke(display)
-- arc of value
local val = value % (max_value + 1)
local start_arc = 0
local stop_arc = 0
local i = 1
while i <= val do
start_arc = (graph_unit_angle * i) - graph_unit_thickness
stop_arc = (graph_unit_angle * i)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
cairo_stroke(display)
i = i + 1
end
local angle = start_arc
-- hand
start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2)
stop_arc = (graph_unit_angle * val)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
cairo_stroke(display)
-- graduations marks
local graduation_radius = data['graduation_radius']
local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
local graduation_unit_angle = data['graduation_unit_angle']
local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
local nb_graduation = graph_end_angle / graduation_unit_angle
local i = 0
while i < nb_graduation do
cairo_set_line_width(display, graduation_thickness)
start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2)
stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2)
cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
cairo_stroke(display)
cairo_set_line_width(display, graph_thickness)
i = i + 1
end
end
-- text
local txt_radius = data['txt_radius']
local txt_weight, txt_size = data['txt_weight'], data['txt_size']
local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight)
cairo_set_font_size (display, txt_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
cairo_show_text (display, value)
cairo_stroke (display)
-- caption
local caption = data['caption']
local caption_weight, caption_size = data['caption_weight'], data['caption_size']
local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha']
local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight);
cairo_set_font_size (display, caption_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
cairo_move_to (display, x + tox + 5, y + toy + 1)
-- bad hack but not enough time !
if graph_start_angle < 105 then
cairo_move_to (display, x + tox - 30, y + toy + 1)
end
cairo_show_text (display, caption)
cairo_stroke (display)
end
-------------------------------------------------------------------------------
-- go_gauge_rings
-- loads data and displays gauges
--
function go_gauge_rings(display)
local function load_gauge_rings(display, data)
local str, value = '', 0
str = string.format('${%s %s}',data['name'], data['arg'])
str = conky_parse(str)
value = tonumber(str)
draw_gauge_ring(display, data, value)
end
for i in pairs(gauge) do
load_gauge_rings(display, gauge)
end
end
-------------------------------------------------------------------------------
-- MAIN
function conky_main()
if conky_window == nil then
return
end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local display = cairo_create(cs)
local updates = conky_parse('${updates}')
update_num = tonumber(updates)
if update_num > 5 then
go_gauge_rings(display)
end
cairo_surface_destroy(cs)
cairo_destroy(display)
end
${voffset 25}${offset 55}${diskiograph 20,115 999999 ffffff}
${voffset -20}${offset 45}${font Pragmata:size=9}${color}DISK
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}- ${fs_used /} - ${fs_size /}
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}~ ${fs_used /home} - ${fs_size /home}
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}@ ${fs_used /mnt/srv} - ${fs_size /mnt/srv}
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}¥ ${fs_used /mnt/backup} - ${fs_size /mnt/backup}
31 Mar 13 | 14:10:29 ~
$ conky -c /media/5/conky/dizzie.conky &
[1] 868
31 Mar 13 | 14:26:10 ~
$ Conky: forked to background, pid is 873
Conky: desktop window (264) is root window
Conky: window type - desktop
Conky: drawing to created window (0x1800001)
Conky: drawing to double buffer
Conky: Oops...looks like something overflowed in add_font().
${voffset 25}${offset 55}${diskiograph 20,115 999999 ffffff}
${voffset -20}${offset 45}${font Pragmata:size=9}${color}DISK
${offset 55}${font Pragmata:size=8}${alignr}${color}- ${fs_used /} - ${fs_size /}
${offset 55}${alignr}${color}~ ${fs_used /home} - ${fs_size /home}
${offset 55}${alignr}${color}@ ${fs_used /mnt/srv} - ${fs_size /mnt/srv}
${offset 55}${alignr}${color}¥ ${fs_used /mnt/backup} - ${fs_size /mnt/backup}
border_inner_margin 5
border_outer_margin 0
format_human_readable
QuoteIf enabled, values which are in bytes will be printed in human readable format (i.e., KiB, MiB, etc). If disabled, the number of bytes is printed instead.Mind you if you want bytes ... don't use that.
short_units
QuoteShortens units to a single character (kiB->k, GiB->G, etc.). Default is off.
${font}Temperatures ${color7}${hr}${color}
${alignc}CPU ${color5}${platform f71882fg.2560 temp 1}${color}°\
MB ${color5}${platform f71882fg.2560 temp 2}${color}°
${alignc}GPU ${color5}${nvidia temp}${color}°\
HD ${color5}${execi 5 hddtemp -n /dev/sda}${color}°
# killall conky && conky -c /media/5/Conky/S11_Conky_Desktop_top &
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
own_window_colour gray
own_window_class Conky
own_window_title Simple
# 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 1900 0 ## width, height
maximum_width 1900 ## width, usually a good idea to equal minimum width
gap_x 10 # left-right
gap_y 0 # up-down
alignment top_left #bottom_left
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont monofur:bold:size=16
#xftfont Anonymous Pro:bold:size=8
#xftfont CorporateMonoExtraBold:size=8
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# 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 1028
# 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 ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 0 0 0 0 0 0x000000 0.1
# lua_draw_hook_post draw-bg 125 0 0 0 0 0x000000 0.01
#
# TEXT
#
### mount.lua ##################################################################
#
##instructions
##load script
##lua_load ~/path_to/mounted.lua
lua_load /media/5/Conky/LUA/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type}, where partition number is a number
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
####################################################### End LUA Settings ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1
TEXT
| ${time %a %x | %T} | ${uptime_short}${goto 416}|\
CPU % Avg=${color5}${if_match ${cpu cpu0} < 10}${color1}00${color}${cpu cpu0}\
${else}${if_match ${cpu cpu0} < 100}${color1}0${color}${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}\
1=${color5}${if_match ${cpu cpu1} < 10}${color1}00${color}${cpu cpu1}\
${else}${if_match ${cpu cpu1} < 100}${color1}0${color}${cpu cpu1}\
${else}${cpu cpu1}${endif}${endif}\
2=${color5}${if_match ${cpu cpu2} < 10}${color1}00${color}${cpu cpu2}\
${else}${if_match ${cpu cpu2} < 100}${color1}0${color}${cpu cpu2}\
${else}${cpu cpu2}${endif}${endif}\
3=${color5}${if_match ${cpu cpu3} < 10}${color1}00${color}${cpu cpu3}\
${else}${if_match ${cpu cpu3} < 100}${color1}0${color}${cpu cpu3}\
${else}${cpu cpu3}${endif}${endif}${color} |\
RAM ${mem} / ${memmax} |\
SDA Read ${diskio_read sda}${goto 1107}| SDA Write ${diskio_write sda}${goto 1298}|\
eth0 Down ${downspeedf eth0}${goto 1510}| Up ${upspeedf eth0}${goto 1630}|\
${goto 1655}${nodename} desktop ${desktop} of ${desktop_number} |
${alignr 1}| ${kernel} | ${machine} | ${freq_g} GHz |
# To use #! in a conky use: ${exec echo '#!'}
# killall conky && conky -c /media/5/Conky/S11_Conky_Desktop_Email &
# WARNING: Change name and passwords on e-mail code if posting!!
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
#own_window_colour gray
own_window_class Conky
own_window_title Conky Desktop Email 1 Line
# 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 # Options: yes or no
### 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 35is 100% opacity.
# own_window_argb_value 255
minimum_size 400 0 ##420 420 ## width, height
maximum_width 400 ##420 ## width
gap_x 0 ### left &right
gap_y 70 ### up & down
alignment top_right
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Monofur:bold:size=16
#xftfont White Rabbit:size=9
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
draw_shades yes # amplifies text if yes
default_shade_color 000000
draw_outline no # amplifies text if yes
default_outline_color 000000
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 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 ##FF0000 #255 0 0 Red
##################################################### 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 yes #no
#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 256
# 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
# Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use
# $image lots. Set to 0 to disable the image cache.
imlib_cache_size 0
# 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 ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.2}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#--------------------------------
#lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.2
#lua_draw_hook_post draw_bg 20 0 0 0 0 0x000000 0.2
#
# TEXT
# ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.2}
##
#
####################################################### End LUA Settings ###
update_interval 1
TEXT
1 CAD = ${execi 1800 wget --timeout=1.0 --tries=1 -O - http://themoneyconverter.com/rss-feed/CAD/rss.xml | grep "Argentine Peso" | cut -c 40-47}\
| 1 ARS = ${execi 1800 wget --timeout=1.0 --tries=1 -O - http://themoneyconverter.com/rss-feed/ARS/rss.xml | grep "Canadian Dollar" | cut -c 39-45}
C ${if_match ${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --port=NUMBER --username=USER-NAME --password=PASSWORD} == 0}\
00${else}\
${if_match ${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --port=NUMBER --username=USER-NAME --password=PASSWORD} < 9}0\
${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --port=NUMBER --username=USER-NAME --password=PASSWORD}${else}\
${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --port=NUMBER --username=USER-NAME --password=PASSWORD}\
${endif}${endif}\
:\
${if_match ${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --ssl --port=NUMBER --username=USER-NAME --password=PASSWORD} == 0}\
00${else}\
${if_match ${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --ssl --port=NUMBER --username=USER-NAME --password=PASSWORD} < 10}0\
${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --ssl --port=NUMBER --username=USER-NAME --password=PASSWORD}${else}\
${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --ssl --port=NUMBER --username=USER-NAME --password=PASSWORD}\
${endif}${endif}\
| S ${if_match ${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --port=NUMBER --username=USER-NAME --password=PASSWORD} == 0}\
00${else}\
${if_match ${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --port=NUMBER --username=USER-NAME --password=PASSWORD} < 9}0\
${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --port=NUMBER --username=USER-NAME --password=PASSWORD}${else}\
${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --port=NUMBER --username=USER-NAME --password=PASSWORD}\
${endif}${endif}\
:\
${if_match ${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --ssl --port=NUMBER --username=USER-NAME --password=PASSWORD} == 0}\
00${else}\
${if_match ${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --ssl --port=NUMBER --username=USER-NAME --password=PASSWORD} < 10}0\
${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --ssl --port=NUMBER --username=USER-NAME --password=PASSWORD}${else}\
${execi 90 conkyEmail --servername=SERVERNAME --servertype=POP --ssl --port=NUMBER --username=USER-NAME --password=PASSWORD}\
${endif}${endif}\
| D ${desktop_name}
# killall conky && conky -c /media/5/Conky/S11_Conky_Desktop_mm &
# To use #! in a conky use: ${exec echo '#!'}
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
own_window_colour grayX
own_window_class Conky
own_window_title Simple
# 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 400 400 ## width, height
maximum_width 400 ## width, usually a good idea to equal minimum width
gap_x 0 # left-right
gap_y 0 # up-down
alignment mm
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont monofur:bold:size=11
#xftfont Anonymous Pro:bold:size=8
#xftfont CorporateMonoExtraBold:size=8
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# 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 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 1028
# 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
### /media/5/Conky/images/VSIDO_Planet_ORB.png
### /media/5/Conky/images/VSIDO_FireOrb.png
### /media/5/Conky/images/VSIDO_ORB_black.png
### /media/5/Conky/images/coffee.png
### /media/5/Conky/images/NASA_Blue_Marble_s.png
### /media/5/Conky/images/Over_the_Hill.png
### /media/5/Conky/images/Over_the_Hill_2.png
### /media/5/Conky/images/Over_the_Hill_3.png
### /media/5/Conky/images/RCAF-Roundel.png
### /media/5/Conky/images/CanAr_Roundel.png
### /media/5/Conky/images/CanAr_Roundel_2.png
TEXT
${image /media/5/Conky/images/Over_the_Hill_3.png -p 0,0 -s 400x400}
# killall conky && conky -c /media/5/Conky/S11_Conky_Desktop_bot &
# To use #! in a conky use: ${exec echo '#!'}
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
own_window_colour gray
own_window_class Conky
own_window_title Simple
# 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 660 0 ## width, height
maximum_width 660 ## width, usually a good idea to equal minimum width
gap_x 10 # left-right
gap_y 30 # up-down
alignment bottom_left #bottom_left
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont monofur:bold:size=11
#xftfont Anonymous Pro:bold:size=8
#xftfont CorporateMonoExtraBold:size=8
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# 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 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 1028
# 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 ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 0 0 0 0 0 0x000000 0.4
# lua_draw_hook_post draw-bg 125 0 0 0 0 0x000000 0.01
#
# TEXT
#
### mount.lua ##################################################################
#
##instructions
##load script
##lua_load ~/path_to/mounted.lua
lua_load /media/5/Conky/LUA/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type}, where partition number is a number
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
####################################################### End LUA Settings ###
# The all important - How often conky refreshes.
update_interval 1
TEXT
${lua get_mounted_data 3}\
${color6}fsys${color} = ${lua mount 1 total}${goto 85}${color8}Size${goto 130}${color7}Free${goto 180}${color1}Used${goto 220}${color}Mount
${color6}${lua mount 1 fsys 9}${goto 85}${color8}${lua mount 1 size}${goto 130}${color7}${lua mount 1 free}${goto 180}${color1}${lua mount 1 use%}${goto 220}${color}${lua mount 1 mount}
${color6}${lua mount 5 fsys 9}${goto 85}${color8}${lua mount 5 size}${goto 130}${color7}${lua mount 5 free}${goto 180}${color1}${lua mount 5 use%}${goto 220}${color}${lua mount 5 mount}\
${goto 290}| ${color6}fsys${goto 380}${color8}Size${goto 420}${color7}Free${goto 460}${color1}Used${goto 500}${color}Mount
${color6}${lua mount 2 fsys 9}${goto 85}${color8}${lua mount 2 size}${goto 130}${color7}${lua mount 2 free}${goto 180}${color1}${lua mount 2 use%}${goto 220}${color}${lua mount 2 mount}\
${goto 290}| ${color6}${lua mount 6 fsys 9}${goto 380}${color8}${lua mount 6 size}${goto 420}${color7}${lua mount 6 free}${goto 460}${color1}${lua mount 6 use%}${goto 500}${color}${lua mount 6 mount}
${color6}${lua mount 4 fsys 9}${goto 85}${color8}${lua mount 4 size}${goto 130}${color7}${lua mount 4 free}${goto 180}${color1}${lua mount 4 use%}${goto 220}${color}${lua mount 4 mount}\
${goto 290}| ${color6}${lua mount 7 fsys 9}${goto 380}${color8}${lua mount 7 size}${goto 420}${color7}${lua mount 7 free}${goto 460}${color1}${lua mount 7 use%}${goto 500}${color}${lua mount 7 mount}
${color6}${lua mount 3 fsys 9}${goto 85}${color8}${lua mount 3 size}${goto 130}${color7}${lua mount 3 free}${goto 180}${color1}${lua mount 3 use%}${goto 220}${color}${lua mount 3 mount}\
${goto 290}| ${color6}${lua mount 8 fsys 9}${goto 380}${color8}${lua mount 8 size}${goto 420}${color7}${lua mount 8 free}${goto 460}${color1}${lua mount 8 use%}${goto 500}${color}${lua mount 8 mount}
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
#own_window_colour gray
own_window_class Conky
own_window_title Top Left
# 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 # Options: yes or no
### 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 255
minimum_size 230 0 ## width, height
maximum_width 230 ## width
gap_x 10 ### left &right
gap_y 10 ### up & down
alignment tr
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Monofur:bold:size=12 ##14
#xftfont White Rabbit:size=9
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10conky -c /media/5/Conky/S11-Top_Left.conky &
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
draw_shades yes # amplifies text if yes
default_shade_color 000000
draw_outline no # amplifies text if yes
default_outline_color 000000
default_color DCDCDC #220 220 220 Gainsboro
color0 8FBC8F #143 188 143 DarkSeaGreen
color1 778899 #119 136 153 LightSlateGray
color2 FF8C00 #255 140 0 DarkOrange
color3 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 ##FF0000 #255 0 0 Red
##################################################### 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 yes #no
#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 256
# 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
# Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use
# $image lots. Set to 0 to disable the image cache.
imlib_cache_size 0
# 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 ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.2}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#--------------------------------
lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.2
#lua_draw_hook_post draw_bg 20 0 0 0 0 0x000000 0.2
#
# TEXT
# ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.2}
##
#
####################################################### End LUA Settings ###
## out({,a=1,x=6,y=50,txt="cpu:"..conky_parse("${cpu}")})
## Show an ICON
## /media/5/Conky/images/NASA_Blue_Marble_s.png
## /media/5/Conky/images/VSIDO_ORB_black.png
## /media/5/Conky/images/VSIDO_FireOrb.png
## /media/5/Conky/images/RCAF-Roundel.png
## /media/5/Conky/images/VSIDO_Planet_ORB.png
## /media/5/Conky/images/CanAr_Roundel_2.png
## /media/5/Conky/images/EVE.png
## /media/5/Conky/images/Wall.E.png
## /media/5/Conky/images/tux_graduate.png
## /media/5/Conky/images/s11.png
##
### mount.lua ##################################################################
#
##instructions
##load script
##lua_load ~/path_to/mounted.lua
lua_load /media/5/Conky/LUA/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type}, where partition number is a number
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
####################################################### End LUA Settings ###
update_interval 1
TEXT
${lua get_mounted_data 3}${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}\
${image /media/5/Conky/images/EVE.png -p 15,0 -s 60x60}\
${image /media/5/Conky/images/Wall.E.png -p 55,0 -s 60x60}\
${image /media/5/Conky/images/S11_128.png -p 0,100 -s 60x60}\
${color5}${alignr 5}${time %x}
${alignr 5}${time %T}
${alignr 5}${uptime_short}${color}
${alignc}${kernel}
${color7}${hr}${color}
${alignc}${font Dock 51:size=18}${color1}${nodename}${color}${font}
${goto 65}% Used${goto 170}${color} Total
Root ${color5}${fs_used_perc /}${goto 100}${fs_used /}${goto 170}${color7} ${alignr 5}${color5} ${fs_size /}${color}
Home ${color5}${fs_used_perc /home}${goto 100}${fs_used /home}${goto 170}${color7} ${alignr 5}${color5} ${fs_size /home}${color}
M|5 ${color5}${fs_used_perc /media/5}${goto 100}${fs_used /media/5}${goto 170}${color7} ${alignr 5}${color5} ${fs_size /media/5}${color}${font Monofur:size=6}
${font} RAM ${color5}${memperc}${goto 100}${mem}${goto 170}${color7} ${alignr 5}${color5} ${memmax}${color}${font Monofur:size=6}
${font}${alignc}Avg CPU % in use ${if_match ${cpu cpu0}<10}${color1}00${color5}${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100}${color1}0${color7}${cpu cpu0}\
${else}${color9}${cpu cpu0}${endif}${endif}${color}${font Monofur:size=6}
${font}${alignc}1 ${if_match ${cpu cpu1}<10}${color1}00${color5}${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100}${color1}0${color7}${cpu cpu1}\
${else}${color9}${cpu cpu1}${endif}${endif}${color}\
2 ${if_match ${cpu cpu2}<10}${color1}00${color5}${cpu cpu2}\
${else}${if_match ${cpu cpu2}<100}${color1}0${color7}${cpu cpu2}\
${else}${color9}${cpu cpu2}${endif}${endif}${color}\
3 ${if_match ${cpu cpu3}<10}${color1}00${color5}${cpu cpu3}\
${else}${if_match ${cpu cpu3}<100}${color1}0${color7}${cpu cpu3}\
${else}${color9}${cpu cpu3}${endif}${endif}${color}${font Monofur:size=6}
${font}CPU Fan${alignr 5}${color5}${platform f71882fg.2560 fan 1} ${color}rpm${font Monofur:size=6}
${font}Temperatures ${color7}${hr}${color}
${alignc}CPU ${color5}${platform f71882fg.2560 temp 1}${color}°\
MB ${color5}${platform f71882fg.2560 temp 2}${color}°
${alignc}GPU ${color5}${nvidia temp}${color}°\
HD ${color5}${execi 5 hddtemp -n /dev/sda}${color}°${font Monofur:size=6}
${font}Graphics GPU ${color5}${nvidia temp}${color}° ${color7}${hr}${color}
GPU ${color5}${nvidia gpufreq} ${color}MHz${alignr 5}MEM ${color5}${nvidia memfreq} ${color}MHz${font Monofur:size=6}
${font}Disk Activity ${color7}${hr}${color}
R${goto 40}${diskiograph_read /dev/sda 14,130 00ffff ff0000 5 -lt}${alignr 5}${color5}${diskio_read /dev/sda}${color}
W${goto 40}${diskiograph_write /dev/sda 14,130 ff0000 00ffff 5 -lt}${alignr 5}${color5}${diskio_write /dev/sda}${color}${font Monofur:size=6}
${font}Network ${color7}${hr}${color}
Dn${goto 40}${downspeedgraph eth0 14,130 00ffff ff0000 5 -lt}${alignr 5}${color5}${downspeedf eth0}${color}
Up${goto 40}${upspeedgraph eth0 14,130 ff0000 00ffff 5 -lt}${alignr 5}${color5}${upspeedf eth0}${color}${font Monofur:size=6}
${font}Transfer Totals ${color7}${hr}${color}
${color5}rx ↓${goto 85}${color0}tx ↑${goto 170}${color5}Total
${goto 5}${color}${execpi 3600 date --date="-1 day" | awk '{print $3" "$2" "$6}'}
${color5}${execpi 300 vnstat | grep "yesterday" | awk '{print $2" "$3"\
${color0}${goto 85}"$5" "$6 "\
${color5}${goto 170}" $8" "$9}'}
${goto 5}${color}${exec date --date="0 day" | awk '{print $3" "$2" "$6}'}
${color5}${execpi 300 vnstat | grep "today" | awk '{print $2" "$3"\
${color0}${goto 85}"$5" "$6"\
${color5}${goto 170}"$8" "$9}'}
${goto 5}${color}Current Week
${color5}${execpi 300 vnstat -w | grep "current week" | awk '{print $3" "$4 "\
${color0}${goto 85}" $6" "$7 "\
${color5}${goto 170}" $9" "$10}'}
${goto 5}${color}Last Week
${color5}${execpi 300 vnstat -w | grep "last week" | awk '{print $3" "$4"\
${color0}${goto 85}" $6" "$7 "\
${color5}${goto 170}" $9" "$10}'}
${goto 5}${color}Last 7 Days
${color5}${execpi 300 vnstat -w | grep "last 7 days" | awk '{print $4" "$5 "\
${color0}${goto 85}" $7" "$8 "\
${color5}${goto 170}" $10" "$11}'}
${goto 5}${color}${time %b %Y}
${color5}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $3" "$4}'}\
${color0}${goto 85}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $6" "$7}'}\
${color5}${goto 170}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $9" "$10}'}${font Monofur:size=6}
${font}${color}External Mounted fsys ${color7}${hr}${color}
${goto 5}${color}Size${goto 60}${color0}Free${goto 110}${color4}Used${goto 160}
${color5}${lua mount 6 mount}
${goto 5}${color}${lua mount 6 size}${goto 60}${color0}${lua mount 6 free}${goto 110}${color4}${lua mount 6 use%}${goto 160}${color5}${lua mount 6 fsys 9}
${color5}${lua mount 7 mount}
${goto 5}${color}${lua mount 7 size}${goto 60}${color0}${lua mount 7 free}${goto 110}${color4}${lua mount 7 use%}${goto 160}${color5}${lua mount 7 fsys 9}
${color5}${lua mount 8 mount}
${goto 5}${color}${lua mount 8 size}${goto 60}${color0}${lua mount 8 free}${goto 110}${color4}${lua mount 8 use%}${goto 160}${color5}${lua mount 8 fsys 9}
${color5}${lua mount 9 mount}
${goto 5}${color}${lua mount 9 size}${goto 60}${color0}${lua mount 9 free}${goto 110}${color4}${lua mount 9 use%}${goto 160}${color5}${lua mount 9 fsys 9}${font}
${color7}${hr 1}${color}
${color}Trash ${color9}${execi 15 du -sh ~/.local/share/Trash/files/ | awk '{print $1}' | sed '/^4.0K/ d' | sed 's/$/ of trash!/'}
--[[partitions for conky by mrpeachy
##instructions
##load script
lua_load ~/lua/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type text_length}, where partition number is a number
## text_length is optional, lets you specify the max number of characters the function returns. only affects fsys and mount data options
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
TEXT
CPU %: ${cpu cpu0} ${lua get_mounted_data 10}
TOTAL PARTITIONS MOUNTED: ${lua mount 1 total}
FSYS${goto 100}SIZE${goto 200}USED%${goto 300}MOUNT
${lua mount 1 fsys}${goto 100}${lua mount 1 size}${goto 200}${lua mount 1 use%}${goto 300}${lua mount 1 mount 10}
${lua mount 2 fsys}${goto 100}${lua mount 2 size}${goto 200}${lua mount 2 use%}${goto 300}${lua mount 2 mount 10}
${lua mount 3 fsys}${goto 100}${lua mount 3 size}${goto 200}${lua mount 3 use%}${goto 300}${lua mount 3 mount 10}
${lua mount 4 fsys}${goto 100}${lua mount 4 size}${goto 200}${lua mount 4 use%}${goto 300}${lua mount 4 mount 10}
]]
conky_start=1
function conky_get_mounted_data(interval)
local updates=tonumber(conky_parse("${updates}"))
timer=(updates % interval)
if timer==0 or conky_start==1 then
fsys={}
size={}
used={}
avail={}
uperc={}
mount={}
local file = io.popen("df -h")
for line in file:lines() do
if string.find(line,"/dev/")~=nil then
local s,f,fs=string.find(line,"^([%d%a%p]*)%s")
table.insert(fsys,fs)
local s,f,sz=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(size,sz)
local s,f,us=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(used,us)
local s,f,av=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(avail,av)
local s,f,up=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(uperc,up)
local s,f,mn=string.find(line,"%s*([%d%a%p]*)%s*$",f)
table.insert(mount,mn)
end
end
file:close()
conky_start=nil
end--timed section
return ""
end
function conky_mount(n,d,c)--n=partition_number,d=data_type,c=number of characters to return
d=tostring(d)
n=tonumber(n)
c=tonumber(c) or 0
if d=="total" then
data=#fsys or 1
elseif d=="fsys" then
data=fsys[n] or ""
if c~=0 then
data=string.sub(data,1,c) or ""
end
elseif d=="size" then
data=size[n] or ""
elseif d=="used" then
data=used[n] or ""
elseif d=="free" then
data=avail[n] or ""
elseif d=="use%" then
data=uperc[n] or ""
elseif d=="mount" then
data=mount[n] or ""
if c~=0 then
data=string.sub(data,1,c) or ""
end
else
data="check data type"
end
return data
end--end main function
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal #override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
own_window_colour gray
own_window_class Conky
own_window_title Vert_Right
# 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 50 760 ## width, height
maximum_width 50 ## width, usually a good idea to equal minimum width
gap_x 10 # left-right
gap_y 10 # up-down
alignment tl #top_right
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Anonymous Pro:bold:size=8
xftfont Monofur:bold:size=10
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# 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 DCDCDC #220 220 220 Gainsboro
color0 8FBC8F #143 188 143 DarkSeaGreen
color1 F0FFFF #240 255 255 Azure
color2 FF8C00 #255 140 0 DarkOrange
color3 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 FF0000 #255 0 0 Red
##################################################### 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 no
# 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 1028
# 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 ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.2
# lua_draw_hook_post draw-bg 125 0 0 0 0 0x000000 0.01
#
# TEXT
#
############### V9000 ########################################################
#starts the lua weather data gathering function, call once at top of conkyrc
lua_load ~/v9000/v9000.lua
lua_draw_hook_post weather
lua_load /media/5/Conky/templates/S11_V9_R-template.lua
####################################################### End LUA Settings ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.3}
--[[
The latest script is a lua only weather script. aka: v9000
http://crunchbanglinux.org/forums/topic/16100/weather-in-conky/
the file:
http://dl.dropbox.com/u/19008369/current%20v9000/v9000.tar.gz
mrppeachys LUA Tutorial
http://crunchbanglinux.org/forums/topic/17246/how-to-using-lua-scripts-in-conky/
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
-- default_font="CorporateMonoExtraBold"--font must be in quotes
-- default_font_size=10
default_font="monofur" --font must be in quotes
default_font_size=13
default_color=0xffffff --white
default_alpha=1 --fully opaque
default_image_width=20
default_image_height=20
-- ## New Options ###
-- ##################
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
datay=15 -- ↑↓
datayh=55
datayf=75
datayy=13 --datay+(datayy*1)
imgyh=165
imgyf=190
imgyy=39 -- imgy+(imgyy*1)
out({c=0x00FFFF,a=1,x=12,y=15,txt="BsAs"})
-- today is
out({c=0x00FFFF,a=1,x=5,y=28,txt=forecast_day_short[1]})
out({c=0x00FFFF,a=1,x=35,y=datay+datayy,txt=forecast_date[1]})
-- out({c=0x00FFFF,,a=1,x=6,y=50,txt="cpu:"..conky_parse("${cpu}")})
out({c=0xF0FFFF,a=1,x=5,y=datay+(datayy*2),txt=low_temp[1]})
out({c=0xFF8C00,a=1,x=30,y=datay+(datayy*2),txt=high_temp[1]})
image({x=5,y=45,h=45,w=45,file=weather_icon[1]})
--image({x=5,y=45,h=45,w=45,file="/media/5/Conky/images/red+x.png"})
out({c=0xFFDEAD,a=1,x=15,y=datay+(datayy*7),txt="NOW"})
out({c=0xF0FFFF,a=1,x=7,y=datay+(datayy*8),txt=now["temp"]})
out({c=0xFFDEAD,a=1,x=30,y=datay+(datayy*8),txt=now["feels_like"]})
image({x=5,y=120,h=45,w=45,file=now["weather_icon"]})
--image({x=5,y=120,h=45,w=45,file="/media/5/Conky/images/red+x.png"})
out({c=0x00FFFF,a=1,x=5,y=datay+(datayy*12.5),txt="B.P."})
out({c=0xF0FFFF,a=1,x=5,y=datay+(datayy*13.4),txt=now["pressure_mb"]})
out({c=0x00FFFF,a=1,x=5,y=datay+(datayy*14.5),txt="Hum"})
out({c=0xF0FFFF,a=1,x=30,y=datay+(datayy*14.5),txt=now["humidity"].."%"})
out({c=0x00FFFF,a=1,x=5,y=datay+(datayy*15.5),txt="DP"})
out({c=0xF0FFFF,a=1,x=30,y=datay+(datayy*15.5),txt=now["dew_point"].."°"})
out({c=0x00FFFF,a=1,x=5,y=datay+(datayy*16.5),txt="UV"})
out({c=0xF0FFFF,a=1,x=30,y=datay+(datayy*16.5),txt=uv_index_num[1]})
out({c=0xF0FFFF,a=1,x=5,y=datay+(datayy*17.5),txt=uv_index_txt[1]})
-- yellow line
image({w=45,h=1,x=5,y=datayh+(datayy*15),file="/media/5/Conky/images/yellow_1.png"})
out({c=0xFFDEAD,a=1,x=10,y=datayh+(datayy*16),txt="3 HRS"})
-- 3 hour output
-- 1st hour
out({c=0x00FFFF,a=1,x=11,y=datayh+(datayy*17),txt=now["fc_hour1_time_24"]..":00"})
image({x=25,y=imgyh+(imgyy*3),file=now["fc_hour1_wicon"]})
--image({x=25,y=imgyh+(imgyy*3),file="/media/5/Conky/images/red+x.png"})
out({c=0xF0FFFF,a=1,x=5,y=datayh+(datayy*18.5),txt=now["fc_hour1_temp"]})
-- 2nd hour
out({c=0x00FFFF,a=1,x=11,y=datayh+(datayy*20),txt=now["fc_hour2_time_24"]..":00"})
image({x=25,y=imgyh+(imgyy*4),file=now["fc_hour2_wicon"]})
--image({x=25,y=imgyh+(imgyy*4),file="/media/5/Conky/images/red+x.png"})
out({c=0xF0FFFF,a=1,x=5,y=datayh+(datayy*21.5),txt=now["fc_hour2_temp"]})
-- 3rd hour
out({c=0x00FFFF,a=1,x=11,y=datayh+(datayy*23),txt=now["fc_hour3_time_24"]..":00"})
image({x=25,y=imgyh+(imgyy*5),file=now["fc_hour3_wicon"]})
--image({x=25,y=imgyh+(imgyy*5),file="/media/5/Conky/images/red+x.png"})
out({c=0xF0FFFF,a=1,x=5,y=datayh+(datayy*24.5),txt=now["fc_hour3_temp"]})
-- start of forcast days
-- yellow line
image({w=45,h=1,x=5,y=datayf+(datayy*24.5),file="/media/5/Conky/images/yellow_1.png"})
out({c=0xFFDEAD,a=1,x=10,y=datayf+(datayy*25.5),txt="9 DAY"})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*26.5),txt=forecast_day_short[2]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*26.5),txt=forecast_date[2]})
image({x=25,y=imgyf+(imgyy*6),file=weather_icon[2]})
--image({x=25,y=imgyf+(imgyy*6),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*27.5),txt=high_temp[2]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*28.5),txt=low_temp[2]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*29.5),txt=forecast_day_short[3]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*29.5),txt=forecast_date[3]})
image({x=25,y=imgyf+(imgyy*7),file=weather_icon[3]})
--image({x=25,y=imgyf+(imgyy*7),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*30.5),txt=high_temp[3]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*31.5),txt=low_temp[3]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*32.5),txt=forecast_day_short[4]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*32.5),txt=forecast_date[4]})
image({x=25,y=imgyf+(imgyy*8),file=weather_icon[4]})
--image({x=25,y=imgyf+(imgyy*8),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*33.5),txt=high_temp[4]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*34.5),txt=low_temp[4]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*35.5),txt=forecast_day_short[5]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*35.5),txt=forecast_date[5]})
image({x=25,y=imgyf+(imgyy*9),file=weather_icon[5]})
--image({x=25,y=imgyf+(imgyy*9),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*36.5),txt=high_temp[5]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*37.5),txt=low_temp[5]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*38.5),txt=forecast_day_short[6]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*38.5),txt=forecast_date[6]})
image({x=25,y=imgyf+(imgyy*10),file=weather_icon[6]})
--image({x=25,y=imgyf+(imgyy*10),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*39.5),txt=high_temp[6]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*40.5),txt=low_temp[6]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*41.5),txt=forecast_day_short[7]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*41.5),txt=forecast_date[7]})
image({x=25,y=imgyf+(imgyy*11),file=weather_icon[7]})
--image({x=25,y=imgyf+(imgyy*11),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*42.5),txt=high_temp[7]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*43.5),txt=low_temp[7]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*44.5),txt=forecast_day_short[8]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*44.5),txt=forecast_date[8]})
image({x=25,y=imgyf+(imgyy*12),file=weather_icon[8]})
--image({x=25,y=imgyf+(imgyy*12),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*45.5),txt=high_temp[8]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*46.5),txt=low_temp[8]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*47.5),txt=forecast_day_short[9]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*47.5),txt=forecast_date[9]})
image({x=25,y=imgyf+(imgyy*13),file=weather_icon[9]})
--image({x=25,y=imgyf+(imgyy*13),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*48.5),txt=high_temp[9]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*49.5),txt=low_temp[9]})
out({c=0x00FFFF,a=1,x=5,y=datayf+(datayy*50.5),txt=forecast_day_short[10]})
out({c=0x00FFFF,a=1,x=35,y=datayf+(datayy*50.5),txt=forecast_date[10]})
image({x=25,y=imgyf+(imgyy*14),file=weather_icon[10]})
--image({x=25,y=imgyf+(imgyy*14),file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=5,y=datayf+(datayy*51.5),txt=high_temp[10]})
out({c=0xF0FFFF,a=1,x=5,y=datayf+(datayy*52.5),txt=low_temp[10]})
-- yellow line
--image({w=45,h=1,x=5,y=550,file="/media/5/Conky/images/yellow_1.png"})
--#######################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
# killall conky && conky -c /media/5/Conky/S11_Conky_Desktop_dizzie &
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
own_window_colour gray
own_window_class Conky
own_window_title Simple
# 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 1900 0 ## width, height
maximum_width 1900 ## width, usually a good idea to equal minimum width
##minimum_size 1346 0 ## width, height
##maximum_width 1346 ## width, usually a good idea to equal minimum width
gap_x 10 # left-right
gap_y 10 # up-down
alignment top_left #bottom_left
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
##xftfont monofur:bold:size=16
xftfont monofur:bold:size=12
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# 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 1028
# 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 ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 0 0 0 0 0 0x000000 0.1
# lua_draw_hook_post draw-bg 125 0 0 0 0 0x000000 0.01
#
# TEXT
#
### mount.lua ##################################################################
#
##instructions
##load script
##lua_load ~/path_to/mounted.lua
lua_load /media/5/Conky/LUA/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type}, where partition number is a number
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
####################################################### End LUA Settings ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1
TEXT
| ${time %a %x | %T} | ${uptime_short}${goto 334}|\
CPU % Avg=${color5}${if_match ${cpu cpu0} < 10}${color1}00${color}${cpu cpu0}\
${else}${if_match ${cpu cpu0} < 100}${color1}0${color}${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}\
1=${color5}${if_match ${cpu cpu1} < 10}${color1}00${color}${cpu cpu1}\
${else}${if_match ${cpu cpu1} < 100}${color1}0${color}${cpu cpu1}\
${else}${cpu cpu1}${endif}${endif}\
2=${color5}${if_match ${cpu cpu2} < 10}${color1}00${color}${cpu cpu2}\
${else}${if_match ${cpu cpu2} < 100}${color1}0${color}${cpu cpu2}\
${else}${cpu cpu2}${endif}${endif}\
3=${color5}${if_match ${cpu cpu3} < 10}${color1}00${color}${cpu cpu3}\
${else}${if_match ${cpu cpu3} < 100}${color1}0${color}${cpu cpu3}\
${else}${cpu cpu3}${endif}${endif}${color} |\
RAM ${mem} / ${memmax} |\
SDA Read ${diskio_read sda}${goto 902}| SDA Write ${diskio_write sda}${goto 1054}|\
eth0 Down ${downspeedf eth0}${goto 1214}| Up ${upspeedf eth0}${goto 1318}|
| ${nodename} on desktop ${desktop} of ${desktop_number} |\
Temperatures: CPU ${color5}${platform f71882fg.2560 temp 1}${color}° |\
MB ${color5}${platform f71882fg.2560 temp 2}${color}° |\
GPU ${color5}${nvidia temp}${color}° |\
HD ${color5}${execi 5 hddtemp -n /dev/sda}${color}° |\
${alignr 580}| ${kernel} | ${machine} | ${freq_g} GHz |
${color FFFFFF}Mostly text output for spacing purposes
| Fri 05/04/13 | 16:34:54 | 98d 22h 56m |\
CPU % Avg=${if_match ${cpu cpu0} < 10}00${cpu cpu0}\
${else}${if_match ${cpu cpu0} < 100}0${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}\
1=${if_match ${cpu cpu1} < 10}00${cpu cpu1}\
${else}${if_match ${cpu cpu1} < 100}0${cpu cpu1}\
${else}${cpu cpu1}${endif}${endif}\
2=${if_match ${cpu cpu2} < 10}00${cpu cpu2}\
${else}${if_match ${cpu cpu2} < 100}0${cpu cpu2}\
${else}${cpu cpu2}${endif}${endif}\
3=${if_match ${cpu cpu3} < 10}00${cpu cpu3}\
${else}${if_match ${cpu cpu3} < 100}0${cpu cpu3}\
${else}${cpu cpu3}${endif}${endif} |\
RAM ${mem} / ${memmax} |\
SDA Read 999.9G | SDA Write 999.9G |\
eth0 Down 9999.99 | Up 9999.99 |${color}
${alignr 580}| ${kernel} | ${machine} | ${freq_g} GHz |
draw_shades yes
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
# killall conky && conky -c /media/5/Conky/S11_VSIDO_Banner.conky &
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
own_window_colour gray
own_window_class Conky
own_window_title Falldown VSIDO Banner
# 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 1552 160 ## width, height
maximum_width 1552 ## width, usually a good idea to equal minimum width
gap_x 0 # left-right
gap_y 5 # up-down
alignment top_middle #bottom_left
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont monofur:bold:size=12
#xftfont Anonymous Pro:bold:size=8
#xftfont CorporateMonoExtraBold:size=8
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# 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
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 DCDCDC #220 220 220 Gainsboro
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 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 1028
# 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 ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.2
# lua_draw_hook_post draw-bg 125 0 0 0 0 0x000000 0.01
#
# TEXT
#
### mount.lua ##################################################################
#
##instructions
##load script
##lua_load ~/path_to/mounted.lua
# lua_load /media/5/Conky/LUA/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type}, where partition number is a number
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpointconky -c /media/5/Conky/S11_Conky_Desktop_top_12 &
####################################################### End LUA Settings ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}${image /media/5/Conky/images/vsido_logo_conky.png -p 0,0 -s 1552x160}\
| ${nodename} | desktop ${desktop} of ${desktop_number} | ${time %a %x | %T} | 2${uptime_short}${goto 526}|\
CPU % Avg=${if_match ${cpu cpu0} < 10}${color1}00${color}${cpu cpu0}\
${else}${if_match ${cpu cpu0} < 100}${color1}0${color}${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}\
1=${if_match ${cpu cpu1} < 10}${color1}00${color}${cpu cpu1}\
${else}${if_match ${cpu cpu1} < 100}${color1}0${color}${cpu cpu1}\
${else}${cpu cpu1}${endif}${endif}\
2=${if_match ${cpu cpu2} < 10}${color1}00${color}${cpu cpu2}\
${else}${if_match ${cpu cpu2} < 100}${color1}0${color}${cpu cpu2}\
${else}${cpu cpu2}${endif}${endif}\
3=${if_match ${cpu cpu3} < 10}${color1}00${color}${cpu cpu3}\
${else}${if_match ${cpu cpu3} < 100}${color1}0${color}${cpu cpu3}\
${else}${cpu cpu3}${endif}${endif}${color} |\
${goto 915}| Net Traffic${goto 1075}${color1}rx ↓${goto 1195}${color0}tx ↑${goto 1315}${color}Total${goto 1435}${color5}Avg. Rate
| CPU Fan ${color5}${platform f71882fg.2560 fan 1} ${color}rpm |\
Temps CPU ${color5}${platform f71882fg.2560 temp 1}${color}° |\
Mobo ${color5}${platform f71882fg.2560 temp 2}${color}° |\
GPU ${color5}${nvidia temp}${color}° |\
HDD ${color5}${execi 5 hddtemp -n /dev/sda}${color}° |\
RAM ${mem} / ${memmax} |\
${goto 915}${color}| ${execpi 86422 date --date="-1 day" | awk '{print $3" "$2" "$6}'}${goto 1075}${execpi 300 vnstat | grep "yesterday" | awk '{print "${color1}"$2" "$3"${goto 1195}${color0}"$5" "$6"${goto 1315}${color}"$8" "$9"${goto 1435}${color5}"$11" "$12}'}
${goto 915}${color}| ${execpi 86422 date --date="0 day" | awk '{print $3" "$2" "$6}'}${goto 1075}${execpi 86422 vnstat | grep "today" | awk '{print "${color1}"$2" "$3"${goto 1195}${color0}"$5" "$6"${goto 1315}${color}"$8" "$9"${goto 1435}${color5}"$11" "$12}'}
${goto 915}${color}| Current Week${execpi 86422 vnstat -w | grep "current week" | awk '{print "${goto 1075}${color1}"$3" "$4"${goto 1195}${color0}"$6" "$7"${goto 1315}${color}"$9" "$10"${goto 1435}${color5}"$12" "$13}'}${color}
| Disk Read ${color5}${diskio_read /dev/sda}${goto 327}${color}| Disk Write ${color5}${diskio_write /dev/sda}${color}\
${goto 915}${color}| Last Week${execpi 86422 vnstat -w | grep "last week" | awk '{print "${goto 1075}${color1}"$3" "$4"${goto 1195}${color0}"$6" "$7"${goto 1315}${color}"$9" "$10"${goto 1435}${color5}"$12" "$13}'}${color}
| ${diskiograph_read /dev/sda 14,300 00ffff ff0000 5 -lt}${diskiograph_write /dev/sda 14,300 ff0000 00ffff 5 -lt}${color}
| eth0 Down ${color5}${downspeedf eth0}${goto 327}${color}| Up ${color5}${upspeedf eth0}${color}
| ${color}${downspeedgraph eth0 14,300 00ffff ff0000 5 -lt}${upspeedgraph eth0 14,300 ff0000 00ffff 5 -lt} ${color9}${execi 15 du -sh ~/.local/share/Trash/files/ | awk '{print $1}' | sed '/^4.0K/ d' | sed 's/$/ of trash!/'}${color}\
${goto 915}${color}| Last 7 Days${execpi 86422 vnstat -w | grep "last 7 days" | awk '{print "${goto 1075}${color1}"$4" "$5"${goto 1195}${color0}"$7" "$8"${goto 1315}${color}"$10" "$11"${goto 1435}${color5}"$13" "$14}'}${color}
| Root Used ${color5}${fs_used /} (${fs_used_perc /}%) ${color}Total ${color5}${fs_size /}${color}${goto 335}Home ${color5}${fs_used_perc /home} ${fs_used /home} ${fs_size /home}${color} \
${goto 915}${color}| ${time %b %Y}${execpi 86422 vnstat -m | grep "`date +"%b %y"`" | awk '{print "${goto 1075}${color1}"$3" "$4"${goto 1195}${color0}"$6" "$7"${goto 1315}${color}"$9" "$10"${goto 1435}${color5}"$12" "$13}'}${color}
Quoteconnecting to img851.imageshack.us...
11 Apr 13 | 11:24:58 ~
$ vuze send cake dizzie
11 Apr 13 | 11:25:58 ~
$ ...done
11 Apr 13 | 11:25:58 ~
$
${downspeedgraph eth0 20,75 0066CC CC0000 }
Quote from: Sector11 on April 15, 2013, 06:17:01 PM
No I don't have the answer ... I "think" this might do the trick though woulf did a script: Bargraph widget (http://u-scripts.blogspot.com.ar/2010/07/bargraph-widget.html). He did that long before I even understood how to use a LUA script. :D
Near the bottom 3/4 of the way down I see a multi-colour graph: green yellow white red blue
Not sure is mrpeachy did one as well or not.
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 285 1000
maximum_width 285
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment middle_left
gap_x 10
gap_y -10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
short_units yes
## Set the path to your script here.
lua_load /home/luke/Conky/allcombined_2.lua
#lua_load ~/Conky/bargraph.lua
#lua_draw_hook_pre main_bars
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
# not for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.5}}
TEXT
${lua draw_bg {20,12,2,268,140,0xFFFFFF,.1,2,1}}${image /home/luke/Conky/red_2.png -p 0,-7}
${goto 25}${voffset 4}${font Pseudo APL:bold:size=10}CPU Average ${lua gradbar {125,27,"${cpu cpu0}",100,48,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -12}${cpu cpu0}${font Sans:bold:size=10}%
#${font saxmono:bold:normal:size=10}${color1}k${voffset -1}${font}${color2} TEMP ${hwmon 1 temp 1}°C${lua gradbar {90,127,"${hwmon 1 temp 1}",100,50,2,10,1,0xFFFFFF,0.25,0xFFFFFF,.5,0xFFFF33,.65,0xCC0000,1}}
${goto 25}${font Pseudo APL:bold:size=10}${voffset 1}CPU1 ${lua gradbar {72,42,"${cpu cpu1}",100,75,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -8}${cpu cpu1}${font Sans:bold:size=10}%
${goto 25}${font Pseudo APL:bold:size=10}CPU2 ${lua gradbar {72,57,"${cpu cpu2}",100,75,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -8}${cpu cpu2}${font Sans:bold:size=10}%
${goto 25}${font Pseudo APL:bold:size=10}CPU3 ${lua gradbar {72,72,"${cpu cpu3}",100,75,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -8}${cpu cpu3}${font Sans:bold:size=10}%
${goto 25}${font Pseudo APL:bold:size=10}CPU4 ${lua gradbar {72,87,"${cpu cpu4}",100,75,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -8}${cpu cpu4}${font Sans:bold:size=10}%
${goto 25}${font Pseudo APL:bold:size=10}CPU5 ${lua gradbar {72,102,"${cpu cpu5}",100,75,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -8}${cpu cpu5}${font Sans:bold:size=10}%
${goto 25}${font Pseudo APL:bold:size=10}CPU6 ${lua gradbar {72,117,"${cpu cpu6}",100,75,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr -8}${cpu cpu6}${font Sans:bold:size=10}%
#${hr 2}
${lua draw_bg {20,12,165,268,75,0xFFFFFF,.1,2,1}}${goto 25}${font Pseudo APL:bold:size=10}RAM${goto 115}${mem}${goto 155} / ${memmax}
${lua gradbar {27,191,"${memperc}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${memperc}${font Sans:bold:size=10}%
${goto 25}${font Pseudo APL:bold:size=10}SWAP${goto 115}${swap}${goto 155} / ${swapmax}
${lua gradbar {27,220,"${swapperc}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${swapperc}${font Sans:bold:size=10}%
#${hr 2}
#${image /home/luke/Conky/red_bar.png -s 250x4 -p 0,235}
${lua draw_bg {20,12,275,268,200,0xFFFFFF,.1,2,1}}
${voffset -8}${goto 25}${font Pseudo APL:bold:size=10}${voffset 10}/${goto 105}${fs_used /}${goto 155} / ${fs_size /}
${lua gradbar {27,298,"${fs_used_perc /}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /}${font Sans:bold:size=10}%
${goto 25}${font Pseudo APL:bold:size=10}/Home${goto 105}${fs_used /home}${goto 155} / ${fs_size /home}
${lua gradbar {27,328,"${fs_used_perc /home}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /home}${font Sans:bold:size=10}%
${goto 25}${font Pseudo APL:bold:size=10}External${goto 105}${fs_used /media/sdf5}${goto 155} / ${fs_size /media/sdf5}
${lua gradbar {27,358,"${fs_used_perc /media/sdf5}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /media/sdf5}${font Sans:bold:size=10}%
${goto 25}${font Pseudo APL:bold:size=10}Software${goto 105}${fs_used /media/sdc1}${goto 155} / ${fs_size /media/sdc1}
${lua gradbar {27,388,"${fs_used_perc /media/sdc1}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /media/sdc1}${font Sans:bold:size=10}%
${goto 25}${font Pseudo APL:bold:size=10}Storage${goto 105}${fs_used /media/storage}${goto 155} / ${fs_size /media/storage}
${lua gradbar {27,418,"${fs_used_perc /media/storage}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /media/storage}${font Sans:bold:size=10}%
${goto 25}${font Pseudo APL:bold:size=10}Media${goto 105}${fs_used /media/sdd1}${goto 155} / ${fs_size /media/sdd1}
${lua gradbar {27,448,"${fs_used_perc /media/sdd1}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /media/sdd1}${font Sans:bold:size=10}%
#${font Pseudo APL:bold:size=10}Storage${goto 105}${fs_used /media/storage}${goto 155} / ${fs_size /media/storage}
#${lua gradbar {5,457,"${fs_used_perc /media/storage}",100,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 15}${fs_used_perc /media/storage}${font Sans:bold:size=10}%${voffset 8}
#${hr 2}
#${image /home/luke/Conky/red_bar.png -s 250x4 -p 0,450}
${lua draw_bg {20,12,500,268,100,0xFFFFFF,.1,2,1}}
${voffset -4}${goto 25}${font Pseudo APL:bold:size=10}CPU Temp
${lua gradbar {27,520,"${platform it87.656 temp 1}",200,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 20}${platform it87.656 temp 1}°
${goto 25}${font Pseudo APL:bold:size=10}System Temp
${lua gradbar {27,550,"${platform it87.656 temp 2}",200,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 20}${platform it87.656 temp 2}°
${goto 25}${font Pseudo APL:bold:size=10}GPU Temp
${lua gradbar {27,580,"${nvidia temp}",220,97,1,10,1,0x000000,.75,0xFFFF00,1,0xCC6633,1,0xCC0000,1}}${alignr 20}${nvidia temp}°${voffset 4}
#${hr 2}
#${image /home/luke/Conky/red_bar.png -s 250x4 -p 0,570}
${lua draw_bg {20,12,629,268,103,0xFFFFFF,.1,2,1}}
${voffset 8}${goto 25}${font Pseudo APL:bold:size=10}NAME ${goto 120} PID CPU MEM
${goto 25}${top name 1} ${alignr 25} ${top pid 1} ${top cpu 1} ${top mem 1}
${goto 25}${top name 2} ${alignr 25} ${top pid 2} ${top cpu 2} ${top mem 2}
${goto 25}${top name 3} ${alignr 25} ${top pid 3} ${top cpu 3} ${top mem 3}
${goto 25}${top name 4} ${alignr 25} ${top pid 4} ${top cpu 4} ${top mem 4}
${goto 25}${top name 5} ${alignr 25} ${top pid 5} ${top cpu 5} ${top mem 5}
#${top name 6} ${alignr 5} ${top pid 6} ${top cpu 6} ${top mem 6}
#${top name 7} ${alignr 5} ${top pid 7} ${top cpu 7} ${top mem 7}
#${top name 8} ${alignr 5} ${top pid 8} ${top cpu 8} ${top mem 8}%{voffset -8}
#${hr 2}
#${voffset 10}${goto 50}${font Sans:size=22}${time %I:%M %p}
#${lua luacal {100,425,"Sans",10,0x00FF00,1,"Sans",10,0xFFFFF0,1,"Mono",14,0x00FF00,1," ",20,18,16,0}}
#${goto 15}${font Sans:bold:size=12}${time %d}${font}
#${goto 15}${time %B}
#${goto 15}${time %Y}
#${voffset 40}${hr 2}
#${voffset 10}${font Sans:size=10}Connection Type ${goto 220}${gw_iface}
#I.P${goto 173}${addr eth0}
#${image /home/luke/Conky/red_bar.png -s 250x4 -p 0,700}
${lua draw_bg {20,12,760,268,223,0xFFFFFF,.1,2,1}}
#${goto 25}Downloads
${goto 25}Down Speed${goto 125}${downspeed eth0}
${goto 25}Today:${alignr 25}${execi 1 vnstat -i eth0 | grep "today" | awk '{print $2 $3}'}
${goto 25}Week:${alignr 20}${execi 1 vnstat -i eth0 -w | grep "current week" | awk '{print $3 $4}'}
${goto 25}Month:${alignr 25}${execi 1 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $3 $4}'}
${goto 20}${downspeedgraph eth0 30,250 FFFF00 CC0000 -t}
${goto 25}Up Speed${goto 125}${upspeed eth0}
${goto 25}Today: ${alignr 25}${execi 1 vnstat -i eth0 | grep "today" | awk '{print $5 $6}'}
${goto 25}Week: ${alignr 20}${execi 1 vnstat -i eth0 -w | grep "current week" | awk '{print $6 $7}'}
${goto 25}Month: ${alignr 25}${execi 1 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $6 $7}'}
#${goto 25}Uploads
${goto 20}${upspeedgraph eth0 30,250 FFFF00 CC0000 000000 -t}
--[[ by mrpeachy -
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'
function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
function conky_gradbar(bartab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_draw_bg(bgtab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
if w==0 then
w=tonumber(conky_window.width)
end
if h==0 then
h=tonumber(conky_window.height)
end
cairo_set_source_rgba (cr,rgb_to_r_g_b({color,alpha}))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luacal(caltab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--####################################################################################################
local caltab=loadstring("return" .. caltab)()
local cal_x=caltab[1]
local cal_y=caltab[2]
local tfont=caltab[3]
local tfontsize=caltab[4]
local tc=caltab[5]
local ta=caltab[6]
local bfont=caltab[7]
local bfontsize=caltab[8]
local bc=caltab[9]
local ba=caltab[10]
local hfont=caltab[11]
local hfontsize=caltab[12]
local hc=caltab[13]
local ha=caltab[14]
local spacer=caltab[15]
local gaph=caltab[16]
local gapt=caltab[17]
local gapl=caltab[18]
local sday=caltab[19]
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b({tc,ta})
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b({bc,ba})
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b({hc,ha})
--###################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]=" "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
for i=1,7 do
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--#########################################################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luaimage(imtab)
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
local imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function
function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type desktop
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 370 420
maximum_width 370
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment top_middle
gap_x 200
gap_y 20
no_buffers yes
uppercase no
cpu_avg_samples 6
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0
# 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
### LUA Load ###
lua_load /home/luke/Conky/allcombined_2.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
${lua draw_bg {25,0,0,0,0,0x000000,0.3}}
TEXT
#${image /home/luke/Conky/weather.png -s 225x90 -p 75,5}${lua draw_bg {25,0,0,0,0,0xFFFFFF,0.05}}${image /home/luke/Conky/red_2.png -p 25,-7}
${lua draw_bg {20,0,18,370,405,0xFFFFFF,.1,2,1}}${image /home/luke/Conky/thermometer.png -s 50x50 -p 20,18}${image /home/luke/Conky/red_3.png -p -7,0}
${goto 70}${font Pseudo APL:Bold:size=20}${texeci 500 bash $HOME/1b1_accuweather_images/1b1}${execpi 600 sed -n '29p' $HOME/1b1_accuweather_images/curr_cond}°F
${font Pseudo APL:bold:size=15}${goto 10}Dawn${font Pseudo APL:bold:size=14} ${execpi 600 sed -n '39p' $HOME/1b1_accuweather_images/curr_cond}${image /home/luke/1b1_accuweather_images/cc.png -p 130,15 -s 260x180}
${font Pseudo APL:bold:size=15}${goto 10}Dusk${font Pseudo APL:bold:size=14} ${execpi 600 sed -n '40p' $HOME/1b1_accuweather_images/curr_cond}
${font Pseudo APL:bold:size=15}${goto 10}Rain${font Pseudo APL:bold:size=14} ${alignc 37}${font Sans:size=11}${execpi 600 sed -n '28p' $HOME/1b1_accuweather_images/first_days}
${font Pseudo APL:bold:size=15}${goto 10}Clouds${font Pseudo APL:bold:size=14} ${alignc 37}${font Sans:size=11}${execpi 600 sed -n '35p' $HOME/1b1_accuweather_images/curr_cond}
#${font Pseudo APL:Bold:size=14}${goto 10}Wind ${alignc 37}${font Sans:size=11}${execpi 600 sed -n '31p' $HOME/1b1_accuweather_images/curr_cond} ${execpi 600 sed -n '32p' $HOME/1b1_accuweather_images/curr_cond}
${font Pseudo APL:Bold:size=12}${goto 25}${execpi 600 sed -n '5p' $HOME/1b1_accuweather_images/first_days}${goto 140}${execpi 600 sed -n '10p' $HOME/1b1_accuweather_images/first_days}${goto 260}${execpi 600 sed -n '15p' $HOME/1b1_accuweather_images/first_days}
${image $HOME/1b1_accuweather_images/6.png -p 0,190 -s 115x79}${image $HOME/1b1_accuweather_images/11.png -p 122,190 -s 115x79}${image $HOME/1b1_accuweather_images/16.png -p 242,190 -s 115x79}
${voffset 9}${font Pseudo APL:Bold:size=13}${goto 40}${execpi 600 sed -n '8p' $HOME/1b1_accuweather_images/first_days}°F${goto 160}${execpi 600 sed -n '13p' $HOME/1b1_accuweather_images/first_days}°F${goto 280}${execpi 600 sed -n '18p' $HOME/1b1_accuweather_images/first_days}°F${voffset -9}
${font Pseudo APL:Bold:size=12}${goto 25}${execpi 600 sed -n '20p' $HOME/1b1_accuweather_images/first_days}${goto 140}${execpi 600 sed -n '1p' $HOME/1b1_accuweather_images/last_days}${goto 260}${execpi 600 sed -n '6p' $HOME/1b1_accuweather_images/last_days}
${image $HOME/1b1_accuweather_images/21.png -p 0,310 -s 115x79}${image $HOME/1b1_accuweather_images/last_2.png -p 122,310 -s 115x79}${image $HOME/1b1_accuweather_images/last_7.png -p 242,310 -s 115x79}
${voffset 9}${font Pseudo APL:Bold:size=13}${goto 40}${execpi 600 sed -n '23p' $HOME/1b1_accuweather_images/first_days}°F${goto 160}${execpi 600 sed -n '4p' $HOME/1b1_accuweather_images/last_days}°F${goto 280}${execpi 600 sed -n '9p' $HOME/1b1_accuweather_images/last_days}°F${voffset -9}
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type desktop
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 450 200
maximum_width 450
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment bottom_middle
gap_x 975
gap_y 50
no_buffers yes
uppercase no
cpu_avg_samples 6
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0
# 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
### LUA Load ###
lua_load /home/luke/Conky/text_clock.lua
lua_draw_hook_post draw_text
TEXT
#${lua draw_bg {25,0,0,0,0,0x000000,0.3}}
--[[
text - text to display, default = "Conky is good for you"
use conky_parse to display conky value ie text=conly_parse("${cpu cpu1}")
- coordinates below are relative to top left corner of the conky window
x - x coordinate of first letter (bottom-left), default = center of conky window
y - y coordinate of first letter (bottom-left), default = center of conky window
h_align - horizontal alignement of text relative to point (x,y), default="l"
available values are "l": left, "c" : center, "r" : right
v_align - vertical alignment of text relative to point (x,y), default="b"
available values "t" : top, "m" : middle, "b" : bottom
font_name - name of font to use, default = Free Sans
font_size - size of font to use, default = 14
italic - display text in italic (true/false), default=false
oblique - display text in oblique (true/false), default=false (I don' see the difference with italic!)
bold - display text in bold (true/false), default=false
angle - rotation of text in degrees, default = 0 (horizontal)
colour - table of colours for text, default = plain white {{1,0xFFFFFF,1}}
this table contains one or more tables with format {P,C,A}
P=position of gradient (0 = beginning of text, 1= end of text)
C=hexadecimal colour
A=alpha (opacity) of color (0=invisible,1=opacity 100%)
Examples :
for a plain color {{1,0x00FF00,0.5}}
for a gradient with two colours {{0,0x00FF00,0.5},{1,0x000033,1}}
or {{0.5,0x00FF00,1},{1,0x000033,1}} -with this one, gradient will start in the middle of the text
for a gradient with three colours {{0,0x00FF00,0.5},{0.5,0x000033,1},{1,0x440033,1}}
and so on ...
orientation - in case of gradient, "orientation" defines the starting point of the gradient, default="ww"
there are 8 available starting points : "nw","nn","ne","ee","se","ss","sw","ww"
(n for north, w for west ...)
theses 8 points are the 4 corners + the 4 middles of text's outline
so a gradient "nn" will go from "nn" to "ss" (top to bottom, parallele to text)
a gradient "nw" will go from "nw" to "se" (left-top corner to right-bottom corner)
radial - define a radial gradient (if present at the same time as "orientation", "orientation" will have no effect)
this parameter is a table with 6 numbers : {xa,ya,ra,xb,yb,rb}
they define two circle for the gradient :
xa, ya, xb and yb are relative to x and y values above
reflection_alpha - add a reflection effect (values from 0 to 1) default = 0 = no reflection
other values = starting opacity
reflection_scale - scale of the reflection (default = 1 = height of text)
reflection_length - length of reflection, define where the opacity will be set to zero
calues from 0 to 1, default =1
skew_x,skew_y - skew text around x or y axis
]]
require 'cairo'
function conky_draw_text()
text_settings={
{
text="" ..conky_parse("${time %I:%M%P}"),
x=100,
y=150,
colour={{0,0xCC0000,.75},{0.8,0xFFFFFF,0.6},{1,0xCC0000,0.75}},
orientation="nn",
font_name="LuxiMono",
bold=true,
font_size=80,
},
{
text="" .. conky_parse("${time %I:%M%P}"),
x=99,
y=149,
colour={{0,0xFFFFFF,0.75},{.2,0xCC0000,0.4},{.8,0xFFFFFF,.75}},
orientation="nn",
font_name="LuxiMono",
bold=true,
font_size=80,
},
{
text="" .. conky_parse("${time %D}"),
x=138,
y=189,
colour={{0,0xCC0000,.75},{0.8,0xFFFFFF,0.6},{1,0xCC0000,0.75}},
orientation="nn",
font_name="LuxiMono",
bold=true,
font_size=40,
},
{
text="" .. conky_parse("${time %D}"),
x=137,
y=190,
colour={{0,0xFFFFFF,0.75},{.2,0xCC0000,0.4},{.8,0xFFFFFF,.75}},
orientation="nn",
font_name="LuxiMono",
bold=true,
font_size=40,
},
}
if conky_window == nil then return end
if tonumber(conky_parse("$updates"))<3 then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create (cs)
for i,v in pairs(text_settings) do
display_text(v)
end
cairo_destroy(cr)
cairo_surface_destroy(cs)
end
function rgb_to_r_g_b(tcolour)
colour,alpha=tcolour[2],tcolour[3]
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function display_text(t)
if t.text==nil then t.text="Conky is good for you !" end
if t.x==nil then t.x = conky_window.width/2 end
if t.y==nil then t.y = conky_window.height/2 end
if t.colour==nil then t.colour={{1,0xFFFFFF,1}} end
if t.font_name==nil then t.font_name="Free Sans" end
if t.font_size==nil then t.font_size=14 end
if t.angle==nil then t.angle=0 end
if t.italic==nil then t.italic=false end
if t.oblique==nil then t.oblique=false end
if t.bold==nil then t.bold=false end
if t.radial ~= nil then
if #t.radial~=6 then
print ("error in radial table")
t.radial=nil
end
end
if t.orientation==nil then t.orientation="ww" end
if t.h_align==nil then t.h_align="l" end
if t.v_align==nil then t.v_align="b" end
cairo_save(cr)
cairo_translate(cr,t.x,t.y)
cairo_rotate(cr,t.angle*math.pi/180)
local slant = CAIRO_FONT_SLANT_NORMAL
local weight =CAIRO_FONT_WEIGHT_NORMAL
if t.italic then slant = CAIRO_FONT_SLANT_ITALIC end
if t.oblique then slant = CAIRO_FONT_SLANT_OBLIQUE end
if t.bold then weight = CAIRO_FONT_WEIGHT_BOLD end
cairo_select_font_face(cr, t.font_name, slant,weight)
cairo_set_font_size(cr,t.font_size)
for i=1, #t.colour do
if #t.colour[i]~=3 then
print ("error in color table")
t.colour[i]={1,0xFFFFFF,1}
end
end
local te=cairo_text_extents_t:create()
cairo_text_extents (cr,t.text,te)
if #t.colour==1 then
cairo_set_source_rgba(cr,rgb_to_r_g_b(t.colour[1]))
else
local pat
if t.radial==nil then
local pts=linear_orientation(t,te)
pat = cairo_pattern_create_linear (pts[1],pts[2],pts[3],pts[4])
else
pat = cairo_pattern_create_radial (t.radial[1],t.radial[2],t.radial[3],t.radial[4],t.radial[5],t.radial[6])
end
for i=1, #t.colour do
cairo_pattern_add_color_stop_rgba (pat, t.colour[i][1], rgb_to_r_g_b(t.colour[i]))
end
cairo_set_source (cr, pat)
cairo_pattern_destroy(pat)
end
local mx,my=0,0
if t.h_align=="c" then
mx=-te.width/2
elseif t.h_align=="r" then
mx=-te.width
end
if t.v_align=="m" then
my=-te.height/2-te.y_bearing
elseif t.v_align=="t" then
my=-te.y_bearing
end
cairo_move_to(cr,mx,my)
cairo_show_text(cr,t.text)
cairo_stroke(cr)
cairo_restore(cr)
end
function linear_orientation(t,te)
local w,h=te.width,te.height
local xb,yb=te.x_bearing,te.y_bearing
if t.h_align=="c" then
xb=xb-w/2
elseif t.h_align=="r" then
xb=xb-w
end
if t.v_align=="m" then
yb=-h/2
elseif t.v_align=="t" then
yb=0
end
if t.orientation=="nn" then
p={xb+w/2,yb,xb+w/2,yb+h}
elseif t.orientation=="ne" then
p={xb+w,yb,xb,yb+h}
elseif t.orientation=="ww" then
p={xb,h/2,xb+w,h/2}
elseif vorientation=="se" then
p={xb+w,yb+h,xb,yb}
elseif t.orientation=="ss" then
p={xb+w/2,yb+h,xb+w/2,yb}
elseif vorientation=="ee" then
p={xb+w,h/2,xb,h/2}
elseif t.orientation=="sw" then
p={xb,yb+h,xb+w,yb}
elseif t.orientation=="nw" then
p={xb,yb,xb+w,yb+h}
end
return p
end
######################
# - Conky settings - #
######################
background no
update_interval .3
cpu_avg_samples 2
total_run_times 0
override_utf8_locale yes
double_buffer yes
#no_buffers yes
text_buffer_size 10240
#imlib_cache_size 0
minimum_size 1250 0
maximum_width 1250
gap_x 60
gap_y 50
#####################
# - Text settings - #
#####################
use_xft yes
xftfont Santana:size=8
xftalpha .8
uppercase no
alignment top_left
#############################
# - Window specifications - #
#############################
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class conky-semi
#own_window_argb_visual yes
#own_window_argb_value 255
border_inner_margin 0
border_outer_margin 0
#########################
# - Graphics settings - #
#########################
draw_shades no
#default_shade_color 292421
draw_outline no
draw_borders no
stippled_borders 0
draw_graph_borders no
TEXT
${execpi 36000 /home/jed/Conky/Scripts/horical.sh}
${font CaviarDreams:size=20}${goto 60}${color 949494}${voffset 10}${time %l:%M %P}
${font CaviarDreams:size=12.5}${goto 90}${color 3881C7}${voffset -20}${time %A %B %d %Y}
${voffset 20}${goto 700}${color 3881C7}${font CaviarDreams:size=10}${execi 1 conkyForecast-SunsetSunriseCountdown -t} in: ${color 949494}${execi 1 conkyForecast-SunsetSunriseCountdown -L}
${goto 700}${color 3881C7}Current Moon Phase: ${goto 900}${color 949494}${execi 300 conkyForecast --imperial --datatype=MP}
${execpi 1800 conkyForecast --location=USME0330 --imperial --template=$HOME/Conky/LUA/day-night.template}
#!/bin/bash
# a script to display a horizontal calendar on conky (hence the name horical :D)
#
TODAY=`date +%d`
TOPLINE=" "
OVER=" "
REST=" "
# -------- This part is to find out the number of days in a month to display-----------#
a=`date +%-Y`
e1=`expr $a % 400`
e2=`expr $a % 100`
e3=`expr $a % 4`
if [ $e1 == 0 ]
then c=1
elif [ $e2 == 0 ]
then c=0
elif [ $e3 == 0 ]
then c=1
else c=0
fi
p=`date +%-m`
# if the current year is not a leap one, c = 0
if [ $c == 0 ]
then
if [ $p == 2 ]
then b=28 # this is the number of days in Febuary
elif [ $p == 11 ] || [ $p == 4 ] || [ $p == 6 ] || [ $p == 9 ]
then b=30
else b=31
fi
else
if [ $p == 2 ]
then b=29 # the number of days in Febuary in a leap year
elif [ $p == 11 ] || [ $p == 4 ] || [ $p == 6 ] || [ $p == 9 ]
then b=30
else b=31
fi
fi
#--------------------- The bottom line which displays the days of month ----------#
i=1
if [ $TODAY -ne 1 ]
then
while [ $i -lt $TODAY ]; do
if [ $i -lt 10 ]
then
OVER="$OVER 0$i"
else
OVER="$OVER $i"
fi
i=$[$i+1]
done
fi
i=$[$i+1]
if [ $TODAY -ne $b ]
then
while [ $i -ne $[$b] ]; do
if [ $i -lt 10 ]
then
REST="$REST 0$i"
else
REST="$REST $i"
fi
i=$[$i+1]
done
REST="$REST $b"
fi
#------------- the top line which displays the abbreviated weekday names-------#
k=`date +%u`
j=`date +%e`
f=`expr $j % 7`
if [ $k -lt $f ]
then
y=$[$k+8-$f]
else
y=$[$k-$f+1]
fi
while [ $b -gt 0 ]; do
case "$y" in
1) TOPLINE="$TOPLINE Mo";;
2) TOPLINE="$TOPLINE Tu";;
3) TOPLINE="$TOPLINE We";;
4) TOPLINE="$TOPLINE Th";;
5) TOPLINE="$TOPLINE Fr";;
6) TOPLINE="$TOPLINE Sa";;
7) TOPLINE="$TOPLINE Su";;
esac
b=$[$b-1]
y=$[$y+1]
if [ $y -eq 8 ]
then
y=1
fi
done
echo '${goto 15}''${color 949494}${font Droid Sans Mono:size=7.5}'$TOPLINE | sed 's/Su/${color 48a3fd}Su${color 949494}/g' | sed 's/Su/${color 3881C7}Su/g'
echo '${goto 15}''${font Droid Sans Mono:bold:size=7.5}''${color 3c3c3c}'$OVER '${color 3881C7}'$TODAY'${color}${color 949494}'$REST
${execi 1 conkyForecast-SunsetSunriseCountdown --location=USME0330 -t}${image [--datatype=WI --night] -p 405,20 -s 100x100}${image [--datatype=MI] -p 555,40 -s 100x100}
background no
background yes
text_buffer_size 10240
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
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 10 # 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 DejaVu Sans Mono:bold:size=10
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# 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
TEXT
${font Monofur:bold:size=18}${execpi 60 /media/5/Conky/scripts/conkycal.sh|sed 's/^/\${goto 20}/'}${font}
${goto 60}${font monofur:size=40}${color 949494}${tztime US/Eastern %l:%M %P}${font}
${goto 60}${font monofur:size=25}${color 3881C7}${tztime US/Eastern %A %B %d %Y}${font}
${execpi 1800 conkyForecast --location=USME0330 --imperial --template=/media/5/conky/jedi/day-night3.template}
==== BsAs ====
${font Monofur:bold:size=18}${execpi 60 /media/5/Conky/scripts/conkycal.sh|sed 's/^/\${goto 20}/'}${font}
${goto 60}${font monofur:size=40}${color 949494}${time %T}${font}
${goto 60}${font monofur:size=25}${color 3881C7}${time %a %d %b %y}${font}
${execpi 1800 conkyForecast --location=ARBA0009 --template=/media/5/conky/jedi/day-night_bsas.template}
${if_match "${execi 1 conkyForecast-SunsetSunriseCountdown --location=USME0330 -t}"=="Sunrise"}${image [--datatype=WI] -p 475,55 -s 150x150}${else}${image [--datatype=WI --night] -p 475,55 -s 150x150}${endif}${image [--datatype=MI] -p 775,65 -s 100x100}
${font monofur:size=20}${color 3881C7}Sunrise: ${color 949494}[--location=USME0330 --datatype=SR] ${color 3881C7}Sunset: ${color 949494}[--location=USME0330 --datatype=SS]${font}
${color 3881C7}${font monofur:size=20}${execi 1 conkyForecast-SunsetSunriseCountdown --location=USME0330 -t} in: ${color 949494}${execi 1 conkyForecast-SunsetSunriseCountdown --location=USME0330 -L}${goto 720}${color 949494}[--datatype=MP]${color}${font}
${if_match "${execi 1 conkyForecast-SunsetSunriseCountdown -t}"=="Sunrise"}${image [--datatype=WI] -p 475,300 -s 150x150}${else}${image [--datatype=WI --night] -p 475,300 -s 150x150}${endif}${image [--datatype=MI] -p 775,310 -s 100x100}
${font monofur:size=20}${color 3881C7}Sunrise: ${color 949494}[--location=ARBA0009 --datatype=SR] ${color 3881C7}Sunset: ${color 949494}[--location=ARBA0009 --datatype=SS]${font}
${color 3881C7}${font monofur:size=20}${execi 1 conkyForecast-SunsetSunriseCountdown --location=ARBA0009 -t} in: ${color 949494}${execi 1 conkyForecast-SunsetSunriseCountdown --location=ARBA0009 -L}${goto 720}${color 949494}[--datatype=MP]${color}${font}
#!/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}
TEXT
${alignc}Apr 2013 - English
${font Monofur:size=20}${execpi 3600 /media/5/Conky/scripts/conkycal.sh|sed 's/^/\${goto 30}/'}${font}${color}
${alignc}Jan 2013 - Spanish
${font Monofur:size=20}${execpi 3600 /media/5/Conky/scripts/conkycal.sh -d "2013 1" -l es|sed 's/^/\${goto 30}/'}${font}${color}
${alignc}Feb 2013 - Portuguese
${font Monofur:size=20}${execpi 3600 /media/5/Conky/scripts/conkycal.sh -d "2013 2" -l pt|sed 's/^/\${goto 30}/'}${font}${color}
case ${lang:-$LANG} in
af* ) DOW=("Ma" "Di" "Wo" "Do" "Vr" "Sa" "So");; # Afrikaans (Afrikaans)
be* ) DOW=("Па" "Аў" "Се" "Ча" "Пя" "Су" "Ня");; # Belarusian (Беларуская)
bs* ) DOW=("Po" "Ut" "Sr" "Če" "Pe" "Su" "Ne");; # Bosnian (Bosanac)
bg* ) DOW=("По" "Вт" "Ср" "Че" "Пе" "Съ" "Не");; # Bulgarian (Български)
zh* ) DOW=("周一" "周二" "周三" "周四" "周五" "周六" "周天");; # Chinese (中文)
hr* ) DOW=("Po" "Ut" "Ut" "Sr" "Če" "Su" "Ne");; # Croatian (Hrvatska)
cs* ) DOW=("Po" "Út" "St" "Čt" "Pá" "So" "Ne");; # Czech (Čeština)
da* ) DOW=("Ma" "Ti" "On" "To" "Fr" "Lø" "Sø");; # Danish (Dánština)
nl* ) DOW=("Ma" "Di" "Wo" "Do" "Vr" "Za" "Zo");; # Dutch (Nederlandse)
de* ) DOW=("Mo" "Di" "Mi" "Do" "Fr" "Sa" "So");; # German (Deutche)
el* ) DOW=("Δε" "Τρ" "Τε" "Πέ" "Πα" "Σά" "Κυ");; # Greek (Ελληνικά)
et* ) DOW=("Es" "Te" "Ko" "Ne" "Re" "La" "Pü");; # Estonian (Eesti)
tl* ) DOW=("Lu" "Ma" "Mi" "Hu" "Bi" "Sa" "Li");; # Filipino (Filipino)
fi* ) DOW=("Ma" "Ti" "Ke" "To" "Pe" "La" "Su");; # Finnish (Suomen)
fr* ) DOW=("Lu" "Ma" "Me" "Je" "Ve" "Sa" "Di");; # French (Français)
gl* ) DOW=("Lu" "Ma" "Mé" "Xo" "Ve" "Sá" "Do");; # Galician (Galego)
hi* ) DOW=("सोम" "मंगल" "बुध" "गुरु" "शुक्र" "शनि" "सूर्य") ;; # Hindi (हिन्दी)
hu* ) DOW=("Hé" "Ke" "Se" "Cü" "Pé" "So" "Va");; # Hungarian (Magyar)
is* ) DOW=("Má" "Þr" "Mi" "Fi" "Fö" "La" "Su");; # Icelandic (Íslenska)
id* ) DOW=("Se" "Se" "Ra" "Ka" "Ju" "Sa" "Mi");; # Indonesian (Indonesia)
it* ) DOW=("Lu" "Ma" "Me" "Gi" "Ve" "Sa" "Do");; # Italian (Italiano)
ja* ) DOW=("月曜" "火曜" "水曜" "木曜" "金曜" "土曜" "日曜");; # Japanese (日本語) x
ko* ) DOW=("월요" "화요" "수요" "목요" "금요" "토요" "일요");; # Korean (한국어) x
lv* ) DOW=("Pr" "Ot" "Tr" "Ce" "Pe" "Se" "Sv");; # Latvian (Latviešu)
lt* ) DOW=("pi" "an" "tr" "ke" "pe" "še" "se");; # Lithuanian (Lietuviškai)
mk* ) DOW=("По" "Вт" "Ср" "Че" "Пе" "Са" "Не");; # Macedonian (Македонски)
ml* ) DOW=("Is" "Se" "Ra" "Ra" "Ju" "Sa" "Mi");; # Malayam (Bahasa Melayu)
nb* ) DOW=("ma" "ti" "on" "to" "fr" "lø" "sø");; # Norwegian (Norsk)
pl* ) DOW=("Po" "Wt" "Śr" "Cz" "Pt" "So" "Nd");; # Polish (Polska)
pt* ) DOW=("Sq" "Te" "Qa" "Qi" "Se" "Sá" "Do");; # Portuguese (Português)
ro* ) DOW=("Lu" "Ma" "Mi" "Jo" "Vi" "Sa" "Du");; # Romanian (Român)
ru* ) DOW=("По" "Вт" "Ср" "Че" "Пя" "Су" "Во");; # Russian (Русский)
sr* ) DOW=("Po" "Ut" "Sr" "Če" "Pe" "Su" "Ne");; # Serbian (Српски)
sk* ) DOW=("Po" "Ut" "St" "Št" "Pi" "So" "Ne");; # Slovak (Slovenčina)
sl* ) DOW=("Po" "To" "Sr" "Če" "Pe" "So" "Ne");; # Slovenian (Slovenski)
es* ) DOW=("Lu" "Ma" "Mi" "Ju" "Vi" "Sá" "Do");; # Spanish (Español)
sv* ) DOW=("Må" "Ti" "On" "To" "Fr" "Lö" "Sö");; # Swedish (Svenska)
tr* ) DOW=("Pa" "Sa" "Ça" "Pe" "Cu" "Cu" "Pa");; # Turkish (Türkçe)
uk* ) DOW=("По" "Ві" "Се" "Че" "Пя" "Су" "Не");; # Ukrainian (Українська)
* ) DOW=("Mo" "Tu" "We" "Th" "Fr" "Sa" "Su") ;;
esac
0 TEXT
1 ${execpi 36000 /home/jed/Conky/Scripts/horical.sh}
2 ${font CaviarDreams:size=20}${goto 60}${color 949494}${voffset 10}${time %l:%M %P}
3 ${font CaviarDreams:size=12.5}${goto 90}${color 3881C7}${voffset -20}${time %A %B %d %Y}
4 ${voffset 20}${goto 700}${color 3881C7}${font CaviarDreams:size=10}${execi 1 conkyForecast-SunsetSunriseCountdown -t} in: ${color 949494}${execi 1 conkyForecast-SunsetSunriseCountdown -L}
5 ${goto 700}${color 3881C7}Current Moon Phase: ${goto 900}${color 949494}${execi 300 conkyForecast --imperial --datatype=MP}
6 ${execpi 1800 conkyForecast --location=USME0330 --imperial --template=$HOME/Conky/LUA/day-night.template}
${execi 1 conkyForecast-SunsetSunriseCountdown --location=USME0330 -t}${image [--dataty... blah blah
${voffset 20}${goto 700}${color 3881C7}Current Moon Phase: ${goto 900}${color 949494}${execi 300 conkyForecast --imperial --datatype=MP}
${goto 700}${color 3881C7}${font CaviarDreams:size=10}${execi 1 conkyForecast-SunsetSunriseCountdown -t} in: ${color 949494}${execi 1 conkyForecast-SunsetSunriseCountdown -L}
${image [--datatype=WI --night] -p 405,20 -s 100x100}${image [--datatype=MI] -p 555,40 -s 100x100}
### Begin Window Settings ##################################################
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-test.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 10 # 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 DejaVu Sans Mono:bold:size=10
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# 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
TEXT
${font Monofur:bold:size=18}${execpi 3600 /path/to/conkycal.sh|sed 's/^/\${goto 20}/'}${font}
this will be DejaVu Sans Mono - bold - size 10
${font Monofur:bold:size=9}${execpi 3600 /path/to/conkycal.sh|sed 's/^/\${goto 20}/'}${font}
## killall conky && conky -c /media/5/Conky/S11_v9_Vert.conky &
##
## The latest script is a lua only weather script. aka: v9000
## http://crunchbanglinux.org/forums/topic/16100/weather-in-conky/
##
## the file:
## http://dl.dropbox.com/u/19008369/weatheragain9000.lua.tar.gz
##
## mrppeachys LUA Tutorial
## http://crunchbanglinux.org/forums/topic/17246/how-to-using-lua-scripts-in-conky/
##
##
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_colour 000000
own_window_class Conky
own_window_title S11 v9 Vertical
# 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 150
minimum_size 110 875 ##820 260 ## width, height
maximum_width 110 ##820 ## width, usually a good idea to equal minimum width
gap_x 10 ### l|r
gap_y 10 ### u|d
alignment top_left #tl
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Anonymous Pro:size=9
xftfont monofur:bold:size=9
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
draw_shades yes
default_shade_color black
draw_outline no # amplifies text if yes
default_outline_color black
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
default_shade_color 000000
default_outline_color 000000
default_color DCDCDC #220 220 220 Gainsboro
color0 8FBC8F #143 188 143 DarkSeaGreen
color1 778899 #119 136 153 LightSlateGray
color2 FF8C00 #255 140 0 DarkOrange
color3 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
#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 512
# 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 ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or it blinks.
##
# lua_load ~/wea_conky/draw_bg.lua
## TEXT
## ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
##
## OR Both above TEXT (No composite manager required - no blinking!)
##
lua_load /media/5/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.2
#
# TEXT
#
############### V9000 ########################################################
#starts the lua weather data gathering function, call once at top of conkyrc
lua_load ~/v9000/v9000.lua
lua_draw_hook_post weather
lua_load /media/5/Conky/templates/S11_V9_Vert-template.lua
####################################################### End LUA Settings ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1
### one blank line after TEXT
TEXT
--[[
The latest script is a lua only weather script. aka: v9000
http://crunchbanglinux.org/forums/topic/16100/weather-in-conky/
the file:
http://dl.dropbox.com/u/19008369/v9000.tar.gz
mrppeachys LUA Tutorial
http://crunchbanglinux.org/forums/topic/17246/how-to-using-lua-scripts-in-conky/
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ###############################
--these tables hold the coordinates for each repeat do not edit ##########################
top_left_x_coordinate={}-- ###############################################################
top_left_y_coordinate={}-- ###############################################################
-- #######################################################################################
-- SET DEFAULTS ##########################################################################
-- set defaults do not localise these defaults if you use a seperate display script
-- default_font="Anonymous Pro" --font must be in quotes
default_font="monofur" -- font must be in quotes
default_font_size=14
default_color=0xF0FFFF -- Azure
default_alpha=1 -- fully opaque
default_image_width=20
default_image_height=20
-- ## New Options ###
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
-- END OF DEFAULTS #######################################################################
-- START OF CURRENT WEATHER CONDITIONS ##################################################
--## Moon ICON Placement for today ###
-- image({x=25,y=20,w=62,h=62,file=moon_icon[1]})
-- image({x=25,y=20,w=62,h=62,file="/media/5/Conky/images/RCAF-Roundel.png"})
out({c=0x00FFFF,a=1,x=20,y=10,txt=forecast_day_short[1].." "..forecast_date[1].." "..forecast_month_short[1]})
out({c=0xF0FFFF,a=1,x=15,y=33,txt=now["temp"]})
out({c=0xFFDEAD,a=1,x=15,y=47,txt=now["feels_like"]})
image({x=40,y=15,h=45,w=45,file=now["weather_icon"]})
-- image({x=40,y=15,h=45,w=45,file="/media/5/Conky/images/red+x.png"})
out({c=0x00FFFF,a=1,x=5,y=73,txt="Bar P"})
out({c=0xF0FFFF,a=1,x=60,y=73,txt=now["pressure_mb"]})
out({c=0x00FFFF,a=1,x=5,y=86,txt="Humid"})
out({c=0xF0FFFF,a=1,x=60,y=86,txt=now["humidity"].." %"})
out({c=0x00FFFF,a=1,x=5,y=99,txt="Dew P"})
out({c=0xF0FFFF,a=1,x=60,y=99,txt=now["dew_point"].." °"})
out({c=0x00FFFF,a=1,x=5,y=112,txt="U V"})
out({c=0xF0FFFF,a=1,x=60,y=112,txt=uv_index_num[1]})
out({c=0xF0FFFF,a=1,x=90,y=112,txt=uv_index_txt[1]})
out({c=0x00FFFF,a=1,x=5,y=125,txt="Cloud"})
out({c=0xF0FFFF,a=1,x=60,y=125,txt=cloud_cover[1].." %"})
out({c=0x00FFFF,a=1,x=5,y=138,txt="Rain"})
out({c=0xF0FFFF,a=1,x=60,y=138,txt=precipitation[1].." %"})
-- 10 Day Forecast starts here
out({c=0xF5F5DC,a=1,x=12,y=158,txt="10 Forecast"})
out({c=0xF5F5DC,a=1,x=10,y=171,txt="Starts Today"})
-- START OF WEATHER REPEAT CODE - WEATHER REPEAT CODE - WEATHER REPEAT CODE ##############
--start or weather forecast table section
--set start forecast day
start_day=1
--set total forecast days you want to display
number_of_days=10
-- up-down
topy=195 --300 --125 -- y = u|d
tyy=70 --55 -- topy+(tyy*1)
-- left-right
topx=5 -- x = l|r
-- txx=130
--set coordinates for top lef corners for each repeat
top_left_x_coordinate[1],top_left_y_coordinate[1] =topx ,topy
top_left_x_coordinate[2],top_left_y_coordinate[2] =topx ,topy+(tyy*1)
top_left_x_coordinate[3],top_left_y_coordinate[3] =topx ,topy+(tyy*2)
top_left_x_coordinate[4],top_left_y_coordinate[4] =topx ,topy+(tyy*3)
top_left_x_coordinate[5],top_left_y_coordinate[5] =topx ,topy+(tyy*4)
top_left_x_coordinate[6],top_left_y_coordinate[6] =topx ,topy+(tyy*5)
top_left_x_coordinate[7],top_left_y_coordinate[7] =topx ,topy+(tyy*6)
top_left_x_coordinate[8],top_left_y_coordinate[8] =topx ,topy+(tyy*7)
top_left_x_coordinate[9],top_left_y_coordinate[9] =topx ,topy+(tyy*8)
top_left_x_coordinate[10],top_left_y_coordinate[10] =topx ,topy+(tyy*9)
--########################################################################################
for i=start_day,number_of_days-(start_day-1) do --start of day repeat, do not edit #######
tlx=top_left_x_coordinate[i] --sets top left x position for each repeat ##################
tly=top_left_y_coordinate[i] --sets top left y position for each repeat ##################
--########################################################################################
-- Day and Date
out({c=0x00FFFF,a=1,x=tlx+10,y=tly,txt=forecast_day_short[i].." "..forecast_date[i].." "..forecast_month_short[i]})
-- Forecasted High & Low
out({c=0xFF8C00,a=1,x=tlx,y=tly+13,txt=high_temp[i]})
out({c=0x87CEFA,a=1,x=tlx,y=tly+26,txt=low_temp[i]})
-- condition images and moon phase images
image({x=30,y=tly+5,file=weather_icon[i]})image({x=75,y=tly+5,file=moon_icon[i]})
-- repeat test images
-- image({x=30,y=tly+5,file="/media/5/Conky/images/red+x.png"})image({x=75,y=tly+5,file="/media/5/Conky/images/red+x.png"})
-- Sunrise & Sunset
out({c=0xEEE8AA,a=1,x=tlx,y=tly+40,txt="S:"..sun_rise_24[i]})
out({c=0x48D1CC,a=1,x=tlx+60,y=tly+40,txt=sun_set_24[i]})
-- Moonrise & Moonset
out({a=1,x=tlx,y=tly+53,txt="M:"..moon_rise_24[i]})
out({c=0x48D1CC,a=1,x=tlx+60,y=tly+53,txt=moon_set_24[i]})
-- out({c=0xFAFAEC,a=1,x=tlx,y=tly+78,txt="P:"..moon_phase[i]})
--########################################################################################
end--of forecast repeat section ##########################################################
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--########################################################################################
end--of weather_display function do not edit this line ###################################
--########################################################################################
### Begin Window Settings ##################################################
own_window yes
# 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
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_class Conky
own_window_title General Conky
### 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 override
# 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 150
minimum_size 270 965 ## width, height
maximum_width 270 ## width
gap_x 10 ### left &right
gap_y 10 ### up & down
alignment tl
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont monofur:bold:size=12
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
draw_shades yes #no # amplifies text if yes
default_shade_color 000000
draw_outline no # amplifies text if yes
default_outline_color 000000
default_color DCDCDC #220 220 220 Gainsboro
color0 8FBC8F #143 188 143 DarkSeaGreen
color1 778899 #119 136 153 LightSlateGray
color2 FF8C00 #255 140 0 DarkOrange
color3 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 FF0000 #255 0 0 Red
##################################################### 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 yes #no
##################################################### End Borders Secton ###
### Miscellaneous Section ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background no
# 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 256
# 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
## default bar size
default_bar_size 200 20
# Width for $top name value (default 15 characters)
top_name_width 8
## Specify a default width and height for graphs.
## Example: 'default_graph_size 0 25'. This is particularly useful for execgraph
## and execigraph as they do not take size arguments
## default_graph_size 200 0
#draw_graph_borders no
############################################## End Miscellaneous Section ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/dra2w-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.2
### mount.lua ##################################################################
#
##instructions
##load script
##lua_load ~/path_to/mounted.lua
#lua_load /media/5/Conky/LUA/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type}, where partition number is a number
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
####################################################### End LUA Settings ###
#digiThe all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1 # in seconds
# stuff after 'TEXT' will be formatted on screen
TEXT
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}\
${font Dock 51:size=40}${color1}Sector${color}${font}\
${image /media/5/My_Images/Sector11_Avatar/S11_falldown3.png -p 200,0 -s 60x60}\
${image /media/5/Conky/images/EVE.png -p -5,65 -s 80x80}
${image /media/5/Conky/images/Wall.E.png -p 205,65 -s 80x80}
${color5}${font LED_Mono:size=30}${alignc}${time %T}${font}${color}
${alignc}${color6}Easter${color}
${alignc}${exec ncal -e}
${alignc}SU MO ${color6}${time %b %Y}${color} FR SA
${goto 60}${color}${execp LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | sed ':a;N;$!ba;s/\n/\n${goto 60}/g'}
${voffset 5} Time online: ${alignr 15}${uptime_short}
${voffset 5}${alignc}${kernel}
${voffset 5}${alignc}${color5}Temperatures${color}
${alignc}CPU ${color5}${platform f71882fg.2560 temp 1}${color}°\
MB ${color5}${platform f71882fg.2560 temp 2}${color}°
${alignc}GPU ${color5}${nvidia temp}${color}°\
HD ${color5}${hddtemp /dev/sda}${color}°
${voffset 5}${alignc}${color5}Nvidia GPU${color}
GPU ${color5}${nvidia gpufreq} ${color}MHz${alignr 15}MEM ${color5}${nvidia memfreq} ${color}MHz
${voffset 5}${alignc}${color5}Disk Activity${color}
${goto 10}${diskiograph 50,250 FF0000 0000FF -t -l}${goto 10}${color1}${cpubar cpu4 50,250}${color}\
${voffset -35}${goto 80}SDA: R: ${diskio_read /dev/sda}
${goto 80} W: ${diskio_write /dev/sda}
${voffset 9}${goto 60}${color1}${fs_bar /}${color}
${voffset -28}/Root ${fs_size /}${goto 170}Used${goto 220}${fs_used_perc /}%
${goto 60}${color1}${fs_bar /home}${color}
${voffset -28}/Home ${fs_size /home}${goto 170}Used${goto 220}${fs_used_perc /home}%
${goto 60}${color1}${fs_bar /media/5}${color}
${voffset -28} /M/5 ${fs_size /media/5}${goto 170}Used${goto 220}${fs_used_perc /media/5}%
${voffset 5} RAM Used ${mem}${goto 170}Total ${memmax}
${voffset 5}${alignc}${color5}CPU${color}
${voffset 5}${goto 10}CPU1\
${voffset -8}${goto 60}${color1}${cpubar cpu1}${goto 60}${cpugraph cpu1 -t 20,200 FF0000 FFFF00}\
${voffset -12}${goto 70}${color}${if_match ${cpu cpu1}<10} ${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100} ${cpu cpu1}\
${else}${cpu cpu1}${endif}${endif}%
${voffset 8}${goto 10}CPU2\
${voffset -8}${goto 60}${color1}${cpubar cpu2}${goto 60}${cpugraph cpu2 -t 20,200 FF0000 FFFF00}\
${voffset -12}${goto 70}${color}${if_match ${cpu cpu2}<10} ${cpu cpu2}\
${else}${if_match ${cpu cpu2}<100} ${cpu cpu2}\
${else}${cpu cpu2}${endif}${endif}%
${voffset 8}${goto 10}CPU3\
${voffset -8}${goto 60}${color1}${cpubar cpu3}${goto 60}${cpugraph cpu3 -t 20,200 FF0000 FFFF00}\
${voffset -12}${goto 70}${color}${if_match ${cpu cpu3}<10} ${cpu cpu3}\
${else}${if_match ${cpu cpu3}<100} ${cpu cpu3}\
${else}${cpu cpu3}${endif}${endif}%
${voffset 8}${goto 10}Avg\
${voffset -8}${goto 60}${color1}${cpubar cpu0}${goto 60}${cpugraph cpu0 -t 20,200 FF0000 FFFF00}\
${voffset -12}${goto 70}${color}${if_match ${cpu cpu0}<10} ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}% μm ${freq_g}
${voffset 8}${alignc}${color5}Network${color}
${voffset 5} Down${voffset -6}${goto 60}${color1}${downspeedgraph eth0 20,200 0000ff fff000 5 -lt}\
${voffset -12}${goto 90}${color}${downspeed eth0}
${voffset 5} Up${voffset -6}${goto 60}${color1}${upspeedgraph eth0 20,200 0000ff fff000 5 -lt}\
${voffset -12}${goto 90}${color}${upspeed eth0}
${voffset 8}${alignc}${color5}Processes${color}
Total ${color5}${processes}${color}${alignr 15}Running ${color5}${running_processes}${color}
${goto 220}${color0}mem${color}
Name${goto 90}${color7}cpu${color} mem ${color1}uid${color}${goto 220}${color0}res${color}
${cpubar cpu0 0,250}
${top name 1}${goto 75}${color7}${top cpu 1}${color}${color}${top mem 1}${color1}${top uid 1}${color0}${goto 220}${top mem_res 1}${color}
${top name 2}${goto 75}${color7}${top cpu 2}${color}${top mem 2}${color1}${top uid 2}${color0}${goto 220}${top mem_res 2}${color}
${top name 3}${goto 75}${color7}${top cpu 3}${color}${top mem 3}${color1}${top uid 3}${color0}${goto 220}${top mem_res 3}${color}
${top name 4}${goto 75}${color7}${top cpu 4}${color}${top mem 4}${color1}${top uid 4}${color0}${goto 220}${top mem_res 4}${color}
${top name 5}${goto 75}${color7}${top cpu 5}${color}${top mem 5}${color1}${top uid 5}${color0}${goto 220}${top mem_res 5}${color}
${top name 6}${goto 75}${color7}${top cpu 6}${color}${top mem 3}${color1}${top uid 6}${color0}${goto 220}${top mem_res 6}${color}
${top name 7}${goto 75}${color7}${top cpu 7}${color}${top mem 7}${color1}${top uid 7}${color0}${goto 220}${top mem_res 7}${color}
${top name 8}${goto 75}${color7}${top cpu 8}${color}${top mem 8}${color1}${top uid 8}${color0}${goto 220}${top mem_res 8}${color}
${top name 9}${goto 75}${color7}${top cpu 9}${color}${top mem 9}${color1}${top uid 9}${color0}${goto 220}${top mem_res 9}${color}
######################
# - Conky settings - #
# -Based on a conky- #
# -by McLovins Bars- #
# -Tweaked by jedi - #
# -all mistakes by me...(jedi)
######################
background no
update_interval 1
cpu_avg_samples 2
total_run_times 0
override_utf8_locale yes
double_buffer yes
#no_buffers yes
text_buffer_size 10240
imlib_cache_size 10240
minimum_size 300 880
maximum_width 300
gap_x 15
gap_y 45
#####################
# - Text settings - #
#####################
use_xft yes
xftfont Santana:size=11
#xftalpha 0.8
uppercase no
# Text alignment, other possible values are commented
#alignment middle_left
#alignment middle_middle
#alignment middle_right
#alignment top_middle
alignment top_right
#alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment bottom_middle
######################
# - Color settings - #
######################
color0 c3c3c3 #mid gray
color1 FF0000 #red
color2 A4FFA4 #light green
color3 007EFF #bright blue
color4 E3E3E3 #very light gray
color5 c6771a #an orange shade
color6 CA8718 #a dust like color
color7 FFE500 #a darker yellow color
color8 C3FF00 #lime green
color9 227992 #bars-blue #another blue 48a3fd
default_color c3c3c3
default_shade_color gray
default_outline_color black
#############################
# - Window specifications - #
#############################
own_window yes
own_window_type normal #override
own_window_transparent yes
own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
own_window_colour gray
own_window_class Conky
own_window_title clicky
#own_window_argb_visual yes
#own_window_argb_value 255
border_inner_margin 0
border_outer_margin 0
#########################
# - Graphics settings - #
#########################
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
draw_graph_borders no
####
## Load Lua for bargraphs (required)
## Set the path to your script here.
#
lua_load ~/Conky/LUA/bargraph.lua
lua_draw_hook_pre main_bars
TEXT
${goto 6}${voffset 4}${color 547EC8}${font xspiralmental:size=14}G${color}${font}${voffset -4}${goto 32}Distro:${alignr}${execi 2600 cat /etc/issue.net}
${goto 6}${voffset 4}${color 547EC8}${font xspiralmental:size=14}Z${color}${font}${voffset -4}${goto 32}Kernel:${alignr}${kernel}
${goto 6}${voffset 4}${color 547EC8}${font StyleBats:size=14}o${color}${font}${voffset -4}${goto 32}Uptime:${alignr}${uptime}
${goto 6}${voffset 4}${color 547EC8}${font StyleBats:size=14}q${color}${font}${voffset -4}${goto 32}Processes:${alignr}${processes} ($running_processes running)
${color 547EC8}${hr}${color}
${goto 8}${color 951C1C}${font Weather:size=19}x${color}${font}${goto 32}${voffset -2}Motherboard Temp: ${alignr}${hwmon 2 temp 2}º C${font}
${goto 8}${color 951C1C}${font Weather:size=19}x${color}${font}${goto 32}${voffset -2}CPU Socket Temp: ${alignr}${hwmon 1 temp 1}º C${font}
${color 547EC8}${hr}${color}
${goto 46}${color 547EC8}${font Poky:size=16}P${color}${voffset}${font}${voffset -4}${goto 28}${alignc}${execi 1000 cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c41-47} ${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c1-5} ${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c10-13}-${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c19-20} ${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c28-49}
${goto 70}${color 951C1C}${font Weather:size=19}x${color}${font}${voffset -4}${goto 85}Physical CPU Temp: ${alignr}${goto 235}${hwmon temp 1}º C${font}
${alignc}Avg CPU use: ${cpu cpu0}%
${alignc}Load: ${loadavg}
${goto 75}${color 951C1C}${font Weather:size=19}x${color}${font}${goto 32}${voffset -4}${alignc}Core 1 Temp: ${execi 10 sensors | grep "Core 1" | cut -d "+" -f2 | cut -c1-2}º C
${goto 6}${color 547EC8}${font Poky:size=16}P${color}${font}${voffset -4}${goto 28}CPU1: ${freq_g 1}Gh ${alignr}${cpu cpu1}%
${goto 6}${color 547EC8}${font Poky:size=16}P${color}${font}${voffset -4}${goto 28}CPU2: ${freq_g 2}Gh ${alignr}${cpu cpu2}%
${goto 75}${color 951C1C}${font Weather:size=19}x${color}${font}${goto 32}${voffset -4}${alignc}Core 2 Temp: ${execi 10 sensors | grep "Core 2" | cut -d "+" -f2 | cut -c1-2}º C
${goto 6}${color 547EC8}${font Poky:size=16}P${color}${font}${voffset -4}${goto 28}CPU3: ${freq_g 3}Gh ${alignr}${cpu cpu3}%
${goto 6}${color 547EC8}${font Poky:size=16}P${color}${font}${voffset -4}${goto 28}CPU4: ${freq_g 4}Gh ${alignr}${cpu cpu4}%
${goto 75}${color 951C1C}${font Weather:size=19}x${color}${font}${goto 32}${voffset -4}${alignc}Core 3 Temp: ${execi 10 sensors | grep "Core 3" | cut -d "+" -f2 | cut -c1-2}º C
${goto 6}${color 547EC8}${font Poky:size=16}P${color}${font}${voffset -4}${goto 28}CPU5: ${freq_g 5}Gh ${alignr}${cpu cpu5}%
${goto 6}${color 547EC8}${font Poky:size=16}P${color}${font}${voffset -4}${goto 28}CPU6: ${freq_g 6}Gh ${alignr}${cpu cpu6}%
${goto 75}${color 951C1C}${font Weather:size=19}x${color}${font}${goto 32}${voffset -4}${alignc}Core 4 Temp: ${execi 10 sensors | grep "Core 0" | cut -d "+" -f2 | cut -c1-2}º C
${goto 6}${color 547EC8}${font Poky:size=16}P${color}${font}${voffset -4}${goto 28}CPU7: ${freq_g 7}Gh ${alignr}${cpu cpu7}%
${goto 6}${color 547EC8}${font Poky:size=16}P${color}${font}${voffset -4}${goto 28}CPU8: ${freq_g 8}Gh ${alignr}${cpu cpu8}%
${goto 66}${voffset 4}${color 547EC8}${font Poky:size=11}M${color}${font}${voffset -8}${goto 32}${alignc}Used RAM: ${mem}${voffset -4}
${voffset 4}${goto 32}${alignc}Total RAM: ${memmax}
${alignc}${color5}GPU Temp:${color9} ${nvidia temp}º
${alignc}${color5}GPU Freq:${color1} ${nvidia gpufreq}MHz
${alignc}${color5}GPU Mem Freq:${color1} ${nvidia memFreq}MHz${color9}
${goto 3}${color 547EC8}${font Martin Vogel's Symbols:size=20}h${color}${font}${voffset -4}${goto 32}Disk I/O: ${diskio}${alignr}${voffset -10}${diskiograph 18,160 00D7FF FF452A -l -t}
${alignc} NETWORK ${alignr}${gw_iface} ${voffset -3}
${color 547EC8}${font PizzaDude Bullets:size=16}M${color}${font}${goto 32}${voffset -4}Upload Speed: ${upspeedf wlan0}${font}${alignr}Total: ${totalup wlan0}
${color 547EC8}${font PizzaDude Bullets:size=16}S${color}${font}${goto 32}${voffset -4}Download Speed: ${downspeedf wlan0}${font}${goto 32}${alignr}Total: ${totaldown wlan0}
${color 547EC8}${font Poky:size=16}w${color}${font}${goto 32}${voffset -20}Router IP: ${alignr}${gw_ip}
${goto 32}Local IP: ${alignr}${addr wlan0}
${goto 32}Public IP: ${alignr}${execi 300 wget -q -O - checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'}
${goto 32}Signal : ${alignr}${wireless_link_qual_perc wlan0}%
${color 547EC8}${font Poky:size=16}Q${color}${font}${goto 32}${voffset -9}Battery :${alignr}${battery_percent BAT0}%
${alignc}${battery_time BAT0}
--[[ BARGRAPH WIDGET
To call the script in a conky, use, before TEXT
lua_load /path/to/the/script/bargraph.lua
lua_draw_hook_pre main_rings
and add one line (blank or not) after TEXT
Parameters are :
3 parameters are mandatory
name - the name of the conky variable to display, for example for {$cpu cpu0}, just write name="cpu"
arg - the argument of the above variable, for example for {$cpu cpu0}, just write arg="cpu0"
arg can be a numerical value if name=""
max - the maximum value the above variable can reach, for example, for {$cpu cpu0}, just write max=100
Optional parameters:
x,y - coordinates of the starting point of the bar, default = middle of the conky window
cap - end of cap line, ossibles values are r,b,s (for round, butt, square), default="b"
http://www.cairographics.org/samples/set_line_cap/
angle - angle of rotation of the bar in degress, default = 0 (i.e. a vertical bar)
set to 90 for an horizontal bar
skew_x - skew bar around x axis, default = 0
skew_y - skew bar around y axis, default = 0
blocks - number of blocks to display for a bar (values >0) , default= 10
height - height of a block, default=10 pixels
width - width of a block, default=20 pixels
space - space between 2 blocks, default=2 pixels
angle_bar - this angle is used to draw a bar on a circular way (ok, this is no more a bar !) default=0
radius - for cicular bars, internal radius, default=0
with radius, parameter width has no more effect.
Colours below are defined into braces {colour in hexadecimal, alpha}
fg_colour - colour of a block ON, default= {0x00FF00,1}
bg_colour - colour of a block OFF, default = {0x00FF00,0.5}
alarm - threshold, values after this threshold will use alarm_colour colour , default=max
alarm_colour - colour of a block greater than alarm, default=fg_colour
smooth - (true or false), create a gradient from fg_colour to bg_colour, default=false
mid_colour - colours to add to gradient, with this syntax {position into the gradient (0 to1), colour hexa, alpha}
for example, this table {{0.25,0xff0000,1},{0.5,0x00ff00,1},{0.75,0x0000ff,1}} will add
3 colurs to gradient created by fg_colour and alarm_colour, default=no mid_colour
led_effect - add LED effects to each block, default=no led_effect
if smooth=true, led_effect is not used
possibles values : "r","a","e" for radial, parallelel, perdendicular to the bar (just try!)
led_effect has to be used with theses colours :
fg_led - middle colour of a block ON, default = fg_colour
bg_led - middle colour of a block OFF, default = bg_colour
alarm_led - middle colour of a block > ALARM, default = alarm_colour
reflection parameters, not avaimable for circular bars
reflection_alpha - add a reflection effect (values from 0 to 1) default = 0 = no reflection
other values = starting opacity
reflection_scale - scale of the reflection (default = 1 = height of text)
reflection_length - length of reflection, define where the opacity will be set to zero
calues from 0 to 1, default =1
reflection - position of reflection, relative to a vertical bar, default="b"
possibles values are : "b","t","l","r" for bottom, top, left, right
draw_me - if set to false, text is not drawn (default = true or 1)
it can be used with a conky string, if the string returns 1, the text is drawn :
example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",
]]
require 'cairo'
----------------START OF PARAMETERS ----------
function conky_main_bars()
local bars_settings={
{ --[ Graph for MOBO Temp ]--
name="hwmon 2 temp 2",
arg="hwmon 2 temp 2",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=35,
x=158, y=97,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU Socket Temp ]--
name="hwmon 1 temp 1",
arg="hwmon 1 temp 1",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=35,
x=158, y=118,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
--[[ { --[ Graph for Physical CPU Temp ]--
name="hwmon temp 3",
arg="hwmon temp 3",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=35,
x=158, y=133,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
]] { --[ Graph for CPU1 Left]--
name="cpu",
arg="cpu1",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=192, y=252,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU1 Right ]--
name="cpu",
arg="cpu1",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=190, y=245,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU2 Left]--
name="cpu",
arg="cpu2",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=192, y=273,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU2 Right]--
name="cpu",
arg="cpu2",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=190, y=266,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU3 Left ]--
name="cpu",
arg="cpu3",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=192, y=327,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU3 Right ]--
name="cpu",
arg="cpu3",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=190, y=320,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU4 Left ]--
name="cpu",
arg="cpu4",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=192, y=348,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU4 Right ]--
name="cpu",
arg="cpu4",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=190, y=341,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU5 Left ]--
name="cpu",
arg="cpu5",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=192, y=403,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU5 Right ]--
name="cpu",
arg="cpu5",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=190, y=396,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU6 Left ]--
name="cpu",
arg="cpu6",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=192, y=424,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU6 Right ]--
name="cpu",
arg="cpu6",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=190, y=417,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU7 Left ]--
name="cpu",
arg="cpu7",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=192, y=479,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU7 Right ]--
name="cpu",
arg="cpu7",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=190, y=472,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU8 Left ]--
name="cpu",
arg="cpu8",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=192, y=501,
height=3,width=7,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU8 Right ]--
name="cpu",
arg="cpu8",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=17,
x=190, y=494,
height=3,width=7,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for Memory ]--
name="memperc",
arg="",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
x=63,y=556,
blocks=89,
space=0,
height=2,width=12,
angle=90,
led_effect="e",
cap="r",
},
--[[ { --[ Graph for Root ]--
name="fs_used_perc",
arg="/",
max=100,
alarm=75,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=92,
x=65, y=500,
height=2,width=10,
angle=90,
led_effect="e",
space=0,
cap="r",
},
{ --[ Graph for Home ]--
name="fs_used_perc",
arg="/home",
max=100,
alarm=75,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=92,
x=65, y=557,
height=2,width=10,
angle=90,
led_effect="e",
space=0,
cap="r",
},
]] { --[ Graph for WiFi Signal strength ]--
name="wireless_link_qual_perc",
arg="wlan0",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=60,
x=86, y=796,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for Battery power ]--
name="battery_percent",
arg="BAT0",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=60,
x=86, y=827,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
}
-----------END OF PARAMETERS--------------
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
--prevent segmentation error when reading cpu state
if tonumber(conky_parse('${updates}'))>3 then
for i in pairs(bars_settings) do
draw_multi_bar_graph(bars_settings[i])
end
end
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end
function draw_multi_bar_graph(t)
cairo_save(cr)
--check values
if t.draw_me == true then t.draw_me = nil end
if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end
if t.name==nil and t.arg==nil then
print ("No input values ... use parameters 'name' with 'arg' or only parameter 'arg' ")
return
end
if t.max==nil then
print ("No maximum value defined, use 'max'")
return
end
if t.name==nil then t.name="" end
if t.arg==nil then t.arg="" end
--set default values
if t.x == nil then t.x = conky_window.width/2 end
if t.y == nil then t.y = conky_window.height/2 end
if t.blocks == nil then t.blocks=10 end
if t.height == nil then t.height=10 end
if t.angle == nil then t.angle=0 end
t.angle = t.angle*math.pi/180
--line cap style
if t.cap==nil then t.cap = "b" end
local cap="b"
for i,v in ipairs({"s","r","b"}) do
if v==t.cap then cap=v end
end
local delta=0
if t.cap=="r" or t.cap=="s" then delta = t.height end
if cap=="s" then cap = CAIRO_LINE_CAP_SQUARE
elseif cap=="r" then
cap = CAIRO_LINE_CAP_ROUND
elseif cap=="b" then
cap = CAIRO_LINE_CAP_BUTT
end
--end line cap style
--if t.led_effect == nil then t.led_effect="r" end
if t.width == nil then t.width=20 end
if t.space == nil then t.space=2 end
if t.radius == nil then t.radius=0 end
if t.angle_bar == nil then t.angle_bar=0 end
t.angle_bar = t.angle_bar*math.pi/360 --halt angle
--colours
if t.bg_colour == nil then t.bg_colour = {0x00FF00,0.5} end
if #t.bg_colour~=2 then t.bg_colour = {0x00FF00,0.5} end
if t.fg_colour == nil then t.fg_colour = {0x00FF00,1} end
if #t.fg_colour~=2 then t.fg_colour = {0x00FF00,1} end
if t.alarm_colour == nil then t.alarm_colour = t.fg_colour end
if #t.alarm_colour~=2 then t.alarm_colour = t.fg_colour end
if t.mid_colour ~= nil then
for i=1, #t.mid_colour do
if #t.mid_colour[i]~=3 then
print ("error in mid_color table")
t.mid_colour[i]={1,0xFFFFFF,1}
end
end
end
if t.bg_led ~= nil and #t.bg_led~=2 then t.bg_led = t.bg_colour end
if t.fg_led ~= nil and #t.fg_led~=2 then t.fg_led = t.fg_colour end
if t.alarm_led~= nil and #t.alarm_led~=2 then t.alarm_led = t.fg_led end
if t.led_effect~=nil then
if t.bg_led == nil then t.bg_led = t.bg_colour end
if t.fg_led == nil then t.fg_led = t.fg_colour end
if t.alarm_led == nil then t.alarm_led = t.fg_led end
end
if t.alarm==nil then t.alarm = t.max end --0.8*t.max end
if t.smooth == nil then t.smooth = false end
if t.skew_x == nil then
t.skew_x=0
else
t.skew_x = math.pi*t.skew_x/180
end
if t.skew_y == nil then
t.skew_y=0
else
t.skew_y = math.pi*t.skew_y/180
end
if t.reflection_alpha==nil then t.reflection_alpha=0 end
if t.reflection_length==nil then t.reflection_length=1 end
if t.reflection_scale==nil then t.reflection_scale=1 end
--end of default values
local function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
--functions used to create patterns
local function create_smooth_linear_gradient(x0,y0,x1,y1)
local pat = cairo_pattern_create_linear (x0,y0,x1,y1)
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
if t.mid_colour ~=nil then
for i=1, #t.mid_colour do
cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
end
end
return pat
end
local function create_smooth_radial_gradient(x0,y0,r0,x1,y1,r1)
local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
if t.mid_colour ~=nil then
for i=1, #t.mid_colour do
cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
end
end
return pat
end
local function create_led_linear_gradient(x0,y0,x1,y1,col_alp,col_led)
local pat = cairo_pattern_create_linear (x0,y0,x1,y1) ---delta, 0,delta+ t.width,0)
cairo_pattern_add_color_stop_rgba (pat, 0.0, rgb_to_r_g_b(col_alp))
cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
cairo_pattern_add_color_stop_rgba (pat, 1.0, rgb_to_r_g_b(col_alp))
return pat
end
local function create_led_radial_gradient(x0,y0,r0,x1,y1,r1,col_alp,col_led,mode)
local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
if mode==3 then
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_alp))
cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))
else
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_led))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))
end
return pat
end
local function draw_single_bar()
--this fucntion is used for bars with a single block (blocks=1) but
--the drawing is cut in 3 blocks : value/alarm/background
--not zvzimzblr for circular bar
local function create_pattern(col_alp,col_led,bg)
local pat
if not t.smooth then
if t.led_effect=="e" then
pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
elseif t.led_effect=="a" then
pat = create_led_linear_gradient (t.width/2, 0,t.width/2,-t.height,col_alp,col_led)
elseif t.led_effect=="r" then
pat = create_led_radial_gradient (t.width/2, -t.height/2, 0, t.width/2,-t.height/2,t.height/1.5,col_alp,col_led,2)
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(col_alp))
end
else
if bg then
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(t.bg_colour))
else
pat = create_smooth_linear_gradient(t.width/2, 0, t.width/2,-t.height)
end
end
return pat
end
local y1=-t.height*pct/100
local y2,y3
if pct>(100*t.alarm/t.max) then
y1 = -t.height*t.alarm/100
y2 = -t.height*pct/100
if t.smooth then y1=y2 end
end
if t.angle_bar==0 then
--block for fg value
local pat = create_pattern(t.fg_colour,t.fg_led,false)
cairo_set_source(cr,pat)
cairo_rectangle(cr,0,0,t.width,y1)
cairo_fill(cr)
cairo_pattern_destroy(pat)
-- block for alarm value
if not t.smooth and y2 ~=nil then
pat = create_pattern(t.alarm_colour,t.alarm_led,false)
cairo_set_source(cr,pat)
cairo_rectangle(cr,0,y1,t.width,y2-y1)
cairo_fill(cr)
y3=y2
cairo_pattern_destroy(pat)
else
y2,y3=y1,y1
end
-- block for bg value
cairo_rectangle(cr,0,y2,t.width,-t.height-y3)
pat = create_pattern(t.bg_colour,t.bg_led,true)
cairo_set_source(cr,pat)
cairo_pattern_destroy(pat)
cairo_fill(cr)
end
end --end single bar
local function draw_multi_bar()
--function used for bars with 2 or more blocks
for pt = 1,t.blocks do
--set block y
local y1 = -(pt-1)*(t.height+t.space)
local light_on=false
--set colors
local col_alp = t.bg_colour
local col_led = t.bg_led
if pct>=(100/t.blocks) or pct>0 then --ligth on or not the block
if pct>=(pcb*(pt-1)) then
light_on = true
col_alp = t.fg_colour
col_led = t.fg_led
if pct>=(100*t.alarm/t.max) and (pcb*pt)>(100*t.alarm/t.max) then
col_alp = t.alarm_colour
col_led = t.alarm_led
end
end
end
--set colors
--have to try to create gradients outside the loop ?
local pat
if not t.smooth then
if t.angle_bar==0 then
if t.led_effect=="e" then
pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
elseif t.led_effect=="a" then
pat = create_led_linear_gradient (t.width/2, -t.height/2+y1,t.width/2,0+t.height/2+y1,col_alp,col_led)
elseif t.led_effect=="r" then
pat = create_led_radial_gradient (t.width/2, y1, 0, t.width/2,y1,t.width/1.5,col_alp,col_led,2)
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(col_alp))
end
else
if t.led_effect=="a" then
pat = create_led_radial_gradient (0, 0, t.radius+(t.height+t.space)*(pt-1),
0, 0, t.radius+(t.height+t.space)*(pt),
col_alp,col_led,3)
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(col_alp))
end
end
else
if light_on then
if t.angle_bar==0 then
pat = create_smooth_linear_gradient(t.width/2, t.height/2, t.width/2,-(t.blocks-0.5)*(t.height+t.space))
else
pat = create_smooth_radial_gradient(0, 0, (t.height+t.space), 0,0,(t.blocks+1)*(t.height+t.space),2)
end
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(t.bg_colour))
end
end
cairo_set_source (cr, pat)
cairo_pattern_destroy(pat)
--draw a block
if t.angle_bar==0 then
cairo_move_to(cr,0,y1)
cairo_line_to(cr,t.width,y1)
else
cairo_arc( cr,0,0,
t.radius+(t.height+t.space)*(pt)-t.height/2,
-t.angle_bar -math.pi/2 ,
t.angle_bar -math.pi/2)
end
cairo_stroke(cr)
end
end
local function setup_bar_graph()
--function used to retrieve the value to display and to set the cairo structure
if t.blocks ~=1 then t.y=t.y-t.height/2 end
local value = 0
if t.name ~="" then
value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
--$to_bytes doesn't work when value has a decimal point,
--https://garage.maemo.org/plugins/ggit/browse.php/?p=monky;a=commitdiff;h=174c256c81a027a2ea406f5f37dc036fac0a524b;hp=d75e2db5ed3fc788fb8514121f67316ac3e5f29f
--http://sourceforge.net/tracker/index.php?func=detail&aid=3000865&group_id=143975&atid=757310
--conky bug?
--value = (conky_parse(string.format('${%s %s}', t.name, t.arg)))
--if string.match(value,"%w") then
-- value = conky_parse(string.format('${to_bytes %s}',value))
--end
else
value = tonumber(t.arg)
end
if value==nil then value =0 end
pct = 100*value/t.max
pcb = 100/t.blocks
cairo_set_line_width (cr, t.height)
cairo_set_line_cap (cr, cap)
cairo_translate(cr,t.x,t.y)
cairo_rotate(cr,t.angle)
local matrix0 = cairo_matrix_t:create()
tolua.takeownership(matrix0)
cairo_matrix_init (matrix0, 1,t.skew_y,t.skew_x,1,0,0)
cairo_transform(cr,matrix0)
--call the drawing function for blocks
if t.blocks==1 and t.angle_bar==0 then
draw_single_bar()
if t.reflection=="t" or t.reflection=="b" then cairo_translate(cr,0,-t.height) end
else
draw_multi_bar()
end
--dot for reminder
--[[
if t.blocks ~=1 then
cairo_set_source_rgba(cr,1,0,0,1)
cairo_arc(cr,0,t.height/2,3,0,2*math.pi)
cairo_fill(cr)
else
cairo_set_source_rgba(cr,1,0,0,1)
cairo_arc(cr,0,0,3,0,2*math.pi)
cairo_fill(cr)
end]]
--call the drawing function for reflection and prepare the mask used
if t.reflection_alpha>0 and t.angle_bar==0 then
local pat2
local matrix1 = cairo_matrix_t:create()
tolua.takeownership(matrix1)
if t.angle_bar==0 then
pts={-delta/2,(t.height+t.space)/2,t.width+delta,-(t.height+t.space)*(t.blocks)}
if t.reflection=="t" then
cairo_matrix_init (matrix1,1,0,0,-t.reflection_scale,0,-(t.height+t.space)*(t.blocks-0.5)*2*(t.reflection_scale+1)/2)
pat2 = cairo_pattern_create_linear (t.width/2,-(t.height+t.space)*(t.blocks),t.width/2,(t.height+t.space)/2)
elseif t.reflection=="r" then
cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,delta+2*t.width,0)
pat2 = cairo_pattern_create_linear (delta/2+t.width,0,-delta/2,0)
elseif t.reflection=="l" then
cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,-delta,0)
pat2 = cairo_pattern_create_linear (-delta/2,0,delta/2+t.width,-0)
else --bottom
cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(t.height+t.space)*(t.reflection_scale+1)/2)
pat2 = cairo_pattern_create_linear (t.width/2,(t.height+t.space)/2,t.width/2,-(t.height+t.space)*(t.blocks))
end
end
cairo_transform(cr,matrix1)
if t.blocks==1 and t.angle_bar==0 then
draw_single_bar()
cairo_translate(cr,0,-t.height/2)
else
draw_multi_bar()
end
cairo_set_line_width(cr,0.01)
cairo_pattern_add_color_stop_rgba (pat2, 0,0,0,0,1-t.reflection_alpha)
cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)
if t.angle_bar==0 then
cairo_rectangle(cr,pts[1],pts[2],pts[3],pts[4])
end
cairo_clip_preserve(cr)
cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
cairo_stroke(cr)
cairo_mask(cr,pat2)
cairo_pattern_destroy(pat2)
cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
end --reflection
pct,pcb=nil
end --setup_bar_graph()
--start here !
setup_bar_graph()
cairo_restore(cr)
end
##################################################
# killall conky && conky -c /home/jed/Conky/sysledconkyrc &
##################################################
background yes
update_interval 1
double_buffer yes
no_buffers yes
imlib_cache_size 0
override_utf8_locale yes
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
own_window_class conky
own_window_title horizleds
border_inner_margin 0
border_outer_margin 0
minimum_size 1920 55
alignment tl
gap_x 5
gap_y 5
default_color 4B60B4
text_buffer_size 512
use_xft yes
xftfont monofur:bold:size=11
xftalpha 1
cpu_avg_samples 2
net_avg_samples 1
lua_load /home/jed/Conky/LUA/leds.lua
lua_draw_hook_post main_bars
TEXT
${goto 15}MOBO Temp ${color ff6100}${hwmon 2 temp 2}°C${color 4B60B4}${goto 135}|${goto 160}CPU Socket Temp ${color ff6100}${hwmon 1 temp 1}°C${voffset -15}${color 4B60B4} ${goto 1050}Kernel: ${kernel} ${goto 1420}Up:${color ff6100} ${uptime}${color 4B60B4}${goto 1630}${scroll 40 1${execi 2600 cat /etc/issue.net}-VSIDO}${goto 365}${color 4B60B4}${voffset 15}Avg CPU Use: ${color 3DBA2F}${cpu cpu0}% ${color 4B60B4}${goto 483}|${goto 500}${color 4B60B4}RAM Use:${color 3DBA2F}${mem} / ${memmax}${color 4B60B4}${goto 735}Bat:${color 3DBA2F}${battery_percent BAT0}% ${color ff6100}${battery_time BAT0}${color 4B60B4}${goto 875}|${goto 900}WiFi Signal: ${color 3DBA2F}${wireless_link_qual_perc wlan0}%
--[[ BARGRAPH WIDGET
v1.3 by wlourf (03 march 2010)
This widget draw a simple bar like (old) equalizers on hi-fi systems.
http://u-scripts.blogspot.com/
Tweaked by McLovin, then borked by jedi
The arguments are :
- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'...
or you can set it to "" if you want to display a numeric value with arg=numeric_value
- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument.
If you would not use an argument in the Conky variable, use ''.
- "max" is the maximum value of the bar. If the Conky variable outputs a percentage, use 100.
- "nb_blocks" is the umber of block to draw
- "cap" id the cap of a block, possibles values are CAIRO_LINE_CAP_ROUND , CAIRO_LINE_CAP_SQUARE or CAIRO_LINE_CAP_BUTT
see http://www.cairographics.org/samples/set_line_cap/
- "xb" and "yb" are the coordinates of the bottom left point of the bar, or the center of the circle if radius>0
- "w" and "h" are the width and the height of a block (without caps), w has no effect for "circle" bar
- "space" is the space betwwen two blocks, can be null or negative
- "bgc" and "bga" are background colors and alpha when the block is not LIGHT OFF
- "fgc" and "fga" are foreground colors and alpha when the block is not LIGHT ON
- "alc" and "ala" are foreground colors and alpha when the block is not LIGHT ON and ALARM ON
- "alarm" is the value where blocks LIGHT ON are in a different color (values from 0 to 100)
- "led_effect" true or false : to show a block with a led effect
- "led_alpha" alpha of the center of the led (values from 0 to 1)
- "smooth" true or false : colors in the bar has a smooth effect
- "mid_color",mid_alpha" : colors of the center of the bar (mid_color can to be set to nil)
- "rotation" : angle of rotation of the bar (values are 0 to 360 degrees). 0 = vertical bar, 90 = horizontal bar
- "radius" : draw the bar on a circle (it's no more a circle, radius = 0 to keep bars)
- "angle_bar" : if radius>0 angle_bar is the angle of the bar
v1.0 (10 Feb. 2010) original release
v1.1 (13 Feb. 2010) numeric values can be passed instead conky stats with parameters name="", arg = numeric_value
v1.2 (28 Feb. 2010) just renamed the widget to bargraph
v1.3 (03 March 2010) added parameters radius & angle_bar to draw the bar in a circular way
]]
require 'cairo'
----------------START OF PARAMETERS ----------
function conky_main_bars()
local bars_settings={
{ --[ Graph for MOBO Temp ]--
name="hwmon 2 temp 2",
arg="hwmon 2 temp 2",
max=100,
alarm=40,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff6100,0},
alarm_led={0xff6100,1},
blocks=35,
x=10, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU Socket Temp ]--
name="hwmon 1 temp 1",
arg="hwmon 1 temp 1",
max=100,
alarm=40,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff6100,0},
alarm_led={0xff6100,1},
blocks=35,
x=175, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU Socket Temp ]--
name="cpu",
arg="cpu0",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=35,
x=366, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for Memory ]--
name="memperc",
arg="",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
x=510,y=20,
blocks=50,
space=1,
height=2,width=10,
angle=90,
led_effect="e",
cap="r",
},
--[[ { --[ Graph for Root ]--
name="fs_used_perc",
arg="/",
max=100,
alarm=75,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=35,
x=1260, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for Home ]--
name="fs_used_perc",
arg="/home",
max=100,
alarm=75,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=35,
x=610, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
]] { --[ Graph for WiFi Signal strength ]--
name="wireless_link_qual_perc",
arg="wlan0",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=40,
x=900, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for Battery power ]--
name="battery_percent",
arg="BAT0",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=35,
x=750, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
}
-----------END OF PARAMETERS--------------
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
--prevent segmentation error when reading cpu state
if tonumber(conky_parse('${updates}'))>3 then
for i in pairs(bars_settings) do
draw_multi_bar_graph(bars_settings[i])
end
end
cairo_destroy(cr)
cairo_surface_destroy(cs)
end
function draw_multi_bar_graph(t)
cairo_save(cr)
--check values
if t.name==nil and t.arg==nil then
print ("No input values ... use parameters 'name' with 'arg' or only parameter 'arg' ")
return
end
if t.max==nil then
print ("No maximum value defined, use 'max'")
return
end
if t.name==nil then t.name="" end
if t.arg==nil then t.arg="" end
--set default values
if t.x == nil then t.x = conky_window.width/2 end
if t.y == nil then t.y = conky_window.height/2 end
if t.blocks == nil then t.blocks=10 end
if t.height == nil then t.height=10 end
if t.angle == nil then t.angle=0 end
t.angle = t.angle*math.pi/180
--line cap style
if t.cap==nil then t.cap = "b" end
local cap="b"
for i,v in ipairs({"s","r","b"}) do
if v==t.cap then cap=v end
end
delta=0
if t.cap=="r" or t.cap=="s" then delta = t.height end
if cap=="s" then cap = CAIRO_LINE_CAP_SQUARE
elseif cap=="r" then
cap = CAIRO_LINE_CAP_ROUND
elseif cap=="b" then
cap = CAIRO_LINE_CAP_BUTT
end
--end line cap style
--if t.led_effect == nil then t.led_effect="r" end
if t.width == nil then t.width=20 end
if t.space == nil then t.space=2 end
if t.radius == nil then t.radius=0 end
if t.angle_bar == nil then t.angle_bar=0 end
t.angle_bar = t.angle_bar*math.pi/360 --halt angle
--colours
if t.bg_colour == nil then t.bg_colour = {0xffffff,0.5} end
if #t.bg_colour~=2 then t.bg_colour = {0xffffff,0.5} end
if t.fg_colour == nil then t.fg_colour = {0xffffff,1} end
if #t.fg_colour~=2 then t.fg_colour = {0xffffff,1} end
if t.alarm_colour == nil then t.alarm_colour = t.fg_colour end
if #t.alarm_colour~=2 then t.alarm_colour = t.fg_colour end
if t.mid_colour ~= nil then
for i=1, #t.mid_colour do
if #t.mid_colour[i]~=3 then
print ("error in mid_color table")
t.mid_colour[i]={1,0xFFFFFF,1}
end
end
end
if t.bg_led ~= nil and #t.bg_led~=2 then t.bg_led = t.bg_colour end
if t.fg_led ~= nil and #t.fg_led~=2 then t.fg_led = t.fg_colour end
if t.alarm_led~= nil and #t.alarm_led~=2 then t.alarm_led = t.fg_led end
if t.led_effect~=nil then
if t.bg_led == nil then t.bg_led = t.bg_colour end
if t.fg_led == nil then t.fg_led = t.fg_colour end
if t.alarm_led == nil then t.alarm_led = t.fg_led end
end
if t.alarm==nil then t.alarm = t.max end --0.8*t.max end
if t.smooth == nil then t.smooth = false end
if t.skew_x == nil then
t.skew_x=0
else
t.skew_x = math.pi*t.skew_x/180
end
if t.skew_y == nil then
t.skew_y=0
else
t.skew_y = math.pi*t.skew_y/180
end
if t.reflection_alpha==nil then t.reflection_alpha=0 end
if t.reflection_length==nil then t.reflection_length=1 end
if t.reflection_scale==nil then t.reflection_scale=1 end
--end of default values
local function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
--functions used to create patterns
local function create_smooth_linear_gradient(x0,y0,x1,y1)
local pat = cairo_pattern_create_linear (x0,y0,x1,y1)
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
if t.mid_colour ~=nil then
for i=1, #t.mid_colour do
cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
end
end
return pat
end
local function create_smooth_radial_gradient(x0,y0,r0,x1,y1,r1)
local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
if t.mid_colour ~=nil then
for i=1, #t.mid_colour do
cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
end
end
return pat
end
local function create_led_linear_gradient(x0,y0,x1,y1,col_alp,col_led)
local pat = cairo_pattern_create_linear (x0,y0,x1,y1) ---delta, 0,delta+ t.width,0)
cairo_pattern_add_color_stop_rgba (pat, 0.0, rgb_to_r_g_b(col_alp))
cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
cairo_pattern_add_color_stop_rgba (pat, 1.0, rgb_to_r_g_b(col_alp))
return pat
end
local function create_led_radial_gradient(x0,y0,r0,x1,y1,r1,col_alp,col_led,mode)
local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
if mode==3 then
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_alp))
cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))
else
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_led))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))
end
return pat
end
local function draw_single_bar()
--this fucntion is used for bars with a single block (blocks=1) but
--the drawing is cut in 3 blocks : value/alarm/background
--not zvzimzblr for circular bar
local function create_pattern(col_alp,col_led,bg)
local pat
if not t.smooth then
if t.led_effect=="e" then
pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
elseif t.led_effect=="a" then
pat = create_led_linear_gradient (t.width/2, 0,t.width/2,-t.height,col_alp,col_led)
elseif t.led_effect=="r" then
pat = create_led_radial_gradient (t.width/2, -t.height/2, 0, t.width/2,-t.height/2,t.height/1.5,col_alp,col_led,2)
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(col_alp))
end
else
if bg then
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(t.bg_colour))
else
pat = create_smooth_linear_gradient(t.width/2, 0, t.width/2,-t.height)
end
end
return pat
end
local y1=-t.height*pct/100
local y2=nil
if pct>(100*t.alarm/t.max) then
y1 = -t.height*t.alarm/100
y2 = -t.height*pct/100
if t.smooth then y1=y2 end
end
if t.angle_bar==0 then
--block for fg value
pat = create_pattern(t.fg_colour,t.fg_led,false)
cairo_set_source(cr,pat)
cairo_rectangle(cr,0,0,t.width,y1)
cairo_fill(cr)
-- block for alarm value
if not t.smooth and y2 ~=nil then
pat = create_pattern(t.alarm_colour,t.alarm_led,false)
cairo_set_source(cr,pat)
cairo_rectangle(cr,0,y1,t.width,y2-y1)
cairo_fill(cr)
y3=y2
else
y2,y3=y1,y1
end
-- block for bg value
cairo_rectangle(cr,0,y2,t.width,-t.height-y3)
pat = create_pattern(t.bg_colour,t.bg_led,true)
cairo_set_source(cr,pat)
cairo_pattern_destroy(pat)
cairo_fill(cr)
end
end --end single bar
local function draw_multi_bar()
--function used for bars with 2 or more blocks
for pt = 1,t.blocks do
--set block y
local y1 = -(pt-1)*(t.height+t.space)
local light_on=false
--set colors
local col_alp = t.bg_colour
local col_led = t.bg_led
if pct>=(100/t.blocks) or pct>0 then --ligth on or not the block
if pct>=(pcb*(pt-1)) then
light_on = true
col_alp = t.fg_colour
col_led = t.fg_led
if pct>=(100*t.alarm/t.max) and (pcb*pt)>(100*t.alarm/t.max) then
col_alp = t.alarm_colour
col_led = t.alarm_led
end
end
end
--set colors
--have to try to create gradients outside the loop ?
local pat
if not t.smooth then
if t.angle_bar==0 then
if t.led_effect=="e" then
pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
elseif t.led_effect=="a" then
pat = create_led_linear_gradient (t.width/2, -t.height/2+y1,t.width/2,0+t.height/2+y1,col_alp,col_led)
elseif t.led_effect=="r" then
pat = create_led_radial_gradient (t.width/2, y1, 0, t.width/2,y1,t.width/1.5,col_alp,col_led,2)
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(col_alp))
end
else
if t.led_effect=="a" then
pat = create_led_radial_gradient (0, 0, t.radius+(t.height+t.space)*(pt-1),
0, 0, t.radius+(t.height+t.space)*(pt),
col_alp,col_led,3)
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(col_alp))
end
end
else
if light_on then
if t.angle_bar==0 then
pat = create_smooth_linear_gradient(t.width/2, t.height/2, t.width/2,-(t.blocks-0.5)*(t.height+t.space))
else
pat = create_smooth_radial_gradient(0, 0, (t.height+t.space), 0,0,(t.blocks+1)*(t.height+t.space),2)
end
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(t.bg_colour))
end
end
cairo_set_source (cr, pat)
cairo_pattern_destroy(pat)
--draw a block
if t.angle_bar==0 then
cairo_move_to(cr,0,y1)
cairo_line_to(cr,t.width,y1)
else
cairo_arc( cr,0,0,
t.radius+(t.height+t.space)*(pt)-t.height/2,
-t.angle_bar -math.pi/2 ,
t.angle_bar -math.pi/2)
end
cairo_stroke(cr)
end
end
local function setup_bar_graph()
--function used to retrieve the value to display and to set the cairo structure
if t.blocks ~=1 then t.y=t.y-t.height/2 end
local value = 0
if t.name ~="" then
value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
else
value = tonumber(t.arg)
end
if value==nil then value =0 end
pct = 100*value/t.max
pcb = 100/t.blocks
cairo_set_line_width (cr, t.height)
cairo_set_line_cap (cr, cap)
cairo_translate(cr,t.x,t.y)
cairo_rotate(cr,t.angle)
local matrix0 = cairo_matrix_t:create()
cairo_matrix_init (matrix0, 1,t.skew_y,t.skew_x,1,0,0)
cairo_transform(cr,matrix0)
--call the drawing function for blocks
if t.blocks==1 and t.angle_bar==0 then
draw_single_bar()
if t.reflection=="t" or t.reflection=="b" then cairo_translate(cr,0,-t.height) end
else
draw_multi_bar()
end
--dot for reminder
--[[
if t.blocks ~=1 then
cairo_set_source_rgba(cr,1,0,0,1)
cairo_arc(cr,0,t.height/2,3,0,2*math.pi)
cairo_fill(cr)
else
cairo_set_source_rgba(cr,1,0,0,1)
cairo_arc(cr,0,0,3,0,2*math.pi)
cairo_fill(cr)
end
]]
--call the drawing function for reflection and prepare the mask used
if t.reflection_alpha>0 and t.angle_bar==0 then
local pat2
local matrix1 = cairo_matrix_t:create()
if t.angle_bar==0 then
pts={-delta/2,(t.height+t.space)/2,t.width+delta,-(t.height+t.space)*(t.blocks)}
if t.reflection=="t" then
cairo_matrix_init (matrix1,1,0,0,-t.reflection_scale,0,-(t.height+t.space)*(t.blocks-0.5)*2*(t.reflection_scale+1)/2)
pat2 = cairo_pattern_create_linear (t.width/2,-(t.height+t.space)*(t.blocks),t.width/2,(t.height+t.space)/2)
elseif t.reflection=="r" then
cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,delta+2*t.width,0)
pat2 = cairo_pattern_create_linear (delta/2+t.width,0,-delta/2,0)
elseif t.reflection=="l" then
cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,-delta,0)
pat2 = cairo_pattern_create_linear (-delta/2,0,delta/2+t.width,-0)
else --bottom
cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(t.height+t.space)*(t.reflection_scale+1)/2)
pat2 = cairo_pattern_create_linear (t.width/2,(t.height+t.space)/2,t.width/2,-(t.height+t.space)*(t.blocks))
end
end
cairo_transform(cr,matrix1)
if t.blocks==1 and t.angle_bar==0 then
draw_single_bar()
cairo_translate(cr,0,-t.height/2)
else
draw_multi_bar()
end
cairo_set_line_width(cr,0.01)
cairo_pattern_add_color_stop_rgba (pat2, 0,0,0,0,1-t.reflection_alpha)
cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)
if t.angle_bar==0 then
cairo_rectangle(cr,pts[1],pts[2],pts[3],pts[4])
end
cairo_clip_preserve(cr)
cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
cairo_stroke(cr)
cairo_mask(cr,pat2)
cairo_pattern_destroy(pat2)
cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
end --reflection
end --setup_bar_graph()
--start here !
setup_bar_graph()
cairo_restore(cr)
end
Quoteminimum_size 1920 55DUH!!!
##################################################
# killall conky && conky -c /home/jed/Conky/sysledconkyrc &
# killall conky && conky -c ~/jed/Conky/sysledconkyrc &
##################################################
background yes
update_interval 0.5
double_buffer yes
no_buffers yes
imlib_cache_size 0
override_utf8_locale yes
own_window yes
own_window_type normal
own_window_transparent yes
## own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below ## Jed's Line
own_window_hints undecorate,skip_taskbar,skip_pager,below
own_window_class conky
own_window_title horizleds
border_inner_margin 0
border_outer_margin 0
minimum_size 1910 55 # testing with 500
## minimum_size 1910 55 ## Jed had 1920 but the 'gap_x 5' pushed it 5 pixels off the screen
maximum_width 1910
alignment tl
gap_x 30
gap_y -5
default_color 4B60B4
text_buffer_size 512
use_xft yes
xftfont monofur:bold:size=11
xftalpha 1
cpu_avg_samples 2
net_avg_samples 1
lua_load ~/jed/Conky/LUA/leds.lua
lua_draw_hook_post main_bars
#${goto 15}MOBO Temp ${color ff6100}${hwmon 2 temp 2}°C${color 4B60B4}${goto 135}|${goto 160}CPU Socket Temp ${color ff6100}${hwmon 1 temp 1}°C${voffset -15}${color 4B60B4} ${goto 1050}Kernel: ${kernel} ${goto 1420}Up:${color ff6100} ${uptime}${color 4B60B4}${goto 1630}${scroll 40 1${execi 2600 cat /etc/issue.net}-VSIDO}
#${goto 365}${color 4B60B4}Avg CPU Use: ${color 3DBA2F}${cpu cpu0}% ${color 4B60B4}${goto 483}|${goto 500}${color 4B60B4}RAM Use:${color 3DBA2F}${mem} / ${memmax}${color 4B60B4}${goto 735}Bat:${color 3DBA2F}${battery_percent BAT0}% ${color ff6100}${battery_time BAT0}${color 4B60B4}${goto 875}|${goto 900}WiFi Signal: ${color 3DBA2F}${wireless_link_qual_perc wlan0}%
lua_load /media/5/Conky/LUA/draw-bg.lua
TEXT
${lua conky_draw_bg 10 0 0 0 0 0xffffff 0.2}
${goto 165}|${goto 350}|${goto 525}|${goto 750}|${goto 920}${color 3DBA2F}${memperc}${goto 936}%${color} |${goto 1040}${time %T}${goto 1190}|${goto 1265}${scroll 23 1${time %A %e %b %Y} }${goto 1500}|${goto 1680}|
${goto 15}MOBO Temp ${color ff6100}${hwmon 2 temp 2}°C${color}\
${goto 165}| CPU Socket Temp ${color ff6100}${hwmon 1 temp 1}°C${color}\
${goto 350}| Avg CPU Use: ${color 3DBA2F}${cpu cpu0}%${color}\
${goto 525}| ${kernel}${goto 750}\
${goto 750}| RAM Use: ${color 3DBA2F}${mem} / ${memmax}${color}\
${goto 950}| Up:${color ff6100} ${uptime}${color}${goto 1190}|\
${goto 1210}${scroll 40 1${execi 86400 cat /etc/issue.net}-VSIDO}\
${goto 1500}| Bat: ${color 3DBA2F}85%${goto 1610}${color ff6100}16:44:52${color}\
${goto 1680}| WiFi Signal: ${color 3DBA2F}100%${color}
--[[ BARGRAPH WIDGET
v1.3 by wlourf (03 march 2010)
This widget draw a simple bar like (old) equalizers on hi-fi systems.
http://u-scripts.blogspot.com/
Tweaked by McLovin, then borked by jedi
The arguments are :
- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'...
or you can set it to "" if you want to display a numeric value with arg=numeric_value
- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument.
If you would not use an argument in the Conky variable, use ''.
- "max" is the maximum value of the bar. If the Conky variable outputs a percentage, use 100.
- "nb_blocks" is the umber of block to draw
- "cap" id the cap of a block, possibles values are CAIRO_LINE_CAP_ROUND , CAIRO_LINE_CAP_SQUARE or CAIRO_LINE_CAP_BUTT
see http://www.cairographics.org/samples/set_line_cap/
- "xb" and "yb" are the coordinates of the bottom left point of the bar, or the center of the circle if radius>0
- "w" and "h" are the width and the height of a block (without caps), w has no effect for "circle" bar
- "space" is the space betwwen two blocks, can be null or negative
- "bgc" and "bga" are background colors and alpha when the block is not LIGHT OFF
- "fgc" and "fga" are foreground colors and alpha when the block is not LIGHT ON
- "alc" and "ala" are foreground colors and alpha when the block is not LIGHT ON and ALARM ON
- "alarm" is the value where blocks LIGHT ON are in a different color (values from 0 to 100)
- "led_effect" true or false : to show a block with a led effect
- "led_alpha" alpha of the center of the led (values from 0 to 1)
- "smooth" true or false : colors in the bar has a smooth effect
- "mid_color",mid_alpha" : colors of the center of the bar (mid_color can to be set to nil)
- "rotation" : angle of rotation of the bar (values are 0 to 360 degrees). 0 = vertical bar, 90 = horizontal bar
- "radius" : draw the bar on a circle (it's no more a circle, radius = 0 to keep bars)
- "angle_bar" : if radius>0 angle_bar is the angle of the bar
v1.0 (10 Feb. 2010) original release
v1.1 (13 Feb. 2010) numeric values can be passed instead conky stats with parameters name="", arg = numeric_value
v1.2 (28 Feb. 2010) just renamed the widget to bargraph
v1.3 (03 March 2010) added parameters radius & angle_bar to draw the bar in a circular way
]]
require 'cairo'
----------------START OF PARAMETERS ----------
function conky_main_bars()
local bars_settings={
{ -- Graph for MOBO Temp
name="hwmon 2 temp 2",
arg="hwmon 2 temp 2",
max=100,
alarm=40,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff6100,0},
alarm_led={0xff6100,1},
blocks=50, --35
x=10, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ -- Graph for CPU Socket Temp
name="hwmon 1 temp 1",
arg="hwmon 1 temp 1",
max=100,
alarm=40,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff6100,0},
alarm_led={0xff6100,1},
blocks=50, --35,
x=190, y=20, --x=175, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ -- Graph for CPU Socket Temp
name="cpu",
arg="cpu0",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=50, --35,
x=370, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ -- Graph for Memory
name="memperc",
arg="",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
x=765, y=20, --x=510,y=70,
blocks=50,
space=1,
height=2,width=10,
angle=90,
led_effect="e",
cap="r",
},
{ -- Graph for WiFi Signal strength
name="cpu",
arg="cpu1",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=50,
x=1520, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ -- Graph for WiFi Signal strength
name="cpu",
arg="cpu2",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=50,
x=1700, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
--[[ { -- Graph for Battery power
name="battery_percent",
arg="BAT0",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=50,
x=1520, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ -- Graph for WiFi Signal strength
name="wireless_link_qual_perc",
arg="wlan0",
max=100,
alarm=100,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=50,
x=1700, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
]]
--[[ { -- Graph for Root
name="fs_used_perc",
arg="/",
max=100,
alarm=75,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=35,
x=1260, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ -- Graph for Home
name="fs_used_perc",
arg="/home",
max=100,
alarm=75,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x48a3fd,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=35,
x=610, y=20,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
]]
}
-----------END OF PARAMETERS--------------
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
--prevent segmentation error when reading cpu state
if tonumber(conky_parse('${updates}'))>3 then
for i in pairs(bars_settings) do
draw_multi_bar_graph(bars_settings[i])
end
end
cairo_destroy(cr)
cairo_surface_destroy(cs)
end
function draw_multi_bar_graph(t)
cairo_save(cr)
--check values
if t.name==nil and t.arg==nil then
print ("No input values ... use parameters 'name' with 'arg' or only parameter 'arg' ")
return
end
if t.max==nil then
print ("No maximum value defined, use 'max'")
return
end
if t.name==nil then t.name="" end
if t.arg==nil then t.arg="" end
--set default values
if t.x == nil then t.x = conky_window.width/2 end
if t.y == nil then t.y = conky_window.height/2 end
if t.blocks == nil then t.blocks=10 end
if t.height == nil then t.height=10 end
if t.angle == nil then t.angle=0 end
t.angle = t.angle*math.pi/180
--line cap style
if t.cap==nil then t.cap = "b" end
local cap="b"
for i,v in ipairs({"s","r","b"}) do
if v==t.cap then cap=v end
end
delta=0
if t.cap=="r" or t.cap=="s" then delta = t.height end
if cap=="s" then cap = CAIRO_LINE_CAP_SQUARE
elseif cap=="r" then
cap = CAIRO_LINE_CAP_ROUND
elseif cap=="b" then
cap = CAIRO_LINE_CAP_BUTT
end
--end line cap style
--if t.led_effect == nil then t.led_effect="r" end
if t.width == nil then t.width=20 end
if t.space == nil then t.space=2 end
if t.radius == nil then t.radius=0 end
if t.angle_bar == nil then t.angle_bar=0 end
t.angle_bar = t.angle_bar*math.pi/360 --halt angle
--colours
if t.bg_colour == nil then t.bg_colour = {0xffffff,0.5} end
if #t.bg_colour~=2 then t.bg_colour = {0xffffff,0.5} end
if t.fg_colour == nil then t.fg_colour = {0xffffff,1} end
if #t.fg_colour~=2 then t.fg_colour = {0xffffff,1} end
if t.alarm_colour == nil then t.alarm_colour = t.fg_colour end
if #t.alarm_colour~=2 then t.alarm_colour = t.fg_colour end
if t.mid_colour ~= nil then
for i=1, #t.mid_colour do
if #t.mid_colour[i]~=3 then
print ("error in mid_color table")
t.mid_colour[i]={1,0xFFFFFF,1}
end
end
end
if t.bg_led ~= nil and #t.bg_led~=2 then t.bg_led = t.bg_colour end
if t.fg_led ~= nil and #t.fg_led~=2 then t.fg_led = t.fg_colour end
if t.alarm_led~= nil and #t.alarm_led~=2 then t.alarm_led = t.fg_led end
if t.led_effect~=nil then
if t.bg_led == nil then t.bg_led = t.bg_colour end
if t.fg_led == nil then t.fg_led = t.fg_colour end
if t.alarm_led == nil then t.alarm_led = t.fg_led end
end
if t.alarm==nil then t.alarm = t.max end --0.8*t.max end
if t.smooth == nil then t.smooth = false end
if t.skew_x == nil then
t.skew_x=0
else
t.skew_x = math.pi*t.skew_x/180
end
if t.skew_y == nil then
t.skew_y=0
else
t.skew_y = math.pi*t.skew_y/180
end
if t.reflection_alpha==nil then t.reflection_alpha=0 end
if t.reflection_length==nil then t.reflection_length=1 end
if t.reflection_scale==nil then t.reflection_scale=1 end
--end of default values
local function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
--functions used to create patterns
local function create_smooth_linear_gradient(x0,y0,x1,y1)
local pat = cairo_pattern_create_linear (x0,y0,x1,y1)
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
if t.mid_colour ~=nil then
for i=1, #t.mid_colour do
cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
end
end
return pat
end
local function create_smooth_radial_gradient(x0,y0,r0,x1,y1,r1)
local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
if t.mid_colour ~=nil then
for i=1, #t.mid_colour do
cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
end
end
return pat
end
local function create_led_linear_gradient(x0,y0,x1,y1,col_alp,col_led)
local pat = cairo_pattern_create_linear (x0,y0,x1,y1) ---delta, 0,delta+ t.width,0)
cairo_pattern_add_color_stop_rgba (pat, 0.0, rgb_to_r_g_b(col_alp))
cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
cairo_pattern_add_color_stop_rgba (pat, 1.0, rgb_to_r_g_b(col_alp))
return pat
end
local function create_led_radial_gradient(x0,y0,r0,x1,y1,r1,col_alp,col_led,mode)
local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
if mode==3 then
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_alp))
cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))
else
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_led))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))
end
return pat
end
local function draw_single_bar()
--this fucntion is used for bars with a single block (blocks=1) but
--the drawing is cut in 3 blocks : value/alarm/background
--not zvzimzblr for circular bar
local function create_pattern(col_alp,col_led,bg)
local pat
if not t.smooth then
if t.led_effect=="e" then
pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
elseif t.led_effect=="a" then
pat = create_led_linear_gradient (t.width/2, 0,t.width/2,-t.height,col_alp,col_led)
elseif t.led_effect=="r" then
pat = create_led_radial_gradient (t.width/2, -t.height/2, 0, t.width/2,-t.height/2,t.height/1.5,col_alp,col_led,2)
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(col_alp))
end
else
if bg then
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(t.bg_colour))
else
pat = create_smooth_linear_gradient(t.width/2, 0, t.width/2,-t.height)
end
end
return pat
end
local y1=-t.height*pct/100
local y2=nil
if pct>(100*t.alarm/t.max) then
y1 = -t.height*t.alarm/100
y2 = -t.height*pct/100
if t.smooth then y1=y2 end
end
if t.angle_bar==0 then
--block for fg value
pat = create_pattern(t.fg_colour,t.fg_led,false)
cairo_set_source(cr,pat)
cairo_rectangle(cr,0,0,t.width,y1)
cairo_fill(cr)
-- block for alarm value
if not t.smooth and y2 ~=nil then
pat = create_pattern(t.alarm_colour,t.alarm_led,false)
cairo_set_source(cr,pat)
cairo_rectangle(cr,0,y1,t.width,y2-y1)
cairo_fill(cr)
y3=y2
else
y2,y3=y1,y1
end
-- block for bg value
cairo_rectangle(cr,0,y2,t.width,-t.height-y3)
pat = create_pattern(t.bg_colour,t.bg_led,true)
cairo_set_source(cr,pat)
cairo_pattern_destroy(pat)
cairo_fill(cr)
end
end --end single bar
local function draw_multi_bar()
--function used for bars with 2 or more blocks
for pt = 1,t.blocks do
--set block y
local y1 = -(pt-1)*(t.height+t.space)
local light_on=false
--set colors
local col_alp = t.bg_colour
local col_led = t.bg_led
if pct>=(100/t.blocks) or pct>0 then --ligth on or not the block
if pct>=(pcb*(pt-1)) then
light_on = true
col_alp = t.fg_colour
col_led = t.fg_led
if pct>=(100*t.alarm/t.max) and (pcb*pt)>(100*t.alarm/t.max) then
col_alp = t.alarm_colour
col_led = t.alarm_led
end
end
end
--set colors
--have to try to create gradients outside the loop ?
local pat
if not t.smooth then
if t.angle_bar==0 then
if t.led_effect=="e" then
pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
elseif t.led_effect=="a" then
pat = create_led_linear_gradient (t.width/2, -t.height/2+y1,t.width/2,0+t.height/2+y1,col_alp,col_led)
elseif t.led_effect=="r" then
pat = create_led_radial_gradient (t.width/2, y1, 0, t.width/2,y1,t.width/1.5,col_alp,col_led,2)
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(col_alp))
end
else
if t.led_effect=="a" then
pat = create_led_radial_gradient (0, 0, t.radius+(t.height+t.space)*(pt-1),
0, 0, t.radius+(t.height+t.space)*(pt),
col_alp,col_led,3)
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(col_alp))
end
end
else
if light_on then
if t.angle_bar==0 then
pat = create_smooth_linear_gradient(t.width/2, t.height/2, t.width/2,-(t.blocks-0.5)*(t.height+t.space))
else
pat = create_smooth_radial_gradient(0, 0, (t.height+t.space), 0,0,(t.blocks+1)*(t.height+t.space),2)
end
else
pat = cairo_pattern_create_rgba (rgb_to_r_g_b(t.bg_colour))
end
end
cairo_set_source (cr, pat)
cairo_pattern_destroy(pat)
--draw a block
if t.angle_bar==0 then
cairo_move_to(cr,0,y1)
cairo_line_to(cr,t.width,y1)
else
cairo_arc( cr,0,0,
t.radius+(t.height+t.space)*(pt)-t.height/2,
-t.angle_bar -math.pi/2 ,
t.angle_bar -math.pi/2)
end
cairo_stroke(cr)
end
end
local function setup_bar_graph()
--function used to retrieve the value to display and to set the cairo structure
if t.blocks ~=1 then t.y=t.y-t.height/2 end
local value = 0
if t.name ~="" then
value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
else
value = tonumber(t.arg)
end
if value==nil then value =0 end
pct = 100*value/t.max
pcb = 100/t.blocks
cairo_set_line_width (cr, t.height)
cairo_set_line_cap (cr, cap)
cairo_translate(cr,t.x,t.y)
cairo_rotate(cr,t.angle)
local matrix0 = cairo_matrix_t:create()
cairo_matrix_init (matrix0, 1,t.skew_y,t.skew_x,1,0,0)
cairo_transform(cr,matrix0)
--call the drawing function for blocks
if t.blocks==1 and t.angle_bar==0 then
draw_single_bar()
if t.reflection=="t" or t.reflection=="b" then cairo_translate(cr,0,-t.height) end
else
draw_multi_bar()
end
--dot for reminder
--[[
if t.blocks ~=1 then
cairo_set_source_rgba(cr,1,0,0,1)
cairo_arc(cr,0,t.height/2,3,0,2*math.pi)
cairo_fill(cr)
else
cairo_set_source_rgba(cr,1,0,0,1)
cairo_arc(cr,0,0,3,0,2*math.pi)
cairo_fill(cr)
end
]]
--call the drawing function for reflection and prepare the mask used
if t.reflection_alpha>0 and t.angle_bar==0 then
local pat2
local matrix1 = cairo_matrix_t:create()
if t.angle_bar==0 then
pts={-delta/2,(t.height+t.space)/2,t.width+delta,-(t.height+t.space)*(t.blocks)}
if t.reflection=="t" then
cairo_matrix_init (matrix1,1,0,0,-t.reflection_scale,0,-(t.height+t.space)*(t.blocks-0.5)*2*(t.reflection_scale+1)/2)
pat2 = cairo_pattern_create_linear (t.width/2,-(t.height+t.space)*(t.blocks),t.width/2,(t.height+t.space)/2)
elseif t.reflection=="r" then
cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,delta+2*t.width,0)
pat2 = cairo_pattern_create_linear (delta/2+t.width,0,-delta/2,0)
elseif t.reflection=="l" then
cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,-delta,0)
pat2 = cairo_pattern_create_linear (-delta/2,0,delta/2+t.width,-0)
else --bottom
cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(t.height+t.space)*(t.reflection_scale+1)/2)
pat2 = cairo_pattern_create_linear (t.width/2,(t.height+t.space)/2,t.width/2,-(t.height+t.space)*(t.blocks))
end
end
cairo_transform(cr,matrix1)
if t.blocks==1 and t.angle_bar==0 then
draw_single_bar()
cairo_translate(cr,0,-t.height/2)
else
draw_multi_bar()
end
cairo_set_line_width(cr,0.01)
cairo_pattern_add_color_stop_rgba (pat2, 0,0,0,0,1-t.reflection_alpha)
cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)
if t.angle_bar==0 then
cairo_rectangle(cr,pts[1],pts[2],pts[3],pts[4])
end
cairo_clip_preserve(cr)
cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
cairo_stroke(cr)
cairo_mask(cr,pat2)
cairo_pattern_destroy(pat2)
cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
end --reflection
end --setup_bar_graph()
--start here !
setup_bar_graph()
cairo_restore(cr)
end
background yes
update_interval 1
cpu_avg_samples 2
total_run_times 0
override_utf8_locale yes
double_buffer yes
no_buffers yes
text_buffer_size 1024
imlib_cache_size 1024
minimum_size 370 0
maximum_width 370
gap_x 0
gap_y 35
#####################
# - Text settings - #
#####################
use_xft yes
xftfont monofur:bold:size=11
xftalpha 1
uppercase no
# Text alignment, other possible values are commented
alignment bottom_right
######################
# - Color settings - #
######################
color0 c3c3c3 #mid gray
color1 FF0000 #red
color2 A4FFA4 #light green
color3 007EFF #bright blue
color4 E3E3E3 #very light gray
color5 c6771a #an orange shade
color6 CA8718 #a dust like color
color7 FFE500 #a darker yellow color
color8 C3FF00 #lime green
color9 227992 #bars-blue #another blue 48a3fd
default_color c3c3c3
default_shade_color gray
default_outline_color black
#############################
# - Window specifications - #
#############################
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class conky
own_window_title clicky
#own_window_argb_visual yes
#own_window_argb_value 255
border_inner_margin 0
border_outer_margin 0
#########################
# - Graphics settings - #
#########################
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
draw_graph_borders no
lua_load ~/Conky/LUA/mounted.lua
Text
${lua get_mounted_data 3}
${color 888888}FSYS${color 888888} = ${lua mount 1 total}${goto 100}${color 888888}Size${goto 150}${color D4741B}Free${goto 200}${color1}Used${goto 255}${color 888888}Mount Point
${voffset -5} ${color 547EC8}${stippled_hr 5 1}${color 888888}
${color 4B60B4}${lua mount 1 fsys 9}${goto 100}${color 888888}${lua mount 1 size}${goto 150}${color D4741B}${lua mount 1 free}${goto 200}${color1}${lua mount 1 use%}${goto 260}${color 888888}${lua mount 1 mount}
${color 4B60B4}${lua mount 5 fsys 9}${goto 100}${color 888888}${lua mount 5 size}${goto 150}${color D4741B}${lua mount 5 free}${goto 200}${color1}${lua mount 5 use%}${goto 260}${color 888888}${lua mount 5 mount}
${color 4B60B4}${lua mount 3 fsys 9}${goto 100}${color 888888}${lua mount 3 size}${goto 150}${color D4741B}${lua mount 3 free}${goto 200}${color1}${lua mount 3 use%}${goto 260}${color 888888}${lua mount 3 mount}
${color 4B60B4}${lua mount 4 fsys 9}${goto 100}${color 888888}${lua mount 4 size}${goto 150}${color D4741B}${lua mount 4 free}${goto 200}${color1}${lua mount 4 use%}${goto 260}${color 888888}${lua mount 4 mount}
${color 4B60B4}${lua mount 6 fsys 9}${goto 100}${color 888888}${lua mount 6 size}${goto 150}${color D4741B}${lua mount 6 free}${goto 200}${color1}${lua mount 6 use%}${goto 260}${color 888888}${lua mount 6 mount}
${color 4B60B4}${lua mount 8 fsys 9}${goto 100}${color 888888}${lua mount 8 size}${goto 150}${color D4741B}${lua mount 8 free}${goto 200}${color1}${lua mount 8 use%}${goto 260}${color 888888}${lua mount 8 mount}
${color 4B60B4}${lua mount 9 fsys 9}${goto 100}${color 888888}${lua mount 9 size}${goto 150}${color D4741B}${lua mount 9 free}${goto 200}${color1}${lua mount 9 use%}${goto 260}${color 888888}${lua mount 9 mount}
${color 4B60B4}${lua mount 7 fsys 9}${goto 100}${color 888888}${lua mount 7 size}${goto 150}${color D4741B}${lua mount 7 free}${goto 200}${color1}${lua mount 7 use%}${goto 260}${color 888888}${lua mount 7 mount}
${alignc}${execi 10 hddtemp /dev/sda}
${alignc}${execi 10 hddtemp /dev/sdb}
--[[partitions for conky by mrpeachy
##instructions
##load script
lua_load ~/lua/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type text_length}, where partition number is a number
## text_length is optional, lets you specify the max number of characters the function returns. only affects fsys and mount data options
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
TEXT
CPU %: ${cpu cpu0} ${lua get_mounted_data 10}
TOTAL PARTITIONS MOUNTED: ${lua mount 1 total}
FSYS${goto 100}SIZE${goto 200}USED%${goto 300}MOUNT
${lua mount 1 fsys}${goto 100}${lua mount 1 size}${goto 200}${lua mount 1 use%}${goto 300}${lua mount 1 mount 10}
${lua mount 2 fsys}${goto 100}${lua mount 2 size}${goto 200}${lua mount 2 use%}${goto 300}${lua mount 2 mount 10}
${lua mount 3 fsys}${goto 100}${lua mount 3 size}${goto 200}${lua mount 3 use%}${goto 300}${lua mount 3 mount 10}
${lua mount 4 fsys}${goto 100}${lua mount 4 size}${goto 200}${lua mount 4 use%}${goto 300}${lua mount 4 mount 10}
]]
conky_start=1
function conky_get_mounted_data(interval)
local updates=tonumber(conky_parse("${updates}"))
timer=(updates % interval)
if timer==0 or conky_start==1 then
fsys={}
size={}
used={}
avail={}
uperc={}
mount={}
local file = io.popen("df -h")
for line in file:lines() do
if string.find(line,"/dev/")~=nil then
local s,f,fs=string.find(line,"^([%d%a%p]*)%s")
table.insert(fsys,fs)
local s,f,sz=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(size,sz)
local s,f,us=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(used,us)
local s,f,av=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(avail,av)
local s,f,up=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(uperc,up)
local s,f,mn=string.find(line,"%s*([%d%a%p]*)%s*$",f)
table.insert(mount,mn)
end
end
file:close()
conky_start=nil
end--timed section
return ""
end
function conky_mount(n,d,c)--n=partition_number,d=data_type,c=number of characters to return
d=tostring(d)
n=tonumber(n)
c=tonumber(c) or 0
if d=="total" then
data=#fsys or 1
elseif d=="fsys" then
data=fsys[n] or ""
if c~=0 then
data=string.sub(data,1,c) or ""
end
elseif d=="size" then
data=size[n] or ""
elseif d=="used" then
data=used[n] or ""
elseif d=="free" then
data=avail[n] or ""
elseif d=="use%" then
data=uperc[n] or ""
elseif d=="mount" then
data=mount[n] or ""
if c~=0 then
data=string.sub(data,1,c) or ""
end
else
data="check data type"
end
return data
end--end main function
# killall conky && conky -c ~/Conky/S11_VNS.conky &
# with help from dk75
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
# 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
own_window_type normal #override
own_window_transparent yes
own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
# own_window_colour ffffff
own_window_class Conky
own_window_title Vnstats
### 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 255
minimum_size 330 0 ## width, height
maximum_width 330 ## width, usually a good idea to equal minimum width
gap_x 380 ### left &right
gap_y 50 #295 ### up & down
alignment br
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Anonymous Pro:size=9
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
### WARNING ### These do NOT play well with ~/Conky/LUA/draw-bg.lua
###################################################################
draw_shades no #### <<<--- yes --- To see it easier on light screens.
#default_shade_color black
draw_outline no #### <<<--- yes --- Amplifies text if yes
default_outline_color black
uppercase no
###################################################### End Font Settings ###
### Color Settings #########################################################
default_shade_color gray
default_outline_color black
color0 c3c3c3 #mid gray
color1 FF0000 #red
color2 A4FFA4 #light green
color3 007EFF #bright blue
color4 E3E3E3 #very light gray
color5 c6771a #an orange shade
color6 CA8718 #a dust like color
color7 FFE500 #a darker yellow color
color8 C3FF00 #lime green
color9 28478D #bars-blue #another blue 227992 48a3fd 3881c7
default_color c3c3c3
##################################################### 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 yes
##################################################### End Borders Secton ###
### Miscellaneous Section ##################################################
# yes
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 right
# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 512
# 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
############################################## End Miscellaneous Section ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#lua_load /home/jed/Conky/test/draw_bg.lua
#lua_draw_hook_pre draw_bg 75 0 0 0 0 0x000000 0.5
#
####################################################### End LUA Settings ###
#digiThe all important - How often conky refreshes.5
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1 # in seconds
# stuff after 'TEXT' will be formatted on screen
TEXT
${color9}Network Usage Statistics${color} ${hr}
${downspeedgraph wlan0 24,150 A52A2A 0000FF -t -l}${goto 180}${upspeedgraph wlan0 24,150 0000FF A52A2A -t -l}
Down: ${downspeedf wlan0}${goto 195}Up: ${upspeedf wlan0}
${color9}Transfer Totals${color} ${hr}
${color6}rx${goto 85}tx${goto 170}Total${goto 265}Avg Rate${color}
${color9}Today:${color}
${execpi 300 vnstat | grep "today" | awk '{print $2" "$3"\
${goto 85}"$5" "$6"\
${goto 170}"$8" "$9"\
${goto 265}"$11" "$12}'}
${color9}Yesterday:${color}
${execpi 300 vnstat | grep "yesterday" | awk '{print $2" "$3"\
${goto 85}"$5" "$6 "\
${goto 170}" $8" "$9 "\
${goto 265}" $11" "$12}'}
${color9}Last Week:${color}
${execpi 300 vnstat -w | grep "last week" | awk '{print $3" "$4"\
${goto 85}" $6" "$7 "\
${goto 170}" $9" "$10 "\
${goto 265}" $12" "$13}'}
${color9}Last 7 Days:${color}
${execpi 300 vnstat -w | grep "last 7 days" | awk '{print $4" "$5 "\
${goto 85}" $7" "$8 "\
${goto 170}" $10" "$11 "\
${goto 265}" $13" "$14}'}
${color9}Current Week:${color}
${execpi 300 vnstat -w | grep "current week" | awk '{print $3" "$4 "\
${goto 85}" $6" "$7 "\
${goto 170}" $9" "$10 "\
${goto 265}" $12" "$13}'}
${color9}${time %B %Y}:${color}
${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $3" "$4}'}\
${goto 85}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $6" "$7}'}\
${goto 170}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $9" "$10}'}\
${goto 265}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $12" "$13}'}
${color9}Monthly Transfer Totals${color} ${hr}
${color6}${goto 85}rx${goto 170}tx${goto 265}Total${color}
${execpi 300 vnstat -m |mawk -v last=5 '/[A-Z][a-z][a-z].+12/ {test[++i]=$0} END{i=0; while (test[++i]); --i; for (j=i-last; j<=i; j++) {$0=test[j]; print "${color6}"$1, $2 ":${color}${goto 85}"$3" "$4"${goto 170}"$6" "$7"${goto 265}"$9" "$10}}'}
${color0}${hr}${color}
use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 1
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 250 0
maximum_width 600
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color 28478D
default_shade_color red
default_outline_color green
alignment bottom_left
gap_x 10
gap_y 50
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer right
#lua_load /home/jed/Conky/LUA/draw_bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.4
TEXT
${font Petita Bold:pixelsize=14}${color 28478D}gmail - ${color 525252}${execi 900 conkyEmail --servertype=POP --servername=pop.gmail.com --ssl --username=gmail.com --password=passwordhere --mailinfo=0} new email(s)
${color 28478D}vsido@gmail - ${color 525252}${execi 900 conkyEmail --servertype=POP --servername=pop.gmail.com --ssl --username=gmail.com --password=passwordhere --mailinfo=0} new email(s)
${color 28478D}live - ${color 525252}${execi 900 conkyEmail --servertype=POP --servername=pop3.live.com --ssl --username=@live.com --password=passwordhere --mailinfo=0} new email(s)
${color 28478D}hotmail - ${color 525252}${execi 900 conkyEmail --servertype=POP --servername=pop3.live.com --ssl --username=hotmail.com --password=passwordhere --mailinfo=0} new email(s)
######################
# - Conky settings -
# based on original work by mobilediesel
######################
background yes
update_interval .3
cpu_avg_samples 2
total_run_times 0
override_utf8_locale yes
double_buffer yes
#no_buffers yes
text_buffer_size 1024
#imlib_cache_size 0
minimum_size 1250 0
maximum_width 1250
gap_x 10
gap_y 10
#####################
# - Text settings - #
#####################
use_xft yes
xftfont Santana:size=8
xftalpha .8
uppercase no
alignment top_left
#############################
# - Window specifications - #
#############################
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class conky-semi
#own_window_argb_visual yes
#own_window_argb_value 255
border_inner_margin 0
border_outer_margin 0
#########################
# - Graphics settings - #
#########################
draw_shades no
#default_shade_color 292421
draw_outline no
draw_borders no
stippled_borders 0
draw_graph_borders no
TEXT
${execpi 36000 /home/jed/Conky/Scripts/horical.sh}
${font CaviarDreams:size=30}${goto 60}${color 949494}${voffset 10}${time %l:%M %P}
${font CaviarDreams:size=18}${goto 60}${color 3881C7}${voffset -10}${time %A %B %d %Y}
${goto 600}${color 3881C7}${font CaviarDreams:size=10}${execi 1 conkyForecast-SunsetSunriseCountdown -t} in: ${color 949494}${execi 1 conkyForecast-SunsetSunriseCountdown -L}
${goto 600}${color 3881C7}Current Moon Phase: ${goto 720}${color 949494}${execi 300 conkyForecast --imperial --datatype=MP}
${execpi 1800 conkyForecast --location=USME0330 --imperial --template=$HOME/Conky/LUA/day-night.template}
#!/bin/bash
# a script to display a horizontal calendar on conky (hence the name horical :D)
# created by mobilediesel
#
TODAY=`date +%d`
TOPLINE=" "
OVER=" "
REST=" "
# -------- This part is to find out the number of days in a month to display-----------#
a=`date +%-Y`
e1=`expr $a % 400`
e2=`expr $a % 100`
e3=`expr $a % 4`
if [ $e1 == 0 ]
then c=1
elif [ $e2 == 0 ]
then c=0
elif [ $e3 == 0 ]
then c=1
else c=0
fi
p=`date +%-m`
# if the current year is not a leap one, c = 0
if [ $c == 0 ]
then
if [ $p == 2 ]
then b=28 # this is the number of days in Febuary
elif [ $p == 11 ] || [ $p == 4 ] || [ $p == 6 ] || [ $p == 9 ]
then b=30
else b=31
fi
else
if [ $p == 2 ]
then b=29 # the number of days in Febuary in a leap year
elif [ $p == 11 ] || [ $p == 4 ] || [ $p == 6 ] || [ $p == 9 ]
then b=30
else b=31
fi
fi
#--------------------- The bottom line which displays the days of month ----------#
i=1
if [ $TODAY -ne 1 ]
then
while [ $i -lt $TODAY ]; do
if [ $i -lt 10 ]
then
OVER="$OVER 0$i"
else
OVER="$OVER $i"
fi
i=$[$i+1]
done
fi
i=$[$i+1]
if [ $TODAY -ne $b ]
then
while [ $i -ne $[$b] ]; do
if [ $i -lt 10 ]
then
REST="$REST 0$i"
else
REST="$REST $i"
fi
i=$[$i+1]
done
REST="$REST $b"
fi
#------------- the top line which displays the abbreviated weekday names-------#
k=`date +%u`
j=`date +%e`
f=`expr $j % 7`
if [$k -lt $f]
then
y=$[$k+8-$f]
else
y=$[$k-$f+1]
fi
while [ $b -gt 0 ]; do
case "$y" in
1) TOPLINE="$TOPLINE Mo";;
2) TOPLINE="$TOPLINE Tu";;
3) TOPLINE="$TOPLINE We";;
4) TOPLINE="$TOPLINE Th";;
5) TOPLINE="$TOPLINE Fr";;
6) TOPLINE="$TOPLINE Sa";;
7) TOPLINE="$TOPLINE Su";;
esac
b=$[$b-1]
y=$[$y+1]
if [ $y -eq 8 ]
then
y=1
fi
done
echo '${goto 15}''${color 949494}${font Droid Sans Mono:size=12}'$TOPLINE | sed 's/Su/${color 48a3fd}Su${color 949494}/g' | sed 's/Su/${color 3881C7}Su/g'
echo '${goto 15}''${font Droid Sans Mono:bold:size=12}''${color 3c3c3c}'$OVER '${color 3881C7}'$TODAY'${color}${color 949494}'$REST
${image [--datatype=WI] -p 350,40 -s 100x100}${image [--datatype=MI] -p 555,40 -s 100x100}
# .conkyrc - Edited from various examples across the 'net
# Used by VastOne on VSIDO
#http://conky.sourceforge.net/config_settings.html
# Bottom right conky, goes together with left tint2
###############################################################
## Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
## fiddle with window
# use_spacer
## Use Xft?
use_xft yes
xftfont liberation sans:size=11
xftalpha 0.9
text_buffer_size 2048
## Update interval in seconds
update_interval 1
## This is the number of times Conky will update before quitting.
## Set to zero to run forever.
total_run_times 0
## Draw shades?
draw_shades no
## Draw outlines?
draw_outline no
## Draw borders around text
draw_borders no
own_window_argb_visual yes
## override lets you see conky even when super+d
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window yes
own_window_transparent yes
own_window_class conky-semi
own_window_colour 000000
## Stippled borders?
stippled_borders 0
## border margins
# border_margin 0
## border width
border_width 1
alignment bottom_right
## Gap between borders of screen and text
## same thing as passing -x at command line
gap_x 2
gap_y 1
minimum_size 100 27
maximum_width 600
## Subtract file system buffers from used memory?
no_buffers yes
## set to yes if you want all text to be in uppercase
uppercase no
## number of cpu samples to average set to 1 to disable averaging
cpu_avg_samples 2
## number of net samples to average
## set to 1 to disable averaging
net_avg_samples 2
## Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
TEXT
${color ebebeb}Kernel $kernel ${color 73AEB4} ${color 73AEB4}MEM ${color lime green}${memperc}% ${mem} / ${memmax} ${color 73AEB4} CPU ${color yellow}${cpu cpu0}%, ${cpu cpu1}%
${color 73AEB4}C0 ${color yellow}${exec sensors | grep 'Core0 Temp' | cut -c15-19}, ${color 73AEB4}C1 ${color yellow}${exec sensors | grep 'Core1 Temp' | cut -c15-19} ${color 73AEB4}NET${color 7D8C93} ${voffset 1}${downspeedgraph eth0 12,70 000000 ff0000} ${upspeedgraph eth0 12,70 000000 00ff00} ${color FFFFFF}${font Arial:size=11} ${time %F} ${time %H: %M: %S}
use_xft yes
xftfont 123:size=11
xftalpha 0.1
update_interval 1
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 250 0
maximum_width 600
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color 3881C7
default_shade_color red
default_outline_color green
alignment top_left
gap_x 95
gap_y 300
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer right
#lua_load /home/jed/Conky/LUA/draw_bg.lua
#lua_draw_hook_post draw_bg 10 0 0 0 0 0x000000 0.4
TEXT
${color 3881C7}Jed - ${execpi 15 python ~/Conky/Scripts/gmail_parser.py yours@gmail.com yours 0}
${color 3881C7}VSIDO Community - ${execpi 15 python ~/Conky/Scripts/gmail_parser.py yours@gmail.com yours 0}
${color 3881C7}jedsdesk - ${color 525252}${execi 90 conkyEmail --servertype=POP --servername=mail.yourserver.com --ssl --username=yours --password=yours --mailinfo=0} new email(s)
${color 3881C7}live - ${color 525252}${execi 900 conkyEmail --servertype=POP --servername=pop3.live.com --ssl --username=yours@live.com --password=yours --mailinfo=0} new email(s)
${color 3881C7}hotmail - ${color 525252}${execi 900 conkyEmail --servertype=POP --servername=pop3.live.com --ssl --username=yours@hotmail.com --password=yours --mailinfo=0} new email(s)
use_xft yes
xftfont 123:size=10
xftalpha 0.1
update_interval 1
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 400 150
maximum_width 600
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color 525252
default_shade_color red
default_outline_color green
alignment top_left
gap_x 120
gap_y 750
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer right
#lua_load /home/jed/Conky/LUA/draw_bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.4
TEXT
${goto 210}${font}${color 780F0F}${font Petita Medium:pixelsize=28}${voffset 25}${time %d},${goto 245}${font Petita Medium:pixelsize=28}${time %A}${font}${goto 10}${color 0F2C48}${font GeoSans Light:pixelsize=75}${voffset -30}${time %l:%M}${goto 210}${font Petita Medium:pixelsize=32}${color CD621B}${font Petita Medium:pixelsize=14}${time %B}, ${time %Y}${font}#${font GeoSans Light:pixelsize=38}
${color 202E37}${hr}
# — Conky settings — #
background yes
update_interval 1
total_run_times 0
net_avg_samples 2
override_utf8_locale yes
double_buffer yes
no_buffers yes
text_buffer_size 2048
imlib_cache_size 0
# — Window specifications — #
own_window_type override
own_window_class Conky
own_window yes
#own_window_type conky
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
border_inner_margin 0
border_outer_margin 0
minimum_size 525 600
maximum_width 525
alignment mm
gap_x -30
gap_y -65
# — Graphics settings — #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# — Text settings — #
use_xft yes
xftfont LCDMono2:size=10.1
xftalpha 1.0
default_color 227992 ##dark red A84C47 ##opaque white FFFFFF
uppercase no
use_spacer right
# — Lua Load — #
lua_load ~/Conky/LUA/greyclock.lua
lua_draw_hook_post main
lua_load ~/v9000/v9000.lua
lua_draw_hook_pre weather
lua_load ~/Conky/chrono-full.template.lua
TEXT
${voffset 305}${goto 290}${font LCDMono2:size=23.1}${time %l:%M}${font}
${voffset 2}${goto 292}${time %a %d %b}
require 'cairo'
--------------------------------------------------------------------------------
----Adjustable Settings
coffee_table = {
{
name='time', arg='%I.%M', max_value=12,
x=230, y=230,
cup_radius=112, --hour-hand
cup_wall_thickness=90,
cup_bg_clr=0xffffff, cup_bg_alpha=0.0,
cup_fg_clr=0xFFFFFF, cup_fg_alpha=0.0,
handle_length=70, handle_circ=5,
handle_fg_clr=0xFFFFFF, handle_fg_alpha=1.0,
graduation_radius=184,
graduation_thickness=8, graduation_mark_circ=1.5,
graduation_mark_angle=30,
graduation_fg_clr=0xFFFFFF, graduation_fg_alpha=0.5,
saucer_thickness=6, thick_saucer_circ=11/12,
saucer_radius=195, thin_saucer_circ=11/12,
saucer_fg_clr=0xFFFFFF, saucer_fg_alpha=0.3,
saucer_mark_fg_clr=0xFFFFFF, saucer_mark_fg_alpha=0.0,
inner_saucer=true,
txt_weight=0, txt_size=8.0,
txt_fg_clr=0xFFFFFF, txt_fg_alpha=0.0,
caption='', caption2='',
},
{
name='time', arg='%H', max_value=12,
x=230, y=230,
cup_radius=2,
cup_wall_thickness=3,
cup_bg_clr=0xffffff, cup_bg_alpha=1.0,
cup_fg_clr=0xFFFFFF, cup_fg_alpha=1.0,
handle_length=40, handle_circ=4,
handle_fg_clr=0xFFFFFF, handle_fg_alpha=0.0,
graduation_radius=187,
graduation_thickness=1, graduation_mark_circ=0.5,
graduation_mark_angle=3,
graduation_fg_clr=0xFFFFFF, graduation_fg_alpha=0.5,
saucer_thickness=6, thick_saucer_circ=11/12,
saucer_radius=195, thin_saucer_circ=11/12,
saucer_fg_clr=0xFFFFFF, saucer_fg_alpha=0.0,
saucer_mark_fg_clr=0xFFFFFF, saucer_mark_fg_alpha=0.0,
inner_saucer=true,
txt_weight=0, txt_size=8.0,
txt_fg_clr=0xFFFFFF, txt_fg_alpha=0.0,
caption='', caption2='',
},
{
name='time', arg='%M', max_value=60,
x=230, y=230,
cup_radius=118,
cup_wall_thickness=120,
cup_bg_clr=0xffffff, cup_bg_alpha=0.0,
cup_fg_clr=0xFFFFFF, cup_fg_alpha=0.0,
graduation_radius=183,
graduation_thickness=10, graduation_mark_circ=2.5,
graduation_mark_angle=90,
graduation_fg_clr=0xFFFFFF, graduation_fg_alpha=0.5,
handle_length=110, handle_circ=3,
handle_fg_clr=0xFFFFFF, handle_fg_alpha=1.0,
saucer_thickness=6, thick_saucer_circ=11/12,
saucer_radius=220, thin_saucer_circ=11/12,
saucer_fg_clr=0xFFFFFF, saucer_fg_alpha=0.3,
saucer_mark_fg_clr=0xFFFFFF, saucer_mark_fg_alpha=0.0,
txt_weight=0, txt_size=8.0,
txt_fg_clr=0xFFFFFF, txt_fg_alpha=0.0,
caption='', caption2='',
},
{
name='time', arg='%S', max_value=60,
x=230, y=230,
cup_radius=120,
cup_wall_thickness=120,
cup_bg_clr=0xffffff, cup_bg_alpha=0.0,
cup_fg_clr=0xFFFFFF, cup_fg_alpha=0.0,
handle_fg_clr=0xFFFFFF, handle_fg_alpha=1.0,
handle_length=118, handle_circ=1,
graduation_radius=185,
graduation_thickness=6, graduation_mark_circ=0.5,
graduation_mark_angle=6,
graduation_fg_clr=0xFFFFFF, graduation_fg_alpha=0.5,
saucer_thickness=5, thick_saucer_circ=1,
saucer_radius=205, thin_saucer_circ=11/12,
saucer_fg_clr=0xFFFFFF, saucer_fg_alpha=0.4,
saucer_mark_fg_clr=0xFFFFFF, saucer_mark_fg_alpha=0.4,
txt_weight=0, txt_size=8.0,
txt_fg_clr=0xFFFFFF, txt_fg_alpha=0.0,
caption='', caption2='',
},
{
name='cpu', arg='cpu0', max_value=100,
x=230, y=105,
cup_radius=20,
cup_wall_thickness=40,
cup_start_angle=0,
cup_bg_clr=0xFFFFFF, cup_bg_alpha=0.0,
cup_fg_clr=0xFFFFFF, cup_fg_alpha=0.0,
handle_fg_clr=0xFFFFFF, handle_fg_alpha=0.0,
handle_length=40, handle_circ=4,
xtxt=-20, ytxt= -12,
txt_weight=0, txt_size=10.0,
txt_fg_clr=0xFFFFFF, txt_fg_alpha=0.8,
caption='CPU ', caption2=' %',
graduation_radius=35,
graduation_thickness=3, graduation_mark_circ=2,
graduation_mark_angle=36,
graduation_fg_clr=0xFFFFFF, graduation_fg_alpha=0.6,
saucer_thickness=6, thick_saucer_circ=0.85,
saucer_radius=40, thin_saucer_circ=0.85,
saucer_fg_clr=0xFFFFFF, saucer_fg_alpha= 0.3,
saucer_mark_fg_clr=0xFFFFFF, saucer_mark_fg_alpha=0.5,
inner_saucer=true,
},
{
name='freq_g', arg='/', max_value=5,
x=230, y=105,
cup_radius=12,
cup_wall_thickness=23,
cup_start_angle=0,
cup_bg_clr=0xFFFFFF, cup_bg_alpha=0.0,
cup_fg_clr=0xFFFFFF, cup_fg_alpha=0.0,
handle_fg_clr=0xFFFFFF, handle_fg_alpha=0.0,
handle_length=40, handle_circ=4,
xtxt=-20, ytxt= 0,
txt_weight=0, txt_size=10.0,
txt_fg_clr=0xFFFFFF, txt_fg_alpha=0.8,
caption='', caption2=' GHz',
graduation_radius=25,
graduation_thickness=6, graduation_mark_circ=4,
graduation_mark_angle=30,
graduation_fg_clr=0xFFFFFF, graduation_fg_alpha=0.0,
saucer_thickness=6, thick_saucer_circ=0.75,
saucer_radius=45, thin_saucer_circ=0.75,
saucer_fg_clr=0xFFFFFF, saucer_fg_alpha= 0.3,
saucer_mark_fg_clr=0xFFFFFF, saucer_mark_fg_alpha=0.5,
},
{
name='hwmon', arg='temp 1', max_value=100,
x=230, y=105,
cup_radius=12,
cup_wall_thickness=23,
cup_start_angle=0,
cup_bg_clr=0xFFFFFF, cup_bg_alpha=0.0,
cup_fg_clr=0xFFFFFF, cup_fg_alpha=0.0,
handle_fg_clr=0xFFFFFF, handle_fg_alpha=0.0,
handle_length=40, handle_circ=4,
xtxt=-15, ytxt= 12,
txt_weight=0, txt_size=10.0,
txt_fg_clr=0xFFFFFF, txt_fg_alpha=0.8,
caption='', caption2=' ºC',
graduation_radius=35,
graduation_thickness=6, graduation_mark_circ=2,
graduation_mark_angle=36,
graduation_fg_clr=0xFFFFFF, graduation_fg_alpha=0.6,
saucer_thickness=6, thick_saucer_circ=0.85,
saucer_radius=40, thin_saucer_circ=0.85,
saucer_fg_clr=0xFFFFFF, saucer_fg_alpha= 0.3,
saucer_mark_fg_clr=0xFFFFFF, saucer_mark_fg_alpha=0.5,
inner_saucer=true,
},
---------------1/2
{
name='memperc', arg='/', max_value=100,
x=135, y=150,
cup_radius=12,
cup_wall_thickness=23,
cup_start_angle=0,
cup_bg_clr=0xFFFFFF, cup_bg_alpha=0.0,
cup_fg_clr=0xFFFFFF, cup_fg_alpha=0.0,
handle_fg_clr=0xFFFFFF, handle_fg_alpha=0.0,
handle_length=40, handle_circ=4,
xtxt=-25, ytxt=0,
txt_weight=0, txt_size=10.0,
txt_fg_clr=0xFFFFFF, txt_fg_alpha=0.8,
caption='RAM ', caption2=' %',
graduation_radius=35,
graduation_thickness=6, graduation_mark_circ=2,
graduation_mark_angle=36,
graduation_fg_clr=0xFFFFFF, graduation_fg_alpha=0.6,
saucer_thickness=6, thick_saucer_circ=0.85,
saucer_radius=40, thin_saucer_circ=0.85,
saucer_fg_clr=0xFFFFFF, saucer_fg_alpha= 0.3,
saucer_mark_fg_clr=0xFFFFFF, saucer_mark_fg_alpha=0.5,
inner_saucer=true,
},
------------------2/3
{
name='fs_used_perc', arg='/home', max_value=100,
x=105, y=240,
cup_radius=12,
cup_wall_thickness=27,
cup_start_angle=0,
cup_bg_clr=0xFFFFFF, cup_bg_alpha=0.0,
cup_fg_clr=0xFFFFFF, cup_fg_alpha=0.0,
handle_fg_clr=0xFFFFFF, handle_fg_alpha=0.0,
handle_length=40, handle_circ=4,
xtxt=-30, ytxt= 12,
txt_weight=0, txt_size=10.0,
txt_fg_clr=0xFFFFFF, txt_fg_alpha=0.8,
caption=' FS H: ', caption2=' %',
graduation_radius=35,
graduation_thickness=6, graduation_mark_circ=2,
graduation_mark_angle=36,
graduation_fg_clr=0xFFFFFF, graduation_fg_alpha=0.6,
saucer_thickness=6, thick_saucer_circ=0.85,
saucer_radius=40, thin_saucer_circ=0.85,
saucer_fg_clr=0xFFFFFF, saucer_fg_alpha=0.3,
saucer_mark_fg_clr=0xFFFFFF, saucer_mark_fg_alpha=0.5,
inner_saucer=true,
},
{
name='fs_used_perc', arg='/', max_value=100,
x=105, y=240,
cup_radius=12,
cup_wall_thickness=27,
cup_start_angle=0,
cup_bg_clr=0xFFFFFF, cup_bg_alpha=0.0,
cup_fg_clr=0xFFFFFF, cup_fg_alpha=0.0,
handle_fg_clr=0xFFFFFF, handle_fg_alpha=0.0,
handle_length=40, handle_circ=4,
xtxt=-30, ytxt= -5,
txt_weight=0, txt_size=10.0,
txt_fg_clr=0xFFFFFF, txt_fg_alpha=0.8,
caption=' FS /: ', caption2=' %',
graduation_radius=25,
graduation_thickness=4, graduation_mark_circ=4,
graduation_mark_angle=36,
graduation_fg_clr=0xFFFFFF, graduation_fg_alpha=0.0,
saucer_thickness=6, thick_saucer_circ=0.85,
saucer_radius=45, thin_saucer_circ=0.85,
saucer_fg_clr=0xFFFFFF, saucer_fg_alpha=0.3,
saucer_mark_fg_clr=0xFFFFFF, saucer_mark_fg_alpha=0.5,
},
}
--Fixed code -do not edit unless you know what you are doing------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- converts color in hexa to decimal
function rgb_to_r_g_b(clr, alpha)
return ((clr / 0x10000) % 0x100) / 255., ((clr / 0x100) % 0x100) / 255., (clr % 0x100) / 255., alpha
end
-------------------------------------------------------------------------------
------------------------------------------------------------------------
local function draw_coffee_table(display, data, value)
max_value = data['max_value']
x, y = data['x'], data['y']
if x==nil then x=conky_window.width/2 end
if y==nil then y=conky_window.height/2 end
cup_radius = data['cup_radius']
if cup_radius==nil then cup_radius=conky_window.width/4 end
cup_wall_thickness = data['cup_wall_thickness']
if cup_wall_thickness==nil then cup_wall_thickness=20 end
handle_length, handle_circ = data['handle_length'], data['handle_circ']
if handle_length==nil then handle_length=20 end
if handle_circ==nil then handle_circ=1 end
cup_start_angle = data['cup_start_angle']
if cup_start_angle == nil then cup_start_angle =0 end
total_angle = data['total_angle']
if total_angle == nil then total_angle=360 end
cup_sector_angle = (math.abs(total_angle))/max_value
cup_end_angle = total_angle + cup_start_angle
cup_bg_clr, cup_bg_alpha = data['cup_bg_clr'], data['cup_bg_alpha']
if cup_bg_clr==nil then cup_bg_clr =0xffffff end
cup_fg_clr, cup_fg_alpha = data['cup_fg_clr'], data['cup_fg_alpha']
if cup_fg_clr==nil then cup_fg_clr =0xffffff end
if cup_fg_alpha==nil then cup_fg_alpha=0 end
handle_fg_clr, handle_fg_alpha = data['handle_fg_clr'], data['handle_fg_alpha']
if handle_fg_clr==nil then handle_fg_clr = 0xffffff end
if handle_fg_alpha==nil then handle_fg_alpha=0 end
saucer_radius = data['saucer_radius']
if saucer_radius==nil then saucer_radius=conky_window.width/2 end
total_saucer_angle=data['total_saucer_angle']
if total_saucer_angle==nil then total_saucer_angle=360 end
saucer_sector_angle=(math.abs(total_saucer_angle))/max_value
saucer_thickness = data['saucer_thickness']
if saucer_thickness==nil then saucer_thickness=6 end
saucer_fg_clr = data['saucer_fg_clr']
if saucer_fg_clr ==nil then saucer_fg_clr=0 end
saucer_fg_alpha = data['saucer_fg_alpha']
if saucer_fg_alpha ==nil then saucer_fg_alpha=0 end
saucer_mark_fg_alpha = data['saucer_mark_fg_alpha']
if saucer_mark_fg_alpha ==nil then saucer_mark_fg_alpha=0 end
saucer_mark_fg_clr = data['saucer_mark_fg_clr']
if saucer_mark_fg_clr ==nil then saucer_mark_fg_clr=0xffffff end
thick_saucer_circ = data['thick_saucer_circ']
if thick_saucer_circ==nil then thick_saucer_circ =0.9 end
thin_saucer_circ = data['thin_saucer_circ']
if thin_saucer_circ==nil then thin_saucer_circ =0.9 end
inner_saucer = data['inner_saucer']
graduation_radius = data['graduation_radius']
if graduation_radius ==nil then graduation_radius = conky_window.width/3 end
graduation_thickness, graduation_mark_circ = data['graduation_thickness'], data['graduation_mark_circ']
if graduation_thickness ==nil then graduation_thickness = 2 end
if graduation_mark_circ ==nil then graduation_mark_circ = 1 end
graduation_mark_angle = data['graduation_mark_angle']
if graduation_mark_angle == nil then graduation_mark_angle = total_angle/10 end
graduation_fg_clr, graduation_fg_alpha = data['graduation_fg_clr'], data['graduation_fg_alpha']
if graduation_fg_clr ==nil then graduation_fg_clr= 0xffffff end
if graduation_fg_alpha==nil then graduation_fg_alpha =0 end
txt_weight, txt_size = data['txt_weight'], data['txt_size']
if txt_weight == nil then txt_weight=1 end
if txt_size == nil then txt_size=8 end
txt_fg_clr, txt_fg_alpha = data['txt_fg_clr'], data['txt_fg_alpha']
if txt_fg_clr ==nil then txt_fg_clr= 0xffffff end
if txt_fg_alpha==nil then txt_fg_alpha =0 end
caption = data['caption']
if caption==nil then caption='' end
caption2 = data['caption2']
if caption2==nil then caption2='' end
xtxt, ytxt= data ['xtxt'], data['ytxt']
if xtxt ==nil then xtxt=0 end
if ytxt ==nil then ytxt=0 end
--convert degree to rad and rotate (0 degree is top/north)
function angle_to_position(start_angle, current_angle)
if total_angle < 0 then
local pos = start_angle - current_angle
return ( ( pos * (math.pi / 180) ) - (math.pi / 2) )
else
local pos = current_angle + start_angle
return ( ( pos * (math.pi / 180) ) - (math.pi / 2) )
end
end
--cup centre background
if cup_bg_alpha >0 then
if total_angle < 0 then
cairo_arc_negative(display, x, y, cup_radius, angle_to_position(cup_start_angle, 0), angle_to_position(cup_end_angle, 0))
else
cairo_arc(display, x, y, cup_radius, angle_to_position(cup_start_angle, 0), angle_to_position(cup_start_angle, cup_end_angle))
end
cairo_set_source_rgba(display, rgb_to_r_g_b(cup_bg_clr, cup_bg_alpha))
cairo_set_line_width(display, cup_wall_thickness)
cairo_stroke(display)
end
--cup wall fg
if cup_fg_alpha > 0 then
local fg_stop_arc = (cup_sector_angle * value)
if total_angle < 0 then
cairo_arc_negative(display, x, y, cup_radius, angle_to_position(cup_start_angle, 0), angle_to_position(cup_start_angle, fg_stop_arc))
else
cairo_arc(display, x, y, cup_radius, angle_to_position(cup_start_angle, 0), angle_to_position(cup_start_angle, fg_stop_arc))
end
cairo_set_source_rgba(display, rgb_to_r_g_b(cup_fg_clr, cup_fg_alpha))
cairo_set_line_width(display, cup_wall_thickness)
cairo_stroke(display)
end
-- cup handle
if handle_fg_alpha>0 then
local start_handle = (cup_sector_angle * value) - (handle_circ*0.5)
local stop_handle = (cup_sector_angle * value) + (handle_circ*0.5)
if total_angle < 0 then
cairo_arc_negative(display, x, y, cup_radius, angle_to_position(cup_start_angle, start_handle), angle_to_position(cup_start_angle, stop_handle))
else
cairo_arc(display, x, y, cup_radius, angle_to_position(cup_start_angle, start_handle), angle_to_position(cup_start_angle, stop_handle))
end
cairo_set_line_width(display, handle_length)
cairo_set_source_rgba(display, rgb_to_r_g_b(handle_fg_clr, handle_fg_alpha))
cairo_stroke(display)
end
--saucers
---thick saucer
if saucer_fg_alpha > 0 and (thin_saucer_circ >0 or thick_saucer_circ > 0)
then
if value < (max_value/2)
then j = value + ((max_value*total_saucer_angle)/720)
else j = value - ((max_value*total_saucer_angle)/720)
end
local start_saucer = (saucer_sector_angle * j) - (value*saucer_sector_angle*0.5*thick_saucer_circ)
local stop_saucer = (saucer_sector_angle * j) + (value*saucer_sector_angle*0.5*thick_saucer_circ)
if total_angle < 0 then
cairo_arc_negative(display, x, y, saucer_radius, angle_to_position(cup_start_angle, start_saucer), angle_to_position(cup_start_angle, stop_saucer))
else
cairo_arc(display, x, y, saucer_radius, angle_to_position(cup_start_angle, start_saucer), angle_to_position(cup_start_angle, stop_saucer))
end
cairo_set_source_rgba(display, rgb_to_r_g_b(saucer_fg_clr, saucer_fg_alpha))
cairo_set_line_width(display, saucer_thickness)
cairo_stroke(display)
--thin saucer
if inner_saucer == true
then rt = (saucer_radius - 0.5) + (0.5 * saucer_thickness)
else rt = (saucer_radius + 0.5) - (0.5 * saucer_thickness)
end
local start_thin_saucer = (saucer_sector_angle * j) - (max_value *0.5*saucer_sector_angle*thin_saucer_circ)
local stop_thin_saucer = (saucer_sector_angle * j) + (max_value *0.5*saucer_sector_angle*thin_saucer_circ)
if total_angle < 0 then
cairo_arc_negative(display, x, y, rt, angle_to_position(cup_start_angle, start_thin_saucer), angle_to_position(cup_start_angle, stop_thin_saucer))
else
cairo_arc(display, x, y, rt, angle_to_position(cup_start_angle, start_thin_saucer), angle_to_position(cup_start_angle, stop_thin_saucer))
end
cairo_set_source_rgba(display, rgb_to_r_g_b(saucer_fg_clr, saucer_fg_alpha))
cairo_set_line_width(display, 1)
cairo_stroke(display)
end
--saucer mark
if saucer_mark_fg_alpha > 0 then
local start_cm = (saucer_sector_angle * value) - (handle_circ *0.5 )
local stop_cm = (saucer_sector_angle * value) + (handle_circ *0.5 )
if total_angle < 0 then
cairo_arc_negative(display, x, y, saucer_radius, angle_to_position(cup_start_angle, start_cm), angle_to_position(cup_start_angle, stop_cm))
else
cairo_arc(display, x, y, saucer_radius, angle_to_position(cup_start_angle, start_cm), angle_to_position(cup_start_angle, stop_cm))
end
cairo_set_source_rgba(display, rgb_to_r_g_b(saucer_mark_fg_clr, saucer_mark_fg_alpha))
cairo_set_line_width(display, saucer_thickness)
cairo_stroke(display)
end
--graduation mark
if graduation_radius > 0 and graduation_thickness > 0 and graduation_mark_angle > 0 then
number_graduation = (math.abs(total_angle) +1)/ graduation_mark_angle
local start_arc_grad = 0
local stop_arc_grad = 0
local i = 0
while i < number_graduation do
local start_arc_grad = (graduation_mark_angle * (i)) - (graduation_mark_circ *0.5)
local stop_arc_grad = (graduation_mark_angle * (i)) + (graduation_mark_circ *0.5)
if total_angle < 0 then
cairo_arc_negative(display, x, y, graduation_radius, angle_to_position(cup_start_angle, start_arc_grad), angle_to_position(cup_start_angle, stop_arc_grad))
else
cairo_arc(display, x, y, graduation_radius, angle_to_position(cup_start_angle, start_arc_grad), angle_to_position(cup_start_angle, stop_arc_grad))
end
cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_clr,graduation_fg_alpha))
cairo_set_line_width(display, graduation_thickness)
cairo_stroke(display)
i = i + 1
end
end
-- text
if txt_fg_alpha>0 then
cairo_select_font_face (display, "hooge 05_53", CAIRO_FONT_SLANT_NORMAL, txt_weight);
cairo_set_font_size (display,txt_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_clr, txt_fg_alpha))
cairo_move_to (display,x+xtxt,y+ytxt)
cairo_show_text (display, caption ) cairo_show_text (display,value)cairo_show_text (display, caption2 )
cairo_stroke (display)
end
end
-------------------------------------------------------------------------------
-- loads data and displays table_settings
function display_coffee_table(display)
local function load_coffee_table(display, data)
local str, value = '', 0
if data['name'] == 'time2' then
local max_value = data['max_value']
str = string.format('${time %s}', data['arg'])
str = conky_parse(str)
local value2 = tonumber(str:sub(0,2))
if value2 == max_value then value2 = 0 end
value = value2 + (tonumber(str:sub(4,5))/60)
else
str = string.format('${%s %s}',data['name'], data['arg'])
str = conky_parse(str)
value = tonumber(str)
end
if value == nil then value = 0 end
draw_coffee_table(display, data, value)
end
for i in pairs(coffee_table) do
load_coffee_table(display, coffee_table[i])
end
end
-------------------------------------------------------------------------------
runscheck = 0 -- fix for draw shades running script twice on every update
function conky_main()
if conky_window == nil then
return
end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local display = cairo_create(cs)
local updates = conky_parse('${updates}')
update_num = tonumber(updates)
if update_num > 5 then
cairo_set_antialias (display, CAIRO_ANTIALIAS_SUBPIXEL)
display_coffee_table(display)
cairo_set_antialias (display, CAIRO_ANTIALIAS_DEFAULT)
end
cairo_surface_destroy(cs)
cairo_destroy(display)
end
--[[
The latest script is a lua only weather script. aka: v9000
http://crunchbang.org/forums/viewtopic.php?id=16100
the file:
http://dl.dropbox.com/u/19008369/weatheragain9000.lua.tar.gz
mrppeachys LUA Tutorial
http://crunchbang.org/forums/viewtopic.php?id=17246
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="Arial"--font must be in quotes
default_font_size=14
default_color=0xffffff --white
default_alpha=1 --fully opaque
default_image_width=50
default_image_height=50
-- ## New Options ###
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
-- forecast
datay=375
datayy=15 --datay+(datayy*1)
datafx1=20
imgx=35
imgy=500
imgyy=60 -- imgy+(imgyy*1)
-- =============================================================================
-- Sun & Moon Rise -------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=10,y=35,txt="Sunrise"})
out({c=0xFAFAEC,a=1,x=20,y=50,txt=sun_rise_time[1]})
out({c=0xC0C0C0,a=1,x=365,y=35,txt="Moonrise"})
out({c=0xC0C0C0,a=1,x=375,y=50,txt=moon_rise_time[1]})
-- Sun & Moon Set --------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=10,y=390,txt="Sunset"})
out({c=0xFAFAEC,a=1,x=15,y=405,txt=sun_set_time[1]})
out({c=0xC0C0C0,a=1,x=350,y=392,txt="Moonset"})
out({c=0xC0C0C0,a=1,x=363,y=407,txt=moon_set_time[1]})
-- Moon Phase - Top Center Circle ----------------------------------------------
out({c=0x227992,a=1,x=253,y=143,txt=moon_phase[1]})
image({x=177,y=67,w=75,h=75,file=moon_icon[1]})
-- image({x=148,y=67,w=55,h=55,file="/media/5/Conky/images/red_1.png"})
-- Forecast for Today - see Day# Circle - Left ---------------------------------
out({c=0xFF8C00,fs=14,a=1,x=104,y=183,txt=high_temp[1]})
image({x=70,y=175,w=80,h=80,file=weather_icon[1]})
-- image({x=70,y=150,w=50,h=50,file="/media/5/Conky/images/red_1.png"})
out({c=0x00BFFF,fs=14,a=1,x=103,y=255,txt=low_temp[1]})
-- Above the Month Circle on the Right -----------------------------------------
-- Humidity
out({c=0xFAFAEC,a=1,x=267,y=92,txt="Hum:"})
out({c=0x227992,a=1,x=305,y=92,txt=now["humidity"].."%"})
-- Chance of Rain
out({c=0xFAFAEC,a=1,x=275,y=107,txt="Rain:"})
out({c=0x227992,a=1,x=320,y=107,txt=precipitation[1].."%"})
-- Wind Info - See Months Circle & below ---------------------------------------
image({x=291,y=182,w=65,h=65,file=now["wind_icon"]})
-- image({x=235,y=150,w=50,h=50,file="/media/5/Conky/images/red_1.png"})
out({c=0x227992,a=1,x=270,y=294,txt=now["wind_mph"]})
-- out({c=0x48D1CC,a=1,x=240,y=260,txt=now["wind_nesw"]})
out({c=0xFAFAEC,a=1,x=318,y=294,txt="@"})
out({c=0x227992,a=1,x=340,y=294,txt=now["wind_deg"]})
-- Dew Point -------------------------------------------------------------------
out({c=0xFAFAEC,a=1,x=292,y=317,txt="DP:"})
out({c=0x227992,a=1,x=320,y=317,txt=now["dew_point"].."°"})
-- Above Day# Circle on left ---------------------------------------------------
-- Cloud Cover
out({c=0xFAFAEC,a=1,x=80,y=125,txt="CC:"})
out({c=0x227992,a=1,x=108,y=124,txt=cloud_cover[1].."%"})
-- Ceiling
out({c=0xFAFAEC,a=1,x=66,y=141,txt="Ceil:"})
out({c=0x227992,a=1,x=100,y=140,txt=now["ceiling"]})
-- Current for Today - Day# Circle ---------------------------------------------
out({c=0xFAFAEC,a=1,x=212,y=250,txt="T:"})
out({c=0xFF8C00,fs=14,a=1,x=208,y=265,txt=now["temp"].."°"})
image({x=177,y=269,w=80,h=80,file=now["weather_icon"]})
-- image({x=132,y=218,w=85,h=85,file="/media/5/Conky/images/red_1.png"})
out({c=0xFAFAEC,a=1,x=212,y=365,txt="F:"})
out({c=0x227992,fs=14,a=1,x=208,y=380,txt=now["feels_like"].."°"})
-- Below day# Circle on left ---------------------------------------------------
-- Barometric Pressure
out({c=0xFAFAEC,a=1,x=75,y=316,txt=" BP:"})
out({c=0x227992,a=1,x=105,y=314,txt=now["pressure_mb"]})
-- UV
out({c=0xFAFAEC,a=1,x=95,y=336,txt="UV:"})
out({c=0x227992,a=1,x=123,y=335,txt=uv_index_num[1]})
out({c=0x227992,a=1,x=137,y=335,txt=uv_index_txt[1]})
-- Forecast for the next 3 hours -----------------------------------------------
-- image({x=5,y=353,w=340,h=2,file="/media/5/Conky/images/LightSlateGrey_1.png"})
out({c=0x227992,a=1,f="Arial",fs=16,x=33,y=433,txt="Next 3"})
out({c=0x227992,a=1,f="Arial",fs=16,x=35,y=447,txt="Hours"})
-- 1st hour
out({c=0xFF9600,x=90,y=440,txt=now["fc_hour1_time"]..":00"})
image({w=60,h=60,x=80,y=450,file=now["fc_hour1_wicon"]}) -- image({w=30,h=30,x=223,y=55,file="/home/sector11/Conky/images/red_1.png"})
out({c=0xAFAFAF,x=95,y=525,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
out({c=0xFF9600,x=195,y=440,txt=now["fc_hour2_time"]..":00"})
image({w=60,h=60,x=190,y=450,file=now["fc_hour2_wicon"]}) -- image({w=30,h=30,x=223,y=130,file="/home/sector11/Conky/images/red_1.png"})
out({c=0xAFAFAF,x=205,y=525,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
out({c=0xFF9600,x=310,y=440,txt=now["fc_hour3_time"]..":00"})
image({w=60,h=60,x=295,y=450,file=now["fc_hour3_wicon"]}) -- image({w=30,h=30,x=223,y=215,file="/home/sector11/Conky/images/red_1.png"})
out({c=0xAFAFAF,x=315,y=525,txt=now["fc_hour3_temp"] .."°"})
-- =============================================================================
-- FORECAST for the next 9 days
-- Forecast day 2 -- x = l|r y = u|d
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
######################
# - Conky settings - #
# -Based on a conky- #
# -by 'well I'm not sure' #
######################
background yes
update_interval 1
cpu_avg_samples 2
total_run_times 0
override_utf8_locale yes
double_buffer yes
no_buffers yes
text_buffer_size 1024
imlib_cache_size 1024
minimum_size 370 0
maximum_width 370
gap_x 0
gap_y 35
#####################
# - Text settings - #
#####################
use_xft yes
xftfont monofur:bold:size=11
xftalpha 1
uppercase no
# Text alignment, other possible values are commented
alignment bottom_left
######################
# - Color settings - #
######################
color0 c3c3c3 #mid gray
color1 FF0000 #red
color2 A4FFA4 #light green
color3 007EFF #bright blue
color4 E3E3E3 #very light gray
color5 c6771a #an orange shade
color6 CA8718 #a dust like color
color7 FFE500 #a darker yellow color
color8 C3FF00 #lime green
color9 227992 #bars-blue #another blue 48a3fd
default_color c3c3c3
default_shade_color gray
default_outline_color black
#############################
# - Window specifications - #
#############################
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class conky
own_window_title clicky
#own_window_argb_visual yes
#own_window_argb_value 255
border_inner_margin 0
border_outer_margin 0
#########################
# - Graphics settings - #
#########################
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
draw_graph_borders no
lua_load ~/Conky/LUA/mounted.lua
Text
${lua get_mounted_data 3}
${color 888888}FSYS${color 888888} = ${lua mount 1 total}${goto 100}${color 888888}Size${goto 150}${color D4741B}Free${goto 200}${color1}Used${goto 255}${color 888888}Mount Point
${voffset -5} ${color 547EC8}${stippled_hr 5 1}${color 888888}
${color 3881C7}${lua mount 1 fsys 9}${goto 100}${color 888888}${lua mount 1 size}${goto 150}${color D4741B}${lua mount 1 free}${goto 200}${color1}${lua mount 1 use%}${goto 260}${color 888888}${lua mount 1 mount}
${color 3881C7}${lua mount 5 fsys 9}${goto 100}${color 888888}${lua mount 5 size}${goto 150}${color D4741B}${lua mount 5 free}${goto 200}${color1}${lua mount 5 use%}${goto 260}${color 888888}${lua mount 5 mount}
${color 3881C7}${lua mount 3 fsys 9}${goto 100}${color 888888}${lua mount 3 size}${goto 150}${color D4741B}${lua mount 3 free}${goto 200}${color1}${lua mount 3 use%}${goto 260}${color 888888}${lua mount 3 mount}
${color 3881C7}${lua mount 4 fsys 9}${goto 100}${color 888888}${lua mount 4 size}${goto 150}${color D4741B}${lua mount 4 free}${goto 200}${color1}${lua mount 4 use%}${goto 260}${color 888888}${lua mount 4 mount}
${color 3881C7}${lua mount 6 fsys 9}${goto 100}${color 888888}${lua mount 6 size}${goto 150}${color D4741B}${lua mount 6 free}${goto 200}${color1}${lua mount 6 use%}${goto 260}${color 888888}${lua mount 6 mount}
${color 3881C7}${lua mount 8 fsys 9}${goto 100}${color 888888}${lua mount 8 size}${goto 150}${color D4741B}${lua mount 8 free}${goto 200}${color1}${lua mount 8 use%}${goto 260}${color 888888}${lua mount 8 mount}
${color 3881C7}${lua mount 9 fsys 9}${goto 100}${color 888888}${lua mount 9 size}${goto 150}${color D4741B}${lua mount 9 free}${goto 200}${color1}${lua mount 9 use%}${goto 260}${color 888888}${lua mount 9 mount}
${color 3881C7}${lua mount 7 fsys 9}${goto 100}${color 888888}${lua mount 7 size}${goto 150}${color D4741B}${lua mount 7 free}${goto 200}${color1}${lua mount 7 use%}${goto 260}${color 888888}${lua mount 7 mount}
${alignc}${execi 10 hddtemp /dev/sda}
${alignc}${execi 10 hddtemp /dev/sdb}
--[[partitions for conky by mrpeachy
##instructions
##load script
lua_load ~/lua/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number. This starts data gathering
## to get output:
## ${lua mount partition_number data_type text_length}, where partition number is a number
## text_length is optional, lets you specify the max number of characters the function returns. only affects fsys and mount data options
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint
TEXT
CPU %: ${cpu cpu0} ${lua get_mounted_data 10}
TOTAL PARTITIONS MOUNTED: ${lua mount 1 total}
FSYS${goto 100}SIZE${goto 200}USED%${goto 300}MOUNT
${lua mount 1 fsys}${goto 100}${lua mount 1 size}${goto 200}${lua mount 1 use%}${goto 300}${lua mount 1 mount 10}
${lua mount 2 fsys}${goto 100}${lua mount 2 size}${goto 200}${lua mount 2 use%}${goto 300}${lua mount 2 mount 10}
${lua mount 3 fsys}${goto 100}${lua mount 3 size}${goto 200}${lua mount 3 use%}${goto 300}${lua mount 3 mount 10}
${lua mount 4 fsys}${goto 100}${lua mount 4 size}${goto 200}${lua mount 4 use%}${goto 300}${lua mount 4 mount 10}
]]
conky_start=1
function conky_get_mounted_data(interval)
local updates=tonumber(conky_parse("${updates}"))
timer=(updates % interval)
if timer==0 or conky_start==1 then
fsys={}
size={}
used={}
avail={}
uperc={}
mount={}
local file = io.popen("df -h")
for line in file:lines() do
if string.find(line,"/dev/")~=nil then
local s,f,fs=string.find(line,"^([%d%a%p]*)%s")
table.insert(fsys,fs)
local s,f,sz=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(size,sz)
local s,f,us=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(used,us)
local s,f,av=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(avail,av)
local s,f,up=string.find(line,"%s*([%d%a%p]*)%s",f)
table.insert(uperc,up)
local s,f,mn=string.find(line,"%s*([%d%a%p]*)%s*$",f)
table.insert(mount,mn)
end
end
file:close()
conky_start=nil
end--timed section
return ""
end
function conky_mount(n,d,c)--n=partition_number,d=data_type,c=number of characters to return
d=tostring(d)
n=tonumber(n)
c=tonumber(c) or 0
if d=="total" then
data=#fsys or 1
elseif d=="fsys" then
data=fsys[n] or ""
if c~=0 then
data=string.sub(data,1,c) or ""
end
elseif d=="size" then
data=size[n] or ""
elseif d=="used" then
data=used[n] or ""
elseif d=="free" then
data=avail[n] or ""
elseif d=="use%" then
data=uperc[n] or ""
elseif d=="mount" then
data=mount[n] or ""
if c~=0 then
data=string.sub(data,1,c) or ""
end
else
data="check data type"
end
return data
end--end main function
Quote from: McLovin on November 04, 2013, 08:09:21 PM
Hey jedi, can I get your .bashrc config, that thing is sweet, and I'm one of those weirdos who likes to mod my bashrc almost as much as my conky configs.
black='\e[0;30m'
blue='\e[0;34m'
green='\e[0;32m'
cyan='\e[0;36m'
red='\e[0;31m'
purple='\e[0;35m'
brown='\e[0;33m'
lightgray='\e[0;37m'
darkgray='\e[1;30m'
lightblue='\e[1;34m'
lightgreen='\e[1;32m'
lightcyan='\e[1;36m'
lightred='\e[1;31m'
lightpurple='\e[1;35m'
yellow='\e[1;33m'
white='\e[1;37m'
nc='\e[0m'
############################################
# scripts n stuff
############################################
upinfo ()
{
echo -ne "${green}$HOSTNAME ${red}uptime is ${cyan} \t ";uptime | awk /'up/ {print $3,$4,$5,$6,$7,$8,$9,$10}'
}
localnet ()
{
/sbin/ifconfig | awk /'inet addr/ {print $2}'
echo ""
/sbin/ifconfig | awk /'Bcast/ {print $3}'
echo ""
}
myip ()
{
lynx -dump -hiddenlinks=ignore -nolist [url]http://checkip.dyndns.org:8245/[/url] | grep "Current IP Address" | cut -d":" -f2 | cut -d" " -f2
}
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "don't know how to extract '$1'..." ;;
esac
else
echo "'$1' is not a valid file!"
fi
}
#------------------------------------------////
# Prompt:
#------------------------------------------////
#PS1='\[\033[01;32m\]\u\[\033[01;34m\]@\[\033[01;31m\]\h\[\033[00;34m\]{\[\033[01;34m\]\w\[\033[00;34m\]}\[\033[01;32m\]:\[\033[00m\]'
PS1='\[\033[01;32m\]\u\[\033[01;34m\]@\[\033[01;31m\]\h\[\033[00;34m\]{\[\033[01;34m\]\w\[\033[00;34m\]}\[\033[01;32m\]:\[\033[00m\]'
#------------------------------------------////
# System Information:
#------------------------------------------////
clear
echo -e "${LIGHTGRAY}";figlet "NSA Deterrence Module";
echo -ne "${red}Today is:\t\t${cyan}" `date`; echo ""
echo -e "${red}Kernel Information: \t${cyan}" `uname -smr`
echo -ne "${cyan}";upinfo;echo ""
echo -e "${cyan}"; cal -3
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
background yes
use_xft yes
xftfont Sans:pixelsize=11
# font Dina-9
xftalpha 0.1
update_interval 1
total_run_times 0
own_window yes
own_window_class conkytile
own_window_title ConkyTile
own_window_type desktop
own_window_colour 0F0F0F
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 620 0
maximum_width 620
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_shade_color 3e0e1e
default_outline_color 0E3E16
alignment tm
gap_x 0
gap_y 8
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer none
default_color DAC79C
color0 ffffff
color1 000000
color2 red
color3 yellow
color4 blue
color5 green
color6 orange
color7 00BFFF
color8 FFFF00
color9 F40E0E
lua_load ~/conky/transbg.lua
lua_draw_hook_pre draw_bg 8 0 0 0 0 0x000000 0.66
# ${goto 24}${time %b %e}${offset 8}${time %k:%M}${offset 16}:${offset 16}\
TEXT
${goto 12}Uptime${offset 2}:${offset 8}${uptime_short}${offset 16}:${offset 16}\
CPU0${offset 2}:${offset 8}${if_match ${execpi 60 /home/doug/conky/TCore0.sh}<=50}${color7}${else}${if_match ${execpi 60 /home/doug/conky/TCore0.sh}<=70}${color8}${else}${if_match ${execpi 60 /home/doug/conky/TCore0.sh}>70}${color9}${endif}${endif}${endif}${execpi 60 /home/doug/conky/TCore0.sh}${offset 2}°C${color}${offset 16}:${offset 16}\
CPU1${offset 2}:${offset 8}${if_match ${execpi 60 /home/doug/conky/TCore1.sh}<=50}${color7}${else}${if_match ${execpi 60 /home/doug/conky/TCore1.sh}<=70}${color8}${else}${if_match ${execpi 60 /home/doug/conky/TCore1.sh}>70}${color9}${endif}${endif}${endif}${execpi 60 /home/doug/conky/TCore1.sh}${offset 2}°C${color}${offset 16}:${offset 16}\
CPU${offset 2}:${offset 8}${if_match ${cpu}<=50}${color7}${else}${if_match ${cpu}<=70}${color8}${else}${if_match ${cpu}>70}${color9}${endif}${endif}${endif}${cpu cpu0}%${color}${offset 10}\
${loadavg 1}${offset 4}${loadavg 2}${offset 4}${loadavg 3}${offset 16}:${offset 16}\
Mem${offset 2}:${offset 8}${if_match ${memperc}<=50}${color7}${else}${if_match ${memperc}<=70}${color8}${else}${if_match ${memperc}>70}${color9}${endif}${endif}${endif}${memperc}%${color}${offset 12}
--[[Background originally by londonali1010 (2009)
ability to set any size for background mrpeachy 2011
ability to set variables for bg in conkyrc dk75
the change is that if you set width and/or height to 0
then it assumes the width and/or height of the conky window
so:
Above and After TEXT (requires a composite manager or it blinks!)
lua_load ~/wea_conky/draw_bg.lua
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}
OR Both above TEXT (no composite manager required - no blinking!)
lua_load ~/wea_conky/draw_bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
TEXT
Note
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
See below: 1 2 3 4 5 6 7
${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
covers the whole window and will change if you change the minimum_size setting
1 = 20 corner_radius
2 = 0 x_position
3 = 0 y_position
3 = 0 width
5 = 0 height
6 = 0x000000 color
7 = 0.4 alpha
]]
require 'cairo'
local cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
#!/bin/sh
# exec sensors -f | awk '/Core0 Temp/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}'
sensors | awk '/Core 0/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}'
#!/bin/bash
#conky -c ~/.config/conky/.conkyrc_hdd &
conky -c ~/.config/conky/.conkyrc_network &
conky -c ~/.config/conky/.conkyrc_monitor & #conky -c ~/.config/conky/.conkyrc_web &
conky -c ~/.config/conky/.conkyrc_music
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_colour 191919
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
border_inner_margin 5
border_outer_margin 0
default_color 919191
default_shade_color 000000
default_outline_color d9d7d6
use_spacer yes
no_buffers yes
uppercase yes
imlib_cache_size 0
text_buffer_size 2048
default_bar_size 120 4
total_run_times 0
update_interval 1
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
minimum_size 120
maximum_width 120
gap_x 20
gap_y 23
background yes
use_xft yes
xftfont dejavu sans mono:size=7
xftalpha 1
alignment top_right
TEXT
${if_running gmusicbrowser}
${execp ~/scripts/conky/conkyGmusicbrowser.py --template=~/scripts/conky/conkyGmusicbrowser.template}$else${if_running amarok}
${execp ~/scripts/conky/conkyAmarok.py --template=~/scripts/conky/conkyAmarok.template}$else${if_running vlc}
${execp ~/scripts/conky/conkyVlc.py --template=~/scripts/conky/conkyVlc.template}$else
#${execi 1200 twidge lsrecent > ~/scripts/conky/tweets.txt}${execi 1200 python ~/scripts/conky/tw.py ~/scripts/conky/tweets.txt}
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
###############################################################################
# conkygmusicbrowser.py is a simple python script to gather
# details from gmusicbrowser for use in conky.
#
# Author: VastOne
# Created: 01/28/2011
from datetime import datetime
from optparse import OptionParser
import sys
import traceback
import codecs
import os
import htmllib
import re
from htmlentitydefs import name2codepoint
import shutil
import urllib
try:
import dbus
DBUS_AVAIL = True
except ImportError:
# Dummy D-Bus library
class _Connection:
get_object = lambda *a: object()
class _Interface:
__init__ = lambda *a: None
ListNames = lambda *a: []
class Dummy: pass
dbus = Dummy()
dbus.Interface = _Interface
dbus.service = Dummy()
dbus.service.method = lambda *a: lambda f: f
dbus.service.Object = object
dbus.SessionBus = _Connection
DBUS_AVAIL = False
class CommandLineParser:
parser = None
def __init__(self):
self.parser = OptionParser()
self.parser.add_option("-t", "--template", dest="template", type="string", metavar="FILE", help=u"define a template file to generate output in one call. A displayable item in the file is in the form [--datatype=TI]. The following are possible options within each item: --datatype,--ratingchar. Note that the short forms of the options are not currently supported! None of these options are applicable at command line when using templates.")
self.parser.add_option("-d", "--datatype", dest="datatype", default="TI", type="string", metavar="DATATYPE", help=u"[default: %default] The data type options are: ST (status), CA (coverart), TI (title), AL (album), AR (artist), GE (genre), YR (year), TN (track number), FN (file name), BR (bitrate k/s), LE (length), PP (current position in percent), PT (current position in time), VO (volume), RT (rating). Not applicable at command line when using templates.")
self.parser.add_option("-c", "--coverartpath", dest="coverartpath", default="/tmp/cover", type="string", metavar="PATH", help=u"[default: %default] The file where coverart gets copied to if found when using the --datatype=CA option. Note that if set to an empty string i.e. \"\" the original file path is provided for the coverart path.")
self.parser.add_option("-r", "--ratingchar", dest="ratingchar", default="*", type="string", metavar="CHAR", help=u"[default: %default] The output character for the ratings scale. Command line option overridden if used in templates.")
self.parser.add_option("-s", "--statustext", dest="statustext", default="Playing,Paused,Stopped", type="string", metavar="TEXT", help=u"[default: %default] The text must be comma delimited in the form 'A,B,C'. Command line option overridden if used in templates.")
self.parser.add_option("-n", "--nounknownoutput", dest="nounknownoutput", default=False, action="store_true", help=u"Turn off unknown output such as \"Unknown\" for title and \"0:00\" for length. Command line option overridden if used in templates.")
self.parser.add_option("-S", "--secondsoutput", dest="secondsoutput", default=False, action="store_true", help=u"Force all position and length output to be in seconds only.")
self.parser.add_option("-m", "--maxlength", dest="maxlength", default="0", type="int", metavar="LENGTH", help=u"[default: %default] Define the maximum length of any datatypes output, if truncated the output ends in \"...\"")
self.parser.add_option("-v", "--verbose", dest="verbose", default=False, action="store_true", help=u"Request verbose output, not a good idea when running through conky!")
self.parser.add_option("-V", "--version", dest="version", default=False, action="store_true", help=u"Displays the version of the script.")
self.parser.add_option("--errorlogfile", dest="errorlogfile", type="string", metavar="FILE", help=u"If a filepath is set, the script appends errors to the filepath.")
self.parser.add_option("--infologfile", dest="infologfile", type="string", metavar="FILE", help=u"If a filepath is set, the script appends info to the filepath.")
def parse_args(self):
(options, args) = self.parser.parse_args()
return (options, args)
def print_help(self):
return self.parser.print_help()
class MusicData:
def __init__(self,status,coverart,title,album,length,artist,tracknumber,genre,year,filename,bitrate,current_position_percent,current_position,rating,volume):
self.status = status
self.coverart = coverart
self.title = title
self.album = album
self.length = length
self.artist = artist
self.tracknumber = tracknumber
self.genre = genre
self.year = year
self.filename = filename
self.bitrate = bitrate
self.current_position_percent = current_position_percent
self.current_position = current_position
self.rating = rating
self.volume = volume
class GmusicbrowserInfo:
error = u""
musicData = None
def __init__(self, options):
self.options = options
def testDBus(self, bus, interface):
obj = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
dbus_iface = dbus.Interface(obj, 'org.freedesktop.DBus')
avail = dbus_iface.ListNames()
return interface in avail
def getOutputData(self, datatype, ratingchar, statustext, nounknownoutput, maxlength):
output = u""
if nounknownoutput == True:
unknown_time = ""
unknown_number = ""
unknown_string = ""
else:
unknown_time = "0:00"
unknown_number = "0"
unknown_string = "Unknown"
try:
bus = dbus.SessionBus()
if self.musicData == None:
if self.testDBus(bus, 'org.mpris.gmusicbrowser'):
self.logInfo("Calling dbus interface for music data")
try:
self.logInfo("Setting up dbus interface")
# setup dbus hooks
remote_player = bus.get_object('org.mpris.gmusicbrowser', '/Player')
iface_player = dbus.Interface(remote_player, 'org.freedesktop.MediaPlayer')
self.logInfo("Calling dbus interface for music data")
status = self.getStatusText(iface_player.GetStatus()[0], statustext)
# try to get all the normal stuff...the props return an empty string if nothing is available
props = iface_player.GetMetadata()
# grab the data into variables
if "location" in props:
location = props["location"]
else:
location = None
# handle a file or stream differently for filename
if location.find("file://") != -1:
filename = location[location.rfind("/")+1:]
elif len(location) > 0:
filename = location
else:
filename = ""
if "title" in props:
title = props["title"]
else:
title = None
if "album" in props:
album = props["album"]
else:
album = None
if "artist" in props:
artist = props["artist"]
else:
artist = None
if "year" in props:
year = str(props["year"])
else:
year = None
if "tracknumber" in props:
tracknumber = str(props["tracknumber"])
else:
tracknumber = None
if "audio-bitrate" in props:
bitrate = str(props["audio-bitrate"])
else:
bitrate = None
if year == "0": year = None
if tracknumber == "0": tracknumber = None
if bitrate == "0": bitrate = None
# TODO: get album art working for internet based (if feasible)...
# get coverart url or file link
if "arturl" in props:
coverart = os.path.expanduser(urllib.unquote(str(props["arturl"])).replace("file://",""))
#coverart = os.path.expanduser(str(props["arturl"]).replace(" ", "%20"))
if coverart.find("http://") != -1:
coverart = None
else:
coverart = None
# common details
if "genre" in props:
genre = props["genre"]
else:
genre = None
if "rating" in props:
rating = props["rating"]
else:
rating = None
if "time" in props:
length_seconds = props["time"]
else:
length_seconds = 0
current_seconds = int(iface_player.PositionGet() / 1000)
if length_seconds > 0:
current_position_percent = str(int((float(current_seconds) / float(length_seconds))*100))
else:
length_seconds = 0
current_position_percent = "0"
if self.options.secondsoutput == True:
length = str(length_seconds)
current_position = str(current_seconds)
else:
length = str(length_seconds/60).rjust(1,"0")+":"+str(length_seconds%60).rjust(2,"0")
current_position = str(int(current_seconds/60)).rjust(1,"0")+":"+str(int(current_seconds%60)).rjust(2,"0")
volume = str(iface_player.VolumeGet())
self.musicData = MusicData(status,coverart,title,album,length,artist,tracknumber,genre,year,filename,bitrate,current_position_percent,current_position,rating,volume)
except Exception, e:
self.logError("Issue calling the dbus service:"+e.__str__())
if self.musicData != None:
self.logInfo("Preparing output for datatype:"+datatype)
if datatype == "ST": #status
if self.musicData.status == None or len(self.musicData.status) == 0:
output = None
else:
output = self.musicData.status
elif datatype == "CA": #coverart
if self.musicData.coverart == None or len(self.musicData.coverart) == 0:
output = None
else:
self.logInfo("Copying coverart from %s to %s"%(self.musicData.coverart, self.options.coverartpath))
shutil.copy(self.musicData.coverart, self.options.coverartpath)
self.musicData.coverart = self.options.coverartpath
output = self.musicData.coverart
elif datatype == "TI": #title
if self.musicData.title == None or len(self.musicData.title) == 0:
output = None
else:
output = self.musicData.title
elif datatype == "AL": #album
if self.musicData.album == None or len(self.musicData.album) == 0:
output = None
else:
output = self.musicData.album
elif datatype == "AR": #artist
if self.musicData.artist == None or len(self.musicData.artist) == 0:
output = None
else:
output = self.musicData.artist
elif datatype == "TN": #tracknumber
if self.musicData.tracknumber == None or len(self.musicData.tracknumber) == 0:
output = None
else:
output = self.musicData.tracknumber
elif datatype == "GE": #genre
if self.musicData.title == genre or len(self.musicData.genre) == 0:
output = None
else:
output = self.musicData.genre
elif datatype == "YR": #year
if self.musicData.year == None or len(self.musicData.year) == 0:
output = None
else:
output = self.musicData.year
elif datatype == "FN": #filename
if self.musicData.filename == None or len(self.musicData.filename) == 0:
output = None
else:
output = self.musicData.filename
elif datatype == "BR": #bitrate
if self.musicData.bitrate == None or len(self.musicData.bitrate) == 0:
output = None
else:
output = self.musicData.bitrate
elif datatype == "LE": # length
if self.musicData.length == None or len(self.musicData.length) == 0:
output = None
else:
output = self.musicData.length
elif datatype == "PP": #current position in percent
if self.musicData.current_position_percent == None or len(self.musicData.current_position_percent) == 0:
output = None
else:
output = self.musicData.current_position_percent
elif datatype == "PT": #current position in time
if self.musicData.current_position == None or len(self.musicData.current_position) == 0:
output = None
else:
output = self.musicData.current_position
elif datatype == "VO": #volume
if self.musicData.volume == None or len(self.musicData.volume) == 0:
output = None
else:
output = self.musicData.volume
elif datatype == "RT": #rating
if self.musicData.rating == None or self.isNumeric(self.musicData.rating) == False:
output = None
else:
rating = int(self.musicData.rating)
if rating > 0:
output = u"".ljust(rating,ratingchar)
elif rating == 0:
output = u""
else:
output = None
else:
self.logError("Unknown datatype provided: " + datatype)
return u""
if output == None or self.musicData == None:
if datatype in ["LE","PT"]:
if self.options.secondsoutput == True:
output = unknown_number
else:
output = unknown_time
elif datatype in ["PP","VO","YR","TN"]:
output = unknown_number
elif datatype == "CA":
output = ""
else:
output = unknown_string
if maxlength > 0 and len(output) > maxlength:
output = output[:maxlength-3]+"..."
return output
except SystemExit:
self.logError("System Exit!")
return u""
except Exception, e:
traceback.print_exc()
self.logError("Unknown error when calling getOutputData:" + e.__str__())
return u""
def getStatusText(self, status, statustext):
if status != None:
statustextparts = statustext.split(",")
if status == 0:
return statustextparts[0]
elif status == 1:
return statustextparts[1]
elif status == 2:
return statustextparts[2]
else:
return status
def getTemplateItemOutput(self, template_text):
# keys to template data
DATATYPE_KEY = "datatype"
RATINGCHAR_KEY = "ratingchar"
STATUSTEXT_KEY = "statustext"
NOUNKNOWNOUTPUT_KEY = "nounknownoutput"
MAXLENGTH_KEY = "maxlength"
datatype = None
ratingchar = self.options.ratingchar #default to command line option
statustext = self.options.statustext #default to command line option
nounknownoutput = self.options.nounknownoutput #default to command line option
maxlength = self.options.maxlength #default to command line option
for option in template_text.split('--'):
if len(option) == 0 or option.isspace():
continue
# not using split here...it can't assign both key and value in one call, this should be faster
x = option.find('=')
if (x != -1):
key = option[:x].strip()
value = option[x + 1:].strip()
if value == "":
value = None
else:
key = option.strip()
value = None
try:
if key == DATATYPE_KEY:
datatype = value
elif key == RATINGCHAR_KEY:
ratingchar = value
elif key == STATUSTEXT_KEY:
statustext = value
elif key == NOUNKNOWNOUTPUT_KEY:
nounknownoutput = True
elif key == MAXLENGTH_KEY:
maxlength = int(value)
else:
self.logError("Unknown template option: " + option)
except (TypeError, ValueError):
self.logError("Cannot convert option argument to number: " + option)
return u""
if datatype != None:
return self.getOutputData(datatype, ratingchar, statustext, nounknownoutput, maxlength)
else:
self.logError("Template item does not have datatype defined")
return u""
def getOutputFromTemplate(self, template):
output = u""
end = False
a = 0
# a and b are indexes in the template string
# moving from left to right the string is processed
# b is index of the opening bracket and a of the closing bracket
# everything between b and a is a template that needs to be parsed
while not end:
b = template.find('[', a)
if b == -1:
b = len(template)
end = True
# if there is something between a and b, append it straight to output
if b > a:
output += template[a : b]
# check for the escape char (if we are not at the end)
if template[b - 1] == '\\' and not end:
# if its there, replace it by the bracket
output = output[:-1] + '['
# skip the bracket in the input string and continue from the beginning
a = b + 1
continue
if end:
break
a = template.find(']', b)
if a == -1:
self.logError("Missing terminal bracket (]) for a template item")
return u""
# if there is some template text...
if a > b + 1:
output += self.getTemplateItemOutput(template[b + 1 : a])
a = a + 1
return output
def writeOutput(self):
if self.options.template != None:
#load the file
try:
fileinput = codecs.open(os.path.expanduser(self.options.template), encoding='utf-8')
template = fileinput.read()
fileinput.close()
except Exception, e:
self.logError("Error loading template file: " + e.__str__())
else:
output = self.getOutputFromTemplate(template)
else:
output = self.getOutputData(self.options.datatype, self.options.ratingchar, self.options.statustext, self.options.nounknownoutput, self.options.maxlength)
print output.encode("utf-8",'replace')
def isNumeric(self,value):
try:
temp = int(value)
return True
except:
return False
def logInfo(self, text):
if self.options.verbose == True:
print >> sys.stdout, "INFO: " + text
if self.options.infologfile != None:
datetimestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
fileoutput = open(self.options.infologfile, "ab")
fileoutput.write(datetimestamp+" INFO: "+text+"\n")
fileoutput.close()
def logError(self, text):
print >> sys.stderr, "ERROR: " + text
if self.options.errorlogfile != None:
datetimestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
fileoutput = open(self.options.errorlogfile, "ab")
fileoutput.write(datetimestamp+" ERROR: "+text+"\n")
fileoutput.close()
def unEscape(self,text):
parser = htmllib.HTMLParser(None)
parser.save_bgn()
parser.feed(text)
return parser.save_end()
def htmlentitydecode(self,s):
return re.sub('&(%s);' % '|'.join(name2codepoint),
lambda m: unichr(name2codepoint[m.group(1)]), s)
def main():
parser = CommandLineParser()
(options, args) = parser.parse_args()
if options.version == True:
print >> sys.stdout,"conkygmusicbrowser v.2.00"
else:
if options.verbose == True:
print >> sys.stdout, "*** INITIAL OPTIONS:"
print >> sys.stdout, " datatype:", options.datatype
print >> sys.stdout, " template:", options.template
print >> sys.stdout, " ratingchar:", options.ratingchar
print >> sys.stdout, " nounknownoutput:", options.nounknownoutput
print >> sys.stdout, " secondsoutput:", options.secondsoutput
print >> sys.stdout, " maxlength:", options.maxlength
print >> sys.stdout, " verbose:", options.verbose
print >> sys.stdout, " errorlogfile:",options.errorlogfile
print >> sys.stdout, " infologfile:",options.infologfile
gmusicbrowserinfo = GmusicbrowserInfo(options)
gmusicbrowserinfo.writeOutput()
if __name__ == '__main__':
main()
sys.exit()
${image [--datatype=CA] -p 0,104-s 120x120}${if_match "[--datatype=ST]" == "Playing"}${alignc}[--datatype=ST]
${alignc}${font Guifxv2Transports:regular:size=22}${offset -11}1${font}
[--datatype=PT]${alignr}[--datatype=LE]
${execibar 1 ~/scripts/conky/conkyGmusicbrowser.py --datatype=PP}${font dejavu sans mono:size=3}
#${color 919191}TITLE:${color 616161}
${font dejavu sans mono:size=7}[--datatype=TI --maxlength=32]
#${color 919191}ARTIST:${color 616161}
[--datatype=AR --maxlength=32]
#${color 919191}ALBUM:${color 616161}
[--datatype=AL --maxlength=30]
#${color 919191}Volume ${color 616161}${alignr}[--datatype=VO]
#${color 919191}BitRate ${color 616161}${alignr}[--datatype=BR]
${image [--datatype=CA] -p 0,104 -s 120x120}$else${if_match "[--datatype=ST]" == "Paused"}${alignc}[--datatype=ST]
${alignc}${font Guifxv2Transports:regular:size=22}${offset -11}2${font}
[--datatype=PT]${alignr}[--datatype=LE]
${execibar 1 ~/scripts/conky/conkyGmusicbrowser.py --datatype=PP}${font dejavu sans mono:size=3}
#${color 919191}TITLE:${color 616161}
${font dejavu sans mono:size=7}[--datatype=TI --maxlength=32]
#${color 919191}ARTIST:${color 616161}
[--datatype=AR --maxlength=32]
#${color 919191}ALBUM:${color 616161}
[--datatype=AL --maxlength=30]
#${color 919191}Volume ${color 616161}${alignr}[--datatype=VO]
#${color 919191}BitRate ${color 616161}${alignr}[--datatype=BR]
${image [--datatype=CA] -p 0,104 -s 120x120}$else${alignc}Stopped
${alignc}${font Guifxv2Transports:regular:size=22}${offset -11}3${font}
[--datatype=PT]${alignr}[--datatype=LE]
${execibar 1 ~/scripts/conky/conkyGmusicbrowser.py --datatype=PP}${font dejavu sans mono:size=3}
#${color 919191}TITLE:${color 616161}
${font dejavu sans mono:size=7}[--datatype=TI --maxlength=32]
#${color 919191}ARTIST:${color 616161}
[--datatype=AR --maxlength=32]
#${color 919191}ALBUM:${color 616161}
[--datatype=AL --maxlength=30]
#${color 919191}Volume ${color 616161}${alignr}[--datatype=VO]
#${color 919191}BitRate ${color 616161}${alignr}[--datatype=BR]
${image ~/scripts/conky/grey.jpg -p 0,104 -s 120x120}$endif$endif
QuoteBut the MPRIS v2 Dbus interface is not enabled by default in VLC 2.0, so here's how to enable it: in VLC go to Tools > Preferences, select "All" under "Show settings" (bottom left), then navigate to Interface > Control Interface and check the box next to "D-Bus control interface"This doesn't seem to have affected the conky output though.
@crunchbang:~/scripts/conky$ python conkyAmarok.py
Side B
@crunchbang:~/scripts/conky$ python conkyVlc.py
Unknown
sudo apt-get install mpdris
own_window_type dock
##############################################
# Settings
##############################################
background yes
use_xft yes
# xftfont Cursive Sans:bold:size=6
xftfont PT Sans Caption:bold:pixelsize=10
xftalpha 1.0
update_interval 1.0
update_interval_on_battery 30.0
total_run_times 0
own_window yes
own_window_colour 1E1D1D
own_window_transparent no
own_window_type dock
# own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class FBoxConky
own_window_title fbox_conky
##############################################
# Compositing tips:
# Conky can play strangely when used with
# different compositors. I have found the
# following to work well, but your mileage
# may vary. Comment/uncomment to suit.
##############################################
##
own_window_argb_visual yes
#own_window_argb_value 2
## xcompmgr
# own_window_argb_visual yes
# own_window_argb_value 120
## cairo-compmgr
#own_window_type desktop
#own_window_argb_visual yes
##############################################
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
short_units yes
imlib_cache_size 0
pad_percents 1
max_specials 2048
max_user_text 3200
text_buffer_size 1024
no_buffers yes
uppercase no
if_up_strictness address
double_buffer yes
minimum_size 1366 0
maximum_width 1366
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
border_inner_margin 1
border_outer_margin 1
default_color DAC79C
default_shade_color 000000
default_outline_color 828282
color0 FFFFFF
color1 000000
color2 FF0000 # - red
color3 FFFF00 # - yellow
color4 0000FF # - blue
color5 00FF00 # - green
color6 FFA500 # - orange
color7 00CDCD # - cyan3
color8 FFD700 # - gold
color9 F00F16 # - reddish
alignment tm
gap_x 0
gap_y 0
# -- doesn't seem to work when docked in the slit --#
# lua_load ~/conky/transbg.lua
# lua_draw_hook_pre draw_bg 0 0 0 0 0 0x140C0B 0.10
TEXT
${goto 12}Uptime:${offset 8}${uptime_short}${offset 16}|${offset 16}\
Core1:${offset 8}${if_match ${execpi 60 ~/conky/TCore0.sh}<=50}${color7}${else}${if_match ${execpi 60 ~/conky/TCore0.sh}<=70}${color8}${else}${if_match ${execpi 60 ~/conky/TCore0.sh}>70}${color9}${endif}${endif}${endif}${execpi 60 ~/conky/TCore0.sh}${offset 2}°C${color}${offset 16}\
Core2:${offset 8}${if_match ${execpi 60 ~/conky/TCore1.sh}<=50}${color7}${else}${if_match ${execpi 60 ~/conky/TCore1.sh}<=70}${color8}${else}${if_match ${execpi 60 ~/conky/TCore1.sh}>70}${color9}${endif}${endif}${endif}${execpi 60 ~/conky/TCore1.sh}${offset 2}°C${color}${offset 16}|${offset 16}\
CPU:${offset 8}${if_match ${cpu}<=50}${color7}${else}${if_match ${cpu}<=70}${color8}${else}${if_match ${cpu}>70}${color9}${endif}${endif}${endif}${cpu cpu0}%${color}${offset 8}${loadavg 1}${offset 8}${loadavg 2}${offset 8}${loadavg 3}${offset 16}\
Memory:${offset 8}${if_match ${memperc}<=50}${color7}${else}${if_match ${memperc}<=70}${color8}${else}${if_match ${memperc}>70}${color9}${endif}${endif}${endif}${memperc}%${color}${offset 16}|${offset 16}\
Battery:${offset 8}${execpi 60 acpi -b | awk '{print $3}' | cut -c1-4}${offset 8}${if_match ${battery_percent BAT0}<=15}${color9}${blink ${battery_percent BAT0}%}${color}${else}${if_match ${battery_percent BAT0}<=33}${color8}${battery_percent BAT0}%${else}${if_match ${battery_percent BAT0}>33}${color7}${battery_percent BAT0}%${endif}${endif}${endif}${color}${offset 16}|${offset 16}\
Wlan0:${if_up wlan0}${offset 8}${wireless_bitrate wlan0}${offset 16}${wireless_link_qual wlan0}/${wireless_link_qual_max wlan0}${offset 16}${if_match ${wireless_link_qual_perc wlan0}<=30}${color9}${blink ${wireless_link_qual_perc wlan0}%}${color}${else}${if_match ${wireless_link_qual_perc wlan0}<=50}${color8}${wireless_link_qual_perc wlan0}%${else}${if_match ${wireless_link_qual_perc wlan0}>50}${color7}${wireless_link_qual_perc wlan0}%${endif}${endif}${endif}${color}${offset 16}${if_up wlan0}Up:${offset 8}${upspeedf wlan0}${offset 16}Down:${offset 8}${downspeedf wlan0}${endif}${color}\
${alignr 12}${time %a %e %b}
#!/bin/sh
# exec sensors -f | awk '/Core0 Temp/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}'
sensors | awk '/Core 0/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}'
own_window_class Fuck_Conky
Quote from: Snap on December 06, 2014, 10:39:34 AM
@jedi mostly.
Please, can you share the code for this conky. This area specifically. I'm a lunatic...
(http://s28.postimg.org/czn6rs889/040714_C1.jpg) (http://postimg.org/image/czn6rs889/)
Cool tint2, BTW.
######################
# - Conky settings - #
######################
background yes
update_interval .3
cpu_avg_samples 2
total_run_times 0
override_utf8_locale yes
double_buffer yes
#no_buffers yes
text_buffer_size 1024
#imlib_cache_size 0
minimum_size 950 0
maximum_width 950
gap_x 50
gap_y 58
#####################
# - Text settings - #
#####################
use_xft yes
xftfont monofur:size=15
xftalpha .8
uppercase no
alignment top_left
#############################
# - Window specifications - #
#############################
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class conky-semi
#own_window_argb_visual yes
#own_window_argb_value 255
border_inner_margin 0
border_outer_margin 0
#########################
# - Graphics settings - #
#########################
draw_shades no
#default_shade_color 292421
draw_outline no
draw_borders no
stippled_borders 0
draw_graph_borders no
#lua_load /home/jed/Conky/LUA/draw_bg.lua
#lua_draw_hook_post draw_bg 10 0 0 0 0 0x5C3434 0.4
TEXT
${execpi 36000 /home/jedi/Conky/Scripts/conkcal.sh}
${font CaviarDreams:size=40}${goto 60}${color 949494}${voffset 15}${time %l:%M %P}
${font CaviarDreams:size=15}${goto 45}${color 3881C7}${voffset -5}${time %A %B %d %Y} ${voffset -95}${color 949494}${font CaviarDreams:size=13}${goto 300}${execpi 1800 conkyForecast --datatype=CC}
${goto 450}${color 3881C7}${font CaviarDreams:size=13}${voffset 40}Current Moon Phase:
${goto 450}${color 949494}${execi 300 conkyForecast --imperial --datatype=MP}
${goto 485}${color 3881C7}${font CaviarDreams:size=13}${execi 1 conkyForecast-SunsetSunriseCountdown -t} in:
${goto 450}${color 949494}${execi 1 conkyForecast-SunsetSunriseCountdown -L}
${execpi 1800 conkyForecast --location=USME0330 --imperial --template=$HOME/Conky/LUA/day-night2.template}
#!/bin/bash
cd $(dirname $0)
# horizontal and vertical calendar for conky by ans
# Updated by: mobilediesel, dk75, Bruce, Crinos512, et al.
# locale depend week day names
DOW=("Mo" "Tu" "We" "Th" "Fr" "Sa" "Su")
while getopts ":vl:" opts; do
case "$opts" in
l) lang=$OPTARG;;
v) orientation="$opts";;
esac
done
if [ -f lang ]; then
. lang
fi
COLOROLD="445566" #MidSlateGrey
COLORTODAY="3881C7" #DeepSkyBlue
COLORREST="445566" #MidSlateGrey
COLORNEXT="778899" #LightSlateGrey
COLORSATURDAY="3881C7" #DeepSkyBlue
COLORSUNDAY="FFA07A" #LightSalmon
COLOR=("" "" "" "" "" "\${color $COLORSATURDAY}" "\${color $COLORSUNDAY}")
COLOREND=("" "" "" "" "" "" "\${color}")
TODAY=$(date +%-d)
LASTDAY=$(date -d "-$TODAY days +1 month" +%d)
FIRSTDAY=$(date -d "-$[$TODAY-1] days" +%u)
# horizontal function
h () {
# Build $TOPLINE
k=$FIRSTDAY
for j in {1..31}; do
x=$[j+LASTDAY/j]
case $j in
${j/#$x}) TOPLINE="$TOPLINE ${COLOR[$[k-1]]}${DOW[$[k-1]]}${COLOREND[$[k-1]]}";;
$[LASTDAY+1]) TOPLINE="$TOPLINE \${color $COLORNEXT}${DOW[$[k-1]]}";;
*) TOPLINE="$TOPLINE ${DOW[$[k-1]]}";;
esac
k=$[${k/#7/0}+1]
done
BOTTOM="\${color $COLOROLD}$(seq -w -s ' ' $LASTDAY|sed "0,/[0-3]*$TODAY \?/s//\${color $COLORTODAY}&\${color $COLORREST}/") \${color $COLORNEXT}$(seq -w -s ' ' 0$[31-$LASTDAY])"
echo "${TOPLINE/# /}"
echo "$BOTTOM\${color}"
}
#vertical function
v () {
for i in $(seq 1 $[TODAY-1]); do
TODAYC[$i]="\${color $COLOROLD}"
done
TODAYC[$TODAY]="\${color $COLORTODAY}"
for i in $(seq $[TODAY+1] $LASTDAY); do
TODAYC[$i]="\${color $COLORREST}"
done
k=$FIRSTDAY
for j in $(seq $LASTDAY); do
echo "${COLOR[$[k-1]]}${DOW[$[k-1]]} ${TODAYC[$j]}$(printf "%02d" $j)\${color}"
k=$[${k/#7/0}+1]
done
}
# call function based on "$orientation"
${orientation:-h}
${image [--datatype=WI --night] -p 305,60 -s 100x100}${image [--location=USME0330 --datatype=MI] -p 455,40 -s 100x100}
Quote from: VastOne on December 06, 2014, 06:25:19 PM
Fuck Conky!
background yes
update_interval 2.0
text_buffer_size 1024
total_run_times 0
double_buffer yes
alignment top_left
gap_x 60
gap_y 0
minimum_size 1320 30
maximum_width 1320
own_window yes
own_window_type normal #override
own_window_transparent yes
own_window_hints undecorated,sticky,skip_taskbar,skip_pager
own_window_argb_visual yes
own_window_argb_value 255
# font defaults:
use_xft yes
xftfont Caviar Dreams:weight=bold:size=12
xftalpha 0.9
override_utf8_locale yes
## NOTE: Other fonts can be called up during the TEXT formatting
# these fonts are found through the normal path, or ~/.fonts
# OpenLogos
## images, buffering, shading
imlib_cache_size 60
double_buffer yes
draw_shades no
#default_shade_color 777777
## misc text formatting
short_units yes
pad_percents 0
border_inner_margin 0
uppercase no
use_spacer right
## outlines and borders
draw_outline no
draw_borders no
draw_graph_borders no
border_width 0
## stdout/console printing
out_to_ncurses no
out_to_console no
## process settings
top_name_width 5
#no_buffers yes
#### end config
#### Begin display information
## everything below 'TEXT' is drawn on screen
lua_load /home/jedi/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 15 0 15 0 25 0x000000 0.8
## color was 09ECC8 and 2D4863 and 021A30
TEXT
${voffset 15}${color #3881C7}${goto 10}Up: ${color 949494}$uptime \
${color #3881C7}Kern: ${color 949494}${kernel} \
${color #3881C7}CPU Use: ${color 949494}${cpu cpu0}% \
${color #3881C7}CPU Temp: ${color 949494}${hwmon 2 temp 1}º \
${color #3881C7}MoBo Temp: ${color 949494}${hwmon 1 temp 1}º \
${color #3881C7}GPU Temp:${color 949494} ${nvidia temp}º \
${color #3881C7} MEM: ${color 949494}$memperc% $mem/$memmax \
${color #3881C7}NET: \
${color #3881C7}Up: ${color 949494}${upspeed wlan0} k/s \
${color #3881C7}Down: ${color 949494}${downspeed wlan0}k/s${color} \
#${color #3881C7} Battery: ${color 949494}${battery_percent BAT0}% ${battery_time BAT0}
# conky configuration
# set to yes if you want Conky to be forked in the background
background yes
# Use Xft?
use_xft yes
xftfont mono:size=12
xftalpha 0.8
# Update interval in seconds
update_interval 1.0
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
draw_graph_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 0
# border width
border_width 1
# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color black
alignment tr
gap_x 10
gap_y 5
minimum_size 375 330
maximum_width 375
# Text alignment, other possible values are commented
#alignment top_right
#alignment bottom_left
#alignment bottom_right
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 1
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 1
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none
# grey
color1 CCCCCC
# orange
#color2 DA7020
# blue
color2 7095BB
text_buffer_size 1024
max_specials 1024
own_window_title conky_forecast
TEXT
${color1}${execpi 900 conkyForecast --imperial USME0330 -t /home/jedi/Conky/Templates/conkyforecast.jed1}
${alignc}[datatype=LF] | ${color FFA07A}[--datatype=CN], Your location here.
${color 547EC8}${stippled_hr 5 1}
Today's Forecast: ${color9}High: [--datatype=HT --startday=0] ${color7} Low: [--datatype=LT --startday=0]
${goto 15} ${color3}Current Temp: [--datatype=HT] ${color}Feels Like: [--datatype=LT]
${goto 80} ${color4}[--datatype=CC]
${alignc}${image [--datatype=WI --night] -p 125,80 -s 80x80}
${goto 100} ${color3}Hum: ${color}[--datatype=HM]
${goto 100} ${color3}Vis: ${color}[--datatype=VI]
${alignc} ${color3}Wind: ${color}[--datatype=WD] ${color3}@ ${color}[--datatype=WS]${color}
${color 547EC8} ${hr}
${goto 27}[--datatype=DW --startday=1] ${goto 170}[--datatype=DW --startday=2]${goto 295}[--datatype=DW --startday=3]
${goto 27}${color9}H: [--datatype=HT --startday=1] ${goto 170}${color9}H: [--datatype=HT --startday=2]${goto 295}${color9}H: [--datatype=HT --startday=3]
${color7}${image [--datatype=WI --startday=1] -p 27,248 -s 40x40}${image [--datatype=WI --startday=2] -p 170,248 -s 40x40}${image [--datatype=WI --startday=3] -p 300,248 -s 40x40}
${goto 27}${color9}L: [--datatype=LT --startday=1] ${goto 170}${color9}L: [--datatype=HT --startday=2] ${goto 300}${color9}L: [--datatype=HT --startday=3]
## For OpenBox
own_window yes
##own_window_type desktop
own_window_type normal
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
# .conkyrc - Edited from various examples across the 'net
# Used by VastOne on VSIDO
# Create own window instead of using desktop (required in nautilus)
#own_window yes
#own_window_type normal
#own_window_transparent no
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
# use_spacer right
# Use Xft?
use_xft yes
xftfont Liberation Sans:size=13.8
xftalpha 0.9
text_buffer_size 2048
# Update interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
#minimum_size 1024 0
#maximum_width 1024
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window yes
own_window_transparent yes
own_window_class conky-semi
# Stippled borders?
stippled_borders 0
# border margins
# border_margin 0
# border width
border_width 1
# Default colors and also border colors
#default_color grey
#color2=white
#color3=grey
#default_shade_color black
#default_outline_color grey
own_window_colour 000000
# Text alignment, other possible values are commented
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 0
gap_y 5
minimum_size 1250 29
maximum_width 1700
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
imlib_cache_size 0
# number of cpu samples to average set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none
#lua_load ~/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.3
## ${voffset -3} ${color 7D8C93}OD ${color 55688A} ${execi 600 inxi -W63882 | cut -c32-34}°
TEXT
${image /usr/local/bin/images/vsidoorb_blk.png -s 40x40 -p 1,-.5} ${voffset 10} ${color 55688A} $kernel ${color 7D8C93} ${color lime green}${uptime_short} ${color 7D8C93} CPU ${color 55688A}${cpu cpu0}% ${color 7D8C93}MEM ${color 55688A}${memperc}% ${mem} / ${memmax} ${color 7D8C93} CPU ${color 55688A}${platform it87.552 temp 2}° ${color 7D8C93} MB ${color 55688A}${platform it87.552 temp 1}° ${color 7D8C93} ${color 7D8C93}GPU ${color 55688A} ${execi 5 sensors nouveau-pci-0400 | grep temp1 | awk '{print $2}' | cut -c2-3}° ${color 7D8C93} HD${color 55688A} ${execi 5 hddtemp -n /dev/sdb}° ${color 7D8C93} NET${color 55688A} ${voffset 2}${downspeedgraph bond0 12,90 000000 00ff00} ${upspeedgraph bond0 12,90 000000 ff0000}${color 7D8C93}
Quote from: VastOne on July 04, 2015, 04:59:41 AM
Those famous words by some hack keep ringing in my ears...
FUCK CONKY!
(perhaps I should trademark that)
T-shirt anyone?
(I hope a certain Someone11 is shitting bricks)
QuoteT-shirt anyone?
Quote from: VastOne on July 04, 2015, 04:59:41 AM
(I hope a certain Someone11 is shitting bricks)
Quote(I hope a certain Someone11 is shitting bricks)
QuoteBTW, I am always open to any replacements in VSIDO. The conky default can be replaced at anytime, just shoot me the config and lets vote on it
##############################################
# Settings
##############################################
background yes
use_xft yes
# xftfont Cursive Sans:bold:size=6
xftfont Source Sans Pro:bold:size=10
xftalpha 1.0
update_interval 1.0
update_interval_on_battery 30.0
total_run_times 0
own_window yes
own_window_colour 1E1D1D
own_window_transparent no
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class ConkyVsido
own_window_title ConkyInfo
##############################################
# Compositing tips:
# Conky can play strangely when used with
# different compositors. I have found the
# following to work well, but your mileage
# may vary. Comment/uncomment to suit.
##############################################
##
#own_window_argb_visual yes
#own_window_argb_value 2
## xcompmgr
# own_window_argb_visual yes
# own_window_argb_value 120
## cairo-compmgr
#own_window_type desktop
#own_window_argb_visual yes
##############################################
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
short_units yes
imlib_cache_size 0
pad_percents 1
max_specials 2048
max_user_text 3200
text_buffer_size 1024
no_buffers yes
uppercase no
if_up_strictness address
double_buffer yes
minimum_size 800 0
maximum_width 800
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
border_inner_margin 1
border_outer_margin 1
default_color DAC79C
default_shade_color 000000
default_outline_color 828282
color0 FFFFFF
color1 000000
color2 FF0000 # - red
color3 FFFF00 # - yellow
color4 0000FF # - blue
color5 00FF00 # - green
color6 FFA500 # - orange
color7 00CDCD # - cyan3
color8 FFD700 # - gold
color9 F00F16 # - reddish
alignment tl
gap_x 0
gap_y 0
# -- doesn't seem to work when docked in the slit --#
# lua_load ~/conky/transbg.lua
# lua_draw_hook_pre draw_bg 0 0 0 0 0 0x140C0B 0.10
TEXT
${goto 24}${time %a %e %b %k:%M}${offset 24}|${offset 24}\
Uptime:${offset 8}${uptime_short}${offset 24}|${offset 24}\
CPU:${offset 8}${if_match ${cpu}<=50}${color7}${else}${if_match ${cpu}<=70}${color8}${else}${if_match ${cpu}>70}${color9}${endif}${endif}${endif}${cpu cpu0}%${color}${offset 8}${loadavg 1}${offset 8}${loadavg 2}${offset 8}${loadavg 3}${offset 16}${offset 24}|${offset 24}\
Memory:${offset 8}${if_match ${memperc}<=50}${color7}${else}${if_match ${memperc}<=70}${color8}${else}${if_match ${memperc}>70}${color9}${endif}${endif}${endif}${memperc}%${color}
#own_window_argb_visual yes
Quote from: PackRat on July 08, 2015, 05:33:38 PM
So yeah, fanden Conky.
conky.config = {
alignment = 'top_left',
background = true,
color2 = '888888',
cpu_avg_samples = 2,
default_color = 'FFFFFF',
double_buffer = true,
font = 'Caviar Dreams:size=8',
gap_x = 25,
gap_y = 13,
minimum_width = 200,
no_buffers = true,
own_window = true,
own_window_type = 'override',
own_window_transparent = true,
update_interval = 1.0,
short_units = yes,
use_xft = true,
}
conky.text = [[
${voffset 8}$color2${font Caviar Dreams:size=16}${time %A}$font${voffset -8}$alignr$color${font Caviar Dreams:size=38}${time %e}$font
$color${voffset -30}$color${font Caviar Dreams:size=18}${time %b}$font${voffset -3} $color${font Caviar Dreams:size=20}${time %Y}$font$color2$hr
#
${voffset 20}${goto 40}${color}CPU${font Caviar Dreams:bold:size=8}$alignr$cpu%
${voffset 5}${goto 40}$font$color2${top name 1}$alignr$color${top cpu 1}%
${goto 40}$color2${top name 2}$alignr$color${top cpu 2}%
${goto 40}$color2${top name 3}$alignr$color${top cpu 3}%
${goto 40}$color2${top name 4}$alignr$color${top cpu 4}%
${goto 40}$color2${top name 5}$alignr$color${top cpu 5}%
#
${voffset 10}${goto 40}${color}RAM${font Caviar Dreams:bold:size=8}$alignr$mem$font
${goto 40}${voffset 5}$color2${top_mem name 1}$alignr$color${top_mem mem_res 1}
${goto 40}$color2${top_mem name 2}$alignr$color${top_mem mem_res 2}
${goto 40}$color2${top_mem name 3}$alignr$color${top_mem mem_res 3}
${goto 40}$color2${top_mem name 4}$alignr$color${top_mem mem_res 4}
${goto 40}$color2${top_mem name 5}$alignr$color${top_mem mem_res 5}
#
${voffset 20}${goto 40}${color}DRIVES${font Caviar Dreams:bold:size=8}$alignr
${voffset 5}${goto 40}${font}${color2}root $alignr$color${fs_size /} (${fs_used /})
${goto 40}${color2}home $alignr$color${fs_size /home} (${fs_used /home})
${goto 40}${color2}data $alignr$color${fs_size /mnt/data} (${fs_used /mnt/data})
${goto 40}${color2}NAS $alignr$color${fs_size /mnt/share} (${fs_used /mnt/share})
#
${voffset 20}${goto 40}${color}NET${font Caviar Dreams:bold:size=8}$alignr
${voffset 5}${goto 40}${font}${color2}down $alignr$color${downspeedf enp3s0} Kb/s
${goto 40}${color2}up $alignr$color${upspeedf enp3s0} Kb/s
#
${voffset 20}${goto 40}${color}WEATHER ${font Caviar Dreams:bold:size=8}$alignr
${voffset 5}${goto 40}${color2}Silkeborg $alignr$color${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=556914&u=c" -o ~/.cache/weather.xml} ${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°C
#${voffset 20}$alignr$color${execi 5000 awk -F= '/ID=/{printf $2" "} /RELEASE=/{printf $2" "} /NAME=/{print $2}' /etc/lsb-release}
${voffset 5}${color2}${alignr}${execi 1200 whoami}@${nodename}
${alignr}${color2}${font Caviar Dreams:size=8}uptime: ${color}${uptime_short}
${color2}${font Caviar Dreams:size=8}${alignr}kernel: ${color}4.1.1-1
]]
conky.config = {
out_to_console = true,
out_to_x = false,
background = false,
cpu_avg_samples = 2,
net_avg_samples = 2,
no_buffers = true,
out_to_stderr = false,
update_interval = 1.0,
uppercase = false,
use_spacer = 'none',
};
conky.text =
[[ Uptime: ${uptime_short} | CPU: ${hwmon 2 temp 1} °C CPU: ${hwmon 2 temp 2} °C | CPU%: ${cpu cpu0}% ${loadavg} | Mem: ${memperc}% | Eth0: Down - ${downspeedf wlp3s0} kb/s Up - ${upspeedf wlp3s0} kb/s | ${time %A %e %b %k:%M} ]]
#! /usr/bin/lua
local usage = [[
Usage: convert.lua old_conkyrc [new_conkyrc]
Tries to convert conkyrc from the old v1.x format to the new, lua-based format.
Keep in mind that there is no guarantee that the output will work correctly
with conky, or that it will be able to convert every conkyrc. However, it
should provide a good starting point.
Altough you can use this script with only 1 arg and let it overwrite the old
config, it's suggested to use 2 args so that the new config is written in a new
file (so that you have backup if something went wrong).
For more information about the new format, read the wiki page
<http://wiki.conky.be/index.php?title=conky2rc_format>
]];
local function quote(s)
if not s:find("[\n'\\]") then
return "'" .. s .. "'";
end;
local q = '';
while s:find(']' .. q .. ']', 1, true) do
q = q .. '=';
end;
return string.format('[%s[\n%s]%s]', q, s, q);
end;
local bool_setting = {
background = true, disable_auto_reload = true, double_buffer = true, draw_borders = true,
draw_graph_borders = true, draw_outline = true, draw_shades = true, extra_newline = true,
format_human_readable = true, no_buffers = true, out_to_console = true,
out_to_ncurses = true, out_to_stderr = true, out_to_x = true, override_utf8_locale = true,
own_window = true, own_window_argb_visual = true, own_window_transparent = true,
short_units = true, show_graph_range = true, show_graph_scale = true,
times_in_seconds = true, top_cpu_separate = true, uppercase = true, use_xft = true
};
local num_setting = {
border_inner_margin = true, border_outer_margin = true, border_width = true,
cpu_avg_samples = true, diskio_avg_samples = true, gap_x = true, gap_y = true,
imlib_cache_flush_interval = true, imlib_cache_size = true,
max_port_monitor_connections = true, max_text_width = true, max_user_text = true,
maximum_width = true, mpd_port = true, music_player_interval = true, net_avg_samples = true,
own_window_argb_value = true, pad_percents = true, stippled_borders = true,
text_buffer_size = true, top_name_width = true, total_run_times = true,
update_interval = true, update_interval_on_battery = true, xftalpha = true
};
local split_setting = {
default_bar_size = true, default_gauge_size = true, default_graph_size = true,
minimum_size = true
};
local colour_setting = {
color0 = true, color1 = true, color2 = true, color3 = true, color4 = true, color5 = true,
color6 = true, color7 = true, color8 = true, color9 = true, default_color = true,
default_outline_color = true, default_shade_color = true, own_window_colour = true
};
local function alignment_map(value)
local map = { m = 'middle', t = 'top', b = 'bottom', r = 'right', l = 'left' };
if map[value] == nil then
return value;
else
return map[value];
end;
end;
local function handle(setting, value)
setting = setting:lower();
if setting == '' then
return '';
end;
if split_setting[setting] then
local x, y = value:match('^(%S+)%s*(%S*)$');
local ret = setting:gsub('_size', '_width = ') .. x .. ',';
if y ~= '' then
ret = ret .. ' ' .. setting:gsub('_size', '_height = ') .. y .. ',';
end;
return '\t' .. ret;
end;
if bool_setting[setting] then
value = value:lower();
if value == 'yes' or value == 'true' or value == '1' or value == '' then
value = 'true';
else
value = 'false';
end;
elseif not num_setting[setting] then
if setting == 'alignment' and value:len() == 2 then
value = alignment_map(value:sub(1,1)) .. '_' .. alignment_map(value:sub(2,2));
elseif colour_setting[setting] and value:match('^[0-9a-fA-F]+$') then
value = '#' .. value;
elseif setting == 'xftfont' then
setting = 'font';
end;
value = quote(value);
end;
return '\t' .. setting .. ' = ' .. value .. ',';
end;
local function convert(s)
local setting, comment = s:match('^([^#]*)#?(.*)\n$');
if comment ~= '' then
comment = '--' .. comment;
end;
comment = comment .. '\n';
return handle(setting:match('^%s*(%S*)%s*(.-)%s*$')) .. comment;
end;
local input;
local output;
if conky == nil then --> standalone program
-- 1 arg: arg is input and outputfile
-- 2 args: 1st is inputfile, 2nd is outputfile
-- 0, 3 or more args: print usage to STDERR and quit
if #arg == 1 or #arg == 2 then
input = io.input(arg[1]);
else
io.stderr:write(usage);
return;
end;
else
-- we are called from conky, the filename is the first argument
input = io.open(..., 'r');
end;
local config = input:read('*a');
input:close();
local settings, text = config:match('^(.-)TEXT\n(.*)$');
local converted = 'conky.config = {\n' .. settings:gsub('.-\n', convert) .. '};\n\nconky.text = ' ..
quote(text) .. ';\n';
if conky == nil then
if #arg == 2 then
output = io.output(arg[2]);
else
output = io.output(arg[1]);
end
output:write(converted);
output:close();
else
return assert(loadstring(converted, 'converted config'));
end;
convert.lua old_conkyrc_file new_conkyrc_file
sudo /usr/share/doc/conky-all/convert.lua /home/jedi/Conky/Weather/.conkyrc
conky.config = {
-- By jedi, See me on VSIDO, nixnut.com or on Google+
background = false,
use_xft = true,
font = 'monofur:size=9',
xftalpha = 0.8,
update_interval = 1,
total_run_times = 0,
own_window = true,
own_window_type = 'normal',
own_window_transparent = true,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
double_buffer = true,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
stippled_borders = 0,
border_width = 1,
default_color = '#000000',
color1 = '#212021',
color2 = '#00FF0E',--E8E1E6 B4AD3F 0FF605
color3 = '#ECEC34',--1BD0F5 3B64A0 B4AD3F
color4 = '#008EF3',--B43617
color5 = '#F3001A',--269E16
default_shade_color = '#000000',
default_outline_color = '#000000',
minimum_width = 620, minimum_height = 200,
maximum_width = 620,
gap_x = 155,
gap_y = 110,
alignment = 'top_right',
uppercase = false,
cpu_avg_samples = 2,
net_avg_samples = 2,
short_units = true,
text_buffer_size = 2048,
use_spacer = 'none',
override_utf8_locale = true,
};
conky.text = [[
${goto 200}${color2}${font ADELE:size=70}${time %l:%M %P}${font ADELE:size=22}${color2}
${goto 235}${time %B %d, %Y}
${font Caviar Dreams:size=11}${execi 2600 cat /etc/issue.net}: ${voffset -3}${font monofur:size=11}${color3}jedi${color2} ${font Caviar Dreams:size=11}${color2}${goto 185}Kernel: ${color3}${kernel} ${color2}${goto 450}Up: ${color FF6100}${uptime}
${font Caviar Dreams:size=11}${color2}Cpu: ${color3}${cpu cpu0}% ${color4}${hwmon 1 temp 1}º${color4}C ${goto 130}Mem: ${color3}${memperc }% ${goto 205}${color2}Root: ${color3}${fs_used_perc /}% ${color4}${hddtemp /dev/sda}º${color4}C ${goto 335}${color2}Home: ${color3}${fs_used_perc /home}% ${color3} ${goto 425}${color2}DATA: ${color3}${fs_used_perc /media/DATA}% ${color4}${hddtemp /dev/sdb}º${color4}C
${font Caviar Dreams:size=9}${goto 125}${color3}${mem}${color2}/${color3}${memmax}${color2} ${goto 225}${color3}${fs_used /}${color2}/${color3}${fs_size /}${color2} ${goto 315}${color3}${fs_used /home}${color2}/${color3}${fs_size /home}${color2} ${goto 425}${color3}${fs_used /media/DATA}${color2}/${color3}${fs_size /media/DATA}${color2}
${goto 50}${font Caviar Dreams:size=11}WiFi: ${color3}${addr wlan0} ${color2} ${goto 200}Public IP: ${color3}${execi 300 wget -q -O - checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'} ${goto 380}${color2}${font Caviar Dreams:size=11} Dwn: ${color3}${font monofur:size=12}${downspeed wlan0} ${font Caviar Dreams:size=11}${color2} ${voffset -3}${goto 475}Up: ${color3}${font monofur:size=12} ${upspeed wlan0}
${goto 250}${font Caviar Dreams:size=11}${color2}Pwr: ${color5}${battery_percent BAT0}% ${color4}${battery_time BAT0}]];
Quote(I hope a certain Someone11 is shitting bricks)
./convert.lua ~/.conkyrc
bash: ./convert.lua: No such file or directory
/usr/bin/convert.lua ~/.conkyrc ~/.newconkyrc
or just
convert.lua ~/.conkyrc ~/.newconkyrc
./convert.lua
QuoteCode Select./convert.lua.
overrides your $PATH environment and restricts you to the current directory
[app] (name=conky) (class=conky)
[Position] (TOPRIGHT) {13% 3%}
[Layer] {12}
[end]
alignment = "bottom_right",
own_window_title = "conkyradio",
[app] (name=conky) (class=conky)
[Position] (TOPRIGHT) {13% 3%}
[Layer] {12}
[end]
[app] (name=conkyradio) (class=conky)
[Position] (BOTTOMRIGHT) {13% 3%}
[Layer] {12}
[end]
own_window_class <unique class #1>
own_window_title <unique class #1>
own_window_class <unique class #2>
own_window_title <unique name #2>
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
Quote from: Snap on July 24, 2015, 06:01:18 AMQuoteCode Select./convert.lua.
overrides your $PATH environment and restricts you to the current directory
Every day learning something new. Didn't knew that about the dot slash way. Thanks, PackRat.
PATH=$PATH:$HOME/bin:$HOME/conky:./
conky.config = {
--#############################################
-- Settings
--#############################################
background = true,
use_xft = true,
-- font = 'Source Sans Pro:semibold:size=10',
font = 'Roboto Mono:Medium:size=10',
xftalpha = 1.0,
update_interval = 1.0,
-- update_interval_on_battery = 30.0,
total_run_times = 0,
own_window = true,
own_window_colour = '#1E1D1D',
own_window_transparent = false,
own_window_type = 'dock',
-- own_window_type desktop
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
own_window_class = 'ConkyFB',
own_window_title = 'ConkyFB',
--#############################################
-- Compositing tips:
-- Conky can play strangely when used with
-- different compositors. I have found the
-- following to work well, but your mileage
-- may vary. Comment/uncomment to suit.
--#############################################
--#
own_window_argb_visual = true,
--own_window_argb_value 2
--# xcompmgr
-- own_window_argb_visual yes
-- own_window_argb_value 120
--# cairo-compmgr
--own_window_type desktop
--own_window_argb_visual yes
--#############################################
no_buffers = true,
uppercase = false,
cpu_avg_samples = 2,
override_utf8_locale = true,
short_units = true,
imlib_cache_size = 0,
pad_percents = 1,
max_user_text = 3200,
text_buffer_size = 1024,
if_up_strictness = 'address',
double_buffer = true,
minimum_width = 1600, minimum_height = 18,
maximum_width = 1600,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
border_inner_margin = 1,
border_outer_margin = 1,
default_color = '#DAC79C',
default_shade_color = '#000000',
default_outline_color = '#828282',
color0 = '#FFFFFF',
color1 = '#000000',
color2 = '#FF0000',-- - red
color3 = '#FFFF00',-- - yellow
color4 = '#0000FF',-- - blue
color5 = '#00FF00',-- - green
color6 = '#FFA500',-- - orange
color7 = '#00CDCD',-- - cyan3
color8 = '#FFD700',-- - gold
color9 = '#F00F16',-- - reddish
alignment = 'top_middle',
gap_x = 0,
gap_y = 0,
-- -- doesn't seem to work when docked in the slit --#
--lua_load ~/conky/transbg.lua
--lua_draw_hook_pre draw_bg 8 0 0 0 0 0x140C0B 0.10
};
conky.text = [[
${voffset 2}${goto 24}Uptime:${offset 8}${uptime_short}${offset 32}\
Core1:${offset 8}${if_match ${hwmon 2 temp 2}<=50}${color7}${else}${if_match ${hwmon 2 temp 2}<=70}${color8}${else}${if_match ${hwmon 2 temp 2}>70}${color9}${endif}${endif}${endif}${hwmon 2 temp 2}${offset 2}°C${color}${offset 32}\
Core2:${offset 8}${if_match ${hwmon 2 temp 3}<=50}${color7}${else}${if_match ${hwmon 2 temp 3}<=70}${color8}${else}${if_match ${hwmon 2 temp 3}>70}${color9}${endif}${endif}${endif}${hwmon 2 temp 3}${offset 2}°C${color}${offset 32}\
CPU:${offset 8}${if_match ${cpu}<=50}${color7}${else}${if_match ${cpu}<=70}${color8}${else}${if_match ${cpu}>70}${color9}${endif}${endif}${endif}${cpu cpu0}%${color}${offset 16}${loadavg 1}${offset 8}${loadavg 2}${offset 8}${loadavg 3}${offset 32}\
Memory:${offset 8}${if_match ${memperc}<=50}${color7}${else}${if_match ${memperc}<=70}${color8}${else}${if_match ${memperc}>70}${color9}${endif}${endif}${endif}${memperc}%${color}${offset 32}\
Network:${if_up wlp3s0}${offset 8}${wireless_bitrate wlp3s0}${endif}${offset 16}${wireless_link_qual wlp3s0}/${wireless_link_qual_max wlp3s0}${offset 16}${if_match ${wireless_link_qual_perc wlp3s0}<=30}${color9}${blink ${wireless_link_qual_perc wlp3s0}%}${color}${else}${if_match ${wireless_link_qual_perc wlp3s0}<=50}${color8}${wireless_link_qual_perc wlp3s0}%${else}${if_match ${wireless_link_qual_perc wlp3s0}>50}${color7}${wireless_link_qual_perc wlp3s0}%${endif}${endif}${endif}${color}${offset 16}${if_up wlp3s0}Up:${offset 8}${upspeedf wlp3s0}${offset 16}Down:${offset 8}${downspeedf wlp3s0}${endif}${color}\
${alignr 20}${time %A %e %B}${offset 12}
]];
Quote from: DrakarNoir on December 27, 2017, 08:48:17 PM
(or perhaps refugees from the old #! days) are still here (Sector11, Wlrouf, mrPechy, et al) and perhaps some new friends, a
TIA
-DrakarNoir
conky.config = {
--#############################################
-- Settings
--#############################################
background = true,
use_xft = true,
font = 'Ubuntu:regular:size=10',
xftalpha = 1.0,
update_interval = 1.0,
-- update_interval_on_battery = 30.0,
total_run_times = 0,
own_window = true,
own_window_colour = '#141414',
own_window_transparent = true,
-- own_window_type = 'dock',
own_window_type = 'desktop' ,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
own_window_class = 'ConkyFB',
own_window_title = 'ConkyFB',
--#############################################
-- Compositing tips:
-- Conky can play strangely when used with
-- different compositors. I have found the
-- following to work well, but your mileage
-- may vary. Comment/uncomment to suit.
--#############################################
--#
-- own_window_argb_visual = true,
-- own_window_argb_value = 2,
--# xcompmgr
-- own_window_argb_visual yes
-- own_window_argb_value 120
--# cairo-compmgr
--own_window_type desktop
--own_window_argb_visual yes
--#############################################
no_buffers = true,
uppercase = true,
cpu_avg_samples = 2,
override_utf8_locale = true,
short_units = true,
imlib_cache_size = 0,
pad_percents = 1,
max_user_text = 3200,
text_buffer_size = 1024,
if_up_strictness = 'address',
double_buffer = true,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
border_inner_margin = 1,
border_outer_margin = 1,
default_color = '#D1BF64',
default_shade_color = '#000000',
default_outline_color = '#828282',
color0 = '#FFFFFF',
color1 = '#000000',
color2 = '#73AEB4',-- - blue titles
color3 = '#FFFF00',-- - yellow
color4 = '#0000FF',-- - blue
color5 = '#00FF00',-- - green
color6 = '#FFA500',-- - orange
color7 = '#D1BF64',-- - cyan3
color8 = '#DAA520',-- - gold
color9 = '#F00A11',-- - reddish
minimum_width = 256, minimum_height = 0,
maximum_width = 256,
alignment = 'top_left',
gap_x = 12,
gap_y = 12,
};
conky.text = [[
${image $HOME/images/vsidoorb_blk.png -s 48x48 -p 1,-1} \
${voffset 12}${goto 60}${color2}Kernel:${goto 128}${color}${kernel}
${voffset 16}${goto 12}${color2}Uptime:${goto 128}${color}${uptime_short}
${voffset 12}${goto 12}${color2}CPU:${goto 128}${if_match ${cpu}<=50}${color7}${else}${if_match ${cpu}<=70}${color8}${else}${if_match ${cpu}>70}${color9}${endif}${endif}${endif}${cpu cpu0}%${color}
${voffset 6}${goto 128}${loadavg 1}${offset 10}${loadavg 2}${offset 10}${loadavg 3}
${voffset 12}${goto 12}${color2}RAM:${goto 128}${if_match ${memperc}<=50}${color7}${else}${if_match ${memperc}<=70}${color8}${else}${if_match ${memperc}>70}${color9}${endif}${endif}${endif}${memperc}%${color}
${voffset 12}${goto 12}${color2}Batt:${color}${goto 128}${if_match ${battery_percent BAT0}<=15}${blink ${battery_percent BAT0}%}${else}${battery_percent BAT0}%${endif}${offset 12}${execpi 60 acpi | awk '/Battery 0/ {print $3}' | cut -c1-4}
${voffset 12}${goto 12}${color2}Up:${color}${goto 128}${upspeedgraph wlan0 16,112 666666 ff0000}
${voffset 16}${goto 12}${color2}Down:${color}${goto 128}${downspeedgraph wlan0 16,112 000000 00ff00}
]];
conky.config = {
--#############################################
-- Settings
--#############################################
background = true,
use_xft = true,
-- font = 'Office Code Pro:Medium:size=10',
-- font = 'Ubuntu:Medium:size=10',
font = 'Inconsolata LGC:regular:size=10',
xftalpha = 1.0,
update_interval = 1.0,
update_interval_on_battery = 30.0,
total_run_times = 0,
own_window = true,
own_window_colour = '#070707',
own_window_transparent = true,
own_window_type = 'override',
-- own_window_type = 'dock',
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
own_window_class = 'ConkyHoriz',
own_window_title = 'ConkyHoriz',
--#############################################
-- Compositing tips:
-- Conky can play strangely when used with
-- different compositors. I have found the
-- following to work well, but your mileage
-- may vary. Comment/uncomment to suit.
--#############################################
-- own_window_argb_visual = true,
--own_window_argb_value 2
--#############################################
no_buffers = true,
uppercase = true,
cpu_avg_samples = 2,
override_utf8_locale = true,
short_units = true,
imlib_cache_size = 0,
pad_percents = 1,
-- max_specials = '2048',
max_user_text = 3200,
text_buffer_size = 1024,
no_buffers = true,
if_up_strictness = 'address',
double_buffer = true,
minimum_width = 1366, minimum_height = 0,
maximum_width = 1366,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
border_inner_margin = 1,
border_outer_margin = 1,
default_color = '#DAC79C',
default_shade_color = '#000000',
default_outline_color = '#828282',
color0 = '#FFFFFF',
color1 = '#000000',
color2 = '#FF0000',-- - red
color3 = '#FFFF00',-- - yellow
color4 = '#0000FF',-- - blue
color5 = '#00FF00',-- - green
color6 = '#FFA500',-- - orange
color7 = '#00CDCD',-- - cyan3
color8 = '#FFD700',-- - gold
color9 = '#F00F16',-- - reddish
alignment = 'top_middle',
gap_x = 0,
gap_y = 0,
-- -- doesn't seem to work when docked in the slit --#
lua_load = '~/conky/transbg.lua',
lua_draw_hook_pre = 'draw_bg 4 0 0 0 0 0x070707 0.58',
-- Mem:${offset 8}${if_match ${memperc}<=50}${color7}${else}${if_match ${memperc}<=70}${color8}${else}${if_match ${memperc}>70}${color9}${endif}${endif}${endif}${memperc}%${color}${offset 32}\
};
conky.text = [[
${goto 12}Uptime:${offset 8}${uptime_short} \
${goto 264}Core0:${offset 8}${if_match ${hwmon 0 temp 2}<=50}${color7}${else}${if_match ${hwmon 0 temp 2}<=70}${color8}${else}${if_match ${hwmon 0 temp 2}>70}${color9}${endif}${endif}${endif}${hwmon 0 temp 2}${offset 2}°C${color}${offset 16} \
Core1:${offset 8}${if_match ${hwmon 0 temp 4}<=50}${color7}${else}${if_match ${hwmon 0 temp 4}<=70}${color8}${else}${if_match ${hwmon 0 temp 4}>70}${color9}${endif}${endif}${endif}${hwmon 0 temp 4}${offset 2}°C${color}${offset 16} \
CPU:${offset 8}${if_match ${cpu}<=50}${color7}${else}${if_match ${cpu}<=70}${color8}${else}${if_match ${cpu}>70}${color9}${endif}${endif}${endif}${cpu cpu0}%${color}${offset 16}${loadavg 1}${offset 8}${loadavg 2}${offset 8}${loadavg 3}${offset 16} \
Batt:${offset 8}${execpi 60 acpi -b | awk '/Battery 0/ {print $3}' | cut -c1-4}${offset 8}${if_match ${battery_percent BAT0}<=15}${color9}${blink ${battery_percent BAT0}%}${color}${else}${if_match ${battery_percent BAT0}<=33}${color8}${battery_percent BAT0}%${else}${if_match ${battery_percent BAT0}>33}${color7}${battery_percent BAT0}%${endif}${endif}${endif}${color}${offset 16} \
Net:${if_up wlo1}${offset 8}${wireless_bitrate wlo1}${endif}${offset 16}${if_match ${wireless_link_qual_perc wlo1}<=30}${color9}${blink ${wireless_link_qual_perc wlo1}%}${color}${else}${if_match ${wireless_link_qual_perc wlo1}<=50}${color8}${wireless_link_qual_perc wlo1}%${else}${if_match ${wireless_link_qual_perc wlo1}>50}${color7}${wireless_link_qual_perc wlo1}%${endif}${endif}${endif}${color}${offset 16}${if_up wlo1}U:${offset 8}${upspeedf wlo1}${offset 24}D:${offset 8}${downspeedf wlo1}${endif}${color}\
${alignr 12}${time %a %e %b}
]];