Conky

Bureaux,conky et autres personnalisations esthétiques.
Avatar du membre
loutch
Messages : 517
Enregistré le : lun. 13 juil. 2015 17:32
Localisation : Sarreguemines

Re: Conky

Message par loutch »

Dernier message de la page précédente :

Hello

Conky glanés sur la toile et que j'ai modifiés (pour certains, remplacement du lua par des graphs conky – ça prend moins de ressources), le pack d'origine est ici :
http://www.deviantart.com/art/ConkyBar- ... -401254455

Cpu:

Code : Tout sélectionner

background yes
use_xft yes
xftfont URW Chancery L:style=Bold: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 310 120
maximum_width 310
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color ffffff 		#220 220 220	Gainsboro
color0 1793d0			#Special Color
color1 DDDDDD			#Shades of grey
color2 AAAAAA
color3 888888
default_outline_color black
alignment tl
gap_x 10
gap_y 720
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
imlib_cache_size 0 
uppercase no


TEXT

${GOTO 50}Processeur
${GOTO 50}${font}Utilisation Avg: ${cpu cpu0}% ${GOTO 215}${font}Freq: ${freq_g} Ghz
${goto 36}${voffset -10}${cpugraph cpu0 20,250 1793d0 1793d0}
${goto 36}${voffset -7}${cpugraph cpu2 -20,250 1793d0 1793d0}
${voffset -10}${GOTO 50}${color0}${top name 1}${GOTO 255}${top cpu 1}%
             ${GOTO 50}${color1}${top name 2}${GOTO 255}${top cpu 2}%
             ${GOTO 50}${color2}${top name 3}${GOTO 255}${top cpu 3}%
${voffset 5} ${GOTO 50}${color}${GOTO 100}${cpu cpu1}%${GOTO 150}${cpu cpu2}%${GOTO 200}${cpu cpu3} %${GOTO 250}${cpu cpu4} %
${GOTO 95}${exec expr `cat /sys/class/hwmon/hwmon2/temp1_input` / 1000}°C${GOTO 145}${exec expr `cat /sys/class/hwmon/hwmon2/temp2_input` / 1000}°C${GOTO 195}${exec expr `cat /sys/class/hwmon/hwmon2/temp3_input` / 1000}°C${GOTO 245}${exec expr `cat /sys/class/hwmon/hwmon2/temp1_input` / 1000}°C
${image ~/.conky/ConkyBar/img/cpu.png -p 0,0 -s 45x45}
${voffset -50}

Mémoire :

Code : Tout sélectionner

background yes
use_xft yes
xftfont URW Chancery L:style=Bold: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 310 100
maximum_width 310
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color ffffff 		#220 220 220	Gainsboro
color0 1793d0			#Special Color
color1 DDDDDD			#Shades of grey
color2 AAAAAA
color3 888888
default_outline_color black
alignment tl
gap_x 350
gap_y 730
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
imlib_cache_size 0 
uppercase no

TEXT

${voffset 40}${GOTO 50}Mémoire
${GOTO 50}Usage: ${memperc}%  | ${mem}      [+${buffers} +${cached}]

${GOTO 50}${color0}${top_mem name 1}${GOTO 255}${top_mem mem 1}%
${GOTO 50}${color1}${top_mem name 2}${GOTO 255}${top_mem mem 2}%
${GOTO 50}${color2}${top_mem name 3}${GOTO 255}${top_mem mem 3}%
${GOTO 50}${color3}${top_mem name 4}${GOTO 255}${top_mem mem 4}%
${GOTO 50}${color3}${top_mem name 5}${GOTO 255}${top_mem mem 5}%
${image ~/.conky/ConkyBar/img/ram.png -p 0,45 -s 45x45}
Système :

Code : Tout sélectionner

background yes
use_xft yes
xftfont URW Chancery L:style=Bold: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 310 100
maximum_width 310
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color ffffff 		#220 220 220	Gainsboro
color0 1793d0			#Special Color
color1 DDDDDD			#Shades of grey
color2 AAAAAA
color3 888888
default_outline_color black
alignment tl
gap_x 700
gap_y 700
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
imlib_cache_size 0 
uppercase no



TEXT
${voffset 35}${GOTO 50}Systeme
${GOTO 50}Uptime: ${color0}${uptime_short}$color
${goto 50}Carte:  ${color0}${hwmon 1 temp 1} °C $color

${GOTO 50}Processes:   ${processes} (${color0}${running_processes} ${color}running)
${GOTO 50}Threads:     ${running_threads}
${GOTO 50}Connections: ${tcp_portmon 1 65535 count}

${image ~/.conky/ConkyBar/img/system.png -p 0,25 -s 45x45}
Racine :

Code : Tout sélectionner

