Page 1080 of 2348 FirstFirst ... 80580980103010701078107910801081108210901130118015802080 ... LastLast
Results 10,791 to 10,800 of 23480

Thread: Post your .conkyrc files w/ screenshots

  1. #10791
    Join Date
    Apr 2009
    Beans
    1

    Re: Post your .conkyrc files w/ screenshots

    This is my first conky. I found it on Internet somewhere and just modify it

    Code:
    background yes
    use_xft yes
    xftfont 123:size=8
    xftalpha 0.3
    update_interval 0.5
    total_run_times 0
    own_window yes
    own_window_type normal
    own_window_transparent yes
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    double_buffer yes
    no_buffers yes
    minimum_size 250 5
    maximum_width 300
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    default_color gray
    default_shade_color red
    default_outline_color green
    alignment top_right
    
    uppercase no
    cpu_avg_samples 2
    net_avg_samples 1
    use_spacer left
    override_utf8_locale yes
    alignment top_right
    
    TEXT
    $alignc ${color ivory}${font openlogos:size=20}K${font Arial:size=20}${color ivory}PAHA${color darkred}GAPON${color ivory}${font openlogos:size=20}t${color black}
    
    ${voffset -90}
    ${color DimGray}
    ${font}
    
    ${font Arial:bold:size=10}${color ivory}PROCESSORS ${color ivory}${hr 2}
    ${font bold:size=7}${color #0099FF}CPU1  ${color DimGray}${cpu cpu1}% ${cpubar cpu1}
    ${color #606060}${cpugraph 333300 66FFCC}$color
    
    
    ${font Arial:bold:size=10}${color ivory}MEMORY ${color DarkSlateGray}${hr 2}
    ${font bold:size=7}${color #0099FF}MEM $alignc $mem / $memmax $alignr $memperc%
    ${color dimgray}$membar
    
    ${font Arial:bold:size=10}${color ivory}HDD ${color DarkSlateGray}${hr 2}
    ${font bold:size=7}${color #0099FF}/home $alignc ${fs_used /home} / ${fs_size /home} $alignr ${fs_free_perc /home}%
    ${color dimgray}${fs_bar /home}
    
    ${font Arial:bold:size=10}${color ivory}TOP PROCESSES (CPU) ${color DarkSlateGray}${hr 2}
    ${font bold:size=7}${color darkred}
    Process $alignc CPU% $alignr MEM&
    ${font bold:size=7}${color #0099FF}${top name 1} ${alignc}${top cpu 1} % $alignr${top mem 1} %
    $font${top name 2} ${alignc}${top cpu 2} % $alignr${top mem 2} %
    ${top name 3} ${alignc}${top cpu 3} % $alignr${top mem 3} %
    ${top name 4} ${alignc}${top cpu 4} % $alignr${top mem 4} %
    
    
    
    ${font Arial:bold:size=10}${color ivory}TIME ${color DarkSlateGray}${hr 2}
    ${color darkred} ${font palai:bold:size=30}$alignc${time %H:%M}
    ${voffset -30}${font palai:bold:size=10}$alignc${time %d %b. %Y}
    ${font palai:bold:size=8}$alignc${time %A}
    
    ${font Arial:bold:size=10}${color ivory}CALENDAR ${color DarkSlateGray}${hr 2}
    ${color red}${font DejaVu Sans Mono:size=12}${alignc}${time %B %Y}
    ${color DarkSlateGray}${font DejaVu Sans Mono:size=12}${execpi 60 DJS=`date +%_d`; cal | sed '1d' | sed '/./!d' | sed 's/$/                     /' | fold -w 21 | sed -n '/^.\{21\}/p' | sed 's/^/${alignc} /' | sed /" $DJS "/s/" $DJS "/" "'${color f6ff07}'"$DJS"'${color darkred}'" "/}
    Attached Images Attached Images
    Last edited by Gaponov; December 9th, 2009 at 12:32 PM.

  2. #10792
    Join Date
    Sep 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Bash script Guru needed

    Anyone got any idea why this all off a sudden (as of yesterday) doesn't display the day names correctly?

    December 2009 - the first day should be Tue (Ma) andthe last day is missing.

    Do = Sun | Lu = Mon | Ma = Tue | Mi = Wed
    Ju = Thu ||Vi = Fri | Sa = Sat |

    conky_calhoriz.sh
    Code:
    #!/bin/bash
    #horizontal calendar for conky by ans
    COLOROLD="778899" #LightSlateGrey
    COLORTODAY="FF8C00" #Darkorange
    COLORREST="778899" #LightSlateGrey
    COLORNEXT="FF0000" #Red
    
    TODAY=`date +%d`
    LASTDAY=`date -d "-$(date +%d) days +1 month" +%d`
    FIRSTDAY=`date -d "-1 month -$(($(date +%d)-1)) days +1 month" +%u`
    i=1
    TOPLINE=" "
    TODAYC="\${color $COLORTODAY}"
    OVER="\${color $COLOROLD} "
    REST="\${color $COLORREST} "
    #OVER=""
    #REST=""
    
    TODAYC="$TODAYC $TODAY"
    
    if [ $TODAY -ne 1 ]
    then
        while [ $i -lt $TODAY ]; do
            if [ $i -lt 10 ]
            then
                OVER="$OVER 0$i"
            else
                OVER="$OVER $i"
            fi
            i=$[$i+1]
        done
    fi
    i=$[$i+1]
    if [ $TODAY -ne $LASTDAY ]
    thenDo = Sun | Lu = Mon | Ma = Tue | Mi = Wed
    Ju = Thu ||Vi = Fri | Sa = Sat |
    
        while [ $i -ne $LASTDAY ]; do
            if [ $i -lt 10 ]
            then
                REST="$REST 0$i"
            else
                REST="$REST $i"
            fi
            i=$[$i+1]
        done
        REST="$REST $LASTDAY"
    fi
    i=$LASTDAY
    j=1
    NEXTMONTH="\${color $COLORNEXT} "
    while [ $i -lt 31 ] ; do
       NEXTMONTH="$NEXTMONTH 0$j"
       i=$[$i+1]
       j=$[$j+1]
    done
    j=31
    k=$FIRSTDAY
    while [ $j -gt 0 ]; do
        case "$k" in
        7)
            TOPLINE="$TOPLINE Do"
        ;;
        1)
            TOPLINE="$TOPLINE Lu"
        ;;
        2)
            TOPLINE="$TOPLINE Ma"
        ;;
        3)
            TOPLINE="$TOPLINE Mi"
        ;;
        4)
            TOPLINE="$TOPLINE Ju"
        ;;
        5)
            TOPLINE="$TOPLINE Vi"
        ;;
        6)
            TOPLINE="$TOPLINE Sa"
        ;;
        esac
    
        j=$[$j-1]
        k=$[$k+1]
        if [ $k -eq 8 ]
        then
            k=1
        fi
    done
    echo '${goto 240}'$TOPLINE | sed 's/Do/${color FFFF00}Do${color}/g' | sed 's/Sa/${color FF8C00}Sa${color}/g'
    echo '${goto 240}'$OVER$TODAYC$REST$NEXTMONTH
    In conky:
    Code:
    ${color}${font DejaVu Sans Mono:Bold:size=10}${execpi 3600 /home/bruloo/Conky/scripts/conky_calhoriz.sh}
    Have a nice day.
    Bruce
    Attached Images Attached Images
    Last edited by Bruce M.; December 9th, 2009 at 03:03 PM.

  3. #10793
    Join Date
    May 2008
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Bruce M. View Post
    Bash script Guru needed

    Anyone got any idea why this all off a sudden (as of yesterday) doesn't display the day names correctly?

    December 2009 - the first day should be Tue (Ma) andthe last day is missing.

    Do = Sun | Lu = Mon | Ma = Tue | Mi = Wed
    Ju = Thu ||Vi = Fri | Sa = Sat |

    conky_calhoriz.sh

    In conky:
    Code:
    ${color}${font DejaVu Sans Mono:Bold:size=10}${execpi 3600 /home/bruloo/Conky/scripts/conky_calhoriz.sh}
    Have a nice day.
    Bruce
    Do you have a screenshot from when it did work? I'm having a bit of trouble seeing how it should work so I can figure why it's not working now.

  4. #10794
    Join Date
    Sep 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by mobilediesel View Post
    Do you have a screenshot from when it did work? I'm having a bit of trouble seeing how it should work so I can figure why it's not working now.
    DUH!!! And the "not working image" wasn't with the original post either, it is now. Included here as well for clarity.

    Here's a working shot beside it!

    Notice how for November (30 days) it puts the 31st day in for Dec at the end in BLUE. Tested it for Feb 2010 and it worked great as well.

    Hope that helps.
    Have a nice day.
    Bruce
    Attached Images Attached Images
    Last edited by Bruce M.; December 9th, 2009 at 03:38 PM.

  5. #10795
    Join Date
    Feb 2008
    Location
    I'm lost ... HELP!
    Beans
    1,014
    Distro
    Xubuntu

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by proxess View Post
    I'm so satisfied with my current Conky setup that I haven't had the heart to change it in any way at all.

    This is what it currently looks like.

    Anyone have a nice idea what I should do with this? What you'd like to see?
    Sounds like it's pretty much perfect for you

    What I'd do (what I'll be doing with my conky soon) is takeover the desktop area with less important/interesting and more entertaining info in another conky.

  6. #10796
    Join Date
    May 2008
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Bruce M. View Post
    DUH!!! And the "not working image" wasn't with the original post either, it is now. Included here as well for clarity.

    Here's a working shot beside it!

    Notice how for November (30 days) it puts the 31st day in for Dec at the end in BLUE. Tested it for Feb 2010 and it worked great as well.

    Hope that helps.
    Have a nice day.
    Bruce
    Damn. I can't even figure out how it worked when it did. I gotta go cook so I'll work on it more after I eat.

    It's bugging the hell out of me that I can't figure it out!

  7. #10797
    Join Date
    Jul 2005
    Location
    The Netherlands
    Beans
    209
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Post your .conkyrc files w/ screenshots

    Just a guess seeing that I'm not a bash guru at all but:
    Code:
    while [ $i -lt 31 ] ; do
       NEXTMONTH="$NEXTMONTH 0$j"
       i=$[$i+1]
       j=$[$j+1]
    done
    If it's while i is less than 31, that means 31 doesn't count. So I guess it'll have to be less than 32.
    Laptop: i7 4930MX @3.9GHz undervolted; 32GB 4x8GB Kingston HyperX Impact 1600MHz; Nvidia 780M 4GB; Samsung 840 EVO mSATA 250GB; Ubuntu 16.04 and Windows 10 Pro.
    Ubuntu #8076 / Linux #429448

  8. #10798
    Join Date
    Oct 2009
    Location
    The Netherlands
    Beans
    183
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Post your .conkyrc files w/ screenshots

    I'm having some issues with my conky
    Code:
     
    alignment tr
    own_window no
    own_window_type desktop
    own_window_transparent yes
    own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
    background no
    border_width 1
    cpu_avg_samples 2
    default_color white
    default_outline_color white
    default_shade_color white
    draw_borders no
    draw_graph_borders yes
    draw_outline no
    draw_shades no
    font 6x10
    gap_x 5
    gap_y 60
    minimum_size 5 5
    net_avg_samples 2
    Double_buffer yes
    out_to_console no
    stippled_borders 0
    update_interval 3.0
    uppercase no
    use_spacer no
    show_graph_scale no
    show_graph_range no
    total_run_times 0
     
    TEXT
    ${color grey}Frequency (in GHz):$color $freq_g
    ${color grey}CPU Usage:$color $cpu% ${cpubar 6}
    
    ${color grey}RAM Usage:$color $mem/$memmax
    $color $memperc% ${membar 6}
    ${color grey}Swap Usage:$color $swap/$swapmax
    $color $swapperc% ${swapbar 6}
    
    ${color grey}Processes:$color $processes  ${color grey}Running:$color $running_processes
    
    $hr
    
    ${color grey}Hard drive:
    $color${fs_free /}/${fs_size /} ${fs_bar 6 /}
    
    $hr
    
    ${color grey}Name                CPU%   MEM%
    ${color} ${top name 1}  ${top cpu 1} ${top mem 1}
    ${color} ${top name 2}  ${top cpu 2} ${top mem 2}
    ${color} ${top name 3}  ${top cpu 3} ${top mem 3}
    ${color} ${top name 4}  ${top cpu 4} ${top mem 4}
    
    $hr
    
    ${color grey}Audio:
    $color${exec conkyRhythmbox -d TI} - $color${exec conkyRhythmbox -d AR}
    $color${exec conkyRhythmbox -d AL} - $color${exec conkyRhythmbox -d PT}/${exec conkyRhythmbox -d LE}
    
    $hr
    
    ${color grey}Calendar
    ${color red}${alignc}${time %B %Y}
    ${color DarkSlateGray}${execpi 60 DJS=`date +%_d`; cal | sed '1d' | sed '/./!d' | sed 's/$/                     /' | fold -w 21 | sed -n '/^.\{21\}/p' | sed 's/^/${alignc} /' | sed /" $DJS "/s/" $DJS "/" "'${color f6ff07}'"$DJS"'${color}'" "/}
    
    $hr
    
    ${color grey}Time
    ${color darkred} $alignc${time %H:%M}
    The frequency oscillates between 0.80 and 2.00 for some reason (which it never did before) and the whole thing kinda flickers and changes occasionally...
    Also I'd like to make the time bigger but I can't find how to change just the size of the font... I tried a few things but none work (Conky told me ' could not find size = 12 for instance).
    Thanks!

  9. #10799
    Join Date
    Jul 2008
    Beans
    70

    Re: Post your .conkyrc files w/ screenshots

    gee, seems like everyone is suddenly having conky probs. well, i´ll add my problem to the mix. running a single conky, but if i remove the processes section, then it kills the amarok script. i´ve included my conky conf AND conky widget (though i cant see any problem with that). any help?

    Code:
    background yes
    own_window yes
    own_window_type override
    own_window_transparent yes
    # own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    # own_window_class conky
    use_xft yes
    #xftfont ariel:size=8
    xftfont MgOpen Modata-07
    xftalpha 1.0 #0.2
    override_utf8_locale yes
    update_interval 1.0
    total_run_times 0
    double_buffer yes
    no_buffers yes
    cpu_avg_samples 2
    net_avg_samples 2
    use_spacer right
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    alignment tl
    uppercase no
    imlib_cache_size 0
    
    minimum_size 1024 1024
    maximum_width 1024 
    
    gap_x 0 # left-right
    gap_y 0 # up-down
    border_inner_margin 0
    border_outer_margin 0
     
    # Colors
    default_color DCDCDC #Gainsboro
    color0 FFD700 #Gold  #7FFFD4 #Aquamarine
    color1 FFA07A #LightSalmon #CD5C5C IndianRed #00CED1 DarkTurquoise #00FFFF Cyan
    color2 FF8C00 #Darkorange
    color3 7FFF00 #Chartreuse
    color4 778899 #LightSlateGrey
    color5 FFDEAD #NavajoWhite
    color6 00BFFF #DeepSkyBlue
    #	colours below used by colorize script
    color7 48D1CC #MediumTurquoise
    color8 FFFF00 #Yellow
    color9 FF0000 #Red
    text_buffer_size 6144 # 256 is the minimum
    short_units yes
    pad_percents 2
    
    # -- Lua Load -- #
    lua_load ~/scripts/Conky/conky_widgets.lua
    lua_draw_hook_pre widgets
    
    TEXT
    ${voffset -10}${image ~/scripts/Conky/images/pc.png -p 460,100 -s 80x80}${image ~/scripts/Conky/images/proc.png -p 500,240 -s 80x80}
    ${image ~/scripts/Conky/images/amarok.png -p 860,300 -s 100x100}
    #--------------------------Time & Calendar-----------------#
    ${voffset 49}${goto 90}${time %l:%M:%S %P}${color}
    ${voffset 70}${goto 30}${color4} Ireland${goto 90}${color6}${tztime Europe:Ireland %l:%M:%S %P}${color}
    ${goto 30}${color4} Sweden${goto 90}${color6}${tztime Europe:Sweden-1  %l:%M:%S %P}${color}
    ${color4}${execpi 1 /etc/conky/calender.sh}${font}${voffset -2}
    #------------------------External Storage--------------------------#
    #------------------------Elements--------------------------#
    ${voffset -280}${goto 235}${color4} Elements ${if_existing /media/ELEMENTS}
    ${voffset 00}${goto 225}${color6}${fs_used /media/ELEMENTS}${color yellow} of ${color6}${fs_size /media/ELEMENTS}
    ${voffset 00}${goto 248}${color yellow}used
    ${voffset 00}${goto 228}Trash ${execi 1 du -sh /media/ELEMENTS/.Trash-1000/files/ | awk '{print $1}' | sed '/^4.0K/ d'  | sed 's/$//'}
    ${else}${voffset 20}${goto 225}${color yellow}NOT MOUNTED${voffset 26}${endif}
    #------------------------Pen Drive--------------------------#
    ${voffset -58}${goto 335}${color4} Pen Drive ${if_existing /media/Pen_Drive}
    ${voffset 00}${goto 325}${color6}${fs_used /media/Pen_Drive}${color yellow} of ${color6}${fs_size /media/Pen_Drive}
    ${voffset 00}${goto 350}${color yellow}used
    ${voffset 00}${goto 335}Trash ${execi 1 du -sh /media/Pen_Drive/.Trash-1000/files/ | awk '{print $1}' | sed '/^4.0K/ d'  | sed 's/$//'}
    ${else}${voffset 20}${goto 325}${color yellow}NOT MOUNTED${voffset 28}${endif}
    #------------------------Camera Card--------------------------#
    ${voffset -60}${goto 425}${color4} Camera Card ${if_existing /media/Cam_Card}
    ${voffset 00}${goto 425}${color6}${fs_used /media/Cam_Card}${color yellow} of ${color6}${fs_size /media/Cam_Card}
    ${voffset 00}${goto 448}${color yellow}used
    ${else}${voffset 20}${goto 425}${color yellow}NOT MOUNTED${voffset 16}${endif}
    #------------------------Movies--------------------------#
    ${voffset -48}${goto 540}${color4} Movies ${if_existing /media/MOVIES}
    ${voffset 00}${goto 525}${color6}${fs_used /media/MOVIES}${color yellow} of ${color6}${fs_size /media/MOVIES}
    ${voffset 00}${goto 545}${color yellow}used
    ${else}${voffset 20}${goto 525}${color yellow}NOT MOUNTED${voffset 16}${endif}
    #------------------------Sony Mp3--------------------------#
    ${voffset -48}${goto 635}${color4} Sony Mp3${if_existing /media/SONY_MP3}
    ${voffset 00}${goto 623}${color6}${fs_used /media/SONY_MP3}${color yellow} of ${color6}${fs_size /media/SONY_MP3}
    ${voffset 00}${goto 647}${color yellow}used
    ${else}${voffset 20}${goto 625}${color yellow}NOT MOUNTED${endif}
    #------------------------Ring Meters--------------------------#
    ${voffset 10}${goto 830}${color2} CPU ${cpu cpu0}%
    ${voffset -00}${goto 830}${color6} RAM ${memperc}%${color}
    ${voffset -00}${goto 780}${color #FFFF58} Swap ${swap} of ${swapmax} used
    ${voffset -00}${goto 785}${color5} Root ${fs_used /} of ${fs_size /} used
    ${voffset -00}${goto 780}${color8} Shitsta ${fs_used /media/Shitsta} of ${fs_size /media/Shitsta} used
    ${voffset -00}${goto 790}${color #34ff54}Battery ${battery}${color}${execpi 1 acpi -b | cut -c30-31 | xargs /etc/conky/colorize.sh}
    ${voffset -00}${goto 800}Power Consumption
    ${voffset -00}${goto 795}${color #3fd2ff}${exec cat /proc/acpi/battery/BAT0/state | grep 'present rate' | cut -c26-33} / ${exec cat /proc/acpi/battery/BAT0/state | grep 'remaining capacity' | cut -c26-33}${color}
    
    #--------------------------Reminders-----------------# 
    ${voffset 110}${font CloisterBlack:normal:size=18}${goto 65}${color6} Reminders${font}
    ${execi 5 remind ~/.reminders}
    #--------------------------TV-----------------#
    ${font CloisterBlack:normal:size=18}${goto 50}${color6} Tv Schedule${color}${font}
    ${voffset -10}${execp /etc/conky/conkyTV.sh}
    #------------------System-----------------#
    ${voffset -330}${font CloisterBlack:normal:size=30}${goto 300}${color6} System${font}${color}
    ${voffset 20}${goto 300}${font OpenLogos:size=15}u${voffset -4}${font}   Ubuntu 9.04 ${kernel}${voffset -5}${goto 500}${font OpenLogos:size=15}  T${voffset -4}${font}Gnome 2.26.1
    ${goto 300}${voffset +3}${font Illustrate IT:size=15}I${voffset -6}${font}   Intel dual CPU 2 x ${freq 1}
    ${voffset -12}${goto 505}${font StyleBats:size=12}v${voffset -4}${font}   Update: ${execi 600 aptitude search "~U" | wc -l | tail} package(s)${goto 600}${voffset 23}${goto 505}${font StyleBats:size=15}q${voffset -3}${font}  Uptime: ${uptime}${goto 318}${voffset -5}   Temp ${execi 300 hddtemp /dev/sda -n;}° C 
    #--------------------------Processes-----------------#
    ${voffset 15}${font CloisterBlack:normal:size=30}${goto 300}${color6} Processes${font}${color}
    ${voffset 20}${goto 400}$processes processes  $running_processes active
    ${goto 350}${color green}NAME ${goto 500} CPU     MEM${color}
    ${goto 350}${top name 1} ${goto 500} ${top cpu 1}   ${top mem 1}
    ${goto 350}${top name 2} ${goto 500} ${top cpu 2}   ${top mem 2}
    ${goto 350}${top name 3} ${goto 500} ${top cpu 3}   ${top mem 3}
    ${goto 350}${top name 4} ${goto 500} ${top cpu 4}   ${top mem 4}
    ${goto 350}${top name 5} ${goto 500} ${top cpu 5}   ${top mem 5}
    #--------------------------Amarok-----------------#
    ${voffset 10}${if_running amarokapp}${goto 760}${color6}${execi 1 dcop amarok player title}
    ${color red}${goto 760}${execi 1 dcop amarok player artist}${color}
    ${color yellow}${goto 760}${execi 1 dcop amarok player album}${color}${color yellow}
    ${goto 860}Year : ${execi 1 dcop amarok player year}${color}
    ${color #ff5a00}${goto 860}${execi 1 dcop amarok player currentTime} ${color green}/${color #ff5a00} ${execi 1 dcop amarok player totalTime}${color}
    ${goto 780}${color green}Player Volume ${execi 1 /etc/conky/Amarok.sh volume}%${goto 900}${color #ff5a00}Bitrate ${execi 1 dcop amarok player bitrate} kbps
    ${voffset -00}${goto 815}${color red}Current song ${execi 1 /etc/conky/Amarok.sh playCount}
    ${else}${image /home/graham/scripts/Conky/images/face-sad.png -p 860,410 -s 100x100}${voffset -120}${font FRESHBOT:size=30}${goto 830}${color #3fd2ff}T
    ${goto 830}U
    ${goto 830}R
    ${goto 830}N
    ${goto 830}E
    ${goto 830}D${voffset 16}
    ${voffset -210}${goto 970}O
    ${goto 970}F
    ${goto 970}F${color}${endif}${font}
    Code:
    --[[
    Conky Widgets by londonali1010 (2009)
    
    This script is meant to be a "shell" to hold a suite of widgets for use in Conky.
    
    To configure:
    + Copy the widget's code block (will be framed by --(( WIDGET NAME )) and --(( END WIDGET NAME )), with "[" instead of "(") somewhere between "require 'cairo'" and "function conky_widgets()", ensuring not to paste into another widget's code block
    + To call the widget, add the following just before the last "end" of the entire script:
    	cr = cairo_create(cs)
    	NAME_OF_FUNCTION(cr, OPTIONS)
    	cairo_destroy(cr)
    + Replace OPTIONS with the options for your widget (should be specified in the widget's code block) 
    
    Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/conky_widgets.lua):
    	lua_load ~/scripts/conky_widgets.lua
    	lua_draw_hook_pre widgets
    	
    Changelog:
    + v1.0 -- Original release (17.10.2009)
    ]]
    
    require 'cairo'
    require 'imlib2'
    
    --[[ CLOCK WIDGET ]]
    
    function ring(cr, name, arg, max, bgc, bga, fgc, fga, xc, yc, r, t, sa, ea)
    	local function rgb_to_r_g_b(colour,alpha)
    		return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    	end
    	
    	local function draw_ring(pct)
    		local angle_0=sa*(2*math.pi/360)-math.pi/2
    		local angle_f=ea*(2*math.pi/360)-math.pi/2
    		local pct_arc=pct*(angle_f-angle_0)
    
    		-- Draw background ring
    
    		cairo_arc(cr,xc,yc,r,angle_0,angle_f)
    		cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    		cairo_set_line_width(cr,t)
    		cairo_stroke(cr)
    	
    		-- Draw indicator ring
    
    		cairo_arc(cr,xc,yc,r,angle_0,angle_0+pct_arc)
    		cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    		cairo_stroke(cr)
    	end
    	
    	local function setup_ring()
    		local str = ''
    		local value = 0
    		
    		str = string.format('${%s %s}', name, arg)
    		str = conky_parse(str)
    		
    		value = tonumber(str)
    		if value == nil then value = 0 end
    		pct = value/max
    		
    		draw_ring(pct)
    	end	
    	
    	local updates=conky_parse('${updates}')
    	update_num=tonumber(updates)
    	
    	if update_num>5 then setup_ring() end
    end
    
    --[[ END CLOCK WIDGET ]]
    
    --[[ GRADIENT RING WIDGET ]]
    --[[ Options (name, arg, max, colour, alpha, x, y, inner_radius, outer_radius, frac, thickness, start_angle, end_angle):
            "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
            "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
            "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
            "fg_colour" is the colour of the ring.
            "fg_alpha" is the alpha value of the ring.
            "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
            "inner_radius" is the inner radius of the ring.
            "outer_radius" is the outer radius of the ring.  
            "frac" determines the extent of the gradient around the ring - 2 implies the gradient fades halfway around the ring, 4 equals a quarter of the way, etc...      
            "thickness" is the thickness of the ring, centred around the radius.
            "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
            "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle. ]]
         
    function gradient_ring(cr, name, arg, max, fgc, fga, xc, yc, ring_i, ring_o, frac, t, sa, ea)
            local function rgb_to_r_g_b(colour,alpha)
                return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
            end
         
            local function draw_gradient_ring(pct)
                local angle_0=sa*(2*math.pi/360)-math.pi/2
                local angle_f=ea*(2*math.pi/360)-math.pi/2
                local pct_arc=pct*(angle_f-angle_0)
         
                for i = 1,max/frac do
                    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga*i/max)) --for flat shading of bars
            
                    --local pat=cairo_pattern_create_linear(xc-ring_i*math.sin(angle_0+t_arc+2*math.pi*i/max),yc+ring_i*math.cos(angle_0+t_arc+2*math.pi*i/max),xc-ring_o*math.sin(angle_0+t_arc+2*math.pi*i/max),yc+ring_o*math.cos(angle_0+t_arc+2*math.pi*i/max))
                    --cairo_pattern_add_color_stop_rgba(pat,0,rgb_to_r_g_b(fgc,0))
                    --cairo_pattern_add_color_stop_rgba(pat,1,rgb_to_r_g_b(fgc,fga*i/max))
                    --cairo_set_source(cr,pat) -- for gradient shading of bars
            
                    cairo_move_to(cr,xc-ring_i*math.cos(angle_0+pct_arc+2*math.pi*i/max),yc-ring_i*math.sin(angle_0+pct_arc+2*math.pi*i/max))
                    cairo_line_to(cr,xc-ring_o*math.cos(angle_0+pct_arc+2*math.pi*i/max),yc-ring_o*math.sin(angle_0+pct_arc+2*math.pi*i/max))
        
                    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
                    cairo_set_line_width(cr,t)
                    cairo_stroke(cr)
                end
            end
         
            local function setup_gradient_ring()
                local str = ''
                local value = 0
         
                str = string.format('${%s %s}', name, arg)
                str = conky_parse(str)
         
                value = tonumber(str)
                if value == nil then value = 0 end
                pct = value/max
         
                draw_gradient_ring(pct)
            end    
         
            local updates=conky_parse('${updates}')
            update_num=tonumber(updates)
         
            if update_num>5 then setup_gradient_ring() end
        end
         
    --[[ END GRADIENT RING WIDGET ]]
    
    --[[ PHOTO ALBUM WIDGET ]]
    
    album_dir = "/home/graham/Pictures/Conky/"
    -- "xc" and "yc" are the coordinates of the centre of the photo album, relative to the top left corner of the Conky window, in pixels
    xc, yc = 400, 600
    -- "w_max" and "h_max" are the maximum dimensions, in pixels, that you want the widget to be.  The script will ensure that the photo album fits inside the box bounded by w_max and h_max
    w_max, h_max = 200, 200
    -- "t" is the thickness of the frame, in pixels
    t = 3
    -- "update_interval" is the number of Conky updates between refreshes
    update_interval = 10
    
    function get_file_to_use()
        num_files = tonumber(conky_parse("${exec ls -A " .. album_dir .. " | wc -l}"))
        if num_files == nil then num_files = 0 end
        if num_files == 0 then return "none" end
        
        updates = tonumber(conky_parse("${updates}"))
        whole = math.ceil(updates/update_interval)
        
        if whole <= num_files
        then
            num_file_to_show = whole
        else
            whole = whole % num_files
            num_file_to_show = whole
        end
        
        return conky_parse("${exec ls " .. album_dir .. " | sed -n " .. num_file_to_show .. "p}")
    end
    
    function init_drawing_surface()
        imlib_set_cache_size(4096 * 1024)
        imlib_context_set_dither(1)
    end
    
    function draw_frame()
    	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual,  conky_window.width, conky_window.height)
        
        cr = cairo_create(cs)
        
        cairo_rectangle(cr, xc - width/2 - t, yc - height/2 - t, width + 2*t, height + 2*t)
        cairo_set_source_rgba(cr, 1, 1, 1, 0.8)
        cairo_fill(cr)   
        
        cairo_destroy(cr)
    end
    
    function draw_image()
        init_drawing_surface()
        
        image = imlib_load_image(album_dir .. filename)
        if image == nil then return end
        imlib_context_set_image(image)
    	
    	w_img, h_img = imlib_image_get_width(), imlib_image_get_height()
    	if w_img >= h_img
    	then
    	    width = w_max - 2*t
    	    height = width * (h_img/w_img)
    	else
    	    height = h_max - 2*t
    	    width = height * (w_img/h_img)
    	end
    	
    	draw_frame()
    	
    	buffer = imlib_create_image(width, height)
    	imlib_context_set_image(buffer)
    	
    	imlib_blend_image_onto_image(image, 0, 0, 0, w_img, h_img, 0, 0, width, height)
    	imlib_context_set_image(image)
    	imlib_free_image()
    	
    	imlib_context_set_image(buffer)
    	imlib_render_image_on_drawable(xc - width/2, yc - height/2)
    	imlib_free_image()
    end
    
    
    function conky_photo_album()
        if conky_window == nil then return end
        filename = get_file_to_use()
        if filename == "none"
        then
            print(album_dir .. ": No files found")
        else
            draw_image()
        end
    end
    
    --[[ END PHOTO ALBUM WIDGET ]]
    
    --[[ BACKGROUND WIDGET ]]
    
    -- Change these settings to affect your background.
    -- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0.
     
    corner_r=15
     
    -- Set the colour and transparency (alpha) of your background.
     
    bg_colour=0xffffff
    bg_alpha=0.2
     
    require 'cairo'
    function rgb_to_r_g_b(colour,alpha)
    	return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
     
    function conky_draw_bg()
    	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)
     
    	cairo_move_to(cr,corner_r,0)
    	cairo_line_to(cr,w-corner_r,0)
    	cairo_curve_to(cr,w,0,w,0,w,corner_r)
    	cairo_line_to(cr,w,h-corner_r)
    	cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
    	cairo_line_to(cr,corner_r,h)
    	cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
    	cairo_line_to(cr,0,corner_r)
    	cairo_curve_to(cr,0,0,0,0,corner_r,0)
    	cairo_close_path(cr)
     
    	cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha))
    	cairo_fill(cr)
    end
    
    --[[ END BACKGROUND WIDGET ]]
    
    function conky_widgets()
    	if conky_window == nil then return end
    	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    	cr = cairo_create(cs)
    	
    	cairo_destroy(cr)
    
    -------------------[[ TIME SETTINGS ]]---------------
    
    	cr = cairo_create(cs)
    	ring(cr, 'time', '%I', 12, 0xFFFFFF, 0.1, 0xFFFFFF, 0.2, 120, 70, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'time', '%M', 60, 0xFFFFFF, 0.1, 0xFFFFFF, 0.2, 120, 70, 55, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'time', '%S', 60, 0xFFFFFF, 0.1, 0xFFFFFF, 0.3, 120, 70, 63, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    -------------------[[ END TIME SETTINGS ]]---------------
    
    -------------------[[ GRADIENT RING SETTINGS ]]---------------
    
    cr = cairo_create(cs)
            gradient_ring(cr, '', '', 12, 0xFF0000, 10.0, 120, 70, 65, 60, 1, 2, 0, 360)
            cairo_destroy(cr)
            
    -------------------[[ END GRADIENT RING SETTINGS ]]---------------
    
    -------------------[[ STORAGE RINGS SETTINGS ]]---------------
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/ELEMENTS', 100, 0xFFFFFF, 0.1, 0xFF0000, 1, 260, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/Pen_Drive', 100, 0xFFFFFF, 0.4, 0xFF0000, 1, 360, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/Cam_Card', 100, 0xFFFFFF, 0.4, 0xFF0000, 1, 460, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/MOVIES', 100, 0xFFFFFF, 0.1, 0xFF0000, 1, 560, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/MOVIES', 100, 0xFFFFFF, 0.1, 0xFF0000, 1, 660, 60, 45, 7, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    -------------------[[ END STORAGE RINGS SETTINGS ]]---------------
    
    -------------------[[ CPU RINGS SETTINGS ]]---------------
    
    	cr = cairo_create(cs)
    	ring(cr, 'cpu', 'cpu0', 100, 0xFFFFFF, 0, 0xFF8C00, 1.0, 850, 148, 140, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'memperc', '', 100, 0xFFFFFF, 0, 0x00BFFF, 1.0, 850, 148, 130, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'swapperc', '', 100, 0xFFFFFF, 0, 0xFFFF58, 1.0, 850, 148, 120, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    	
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/', 100, 0xFFFFFF, 0, 0xFFDEAD, 1.0, 850, 148, 110, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    	cr = cairo_create(cs)
    	ring(cr, 'fs_used_perc', '/media/Shitsta', 100, 0xFFFFFF, 0, 0xFFFF00, 1.0, 850, 148, 100, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)	
    
    	cr = cairo_create(cs)
    	ring(cr, 'battery_percent', 'BAT0', 100, 0xFFFFFF, 0, 0x00FF2A, 1.0, 850, 148, 90, 10, 0, 360) -- options: name, arg, max, bg_colour, bg_alpha, fg_colour, fg_alpha, xc, yc, radius, thickness, start_angle, end_angle
    	cairo_destroy(cr)
    
    -------------------[[ END CPU RINGS SETTINGS ]]---------------	
    
    -------------------[[ PHOTO ALBUM SETTINGS ]]---------------
    --conky_photo_album('/home/graham/Pictures/Conky/', 400, 600, 200, 200, 10, 10)
    -------------------[[ END PHOTO ALBUM SETTINGS ]]---------------
    
    conky_draw_bg(0xFFFFFF, 0.4)
    end
    Last edited by merlin_ie; December 9th, 2009 at 08:51 PM.

  10. #10800
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Bruce M. View Post
    Bash script Guru needed

    Anyone got any idea why this all off a sudden (as of yesterday) doesn't display the day names correctly?
    Did you edited it by hand?
    I see 2 problems:
    1. line 8-10
      Code:
      TODAY=`date +%d`
      LASTDAY=`date -d "-$(date +%d) days +1 month" +%d`
      FIRSTDAY=`date -d "-1 month -$(($(date +%d)-1)) days +1 month" +%u`
      line 10 have error with date parameter but it could be made simpler
      Code:
      TODAY=`date +%d`
      LASTDAY=`date -d "-$TODAY days +1 month" +%d`
      FIRSTDAY=`date -d "-$TODAY days" +%u`
    2. line 35-36: what is this? You can't wirte function "then" without space with rest of text and then there is no "Do" function to write it without "=" exact by it without space and what with pipeline command "|"?
      Code:
      if [ $TODAY -ne $LASTDAY ]
      thenDo = Sun | Lu = Mon | Ma = Tue | Mi = Wed
      Ju = Thu ||Vi = Fri | Sa = Sat |
      
          while [ $i -ne $LASTDAY ]; do
      Delete it since it have no purpose and is wrong
      Code:
      if [ $TODAY -ne $LASTDAY ]
      then
          while [ $i -ne $LASTDAY ]; do




    PS: not right... correction to line 10
    Code:
    FIRSTDAY=`date -d "-$[$(echo $TODAY |sed -e 's/^0//')-1] days" +%u`
    I overlook that "+%u" gives day of the week not day of the month so it needs to be done arthmetics with muber "09" from "today +%d" and "1" which won't work so the "sed" that deletes "zero" at the beginning of weekday string



    PS2: the script as it is now don't show any day from next month so everything that is for that in script could be safelly deleted as well
    Last edited by dk75; December 9th, 2009 at 10:06 PM.
    Linux Debian Sid (Minted) x86_64/3.12.10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Lenovo T61, Intel X3100, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
    Linux user No.: 483055 | My Conky Pitstop corner | One4All project

Page 1080 of 2348 FirstFirst ... 80580980103010701078107910801081108210901130118015802080 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •