Rotating Conky (fr)

From Conky PitStop

(Difference between revisions)
Jump to: navigation, search
(Created page with "__NOTITLE__ =Alterner l'affichage des informations= Category:Français Category:Tips and tricks (fr) Category:Lua scripts (fr) Category:Wlourf scripts (fr) {{i18n...")
m
 
Line 12: Line 12:
L'image avec le style "tint2" :
L'image avec le style "tint2" :
-
[[Image:Script-wlourf-rotatingconky-2.png|left|300 px]]
+
[[Image:Script-wlourf-rotatingconky-2.jpg|center]]
'''conkyrc'''
'''conkyrc'''

Latest revision as of 20:59, 11 August 2011

Alterner l'affichage des informations

 Langue   English   Français   


Script-wlourf-rotatingconky-1.png

Si vous regardez "Root | Temps | MEM | Swap" juste au dessus de la barre tint2, seule cette section est visible à l'écran, mais l'information affichée change toutes les 2.5 secondes, ou à la fréquence que vous définissez dans la variable "update_interval" de Conky. J'ai essayé une seconde, c'était trop rapide, et 5 secondes était beaucoup trop long!

L'image avec le style "tint2" :

Script-wlourf-rotatingconky-2.jpg

conkyrc

# To use #! in a conky use: ${exec echo '#!'}
# Conky name: rotate
# LUA: original by wlourf

background no
border_inner_margin 0
border_width 0
default_color FFFFFF
default_outline_color black
default_shade_color black
double_buffer yes
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
no_buffers yes

own_window yes
own_window_type override
own_window_transparent yes
own_window_hints below,skip_taskbar,skip_pager
own_window_title Rotate
own_window_class Rotate

pad_percents 2
short_units yes
stippled_borders 0
top_name_width 5
uppercase no
use_spacer right
use_xft yes
xftalpha 1.0 #0.2
override_utf8_locale yes

# Colors
default_color DCDCDC #Gainsboro
color0 FFFFF0 #Ivory
color1 FFA07A #LightSalmon
color2 FF8C00 #Darkorange
color3 C6FF8E #a light green #FFF00 #Chartreuse
color4 778899 #LightSlateGrey
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red

### conky: gnu_rotate ###
update_interval 2.5
imlib_cache_size 0
gap_x 370           ### left &right
gap_y 973           ### up & down
minimum_size 540 22 ### width, height ### make this equal to what is used for the image
maximum_width 540   ### make this equal to the image width
alignment tl  # Aligned position on screen: tl, tr, tm, bl, br, bm, ml, mr
xftfont monospace:size=8.5

### conky: rotate ###
#     -- Lua load --     #
lua_load  ~/Conky/GNU/rotate.lua   ### path to LUA script used

TEXT
${goto 8}${voffset 4}${lua main_rotate1}${goto 175}| ${lua main_rotate2}${goto 310}| ${lua main_rotate3}${goto 400}| ${lua main_rotate4}${image ~/Conky/images/rotate_540-22.png -p 0,0 -s 540x22}


rotate.lua

--rotate.lua v1.0, a script to rotate informations on your screen, by wlourf 25.01.2011
function conky_main_rotate1()
    if conky_window==nil then return "" end
    local updates=tonumber(conky_parse("$updates"))

    --prevent segmentation error on cpu reading
    if updates<3 then return "" end

    local arrToggle_1={
                "Root   : ${fs_free /} / ${fs_size /}",
                "Home   : ${fs_free /home} / ${fs_size /home}",
                "media/5: ${fs_free /media/5} / ${fs_size /media/5}",
                "media/6: ${fs_free /media/6} / ${fs_size /media/6}",
                "SWAP   : ${fs_free /swap} / ${fs_size /swap}",
    }

    local nb_toggle_1 = #arrToggle_1

    for i=0, nb_toggle_1-1 do
        if (updates)%(nb_toggle_1) == i then
            return tostring(conky_parse(arrToggle_1[i+1]))
        end
    end

end

function conky_main_rotate2()
    if conky_window==nil then return "" end
    local updates=tonumber(conky_parse("$updates"))

    --prevent segmentation error on cpu reading
    if updates<3 then return "" end

    local arrToggle_2={
                "Temps - M/B : ${exec sensors | grep 'temp1:' | cut --characters 15-16}°",
                "Temps - Core: ${exec sensors | grep 'Core0' | cut --characters 15-16}°",
                "Temps - GPU : ${exec sh -c 'DISPLAY=:0.0 nvclock -T | grep 'GPU' | cut -c21-22'}°",
                "Temps - SDA : ${exec hddtemp /dev/sda | cut --characters 34-37}",
    }

    local nb_toggle_2 = #arrToggle_2

    for i=0, nb_toggle_2-1 do
        if (updates)%(nb_toggle_2) == i then
            return tostring(conky_parse(arrToggle_2[i+1]))
        end
    end

end

function conky_main_rotate3()
    if conky_window==nil then return "" end
    local updates=tonumber(conky_parse("$updates"))

    --prevent segmentation error on cpu reading
    if updates<3 then return "" end

    local arrToggle_3={
                "CPU0 %: ${cpu cpu0}",
                "MEM  %: ${memperc}",
    }

    local nb_toggle_3 = #arrToggle_3

    for i=0, nb_toggle_3-1 do
        if (updates)%(nb_toggle_3) == i then
            return tostring(conky_parse(arrToggle_3[i+1]))
        end
    end

end

function conky_main_rotate4()
    if conky_window==nil then return "" end
    local updates=tonumber(conky_parse("$updates"))

    --prevent segmentation error on cpu reading
    if updates<3 then return "" end

    local arrToggle_4={
                "Swap Free: ${swapfree}",
                "Swap Max : ${swapmax}",
                "Swap    %: ${swapperc}",
    }

    local nb_toggle_4 = #arrToggle_4

    for i=0, nb_toggle_4-1 do
        if (updates)%(nb_toggle_4) == i then
            return tostring(conky_parse(arrToggle_4[i+1]))
        end
    end

end

Personal tools
Namespaces
Variants
Actions
Navigation
English
Français
Toolbox