background yes
use_xft yes
xftfont URW Chancery L:style=Bold: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 310 100
maximum_width 310
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color ffffff 		#220 220 220	Gainsboro
color0 1793d0			#Special Color
color1 DDDDDD			#Shades of grey
color2 AAAAAA
color3 888888
default_outline_color black
alignment tl
gap_x 350
gap_y 730
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
imlib_cache_size 0 
uppercase no

TEXT

${voffset 40}${GOTO 50}Mémoire
${GOTO 50}Usage: ${memperc}%  | ${mem}      [+${buffers} +${cached}]

${GOTO 50}${color0}${top_mem name 1}${GOTO 255}${top_mem mem 1}%
${GOTO 50}${color1}${top_mem name 2}${GOTO 255}${top_mem mem 2}%
${GOTO 50}${color2}${top_mem name 3}${GOTO 255}${top_mem mem 3}%
${GOTO 50}${color3}${top_mem name 4}${GOTO 255}${top_mem mem 4}%
${GOTO 50}${color3}${top_mem name 5}${GOTO 255}${top_mem mem 5}%
${image ~/.conky/ConkyBar/img/ram.png -p 0,45 -s 45x45}
et pour celui-ci son lua :

Code : Tout sélectionner

--==============================================================================
--                            seamod_rings.lua
--
--  Date    : 05/02/2012
--  Author  : SeaJey
--  Version : v0.1
--  License : Distributed under the terms of GNU GPL version 2 or later
--
--  This version is a modification of lunatico_rings.lua wich is modification of conky_orange.lua 
--
--  conky_orange.lua:    http://gnome-look.org/content/show.php?content=137503&forumpage=0
--  lunatico_rings.lua:  http://gnome-look.org/content/show.php?content=142884
--==============================================================================

require 'cairo'


