#301 Le 26/06/2013, à 13:43
- ragamatrix
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Lorsque la radio est inactive une icone s'affiche.
icone
conky:
# Conky for current radio playing #
background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
double_buffer yes
no_buffers yes
text_buffer_size 1024
imlib_cache_size 0
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,skip_taskbar,skip_pager,below
border_inner_margin 1
border_outer_margin 0
minimum_size 590 160
maximum_width 590
alignment ml
gap_x 5
gap_y -155
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_shade_color 181818
use_xft yes
xftfont Andale-Mono:size=12 ##Droid-Sans-Mono # Monofur
xftalpha 1.0
uppercase no
override_utf8_locale yes
default_color ececec
color1 606060
lua_load ~/.conky/script/image.lua
TEXT
${voffset 20}${goto 165}${font Compacta Blk BT:Italic:size=12}${color f2d873}${if_match "${execi 10 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray net.sourceforge.radiotray.getCurrentRadio}" == "not playing"}${lua conky_fDrawImage ~/.conky/conky21/db/CD/radiotray3.png 110 -10 199 200}${else}${execi 10 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray net.sourceforge.radiotray.getCurrentRadio}
${color dodgerblue3}${goto 85}${font Lobster1.4:size=12:bold}${execi 10 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w55}${color}${endif}
#${voffset -50}
script image.lua (vrai transparence Didier-T):
require 'cairo'
home = os.getenv ('HOME')
--Fonction d'affichage
function conky_fDrawImage(path,x,y,w,h,arc)
path = string.gsub(path, "~", home)
path = string.gsub(path, "$HOME", home)
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local function fDrawImage(path,x,y,w,h,arc)
x=x+(w/2)
y=y+(h/2)
local img = cairo_image_surface_create_from_png(path)
local w_img, h_img = cairo_image_surface_get_width (img), cairo_image_surface_get_height (img)
local cr = cairo_create (cs)
cairo_translate (cr, x, y)
if arc then
cairo_rotate (cr, arc)
end
cairo_scale (cr, w/w_img, h/h_img)
cairo_set_source_surface (cr, img, -w_img/2, -h_img/2)
cairo_paint (cr)
cairo_destroy(cr)
cairo_surface_destroy (img)
end
fDrawImage(path,x,y,w,h,arc)
cairo_surface_destroy(cs)
return ""
end
Dernière modification par ragamatrix (Le 26/06/2013, à 15:37)
Hors ligne
#302 Le 27/06/2013, à 08:15
- loutch
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
hello
Donc voila Didier-t j'ai python3-beautifulsoup4 installé et j'ai en konsole ceci
[romuald@localhost ~]$ conky -c ~/.conky/conky-meteo/meteo6jours/conkyrc
Conky: desktop window (2200121) is subwindow of root window (249)
Conky: window type - normal
Conky: drawing to created window (0x800002)
Conky: drawing to double buffer
version = v1.09
web = http://www.accuweather.com/fr/fr/sarreguemines/57200/weather-forecast/167193_pc
Pévision Nb jours = 7
Pévision Matin = non
Pévision Après Midi = non
Pévision Soirée = non
Pévision Nuit = non
Prévision sur 8 heures = non
nbFoisHuit= 1
Délais = 15
Chemin de travail = /tmp
Palier = 20
Chemin de sauvegarde = /home/romuald/.conky/conky-meteo/meteo6jours/reptravail
Chemin script = /home/romuald/.conky/conky-meteo/meteo_lua_2/scripts
Notification = non
ID = 7561
Condition courante Ok
Prévision 1 Ok
Prévision 2 Ok
Prévision 3 Ok
Prévision 4 Ok
Prévision 5 Ok
Prévision 6 Ok
Prévision 7 Ok
Conky: llua_do_call: function conky_Meteo_Heure execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:871: bad argument #2 to 'date' (number expected, got string)
Conky: llua_do_call: function conky_Meteo_Minute execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:875: bad argument #2 to 'date' (number expected, got string)
Traceback (most recent call last):
File "/home/romuald/.conky/conky-meteo/meteo_lua_2/scripts/recmeteo.py", line 15, in <module>
from bs4 import BeautifulSoup
File "/usr/lib/python3.3/site-packages/bs4/__init__.py", line 359
print soup.prettify()
^
SyntaxError: invalid syntax
lunaison Ok
Conky: llua_do_call: function conky_Meteo_Heure execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:871: bad argument #2 to 'date' (number expected, got string)
Conky: llua_do_call: function conky_Meteo_Minute execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:875: bad argument #2 to 'date' (number expected, got string)
Conky: llua_do_call: function conky_Meteo_Heure execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:871: bad argument #2 to 'date' (number expected, got string)
Conky: llua_do_call: function conky_Meteo_Minute execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:875: bad argument #2 to 'date' (number expected, got string)
voila donc si j'ai bien compris il y a un truc qui cloche à la ligne 359 ?
copie de ligne 355 à 359 :
#By default, act as an HTML pretty-printer.
if __name__ == '__main__':
import sys
soup = BeautifulSoup(sys.stdin)
print soup.prettify()
@+
Hors ligne
#303 Le 27/06/2013, à 08:46
- ljere
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
je pense que le souci vient plutôt de meteo2.lua moi j'ai ça de 870 à 882
function conky_Meteo_Heure()
return os.date("%H", time)
end
function conky_Meteo_Minute()
return os.date("%M", time)
end
--Prévision Météo
--Jour
ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon
Hors ligne
#304 Le 27/06/2013, à 11:57
- Didier-T
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
hello
Donc voila Didier-t j'ai python3-beautifulsoup4 installé et j'ai en konsole ceci
[romuald@localhost ~]$ conky -c ~/.conky/conky-meteo/meteo6jours/conkyrc Conky: desktop window (2200121) is subwindow of root window (249) Conky: window type - normal Conky: drawing to created window (0x800002) Conky: drawing to double buffer version = v1.09 web = http://www.accuweather.com/fr/fr/sarreguemines/57200/weather-forecast/167193_pc Pévision Nb jours = 7 Pévision Matin = non Pévision Après Midi = non Pévision Soirée = non Pévision Nuit = non Prévision sur 8 heures = non nbFoisHuit= 1 Délais = 15 Chemin de travail = /tmp Palier = 20 Chemin de sauvegarde = /home/romuald/.conky/conky-meteo/meteo6jours/reptravail Chemin script = /home/romuald/.conky/conky-meteo/meteo_lua_2/scripts Notification = non ID = 7561 Condition courante Ok Prévision 1 Ok Prévision 2 Ok Prévision 3 Ok Prévision 4 Ok Prévision 5 Ok Prévision 6 Ok Prévision 7 Ok Conky: llua_do_call: function conky_Meteo_Heure execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:871: bad argument #2 to 'date' (number expected, got string) Conky: llua_do_call: function conky_Meteo_Minute execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:875: bad argument #2 to 'date' (number expected, got string) Traceback (most recent call last): File "/home/romuald/.conky/conky-meteo/meteo_lua_2/scripts/recmeteo.py", line 15, in <module> from bs4 import BeautifulSoup File "/usr/lib/python3.3/site-packages/bs4/__init__.py", line 359 print soup.prettify() ^ SyntaxError: invalid syntax lunaison Ok Conky: llua_do_call: function conky_Meteo_Heure execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:871: bad argument #2 to 'date' (number expected, got string) Conky: llua_do_call: function conky_Meteo_Minute execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:875: bad argument #2 to 'date' (number expected, got string) Conky: llua_do_call: function conky_Meteo_Heure execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:871: bad argument #2 to 'date' (number expected, got string) Conky: llua_do_call: function conky_Meteo_Minute execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:875: bad argument #2 to 'date' (number expected, got string)
voila donc si j'ai bien compris il y a un truc qui cloche à la ligne 359 ?
copie de ligne 355 à 359 :
#By default, act as an HTML pretty-printer.
if __name__ == '__main__':
import sys
soup = BeautifulSoup(sys.stdin)
print soup.prettify()@+
print est une fonction donc ()
print(soup.prettify())
Devrait fonctionner.
Dernière modification par Didier-T (Le 27/06/2013, à 11:59)
Hors ligne
#305 Le 27/06/2013, à 16:09
- loutch
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
re
@ ljere
j'ai la même chose .
@Didier
j'ai modifié et maintenant j'ai ça :
Conky: llua_do_call: function conky_Meteo_Heure execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:871: bad argument #2 to 'date' (number expected, got string)
Conky: llua_do_call: function conky_Meteo_Minute execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:875: bad argument #2 to 'date' (number expected, got string)
^[[B^[[B^[[B^[[B^[[B^[[BTraceback (most recent call last):
File "/home/romuald/.conky/conky-meteo/meteo_lua_2/scripts/recmeteo.py", line 15, in <module>
from bs4 import BeautifulSoup
File "/usr/lib/python3.3/site-packages/bs4/__init__.py", line 29, in <module>
from .builder import builder_registry
File "/usr/lib/python3.3/site-packages/bs4/builder/__init__.py", line 4, in <module>
from bs4.element import (
File "/usr/lib/python3.3/site-packages/bs4/element.py", line 5, in <module>
from bs4.dammit import EntitySubstitution
File "/usr/lib/python3.3/site-packages/bs4/dammit.py", line 11, in <module>
from htmlentitydefs import codepoint2name
ImportError: No module named 'htmlentitydefs'
lunaison Ok
Conky: llua_do_call: function conky_Meteo_Heure execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:871: bad argument #2 to 'date' (number expected, got string)
Conky: llua_do_call: function conky_Meteo_Minute execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:875: bad argument #2 to 'date' (number expected, got string)
Conky: llua_do_call: function conky_Meteo_Heure execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:871: bad argument #2 to 'date' (number expected, got string)
Conky: llua_do_call: function conky_Meteo_Minute execution failed: ...ld/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua:875: bad argument #2 to 'date' (number expected, got string)
@+
Hors ligne
#306 Le 27/06/2013, à 16:41
- Didier-T
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Bs4 est mal installé, il lui manque la bibliothèque htmlentitydefs pour python3.
Mais sa avance.
Au fait étrange le premier soucis normalement cette ligne est au minimum commenté, si ce n'est supprimé... Je vérifierai sa ce soir
Hors ligne
#307 Le 27/06/2013, à 17:17
- loutch
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
re
ok merci je pécise juste que sur mageia 2 il tourne toujours au poil
@+
Hors ligne
#308 Le 27/06/2013, à 17:35
- Didier-T
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
et la c'est qu'elle distribution ?
Hors ligne
#309 Le 27/06/2013, à 18:38
- loutch
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
re
mageia 3 64 bit kde 4.10.2
@+
Hors ligne
#310 Le 30/06/2013, à 10:47
- milou32
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Bonjour,
Je ne suis pas sûre de poster au bon endroit.
Je me sers du conky météo de Didier-T, mais en regardant par la fenêtre.... je me suis aperçue que la météo en temps réel n'est pas toujours exacte (le conky m'annonce qu'il pleut alors qu'il fait soleil.....)
Pour comparer j'ai installé et configuré celui-là (si je ne me trompe pas il ne prend pas les données météo sur le même site)
http://doc.ubuntu-fr.org/conky_scripts_temps_et_meteo
Je voudrais savoir comment récupérer la direction du vent ? Il ne m'indique que la vitesse.
Merci pour vos réponses
Hors ligne
#311 Le 01/07/2013, à 08:07
- loutch
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Comme c'est dernier temps il ni a pas de soleil j'en ai profité pour rajouter du lua à mon conkyrc:
le conkyrc :
background yes
use_xft yes
xftfont Sans:size=10
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 260
maximum_width 260
text_buffer_size 1024
draw_shades no
draw_outline no
draw_borders yes
draw_graph_borders no
default_color white
default_outline_color white
alignment top_left
gap_x 20
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
#
color1 white
#
color2 orange
#
color3 cornflowerblue
#
color4 green
#cornflowerblue
color5 red
color6 yellow
# Lua Load
lua_load ~/.conky/draw_bg.lua (attention ceci est mon chemin à modifier en fonction de votre chemin)
lua_draw_hook_pre draw_bg
#lua_load ~/.conky/conky_grey.lua
#lua_draw_hook_pre main
lua_load ~/.conky/horloge.lua
lua_draw_hook_post main_rings
TEXT
${font Sans:size=8}${color3}Kernel: ${color2}$kernel
${color3}Uptime:${color2} $uptime
${color3}Processus: ${color2} $processes${color3}${alignr}En cours: ${color2} $running_processes
${color3}KDE:${alignr} 4.10.2
${color1}CPU: ${hr}
${goto 105}${color3}Frequence :
${color4}${goto 40}${cpu cpu0}%${GOTO 210}${cpu cpu1}%
${color2}$alignc ${freq_g} GHz
${color5}${goto 40}${exec expr `cat /sys/class/hwmon/hwmon0/device/temp2_input` / 1000}°C${color5}${goto 210}${exec expr `cat /sys/class/hwmon/hwmon0/device/temp3_input` / 1000}°C
${color3}Core 1 Core 2
${color1}MEMOIRE: ${hr}
${color3}RAM:${color4} $mem/$memmax ${goto 210}$memperc%
${color3}SWAP:${color5} ${swap} / ${swapmax} ${goto 210} ${swapperc}%
${color1}GPU: ${hr}
${color3}Carte Graphique: ${color2}${execi 1800 nvidia-settings -q gpus |grep '0] (' | cut -d '(' -f 2,2 | sed -e 's/.\{1\}$//'}
${color3}Pilote NVidia: ${color2}${execi 1800 nvidia-settings -q NvidiaDriverVersion -t}
${color3}Température GPU: ${color2}${exec nvidia-settings -q gpucoretemp | grep '):' | awk '{print $4}'}°C
${color3}Fréquence gpu: ${color2}${execi 60 nvidia-settings -query 0/GPUCurrentClockFreqs |grep Attribute |awk '{print $4}' |cut -c1-7} Mhz
${color1}ESPACE DISQUE:${hr}
${color3}${alignc}TempD:
${color4}${goto 40}${fs_used_perc /}%${color4}${goto 210}${fs_used_perc /home}%
${color2}${alignc}${execi 10 hddtemp -n /dev/sda} °C
${goto 30}${color2}${fs_used /}${goto 200}${fs_used /home}
${goto 30}${color2}${fs_size /}${goto 200}${fs_size /home}
${color3}/racine ${color3}/home
${color1}RESEAU: ${hr}
${color3}Down:${color4}${totaldown eth0}${goto 125}${voffset 6}${color5}${upspeedf eth0}${color2}${goto 175} k/s${goto 215}${color4}${downspeedf eth0}
${color3}Up: ${color5}${totalup eth0}
${color3}URL${goto 100}NB PORTS OUVERTS:${tcp_portmon 1 65535 count}
${color2}${tcp_portmon 1 65535 rip 0}${goto 195}${tcp_portmon 1 65535 rport 0}
${tcp_portmon 1 65535 rip 1}${goto 195}${tcp_portmon 1 65535 rport 1}
${tcp_portmon 1 65535 rip 2}${goto 195}${tcp_portmon 1 65535 rport 2}
${tcp_portmon 1 65535 rip 3}${goto 195}${tcp_portmon 1 65535 rport 3}
${tcp_portmon 1 65535 rip 4}${goto 195}${tcp_portmon 1 65535 rport 4}
${tcp_portmon 1 65535 rip 5}${goto 195}${tcp_portmon 1 65535 rport 5}
${color1}PROCESSUS ${hr}
${color3}NOM ${alignr}CPU ${alignr}RAM
${color1} ${top name 1} ${alignr}${top cpu 1} ${alignr}${top mem 1}
${color1} ${top name 2} ${alignr}${top cpu 2} ${alignr}${top mem 2}
${color1} ${top name 3} ${alignr}${top cpu 3} ${alignr}${top mem 3}
${color1} ${top name 4} ${alignr}${top cpu 4} ${alignr}${top mem 4}
${color1} ${top name 5} ${alignr}${top cpu 5} ${alignr}${top mem 5}
${color1}CALENDRIER ${hr}
${color2}${voffset 3}${font courier:style=bold:size=9}${execpi 300 TODAY=`date +%_d` ; cal -s | sed s/sa$/sa$'${color1}'/ | sed s/"$TODAY"'\b'/'${color3}'"$TODAY"'${color1}'/}
${goto 172}${voffset -95}${color ff8000}${font Sans:size=12}${time %H}${color 00ff00}${time :%M}${color 6495EE}${time :%S}
le lua nommé : horloge.lua
--[[
Ring Meters by londonali1010 (2009)
This script draws percentage meters as rings. It is fully customisable; all options are described in the 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 on line 145 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/rings-v1.2.lua
lua_draw_hook_pre ring_stats
Changelog:
+ v1.2 -- Added option for the ending angle of the rings (07.10.2009)
+ v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009)
+ v1.0 -- Original release (28.09.2009)
]]
require 'cairo'
function conky_main_rings()
if (os.date("%l"))=='12' then
heure=(os.date("%M")/60)
else
heure=(os.date("%l"))+(os.date("%M")/60)
end
-- START PARAMETERS HERE
local rings_settings={
{
name="cpu",
arg="cpu0",
max=100,
xc=50,
yc=138,
radius=40,
thickness=5,
gap_sectors=0,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{0,0x00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
fg_colour2={{0,0X00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
},
{
name="exec",
arg="exec expr `cat /sys/class/hwmon/hwmon0/device/temp2_input` / 1000",
max=100,
xc=50,
yc=138,
radius=35,
thickness=5,
gap_sectors=0,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{0,0xFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
bd_colour1={{0,0XFF0000,1},{0.5,0xFF0000,1}, {1,0xFF0000,1}},
},
{
name="cpu",
arg="cpu1",
max=100,
xc=220,
yc=138,
radius=40,
thickness=5,
gap_sectors=0,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{0,0x00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
fg_colour2={{0,0X00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
},
{
name="exec",
arg="exec expr `cat /sys/class/hwmon/hwmon0/device/temp3_input` / 1000",
max=100,
xc=220,
yc=138,
radius=35,
thickness=5,
gap_sectors=0,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{0,0xFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
bd_colour1={{0,0XFF0000,1},{0.5,0xFF0000,1}, {1,0xFF0000,1}},
},
{
name="memperc",
arg="",
max=100,
xc=220,
yc=245,
radius=40,
thickness=5,
gap_sectors=0,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{0,0x00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
fg_colour2={{0,0X00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
},
{
name="swapperc",
arg="",
max=100,
xc=220,
yc=245,
radius=35,
thickness=5,
gap_sectors=0,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{0,0xFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
bd_colour1={{0,0XFF0000,1},{0.5,0xFF0000,1}, {1,0xFF0000,1}},
},
{
name="fs_used_perc",
arg="/home",
max=100,
xc=220,
yc=400,
radius=40,
thickness=5,
gap_sectors=0,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{0,0x00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
fg_colour2={{0,0X00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
},
{
name="fs_used_perc",
arg="/",
max=100,
xc=50,
yc=400,
radius=40,
thickness=5,
gap_sectors=0,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{0,0x00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
fg_colour2={{0,0X00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
},
{
name="downspeedf",
arg="eth0",
max=500,
xc=230,
yc=490,
radius=30,
thickness=5,
gap_sectors=0,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{0,0x00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
fg_colour2={{0,0X00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
},
{
name="upspeedf",
arg="eth0",
max=100,
xc=140,
yc=490,
radius=30,
thickness=5,
gap_sectors=0,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{0,0xFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
fg_colour2={{0,0XFF0000,0},{0.5,0xFF0000,1}, {1,0xFF0000,0}},
bd_colour1={{0,0XFF0000,1},{0.5,0xFF0000,1}, {1,0xFF0000,1}},
},
{
name="",
arg=heure,
max=11.99,
xc=208,
yc=800,
radius=57,
thickness=5,
gap_sectors=5,
sectors=12,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{0,0xFF8000,0},{0.5,0xFF8000,1}, {1,0xFF8000,0}},
fg_colour2={{0,0XFF8000,0},{0.5,0xFF8000,1}, {1,0xFF8000,0}},
bd_colour1={{0,0XFF8000,1},{0.5,0xFF8000,1}, {1,0xFF8000,1}},
},
{
name="",
arg=(os.date("%M"))+(os.date("%S")/60),
max=59.99,
xc=208,
yc=800,
radius=50,
thickness=5,
start_angle=0,
end_angle=360,
gap_sectors=1,
sectors=60,
fill_sector=false,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{0,0X00FF00,0},{0.5,0X00FF00,1}, {1,0X00FF00,1}},
fg_colour2={{0,0x00FF00,0},{0.5,0x00FF00,1}, {1,0x00FF00,0}},
bd_colour1={{0,0X00FF00,1},{0.5,0x00FF00,1}, {1,0x00FF00,1}},
},
{
name="time",
arg="%S",
max=60,
xc=208,
yc=800,
radius=43,
thickness=5,
start_angle=0,
end_angle=360,
sectors=60,
fill_sector=false,
bg_colour1={{0,0x999999,0},{0.5,0x999999,0.3}, {1,0x999999,0}},
fg_colour1={{1,0X6495EE,1},{1,0x6495EE,1}, {1,0x6495EE,1}},
fg_colour2={{1,0X6495EE,1},{1,0x6495EE,1}, {1,0x6495EE,1}},
bd_colour1={{0,0X6495EE,1},{0.5,0x6495EE,1}, {1,0x6495EE,1}},
},
}
--END OF PARAMETERS HERE
--main function
--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 tonumber(conky_parse('${updates}'))>3 then
for i in pairs(rings_settings) do
draw_ring(cr,rings_settings[i])
end
end
cairo_destroy(cr)
end
function draw_ring(cr, t)
local function rgba_to_r_g_b_a(tcolour)
local colour,alpha=tcolour[2],tcolour[3]
return ((colour / 0x10000) % 0x100) / 255.,
((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
local function calc_delta(tcol1,tcol2)
--calculate deltas P R G B A to table_colour 1
for x = 1, #tcol1 do
tcol1[x].dA = 0
tcol1[x].dP = 0
tcol1[x].dR = 0
tcol1[x].dG = 0
tcol1[x].dB = 0
if tcol2~=nil and #tcol1 == #tcol2 then
local r1,g1,b1,a1 = rgba_to_r_g_b_a(tcol1[x])
local r2,g2,b2,a2 = rgba_to_r_g_b_a(tcol2[x])
tcol1[x].dP = (tcol2[x][1]-tcol1[x][1])/t.sectors
tcol1[x].dR = (r2-r1)/t.sectors
tcol1[x].dG = (g2-g1)/t.sectors
tcol1[x].dB = (b2-b1)/t.sectors
tcol1[x].dA = (a2-a1)/t.sectors
end
end
return tcol1
end
--check values
local function setup(t)
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'")
print ("for name=" .. t.name)
print ("with arg=" .. t.arg)
return
end
if t.name==nil then t.name="" end
if t.arg==nil then t.arg="" end
if t.xc==nil then t.xc=conky_window.width/2 end
if t.yc==nil then t.yc=conky_window.height/2 end
if t.thickness ==nil then t.thickness = 10 end
if t.radius ==nil then t.radius =conky_window.width/4 end
if t.start_angle==nil then t.start_angle =0 end
if t.end_angle==nil then t.end_angle=360 end
if t.bg_colour1==nil then
t.bg_colour1={{0,0x00ffff,0.1},{0.5,0x00FFFF,0.5},{1,0x00FFFF,0.1}}
end
if t.fg_colour1==nil then
t.fg_colour1={{0,0x00FF00,0.1},{0.5,0x00FF00,1},{1,0x00FF00,0.1}}
end
if t.bd_colour1==nil then
t.bd_colour1={{0,0xFFFF00,0.5},{0.5,0xFFFF00,1},{1,0xFFFF00,0.5}}
end
if t.sectors==nil then t.sectors=10 end
if t.gap_sectors==nil then t.gap_sectors=1 end
if t.fill_sector==nil then t.fill_sector=false end
if t.sectors==1 then t.fill_sector=false end
if t.border_size==nil then t.border_size=0 end
if t.cap==nil then t.cap="p" end
--some checks
if t.thickness>t.radius then t.thickness=t.radius*0.1 end
t.int_radius = t.radius-t.thickness
--check colors tables
for i=1, #t.bg_colour1 do
if #t.bg_colour1[i]~=3 then t.bg_colour1[i]={1,0xFFFFFF,0.5} end
end
for i=1, #t.fg_colour1 do
if #t.fg_colour1[i]~=3 then t.fg_colour1[i]={1,0xFF0000,1} end
end
for i=1, #t.bd_colour1 do
if #t.bd_colour1[i]~=3 then t.bd_colour1[i]={1,0xFFFF00,1} end
end
if t.bg_colour2~=nil then
for i=1, #t.bg_colour2 do
if #t.bg_colour2[i]~=3 then t.bg_colour2[i]={1,0xFFFFFF,0.5} end
end
end
if t.fg_colour2~=nil then
for i=1, #t.fg_colour2 do
if #t.fg_colour2[i]~=3 then t.fg_colour2[i]={1,0xFF0000,1} end
end
end
if t.bd_colour2~=nil then
for i=1, #t.bd_colour2 do
if #t.bd_colour2[i]~=3 then t.bd_colour2[i]={1,0xFFFF00,1} end
end
end
if t.start_angle>=t.end_angle then
local tmp_angle=t.end_angle
t.end_angle= t.start_angle
t.start_angle = tmp_angle
-- print ("inversed angles")
if t.end_angle-t.start_angle>360 and t.start_angle>0 then
t.end_angle=360+t.start_angle
print ("reduce angles")
end
if t.end_angle+t.start_angle>360 and t.start_angle<=0 then
t.end_angle=360+t.start_angle
print ("reduce angles")
end
if t.int_radius<0 then t.int_radius =0 end
if t.int_radius>t.radius then
local tmp_radius=t.radius
t.radius=t.int_radius
t.int_radius=tmp_radius
print ("inversed radius")
end
if t.int_radius==t.radius then
t.int_radius=0
print ("int radius set to 0")
end
end
t.fg_colour1 = calc_delta(t.fg_colour1,t.fg_colour2)
t.bg_colour1 = calc_delta(t.bg_colour1,t.bg_colour2)
t.bd_colour1 = calc_delta(t.bd_colour1,t.bd_colour2)
end
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
--initialize table
setup(t)
--initialize cairo context
cairo_save(cr)
cairo_translate(cr,t.xc,t.yc)
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND)
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND)
--get value
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
--initialize sectors
--angle of a sector :
local angleA = ((t.end_angle-t.start_angle)/t.sectors)*math.pi/180
--value of a sector :
local valueA = t.max/t.sectors
--first angle of a sector :
local lastAngle = t.start_angle*math.pi/180
local function draw_sector(type_arc,angle0,angle,valpc, idx)
--this function draws a portion of arc
--type of arc, angle0 = strating angle, angle= angle of sector,
--valpc = percentage inside the sector, idx = sctor number #
local tcolor
if type_arc=="bg" then --background
if valpc==1 then return end
tcolor=t.bg_colour1
elseif type_arc=="fg" then --foreground
if valpc==0 then return end
tcolor=t.fg_colour1
elseif type_arc=="bd" then --border
tcolor=t.bd_colour1
end
--angles equivalents to gap_sector
local ext_delta=math.atan(t.gap_sectors/(2*t.radius))
local int_delta=math.atan(t.gap_sectors/(2*t.int_radius))
--angles of arcs
local ext_angle=(angle-ext_delta*2)*valpc
local int_angle=(angle-int_delta*2)*valpc
--define colours to use for this sector
if #tcolor==1 then
--plain color
local vR,vG,vB,vA = rgba_to_r_g_b_a(tcolor[1])
cairo_set_source_rgba(cr,vR+tcolor[1].dR*idx,
vG+tcolor[1].dG*idx,
vB+tcolor[1].dB*idx,
vA+tcolor[1].dA*idx )
else
--radient color
local pat=cairo_pattern_create_radial(0,0,t.int_radius,0,0,t.radius)
for i=1, #tcolor do
local vP,vR,vG,vB,vA = tcolor[i][1], rgba_to_r_g_b_a(tcolor[i])
cairo_pattern_add_color_stop_rgba (pat,
vP+tcolor[i].dP*idx,
vR+tcolor[i].dR*idx,
vG+tcolor[i].dG*idx,
vB+tcolor[i].dB*idx,
vA+tcolor[i].dA*idx )
end
cairo_set_source (cr, pat)
cairo_pattern_destroy(pat)
end
--start drawing
cairo_save(cr)
--x axis is parrallel to start of sector
cairo_rotate(cr,angle0-math.pi/2)
local ri,re = t.int_radius ,t.radius
--point A
local angle_a
if t.cap == "p" then
angle_a = int_delta
if t.inverse_arc and type_arc ~="bg" then
angle_a = angle-int_angle-int_delta
end
if not(t.inverse_arc) and type_arc =="bg" then
angle_a = int_delta+int_angle
end
else --t.cap=="r"
angle_a = ext_delta
if t.inverse_arc and type_arc~="bg" then
angle_a = angle-ext_angle-ext_delta
end
if not(t.inverse_arc) and type_arc=="bg" then
angle_a = ext_delta+ext_angle
end
end
local ax,ay = ri*math.cos(angle_a),ri*math.sin(angle_a)
--point B
local angle_b = ext_delta
if t.cap == "p" then
if t.inverse_arc and type_arc ~="bg" then
angle_b = angle-ext_angle-ext_delta
end
if not(t.inverse_arc) and type_arc=="bg" then
angle_b = ext_delta+ext_angle
end
else
if t.inverse_arc and type_arc ~="bg" then
angle_b = angle-ext_angle-ext_delta
end
if not(t.inverse_arc) and type_arc=="bg" then
angle_b = ext_delta+ext_angle
end
end
local bx,by = re*math.cos(angle_b),re*math.sin(angle_b)
-- EXTERNAL ARC B --> C
local b0,b1
if t.inverse_arc then
if type_arc=="bg" then
b0,b1= ext_delta, angle-ext_delta-ext_angle
else
b0,b1= angle-ext_angle-ext_delta, angle-ext_delta
end
else
if type_arc=="bg" then
b0,b1= ext_delta+ext_angle, angle-ext_delta
else
b0,b1= ext_delta, ext_angle+ext_delta
end
end
---POINT D
local angle_c, angle_d
if t.cap == "p" then
angle_d = angle-int_delta
if t.inverse_arc and type_arc=="bg" then
angle_d = angle-int_delta-int_angle
end
if not(t.inverse_arc) and type_arc~="bg" then
angle_d=int_delta+int_angle
end
else
angle_d = angle-ext_delta
if t.inverse_arc and type_arc=="bg" then
angle_d =angle-ext_delta-ext_angle
end
if not(t.inverse_arc) and type_arc~="bg" then
angle_d = ext_angle+ext_delta
end
end
local dx,dy = ri*math.cos(angle_d),ri*math.sin(angle_d)
-- INTERNAL ARC D --> A
local d0,d1
if t.cap=="p" then
if t.inverse_arc then
if type_arc=="bg" then
d0,d1= angle-int_delta-int_angle,int_delta
else
d0,d1= angle-int_delta, angle- int_angle-int_delta
end
else
if type_arc=="bg" then
d0,d1= angle-int_delta, int_delta+int_angle
else
d0,d1= int_delta+int_angle, int_delta
end
end
else
if t.inverse_arc then
if type_arc=="bg" then
d0,d1= angle-ext_delta-ext_angle,ext_delta
else
d0,d1= angle-ext_delta, angle- ext_angle-ext_delta
end
else
if type_arc=="bg" then
d0,d1= angle-ext_delta,ext_delta+ext_angle
else
d0,d1= ext_angle+ext_delta, ext_delta
end
end
end
--draw sector
cairo_move_to(cr,ax,ay)
cairo_line_to(cr,bx,by)
cairo_arc(cr,0,0,re,b0,b1)
cairo_line_to(cr,dx,dy)
cairo_arc_negative(cr,0,0,ri,d0,d1)
cairo_close_path (cr);
--stroke or fill sector
if type_arc=="bd" then
cairo_set_line_width(cr,t.border_size)
cairo_stroke(cr)
else
cairo_fill(cr)
end
cairo_restore(cr)
end
--draw sectors
local n0,n1,n2 = 1,t.sectors,1
if t.inverse_arc then n0,n1,n2 = t.sectors,1,-1 end
local index = 0
for i = n0,n1,n2 do
index = index +1
local valueZ=1
local cstA, cstB = (i-1),i
if t.inverse_arc then cstA,cstB = (t.sectors-i), (t.sectors-i+1) end
if value>valueA *cstA and value<valueA*cstB then
if not t.fill_sector then
valueZ = (value-valueA*cstA)/valueA
end
else
if value<valueA*cstB then valueZ=0 end
end
local start_angle= lastAngle+(i-1)*angleA
if t.foreground ~= false then
draw_sector("fg",start_angle,angleA,valueZ, index)
end
if t.background ~= false then
draw_sector("bg",start_angle,angleA,valueZ, i)
end
if t.border_size>0 then draw_sector("bd",start_angle,angleA,1, i) end
end
cairo_restore(cr)
end
--[[END OF RING-SECTORS WIDGET]]
il fonctionne très bien mais en konsole j'ai ça vous en pensez quoi?
[romuald@localhost ~]$ conky -c ~/conkyrc
Conky: invalid configuration file '/home/romuald/conkyrc'
Conky: llua_load: cannot open (attention: No such file or directory
Conky: llua_load: cannot open ceci: No such file or directory
Conky: llua_load: cannot open est: No such file or directory
Conky: llua_load: cannot open mon: No such file or directory
Conky: llua_load: cannot open chemin: No such file or directory
Conky: llua_load: cannot open à: No such file or directory
Conky: llua_load: cannot open modifier: No such file or directory
Conky: llua_load: cannot open en: No such file or directory
Conky: llua_load: cannot open fonction: No such file or directory
Conky: llua_load: cannot open de: No such file or directory
Conky: llua_load: cannot open votre: No such file or directory
Conky: llua_load: cannot open chemin): No such file or directory
Conky: forked to background, pid is 27381
[romuald@localhost ~]$ Conky: desktop window (220012a) is subwindow of root window (249)
Conky: window type - normal
Conky: drawing to created window (0x2800002)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_main_rings execution failed: /home/romuald/.conky/horloge.lua:241: attempt to index global 'conky_window' (a nil value)
Hors ligne
#312 Le 01/07/2013, à 09:58
- ragamatrix
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Conky Calendrier Convert :
alignment tm
background yes
border_inner_margin 0
border_width 0
color0 FFFFF0
default_color DCDCDC
default_outline_color black
default_shade_color black
double_buffer yes
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
minimum_size 1465 80
maximum_width 1465 #Largeur maximum (px)
#out_to_console no
gap_x 0 # pos = left & neg = right
gap_y 55 #pos = up & neg = down
no_buffers yes
override_utf8_locale yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type normal
own_window yes
override_utf8_locale yes
pad_percents 2
short_units yes
stippled_borders 0
text_buffer_size 1028
update_interval 1
uppercase no
use_spacer right
use_xft yes
xftalpha 1.0
xftfont Arial Black:size=12
#########lua#scrpit
lua_load ~/.conky/script/image.lua
TEXT
${execi 1600 ~/calendar.sh}
${lua conky_fDrawImage /tmp/calendar/calF.png 0 0 1462 72}
calendar.sh:
#!/bin/bash
###############################################################################
# #
# #
#-----------------------------------Calendrier 1------------------------------#
# #
# #
###############################################################################
# initialisation variables ----------------------------------------------------
#------------------ Variables que vous pouvez modifier ------------------------
fonte=Andale-Mono # fonte generique # HelveticaLTStd-Bold # Consolas-Bold-Italic # Andale-Mono
fonte1=Agency-FB # fonte ville, date, mail et news # Agency-FB # Lobster1.4
fonte2=Monaco # fonte cond act # Droid-Sans-Bold #
#temp working folders
repertimages=/tmp
reptemp=$repertimages/calendar
imagetemp=$repertimages/calendar/temp.png
imagetemp1=$repertimages/calendar/temp1.png
imageF=calF
#------------------------------------------------------------------------------
if [[ ! -d $reptemp ]]; then
mkdir $repertimages/calendar
fi
#------------------------------------------------------------------------------
# couleurs
coulm1="blue4"
coulm2="dodgerblue1"
coulm3="yellow"
coulm4="white"
coulm5="springgreen"
coulm6="red"
coulm7="black"
# couleurs 2
could1="orange"
could2="dodgerblue1"
could3="yellow"
could4="white"
could5="#0EAF00"
could6="red"
could7="blue"
could8="gold"
could9="black"
could10="#00003F"
########################################################
# calendrier 1 -------------------------------------------------------------------
samedi=`echo "SAM"`
dimanche=`echo "DIM"`
function calendar
{
if [ $cale = `echo ${calen[20]}` ] ; then
coul2=$could6
elif [ $cale = `echo ${calen[0]}` ] ; then
coul2=$could6
elif [ `echo $cale | cut -c1-3` = `echo $dimanche` ] ; then
coul2=$could1
elif [ `echo $cale | cut -c1-3` = `echo $samedi` ] ; then
coul2=$could3
else coul2=$could7
fi
if [ $cale = `echo ${calen[20]}` ] ; then
coul5=$could8
elif [ $cale = `echo ${calen[0]}` ] ; then
coul5=$could8
elif [ `echo $cale | cut -c1-3` = `echo $dimanche` ] ; then
coul5=$could9
elif [ `echo $cale | cut -c1-3` = `echo $samedi` ] ; then
coul5=$could9
else coul5=$could9
fi
if [ $cale = `echo ${calen[20]}` ] ; then
fonts=20
elif [ $cale = `echo ${calen[0]}` ] ; then
fonts=20
else fonts=16
fi
if [ $cale = `echo ${calen[20]}` ] ; then
ecart8=1
elif [ $cale = `echo ${calen[0]}` ] ; then
ecart8=10
else ecart8=0
fi
}
###################################################################################################################
#================================================calendar========DAY=NAMES========================================#
###################################################################################################################
samedi="SAM"
dimanche="DIM"
function calendar
{
if [[ $cale1 = `echo ${calen1[30]}` ]] ; then
coul3=$could6
elif [[ `echo $cale1 | cut -c1-3` = `echo $dimanche` ]] ; then
coul3=$could1
elif [[ `echo $cale1 | cut -c1-3` = `echo $samedi` ]] ; then
coul3=$could3
else coul3=$could7
fi
if [ $cale1 = `echo ${calen1[30]}` ] ; then
fonts1=18
else fonts1=16
fi
if [ $cale1 = `echo ${calen1[30]}` ] ; then
pos13=1
else pos13=0
fi
if [[ $cale1 = `echo ${calen1[30]}` ]] ; then
coul4=$could8
elif [[ `echo $cale1 | cut -c1-3` = `echo $dimanche` ]] ; then
coul4=$could10
elif [[ `echo $cale1 | cut -c1-3` = `echo $samedi` ]] ; then
coul4=$could10
else coul4=$coulm7
fi
}
# Cartouche Calendar 2 --------------------------------------------------------
convert -size 1440x50 xc:none -fill none $imagetemp
# Position--et--jours---------------------------------
dep1=7 ; pos12=23
calen1[0]=`date +%^a%d --date '-30 days'`
calen1[1]=`date +%^a%d --date '-29 days'`
calen1[2]=`date +%^a%d --date '-28 days'`
calen1[3]=`date +%^a%d --date '-27 days'`
calen1[4]=`date +%^a%d --date '-26 days'`
calen1[5]=`date +%^a%d --date '-25 days'`
calen1[6]=`date +%^a%d --date '-24 days'`
calen1[7]=`date +%^a%d --date '-23 days'`
calen1[8]=`date +%^a%d --date '-22 days'`
calen1[9]=`date +%^a%d --date '-21 days'`
calen1[10]=`date +%^a%d --date '-20 days'`
calen1[11]=`date +%^a%d --date '-19 days'`
calen1[12]=`date +%^a%d --date '-18 days'`
calen1[13]=`date +%^a%d --date '-17 days'`
calen1[14]=`date +%^a%d --date '-16 days'`
calen1[15]=`date +%^a%d --date '-15 days'`
calen1[16]=`date +%^a%d --date '-14 days'`
calen1[17]=`date +%^a%d --date '-13 days'`
calen1[18]=`date +%^a%d --date '-12 days'`
calen1[19]=`date +%^a%d --date '-11 days'`
calen1[20]=`date +%^a%d --date '-10 days'`
calen1[21]=`date +%^a%d --date '-9 days'`
calen1[22]=`date +%^a%d --date '-8 days'`
calen1[23]=`date +%^a%d --date '-7 days'`
calen1[24]=`date +%^a%d --date '-6 days'`
calen1[25]=`date +%^a%d --date '-5 days'`
calen1[26]=`date +%^a%d --date '-4 days'`
calen1[27]=`date +%^a%d --date '-3 days'`
calen1[28]=`date +%^a%d --date '-2 days'`
calen1[29]=`date +%^a%d --date '-1 days'`
calen1[30]=`date +%^a%d --date '0 days'`
calen1[31]=`date +%^a%d --date '+1 days'`
calen1[32]=`date +%^a%d --date '+2 days'`
calen1[33]=`date +%^a%d --date '+3 days'`
calen1[34]=`date +%^a%d --date '+4 days'`
calen1[35]=`date +%^a%d --date '+5 days'`
calen1[36]=`date +%^a%d --date '+6 days'`
calen1[37]=`date +%^a%d --date '+7 days'`
calen1[38]=`date +%^a%d --date '+8 days'`
calen1[39]=`date +%^a%d --date '+9 days'`
calen1[40]=`date +%^a%d --date '+10 days'`
calen1[41]=`date +%^a%d --date '+11 days'`
calen1[42]=`date +%^a%d --date '+12 days'`
calen1[43]=`date +%^a%d --date '+13 days'`
calen1[44]=`date +%^a%d --date '+14 days'`
calen1[45]=`date +%^a%d --date '+15 days'`
calen1[46]=`date +%^a%d --date '+16 days'`
calen1[47]=`date +%^a%d --date '+17 days'`
calen1[48]=`date +%^a%d --date '+18 days'`
calen1[49]=`date +%^a%d --date '+19 days'`
calen1[50]=`date +%^a%d --date '+20 days'`
calen1[51]=`date +%^a%d --date '+21 days'`
calen1[52]=`date +%^a%d --date '+22 days'`
calen1[53]=`date +%^a%d --date '+23 days'`
calen1[54]=`date +%^a%d --date '+24 days'`
calen1[55]=`date +%^a%d --date '+25 days'`
calen1[56]=`date +%^a%d --date '+26 days'`
calen1[57]=`date +%^a%d --date '+27 days'`
calen1[58]=`date +%^a%d --date '+28 days'`
calen1[59]=`date +%^a%d --date '+29 days'`
calen1[60]=`date +%^a%d --date '+30 days'`
calen1[61]=`date +%^a%d --date '+31 days'`
for (( x=0 ; x<62 ; x++ ));do
cale1=`echo ${calen1[x]}`;calendar
echo ${calen1[x]} | tr '.' '\012' | cut -c1-2 |\
convert -background none -fill $coul3 -font $fonte2 -pointsize $fonts1 -gravity center label:@- -trim \
\( +clone -background $coul4 -shadow 100x1 -channel A -level 0,7% +channel \) +swap +repage -gravity center -composite $imagetemp1
composite -gravity west -background transparent -geometry +$(((pos12*x-pos13)+dep1))-12 -dissolve 65% $imagetemp1 $imagetemp $imagetemp
done
# shadow Day names 5 ----------------------------------------------------------
convert $imagetemp -bordercolor None -border 11x11 \( +clone -background none -shadow 100x2 \) -compose DstOver -composite -compose Over $reptemp/$imageF.png
###################################################################################################################
#================================================calendar========DAY=NUMBERS======================================#
###################################################################################################################
###############################################################################
# Cartouche Calendar 2 --------------------------------------------------------
convert $reptemp/$imageF.png xc:none -fill none $imagetemp
# Position--et--jours---------------------------------
dep1=7 ; pos12=23
calen1[0]=`date +%^a%d --date '-30 days'`
calen1[1]=`date +%^a%d --date '-29 days'`
calen1[2]=`date +%^a%d --date '-28 days'`
calen1[3]=`date +%^a%d --date '-27 days'`
calen1[4]=`date +%^a%d --date '-26 days'`
calen1[5]=`date +%^a%d --date '-25 days'`
calen1[6]=`date +%^a%d --date '-24 days'`
calen1[7]=`date +%^a%d --date '-23 days'`
calen1[8]=`date +%^a%d --date '-22 days'`
calen1[9]=`date +%^a%d --date '-21 days'`
calen1[10]=`date +%^a%d --date '-20 days'`
calen1[11]=`date +%^a%d --date '-19 days'`
calen1[12]=`date +%^a%d --date '-18 days'`
calen1[13]=`date +%^a%d --date '-17 days'`
calen1[14]=`date +%^a%d --date '-16 days'`
calen1[15]=`date +%^a%d --date '-15 days'`
calen1[16]=`date +%^a%d --date '-14 days'`
calen1[17]=`date +%^a%d --date '-13 days'`
calen1[18]=`date +%^a%d --date '-12 days'`
calen1[19]=`date +%^a%d --date '-11 days'`
calen1[20]=`date +%^a%d --date '-10 days'`
calen1[21]=`date +%^a%d --date '-9 days'`
calen1[22]=`date +%^a%d --date '-8 days'`
calen1[23]=`date +%^a%d --date '-7 days'`
calen1[24]=`date +%^a%d --date '-6 days'`
calen1[25]=`date +%^a%d --date '-5 days'`
calen1[26]=`date +%^a%d --date '-4 days'`
calen1[27]=`date +%^a%d --date '-3 days'`
calen1[28]=`date +%^a%d --date '-2 days'`
calen1[29]=`date +%^a%d --date '-1 days'`
calen1[30]=`date +%^a%d --date '0 days'`
calen1[31]=`date +%^a%d --date '+1 days'`
calen1[32]=`date +%^a%d --date '+2 days'`
calen1[33]=`date +%^a%d --date '+3 days'`
calen1[34]=`date +%^a%d --date '+4 days'`
calen1[35]=`date +%^a%d --date '+5 days'`
calen1[36]=`date +%^a%d --date '+6 days'`
calen1[37]=`date +%^a%d --date '+7 days'`
calen1[38]=`date +%^a%d --date '+8 days'`
calen1[39]=`date +%^a%d --date '+9 days'`
calen1[40]=`date +%^a%d --date '+10 days'`
calen1[41]=`date +%^a%d --date '+11 days'`
calen1[42]=`date +%^a%d --date '+12 days'`
calen1[43]=`date +%^a%d --date '+13 days'`
calen1[44]=`date +%^a%d --date '+14 days'`
calen1[45]=`date +%^a%d --date '+15 days'`
calen1[46]=`date +%^a%d --date '+16 days'`
calen1[47]=`date +%^a%d --date '+17 days'`
calen1[48]=`date +%^a%d --date '+18 days'`
calen1[49]=`date +%^a%d --date '+19 days'`
calen1[50]=`date +%^a%d --date '+20 days'`
calen1[51]=`date +%^a%d --date '+21 days'`
calen1[52]=`date +%^a%d --date '+22 days'`
calen1[53]=`date +%^a%d --date '+23 days'`
calen1[54]=`date +%^a%d --date '+24 days'`
calen1[55]=`date +%^a%d --date '+25 days'`
calen1[56]=`date +%^a%d --date '+26 days'`
calen1[57]=`date +%^a%d --date '+27 days'`
calen1[58]=`date +%^a%d --date '+28 days'`
calen1[59]=`date +%^a%d --date '+29 days'`
calen1[60]=`date +%^a%d --date '+30 days'`
calen1[61]=`date +%^a%d --date '+31 days'`
for (( x=0 ; x<62 ; x++ ));do
cale1=`echo ${calen1[x]}`;calendar
echo ${calen1[x]} | cut -c4-5 |\
convert -background none -fill $coul3 -font $fonte2 -pointsize $fonts1 -gravity center label:@- -trim \
\( +clone -background $coul4 -shadow 100x1 -channel A -level 0,7% +channel \) +swap +repage -gravity center -composite $imagetemp1
composite -gravity west -background transparent -geometry +$(((pos12*x-pos13)+dep1))+12 -dissolve 65% $imagetemp1 $imagetemp $imagetemp
done
# shadow ----------------------------------------------------------
convert $imagetemp -bordercolor None -border 11x11 \( +clone -background none -shadow 100x2 \) -compose DstOver -composite -compose Over $reptemp/$imageF.png
exit 0
image.lua:
require 'cairo'
home = os.getenv ('HOME')
--Fonction d'affichage
function conky_fDrawImage(path,x,y,w,h,arc)
path = string.gsub(path, "~", home)
path = string.gsub(path, "$HOME", home)
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local function fDrawImage(path,x,y,w,h,arc)
x=x+(w/2)
y=y+(h/2)
local img = cairo_image_surface_create_from_png(path)
local w_img, h_img = cairo_image_surface_get_width (img), cairo_image_surface_get_height (img)
local cr = cairo_create (cs)
cairo_translate (cr, x, y)
if arc then
cairo_rotate (cr, arc)
end
cairo_scale (cr, w/w_img, h/h_img)
cairo_set_source_surface (cr, img, -w_img/2, -h_img/2)
cairo_paint (cr)
cairo_destroy(cr)
cairo_surface_destroy (img)
end
fDrawImage(path,x,y,w,h,arc)
cairo_surface_destroy(cs)
return ""
end
résultat:
image
Si quelqu'un a une idée pour lancer le script convert qu'une fois avec la valeur "execi" ?
Hors ligne
#313 Le 01/07/2013, à 10:35
- ljere
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
@loutch modifie la ligne
lua_load ~/.conky/draw_bg.lua (attention ceci est mon chemin à modifier en fonction de votre chemin)
en
lua_load ~/.conky/draw_bg.lua # (attention ceci est mon chemin à modifier en fonction de votre chemin)
ça devrait fonctionner mieux
ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon
Hors ligne
#314 Le 01/07/2013, à 14:29
- loutch
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
re
@ljere
merci il ni a plus que ça :
[romuald@localhost ~]$ conky -c ~/conkyrc
Conky: invalid configuration file '/home/romuald/conkyrc'
Conky: forked to background, pid is 11034
[romuald@localhost ~]$ Conky: desktop window (2200134) is subwindow of root window (249)
Conky: window type - normal
Conky: drawing to created window (0x5400002)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_main_rings execution failed: /home/romuald/.conky/horloge.lua:241: attempt to index global 'conky_window' (a nil value)
Hors ligne
#315 Le 01/07/2013, à 16:15
- chepioq
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Si quelqu'un a une idée pour lancer le script convert qu'une fois avec la valeur "execi" ?
Qu'est_ce que tu appelles "script convert" ?
C'est le conky ?
Je remarque que tu as :
update_interval 1
Ce qui veut dire que ton conky calendrier est lancé toutes les secondes, ce qui, je pense, n'est pas néccessaire.
J'aurais mis
update_interval 3600, ce qui lance le conky toutes les heures,
je pense même que tu peux rallonger ce temps à 2, 3 heures ou plus.
Tout est dans tout et réciproquement....
Hors ligne
#316 Le 01/07/2013, à 16:40
- ragamatrix
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
ragamatrix a écrit :Si quelqu'un a une idée pour lancer le script convert qu'une fois avec la valeur "execi" ?
Qu'est_ce que tu appelles "script convert" ?
C'est le conky ?
Je remarque que tu as :
update_interval 1
Ce qui veut dire que ton conky calendrier est lancé toutes les secondes, ce qui, je pense, n'est pas néccessaire.J'aurais mis
update_interval 3600, ce qui lance le conky toutes les heures,
je pense même que tu peux rallonger ce temps à 2, 3 heures ou plus.
Je voudrais que lorsque je lance ce conky le script "calendar.sh" soit lancé (juste au lancement de conky) ensuite pas la peine que ce script soit actualisé toutes les "n" valeurs.
Dernière modification par ragamatrix (Le 01/07/2013, à 16:44)
Hors ligne
#317 Le 01/07/2013, à 16:52
- chepioq
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Je viens de trouverceci ici http://conky.sourceforge.net/variables.html :
updates Number of updates for debugging
Je suppose que cela veux dire le nombre de fois que la commande est exécuté, donc je mettrais, pour voir ce que cela donne :
${update 1 ~/calendar.sh}
Mais je ne suis sur de rien sur ce coup là.
Tout est dans tout et réciproquement....
Hors ligne
#318 Le 01/07/2013, à 16:57
- ragamatrix
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
@chepioq
J'ai mis la valeur à 86400... Parce que 86400÷3600=24
Normalement ce script ne sera exécuter qu'une fois par 24 heures...
J'ai bon ?
Dernière modification par ragamatrix (Le 01/07/2013, à 16:59)
Hors ligne
#319 Le 01/07/2013, à 17:00
- chepioq
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
@chepioq
J'ai mis la valeur à 86400... Parce que 86400÷3600=24
Normalement ce script ne sera exécuter qu'une fois par 24 heures...
J'ai bon ?
Je pense que cela est bon, ton conky se relanceras toutes le 24 heures, sauf si, bien sur, tu relances ta session ou que tu redémarres.
Dernière modification par chepioq (Le 01/07/2013, à 17:00)
Tout est dans tout et réciproquement....
Hors ligne
#320 Le 01/07/2013, à 17:03
- ragamatrix
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Je viens de trouverceci ici http://conky.sourceforge.net/variables.html :
updates Number of updates for debuggingJe suppose que cela veux dire le nombre de fois que la commande est exécuté, donc je mettrais, pour voir ce que cela donne :
${update 1 ~/calendar.sh}Mais je ne suis sur de rien sur ce coup là.
Merci d'avoir jeter un coup d' œil je pense que c'est le script qui doit-être executé une fois par 24h; le rafraîchissement de conky peut rester tel que ... (je crois)
Hors ligne
#321 Le 01/07/2013, à 19:30
- ragamatrix
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Quelqu'un aurait-il le conky qui affiche des points lorsqu'on change de bureau ? (je crois qu'il était sous voyager, je ne le retrouve plus...)
Hors ligne
#322 Le 02/07/2013, à 11:24
- ragamatrix
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Quelqu'un aurait-il le conky qui affiche des points lorsqu'on change de bureau ? (je crois qu'il était sous voyager, je ne le retrouve plus...)
Bon .. Bin J'ai trouvé dans le cd live ...
Hors ligne
#323 Le 12/07/2013, à 09:24
- Swiss_Knight
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Bonjour,
j'aimerai faire en sorte que le nom de mon processeur s'indique automatiquement dans mon Conky. Comprendre par là qu'actuellement il est écrit en dur, donc quand je change de CPU ça ne change pas son nom dans Conky.
J'ai trouvé cette commande qui me sort ça :
sudo dmidecode -t processor | grep -i version
Version: AMD Athlon(tm) II X4 640 Processor
mais en accolant un truc du genre | awk -FS ":" 'print{$2}' pour ne garder que ce qui vient dans la 2ème colonne (après les deux points) ça ne fonctionne pas (awk: cmd. ligne:1: ^ syntax error).
Et pour pointiller j'aimerai bien qu'il ne me sorte que "AMD Athlon(tm) II X4 640" (sans le "Processor" à la fin. (peut-être que même le (tm) je m'en passerais).
Merci de vos tuyaux !!! Et bonne journée
xuniL
Hors ligne
#324 Le 12/07/2013, à 18:15
- Didier-T
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Bonjour Swiss_Knight,
Je ne suis pas certain pour l’utilisation du sudo dans un Conky
Test cette commande-ci, et dis moi si ça te convient.
grep -i -m 1 'Model name' /proc/cpuinfo |sed 's/^.*: //'
Hors ligne
#325 Le 12/07/2013, à 20:23
- Swiss_Knight
Re : [5] Conky : Postez vos conkyrc ou certaines parties intéressantes
Salut,
Bien vu pour le sudo Didier-T, dommage ; dmidecode est pas mal utile.
Mais ta commande fonctionne très bien aussi merci infiniment !
xuniL
Hors ligne