--------------------------------------------------------------------------------
--                                                                    gauge DATA
gauge = {
{
    name='fs_used_perc',            arg='',                  max_value=100,
    x=155,                          y=180,
    graph_radius=110,
    graph_thickness=5,
    graph_start_angle=-60,
    graph_unit_angle=1.2,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x1793d0,       hand_fg_alpha=1.0,
    txt_radius=120,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x1793d0,        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=9.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[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)
    end

    cairo_surface_destroy(cs)
    cairo_destroy(display)

end

Réseau :

Code : Tout sélectionner

background yes
use_xft yes
xftfont URW Chancery L:style=Bold: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 310 150
maximum_width 310
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color ffffff
default_outline_color black
alignment tr
gap_x 50
gap_y 720
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
imlib_cache_size 0 
uppercase no

 
TEXT

${GOTO 55}Réseau ${goto 150}Signal: ${wireless_link_qual_perc wlp2s0} %
${voffset 85}${GOTO 50}Reçu à: ${downspeedf wlp2s0} k/s ${GOTO 200}Envoyé à: ${upspeedf wlp2s0} k/s
             ${goto 50}Total : ${totaldown wlp2s0}      ${goto 200}Total : ${totalup wlp2s0}
${goto 36}${voffset -90}${upspeedgraph wlp2s0 20,250 1793d0 1793d0}
${goto 36}${voffset -7}${downspeedgraph wlp2s0 -20,250 1793d0 1793d0}
${image ~/.conky/ConkyBar/img/networkhigh.png -p 0,5 -s 45x45}
${voffset -200}
@+
Fichiers joints
11.png
HP Pavilion g 7 1357 sf avec ssd Tessa cinnamon Mageia 7rc mate
Asus ROG avec xubuntu 18.04 et xubuntu 19.04

Image

zeb
Messages : 16473
Enregistré le : ven. 19 juin 2015 22:13
Localisation : plus ici

Re: Conky

Message par zeb »

Salut loutch,
Celui-ci est magnifique, je n'ai toujours pas changé le mien, celui-ci me donne vraiment envie, merci.

Avatar du membre
loutch
Messages : 517
Enregistré le : lun. 13 juil. 2015 17:32
Localisation : Sarreguemines

Re: Conky

Message par loutch »

Re
zebulon a écrit :Salut loutch,
Celui-ci est magnifique, je n'ai toujours pas changé le mien, celui-ci me donne vraiment envie, merci.
En plus "Hermes" m'a contaminé je change plus souvent qu'avant de bureau, c'est vrai que celui-ci en "jette".

Image
@+
Modifié en dernier par zeb le mer. 29 avr. 2020 14:57, modifié 1 fois.
Raison : image mise sur FFLMpics
HP Pavilion g 7 1357 sf avec ssd Tessa cinnamon Mageia 7rc mate
Asus ROG avec xubuntu 18.04 et xubuntu 19.04

Image

zeb
Messages : 16473
Enregistré le : ven. 19 juin 2015 22:13
Localisation : plus ici

Re: Conky

Message par zeb »

C'est vrai qu'à le voir, autant changer, moi aussi je commence

Avatar du membre
dagonh
Messages : 1512
Enregistré le : lun. 13 juil. 2015 15:41

Re: Conky

Message par dagonh »

Le mien change tout seul – sans conky – toutes les 15 mn, et comme il y a 96 images…
CM Gigabyte Z97-HD3, Intel i7-4790K, RAM 16 Go
système sur SSD 240 Go + 3 To pour les données (+2,5 To externes pour les sauvegardes)
Écran Hanns 27" 16/10
Sarah Maté

lacktchou
Messages : 2347
Enregistré le : lun. 13 juil. 2015 19:33

Re: Conky

Message par lacktchou »

dagonh a écrit :Le mien change tout seul – sans conky – toutes les 15 mn, et comme il y a 96 images…
Bien bonne celle-là! Vraiment bien bonne. Je dirai......
Lacktchou
Image
Relisez-vous avant de poster.
LM 17.3 XFCE 64-bit - Noyau 3.16.0-38 et 3.16.0-32 - LM 17.2 Maté 64-bit - Xubuntu 16.04 LTS 64-bit - Windows 7
Laptop Lenovo G560 DD Toshiba 640 Go DD ext Toshiba 1.0 To

Avatar du membre
loutch
Messages : 517
Enregistré le : lun. 13 juil. 2015 17:32
Localisation : Sarreguemines

Re: Conky

Message par loutch »

hello

Pour ceux qui utilise Music On Console (moc)

Le script qui lance le conky et mocp avec son interface dans la console( remplacer konsole par console ou autre suivant votre environnement)

Code : Tout sélectionner

 
#!/bin/bash

PROG_NAME1="conky -c /home/$USER/.conky/moc/conkyrc"	# Nom du programme à  démarrer/arrêter.
PROG_NAME2="/usr/bin/konsole -e /usr/bin/mocp" # Nom du programme à  démarrer/arrêter.

PROCESSPID1=$(pgrep -f /home/$USER/.conky/moc/conkyrc)	# Récupère le PID du processus.
PROCESSPID2=$(pgrep -f "/usr/bin/mocp")	# Récupére le PID du processus.


if [[ "$PROCESSPID1" != ""  && "$PROCESSPID2" != "" ]]; then	# Si les deux processus existe alors on le(s) kill.
        kill $PROCESSPID1 && echo "Stop $PROG_NAME1 (PID: $PROCESSPID1)"
        kill $PROCESSPID2  && echo "Stop $PROG_NAME2 (PID: $PROCESSPID2)"
else	# Si aucun processus on démarre le programme.
        kill $PROCESSPID1 
        $PROG_NAME1 & 
        echo "Start $PROG_NAME1"
        kill $PROCESSPID2  
        $PROG_NAME2 & 
        echo "Start $PROG_NAME2"
        if [[ "$PROCESSPID1" == ""  || "$PROCESSPID2" == "" ]]; then	# Si un des processus n'existe pas alors on le(s) kill.
                kill $PROCESSPID1 && echo "Stop $PROG_NAME1 (PID: $PROCESSPID1)"
                kill $PROCESSPID2  && echo "Stop $PROG_NAME2 (PID: $PROCESSPID2)"
                echo "Il y a eu un souci au lancement tout a été coupé"
        fi
fi

exit 0
le conkyrc:

Code : Tout sélectionner

 

background yes
use_xft yes
xftfont URW Chancery L:style=Bold: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 310 500
maximum_width 310
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color ffffff #ffd579
default_outline_color black
default_bar_size 230 6
alignment tl
gap_x 0
gap_y 200
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
imlib_cache_size 0 
 uppercase no
 
 TEXT
 
${font URW Chancery L:style=Bold:size=20}${alignc}Music On Console $font

Artiste : ${goto 150}${moc_artist}
Album :   ${goto 150}${moc_album}
Titre :   ${goto 150}${moc_song}
${goto 40}${execbar mocp -Q '%cs/%ts*100' | bc -l}
${voffset -20}0:00 ${goto 280}${moc_totaltime}
 ${goto 140}${moc_curtime}
Image
avec la fenêtre réduite:

Image

@+
Modifié en dernier par zeb le mer. 29 avr. 2020 14:59, modifié 1 fois.
Raison : image mise sur FFLMpics
HP Pavilion g 7 1357 sf avec ssd Tessa cinnamon Mageia 7rc mate
Asus ROG avec xubuntu 18.04 et xubuntu 19.04

Image

Avatar du membre
loutch
Messages : 517
Enregistré le : lun. 13 juil. 2015 17:32
Localisation : Sarreguemines

Re: Conky

Message par loutch »

Hello

Conky météo (attention il faut le fameux pack météo de Didier-t sur le forum ubuntu.fr ainsi que le pack d'icônes du conkyforecast)

le conky :

Code : Tout sélectionner

background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=10
xftalpha 1
imlib_cache_size 0
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 200 700
maximum_width 200
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color ffffff #ffd579
default_outline_color white
alignment top_right
gap_x 00
gap_y 00
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes

 # -- Déclaration template -- #
 template0 ${lua fDrawImage ~/.conky/conky-meteo/meteo6jours/fon/\1 \2 \3 \4 \5} # -- images fond -- #
 template1 ${lua Meteo_\1 \2 \3 \4 \5 \6} # -- gestion météo --#
 template2 ${lua Meteo_\1 \2 \3 \4 \5 \6 \7} # -- icônes météo -- \2=répertoire icônes \3=position \4=taille \5=jour (pour les prévisions) #
 template3 ${lua Lune_\1} 
 template4 ${lua_parse Images_\1 \2 \3 60 \4} # -- Appelle image -- \2=position \3=taille \4=jour (pour les prévisions) #

lua_load ~/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua
lua_startup_hook init ~/.conky/conky-meteo/meteo6jours/meteo.cfg

lua_load ~/.conky/blanc/baro.lua
lua_draw_hook_pre main

lua_load ~/.conky/blanc/textwriting.lua
lua_draw_hook_post draw_text

  
#lua_load ~/.conky/draw_bg/draw_bg.lua${lua conky_draw_bg 20 0 10 1300 150 0x000000 0.5}
 #### ${lua fDrawImage ~/.conky/conky-meteo/meteo_lua_2/icones/icone_meteo/a33.png 80 640 60 60}  ####
 
 TEXT 
 
${template1 Maj}${voffset 100}${goto 90}${template1 Pression 1} mb 
${voffset 20}${goto 30}Temp                   ${goto 165}Res
             ${goto 35}${template1 TempAct} ° ${goto 170}${template1 TempRes} ° 
${voffset 10}${goto 40}Dernière mise à jour : ${template1 Heure} h ${template1 Minute}
             ${alignc}${template1 CondMeteo}    
${voffset 80}${goto 25}${template1 huitHeures_Heure 1} h                     ${goto 75}${template1 huitHeures_Heure 2} h                     ${goto 125}${template1 huitHeures_Heure 3} h                     ${goto 175}${template1 huitHeures_Heure 4} h  
             ${goto 25}${template1 huitHeures_Temp 1}°                       ${goto 75}${template1 huitHeures_Temp 2}°                       ${goto 125}${template1 huitHeures_Temp 3}°                       ${goto 175}${template1 huitHeures_Temp 4}°
${voffset 25}${goto 15}${template1 Jour %a_%d 2}                             ${goto 65}${template1 Jour %a_%d 3}                             ${goto 115}${template1 Jour %a_%d 4}                             ${goto 165}${template1 Jour %a_%d 5}  
             ${goto 15}${template1 Nuit_Temp 2}°/${template1 Jour_Temp 2}°   ${goto 65}${template1 Nuit_Temp 3}°/${template1 Jour_Temp 3}°   ${goto 115}${template1 Nuit_Temp 4}°/${template1 Jour_Temp 4}°   ${goto 165}${template1 Nuit_Temp 5}°/${template1 Jour_Temp 5}°
${voffset 35}${alignc}Indice Uv : ${template1 Uv}
             ${alignc}Durée Enso : ${template1 HDureeJour} h ${template1 MDureeJour}
${voffset 30}${goto 15}Heu.Lev. ${goto 160}Heu.Cou.
             ${goto 22}${template1 HLeverSoleil}-${template1 MLeverSoleil} ${goto 165}${template1 HCoucherSoleil}-${template1 MCoucherSoleil}    
${voffset 10}${alignc}${template3 ephemerides}
             ${alignc}${template3 Phases}
             ${alignc}${template3 Age}
${voffset 40}${goto 15}Heu.Lev. ${goto 160}Heu.Cou.
             ${goto 22}${template3 HLeverLune}-${template3 MLeverLune} ${goto 165}${template3 HCoucherLune}-${template3 MCoucherLune}
${voffset 10}${goto 100}Alerte 
             ${goto 20}${template1 Alerte1}     
             ${goto 20}${template1 Alerte2}     
#### icones barometre ####
${lua fDrawImage ~/.conky/conky-meteo/meteo_lua_2/icones/icone_forecast/00.png 20 120 30 20}
${lua fDrawImage ~/.conky/conky-meteo/meteo_lua_2/icones/icone_forecast/12.png 20  90 30 20} 
${lua fDrawImage ~/.conky/conky-meteo/meteo_lua_2/icones/icone_forecast/09.png 35  60 30 20}
${lua fDrawImage ~/.conky/conky-meteo/meteo_lua_2/icones/icone_forecast/39.png 70  30 30 20}
${lua fDrawImage ~/.conky/conky-meteo/meteo_lua_2/icones/icone_forecast/28.png 130  30 30 20}
${lua fDrawImage ~/.conky/conky-meteo/meteo_lua_2/icones/icone_forecast/30.png 155  60 30 20}
${lua fDrawImage ~/.conky/conky-meteo/meteo_lua_2/icones/icone_forecast/34.png 170  90 30 20}
${lua fDrawImage ~/.conky/conky-meteo/meteo_lua_2/icones/icone_forecast/36.png 170 120 30 20}            
#### icone condition actuelle ####
${template2 IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 80 250 70 70} 
#### icones prochaines quatre heures ####
${template2 huitHeures_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones  10 350 40 40 1}   
${template2 huitHeures_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones  60 350 40 40 2}
${template2 huitHeures_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 110 350 40 40 3}
${template2 huitHeures_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 160 350 40 40 4}
#### icones prochains quatre jours ####
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones  10 410 40 40 2}   
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones  60 410 40 40 3}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 110 410 40 40 4}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 160 410 40 40 5}
#### icone soleil ####
${lua fDrawImage ~/.conky/conky-meteo/meteo_lua_2/icones/icone_forecast/36.png 80 490 70 70}  
#### icone lune ####
${lua fDrawImage /tmp/lune.png 80 625 70 70}
le baro.lua

Code : Tout sélectionner

 
--==============================================================================
--                                 baro.lua
--
--  author  : SLK-adapted by shamen456
--  version : v2011-06-13
--  license : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================

require 'cairo'

--------------------------------------------------------------------------------
--                                                                    gauge DATA
gauge = {

{
    name='cpu',                arg='',                      max_value=1060, sub_value=960,
    x=110,                          y=110,
    graph_radius=40,
    graph_thickness=5,
    graph_start_angle=235,
    graph_unit_angle=2.5,          graph_unit_thickness=2.,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.4,
    graph_fg_colour=0xB1ADA7,      graph_fg_alpha=0,
    hand_fg_colour=0x000000,       hand_fg_alpha=.0,
    txt_radius=0,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0,
    graduation_radius=40,
    graduation_thickness=8,        graduation_mark_thickness=2,
    graduation_unit_angle=18,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=0,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.8,
},
{
    name='lua',                arg='Meteo_Pression',                      max_value=1050, sub_value=950,
    x=110,                          y=110,
    graph_radius=30,
    graph_thickness=50,
    graph_start_angle=260,
    graph_unit_angle=2.1,          graph_unit_thickness=2.,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.0,
    graph_fg_colour=0xB1ADA7,      graph_fg_alpha=0,
    hand_fg_colour=0xFF0000,       hand_fg_alpha=0.8,
    txt_radius=20,
    txt_weight=0,                  txt_size=10.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0,
    graduation_radius=32,
    graduation_thickness=6,        graduation_mark_thickness=2,
    graduation_unit_angle=18,
    graduation_fg_colour=0x4F4B41, graduation_fg_alpha=1,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.1,
},
{
    name='lua',                arg='Meteo_TempRes',   
    max_value=60,                   sub_value=-30,--valeur de depart du graphe
    x=110,                          y=160,
    graph_radius=20,
    graph_thickness=40,
    graph_start_angle=75,
    graph_unit_angle=2.33,          graph_unit_thickness=1.5,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0,
    graph_fg_colour=0xB1ADA7,      graph_fg_alpha=0,
    hand_fg_colour=0xFF0000,       hand_fg_alpha=0,
    txt_radius=18,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xC0C0FF,        txt_fg_alpha=0,
    graduation_radius=20,
    graduation_thickness=8,        graduation_mark_thickness=2,
    graduation_unit_angle=11.6,
    graduation_fg_colour=0xffffff, graduation_fg_alpha=0.9,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='lua',                arg='Meteo_TempAct',                      max_value=60, sub_value=-30,
    x=110,                          y=160,
    graph_radius=20,
    graph_thickness=40,
    graph_start_angle=75,
    graph_unit_angle=2.33,          graph_unit_thickness=1.5,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.,
    graph_fg_colour=0xB1ADA7,      graph_fg_alpha=0,
    hand_fg_colour=0xff0000,       hand_fg_alpha=1,
    txt_radius=30,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xED7F77,        txt_fg_alpha=0,
    graduation_radius=22,
    graduation_thickness=14,        graduation_mark_thickness=2,
    graduation_unit_angle=23.3,
    graduation_fg_colour=0xffffff, graduation_fg_alpha=1,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.9,
},

}

-------------------------------------------------------------------------------
--                                                                 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']-data['sub_value']
    local sub_value = data['sub_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-sub_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[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)
    end

end
le textwring.lua

Code : Tout sélectionner

 
--[[circlewriting by mrpeachy (2010)]]
require 'cairo'
function addzero100(num)
if tonumber(num) < 10 then
return "00" .. num
elseif tonumber(num) <100 then
return "0" .. num
else
return num
end
end

function string:split(delimiter)
local result = { }
local from  = 1
local delim_from, delim_to = string.find( self, delimiter, from  )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from  = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from  )
end
table.insert( result, string.sub( self, from  ) )
return result
end

function circlewriting(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
range=finish
deg=(finish-start)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start+(deg*(i-1))))+var1
interval2=degrads*(start+(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2)
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval2)
end
end

function circlewritingdown(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
deg=(start-finish)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start-(deg*(i-1))))+var1
interval2=degrads*(start-(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2+(180*math.pi/180))
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval2-(180*math.pi/180))
end
end

function conky_draw_text()
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num > 5 then
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)



--circlewriting variable
cpu=tonumber(conky_parse('${cpu}'))
--text must be in quotes
text=("Tempete - Pluie - Variable - Beau - Tres Sec")
--text=("Stormy - Rain - Change - Fair - Very Dry") 
--font name must be in quotes
font="URW Chancery L"
fontsize=15
radius=50
positionx=110
positiony=110
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450.  Finish has to be greater than start.
start=-115
finish=115
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--circlewritingdown variables
--mem=tonumber(conky_parse('${memperc}'))
--text must be in quotes
text=(" 0 ")
--font name must be in quotes
font="URW Chancery L"
fontsize=10
radius=40
positionx=110
positiony=160
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90.  Start has to be greater than finish
start=150
finish=144
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("50")
font="URW Chancery L"
fontsize=10
radius=40
positionx=110
positiony=160
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
start=268
finish=262
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("40")
font="URW Chancery L"
fontsize=10
radius=40
positionx=110
positiony=160
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
start=245
finish=239
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("30")
font="URW Chancery L"
fontsize=10
radius=40
positionx=110
positiony=160
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
start=222
finish=216
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("20")
font="URW Chancery L"
fontsize=10
radius=40
positionx=110
positiony=160
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
start=199
finish=193
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("10")
font="URW Chancery L"
fontsize=10
radius=40
positionx=110
positiony=160
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
start=176
finish=170
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("-10")
font="URW Chancery L"
fontsize=10
radius=40
positionx=110
positiony=160
colorred=1
colorgreen=0
colorblue=0
coloralpha=1
start=134
finish=124
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

text=("-20")
font="URW Chancery L"
fontsize=10
radius=40
positionx=110
positiony=160
colorred=1
colorgreen=0
colorblue=0
coloralpha=1
start=112
finish=99
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

end
end
ça donne ceci:
Image
@+
Modifié en dernier par zeb le mer. 29 avr. 2020 15:00, modifié 1 fois.
Raison : image mise sur FFLMpics
HP Pavilion g 7 1357 sf avec ssd Tessa cinnamon Mageia 7rc mate
Asus ROG avec xubuntu 18.04 et xubuntu 19.04

Image

Avatar du membre
loutch
Messages : 517
Enregistré le : lun. 13 juil. 2015 17:32
Localisation : Sarreguemines

Re: Conky

Message par loutch »

Hello

Conky lune prendre le pack ici: http://bit.ly/4_2-6-15 du site "bunsenlabs" à décompresser dans votre home.

J'y ai intégré du lua (pour ceux qui on un fond d'écran clair) les images passent mieux et traduit en françois .

le conkyrc :

Code : Tout sélectionner

background yes
use_xft yes
xftfont URW Chancery L:style=Bold: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 410 250
maximum_width 410
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white #dbc38f
default_outline_color black
alignment tr
gap_x 00
gap_y 620
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
imlib_cache_size 0 
 uppercase no

 lua_load ~/.conky/lua/image.lua
 
 
TEXT 

${texeci 500 bash $HOME/4_Moon/moon_MoonGiant}
${voffset 90}${alignc 10}${execpi 600 sed -n '7p' $HOME/4_Moon/raw | awk '{print $1}'}
             ${alignc 10}${execpi 600 sed -n '7p' $HOME/4_Moon/raw | awk '{print $2}'}
             ${alignc 10}${execpi 600 sed -n '1p' $HOME/4_Moon/raw}
${voffset -60}${goto 25}${execi 3600 echo `date --date="-2 day" | awk '{print $3" "$2}'`}\
              ${goto 92}${execi 3600 echo `date --date="-1 day" | awk '{print $3" "$2}'`}\
              ${goto 277}${execi 3600 echo `date --date="+1 day" | awk '{print $3" "$2}'`}\
              ${goto 350}${execi 3600 echo `date --date="+2 day" | awk '{print $3" "$2}'`}
${voffset -5}${goto 25}${execpi 600 sed -n '19p' $HOME/4_Moon/raw | awk '{print $1}'}\
              ${goto 92}${execpi 600 sed -n '27p' $HOME/4_Moon/raw | awk '{print $1}'}\
              ${goto 277}${execpi 600 sed -n '35p' $HOME/4_Moon/raw | awk '{print $1}'}\
              ${goto 350}${execpi 600 sed -n '43p' $HOME/4_Moon/raw | awk '{print $1}'} 
${voffset -5}${goto 20}${execpi 600 sed -n '19p' $HOME/4_Moon/raw | awk '{print $2}'}\
              ${goto 87}${execpi 600 sed -n '27p' $HOME/4_Moon/raw | awk '{print $2}'}\
              ${goto 272}${execpi 600 sed -n '35p' $HOME/4_Moon/raw | awk '{print $2}'}\
              ${goto 347}${execpi 600 sed -n '43p' $HOME/4_Moon/raw | awk '{print $2}'}
${voffset -5}${goto 30}${execpi 600 sed -n '13p' $HOME/4_Moon/raw}\
              ${goto 100}${execpi 600 sed -n '21p' $HOME/4_Moon/raw}\
              ${goto 280}${execpi 600 sed -n '29p' $HOME/4_Moon/raw}\
              ${goto 355}${execpi 600 sed -n '37p' $HOME/4_Moon/raw}
${alignc}Details 
Visibilitée: ${execpi 600 sed -n '1p' $HOME/4_Moon/raw} %       ${goto 250}Age lune: ${execpi 600 sed -n '5p' $HOME/4_Moon/raw} jours
Angle soleil: ${execpi 600 sed -n '2p' $HOME/4_Moon/raw} °      ${goto 250}Angle lune: ${execpi 600 sed -n '6p' $HOME/4_Moon/raw} °
Distance soleil: ${execpi 600 sed -n '3p' $HOME/4_Moon/raw} kms ${goto 250}Distance lune: ${execpi 600 sed -n '4p' $HOME/4_Moon/raw} kms
${lua fDrawImage ~/4_Moon/-2.png 10 65 60 60}
${lua fDrawImage ~/4_Moon/-1.png 80 65 60 60}
${lua fDrawImage ~/4_Moon/0.png 157 35 90 90}
${lua fDrawImage ~/4_Moon/1.png 265 65 60 60}
${lua fDrawImage ~/4_Moon/2.png 340 65 60 60}
${voffset -500}
le moon_MoonGiant (rendu éxécutable ) aussi en françois:

Code : Tout sélectionner

#!/bin/bash

#function: moonrise_set
moonrise_set () {
    case "$1" in
         "FirstQuarter")
			echo "Noon/Midnight"
			cp $HOME/4_Moon/riseicons/rise_FirstQuarter.jpg $HOME/4_Moon/rise.jpg
         ;;
         "FullMoon")
			echo "6PM/6AM"
			cp $HOME/4_Moon/riseicons/rise_FullMoon.jpg $HOME/4_Moon/rise.jpg
		 ;;	
		 "LastQuarter")
			echo "Midnight/Noon"
			p $HOME/4_Moon/riseicons/rise_LastQuarter.jpg $HOME/4_Moon/rise.jpg
		 ;;	
		 "NewMoon")
			echo "6AM/6PM"
			cp $HOME/4_Moon/riseicons/rise_NewMoon.jpg $HOME/4_Moon/rise.jpg
		 ;;
		 "WaningCrescent")
			echo "3AM/3PM"
			cp $HOME/4_Moon/riseicons/rise_WaningCrescent.jpg $HOME/4_Moon/rise.jpg
		 ;;
		 "WaningGibbous")
			echo "9PM/9AM"
			cp $HOME/4_Moon/riseicons/rise_WaningGibbous.jpg $HOME/4_Moon/rise.jpg
		 ;;
		 "WaxingCrescent")
			echo "9AM/9PM"
			cp $HOME/4_Moon/riseicons/rise_WaxingCrescent.jpg $HOME/4_Moon/rise.jpg
		 ;;
		 "WaxingGibbous")
			echo "3PM/3AM"
			cp $HOME/4_Moon/riseicons/rise_WaxingGibbous.jpg $HOME/4_Moon/rise.jpg
		 ;;
		 *)
			echo "Unavailable"
		 esac
} 

kill -STOP $(pidof conky)
killall wget

#put your hemisphere here: north or south
hemisphere=north

wget -O $HOME/4_Moon/raw "http://www.moongiant.com/phase/today"
rm $HOME/4_Moon/*.png $HOME/4_Moon/*.jpg

sed -i -e '/^ *$/d' -e 's/^ *//g' $HOME/4_Moon/raw
sed -i '/var jArray=\|"todayMoonContainer"\|"moonNotToday"/!d' $HOME/4_Moon/raw
sed -i -e '/var jArray/s/","/\n/g' -e 's/<span>\|<b>\|<\\\/span>\|<\\\/b>\|\\n//g' /$HOME/4_Moon/raw
sed -i 's/"\].*\[\"/\n/g' /$HOME/4_Moon/raw
sed -i '/var jArray/d' /$HOME/4_Moon/raw
sed -i -e 's/"\]};//g' -e 's/^.*today_phase\///g' -e 's/\.jpg.*$//g' /$HOME/4_Moon/raw
sed -i -e 's/^small\///g' -e 's/\.png.*$//g' /$HOME/4_Moon/raw
sed -i 's/Illumination: \|Sun Angle: \|Sun Distance: \|Moon Distance: \|Moon Age: \|Moon Angle: //g' /$HOME/4_Moon/raw
phase=$(sed -n 7p $HOME/4_Moon/raw|sed 's/ //')
mrise_mset=$(moonrise_set $phase)
sed -i 7a$(moonrise_set $phase) /$HOME/4_Moon/raw

#Day before Yesterday
img_in=$(sed -n 44p $HOME/4_Moon/raw)
cp $HOME/4_Moon/moongiant_icons_$hemisphere/$img_in.png $HOME/4_Moon/-2.png

#Yesterday
img_in=$(sed -n 45p $HOME/4_Moon/raw)
cp $HOME/4_Moon/moongiant_icons_$hemisphere/$img_in.png $HOME/4_Moon/-1.png

#Today
img_in=$(sed -n 46p $HOME/4_Moon/raw)
cp $HOME/4_Moon/moongiant_icons_$hemisphere/$img_in.png $HOME/4_Moon/0.png

#Tomorrow
img_in=$(sed -n 47p $HOME/4_Moon/raw)
cp $HOME/4_Moon/moongiant_icons_$hemisphere/$img_in.png $HOME/4_Moon/1.png

#Day after Tomorrow
img_in=$(sed -n 48p $HOME/4_Moon/raw)
cp $HOME/4_Moon/moongiant_icons_$hemisphere/$img_in.png $HOME/4_Moon/2.png

sed -i -e 's/New Moon/Nouvelle Lune/g' -e 's/Waxing Crescent/Lune Montante/g' -e 's/First Quarter/Premier Quartier/g' -e 's/Waxing Gibbous/Gibeuse Croissante/g' -e 's/Full Moon/Pleine Lune/g' -e 's/Waning Gibbous/Gibeuse Décroissante/g' -e 's/Last Quarter/Dernier Quartier/g' -e 's/Waning Crescent/Lune Déscendante/g' /$HOME/4_Moon/raw
kill -CONT $(pidof conky)
Image

@+
Modifié en dernier par zeb le mer. 29 avr. 2020 15:01, modifié 1 fois.
Raison : image mise sur FFLMpics
HP Pavilion g 7 1357 sf avec ssd Tessa cinnamon Mageia 7rc mate
Asus ROG avec xubuntu 18.04 et xubuntu 19.04

Image

Avatar du membre
thekod
Messages : 80
Enregistré le : lun. 16 nov. 2015 13:23

Re: Conky

Message par thekod »

@loutch : est-ce qu'il existe un package ou une archive avec un exécutable qui permettrait d'installer simplement ce conky sur le bureau de Maté ?

EDIT : je parle du conky "météo" auquel tu fais référence deux posts au-dessus...
theKOD

Linux Mint 17.3 - MATE
INTEL NUC BOX 5 i3 RYH
Intel Core i3 5010U / 2.1 GHz - Intel HD Graphics 5500
Kingston SSDNow M.2 SATA 120 Go - WD Black Mobile 750 Go
2 x 4 Go (Crucial DDR3L 1600 MHz CL11)


Linux Mint 18 - MATE - 32 bits
LENOVO THINKSTATION E31
Intel Xeon E3-1220 V2 @ 3.10GHz - 64 bits
1 x 8 Go

Avatar du membre
loutch
Messages : 517
Enregistré le : lun. 13 juil. 2015 17:32
Localisation : Sarreguemines

Re: Conky

Message par loutch »

hello
thekod a écrit :@loutch : est-ce qu'il existe un package ou une archive avec un exécutable qui permettrait d'installer simplement ce conky sur le bureau de Maté ?

EDIT : je parle du conky "météo" auquel tu fais référence deux posts au-dessus...
Oui Didier-t l’a mis en .deb (pas essayé vu que Mageia est en rpm ) ici:

https://forum.ubuntu-fr.org/viewtopic.p ... 229761&p=1

Une fois installé tu prends mes scripts que tu mets à la place de ceux du pack en faisant attention au chemin d'appel des scripts vu que le .deb en met certains dans le .bin

@+
HP Pavilion g 7 1357 sf avec ssd Tessa cinnamon Mageia 7rc mate
Asus ROG avec xubuntu 18.04 et xubuntu 19.04

Image

Répondre