SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#3201 2012-10-09 21:02:35

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,108

Re: Conky v1.9 Thread

@ Sector11....amazing work again

Offline

Help fund CrunchBang, donate to the project!

#3202 2012-10-09 22:14:43

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Conky v1.9 Thread

Added Sector11's Clock

screenshot-10092012-051337pm.php


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#3203 2012-10-09 22:33:31

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

VastOne wrote:
Sector11 wrote:

Shamelessly borrowed, with modifications, from Voyager Linux while found on the ARCH forums.
Imagine that no shame anywhere.

Nice...

I have loaded the Clock and it all functions correctly, but I noticed the following when I test/ran it from terminal

Conky: llua_do_call: function conky_main execution failed: /home/vastone/clock_conky.lua:190: attempt to call global 'go_gauge_rings' (a nil value)

screenshot-10092012-035008pm.php

You seeing anything like that?

Thanks ... I'll look at that in an hour or so ... the girls are callin'
Gotta run!

Last edited by Sector11 (2012-10-09 22:39:01)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3204 2012-10-09 22:38:16

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

TeoBigusGeekus wrote:

Shouldn't be hard for a perl using crunchbanger to change the logo; it should then work out of the box.

Cut-n-paste did it:
adhr724e.jpg <--> adoQXTYz.jpg

Left the '-n' in there for the new ARCH logo.

asli2

#!/usr/bin/perl

#
# Alsi is a system information tool written in PERL. It has been inspired by Archey...
#

# Coded by Trizen
# http://trizen.go.ro

$c = $ARGV[0];
$z = "\e[0m";
for ($nr = 0; $nr <= $#ARGV; ++$nr) {
    push @argvs, $ARGV[$nr];
}
if ($c =~ /-h|--help/) {
    die "
Usage: $0 [...]

Colors:
\t-d --default
\t-r --red
\t-g --green
\t-b --black
\t-p --purple
\t-c --cyan
\t-w --white
\t
Options:
\t-s  :  take screenshot (using scrot)
\t-n  :  show the new arch logo

";
}
if ($c eq '' or $c eq '-n' and $ARGV[1] eq '' or $c eq '-s') {
    $c1 = "\e[0;34m";
    $c2 = $c1;
    $c2 =~ s/\[0/[1/;
}
else {
    @colors = "
\e[0;34m' -d --default
\e[0;31m' -r --red
\e[0;32m' -g --green
\e[0;33m' -y --yellow
\e[0;30m' -b --black
\e[0;35m' -p --purple
\e[0;36m' -c --cyan
\e[0;37m' -w --white
";
}

(%wm) = (
'awesome', 'Awesome', 'beryl', 'Beryl', 'blackbox', 'Blackbox',
'compiz', 'Compiz', 'dwm', 'DWM', 'enlightenment', 'Enlightenment',
'fluxbox', 'Fluxbox', 'fvwm', 'FVWM', 'i3', 'i3', 'weewm', 'WeeWM',
'sawfish', 'Sawfish', 'qlwm', 'qLWM', 'echinus', 'Echinus', 'w9wm', 'w9wm',
'hackedbox', 'Hackedbox', 'scrotwm', 'Scrotwm', 'twm', 'twm', 'vtwm', 'VtWM',
'9wm', '9wm', 'swm', 'swm', 'flwm', 'FlWM', 'jwm', 'JWM', 'icewm', 'IceWM',
'kwin', 'KWin', 'metacity', 'Metacity', 'musca', 'Musca', 'openbox', 'Openbox',
'pekwm', 'PekWM', 'ratpoison', 'ratpoison', 'scrotwm', 'ScrotWM',
'wmaker', 'WMaker','wmfs', 'Wmfs', 'wmii', 'wmii', 'xmonad', 'xmonad'
);

(%sh) = (
'zsh', 'Zsh', 'bash', 'Bash', 'dash', 'Dash', 'fish', 'Fish',
'ksh', 'Ksh', 'csh', 'Csh', 'jsh', 'Jsh', 'tcsh', 'Tcsh'
);
$psx = `ps -A`;
foreach $wm (keys %wm) {
    if ($psx =~ /([\W]+)$wm/) {
        $WM = $wm;
    }
}
foreach $Wm (values %wm) {
    if ($WM =~ /$Wm/i) {
        $WM = $Wm;
    }
}
if ($WM eq '') {
    $WM = 'Unknown';
}
foreach $sh (keys %sh) {
    if ($psx =~ /([\W]+)$sh/) {
        $SH = $sh;
    }
}
foreach $Sh (values %sh) {
    if ($Sh =~ /$SH/i) {
        $SH = $Sh;
    }
}
if ($SH eq '') {
    $SH = 'Unknown';
}
foreach $color (@colors) {
    foreach $arg (@argvs) {
        if ($color =~ /(.+)'(.*)$arg/) {
            $c1 = $1;
            $c2 = $c1;
            $c2 =~ s/\[0/[1/;
        }
    }
}
$ram = `free`;
if ($ram =~ /cache:([\ ]+)([\d]+)/) {
    $usedram = $2;
    $usedram = $usedram / 1024;
    $usedram =~ s/([\d]+)([\.]*)(.*)$/$1/;
}
else {
    $usedram = '';
}
if ($ram =~ /Mem:([\ ]+)([\d]+)/) {
    $totalram = $2;
    $totalram = $totalram / 1024;
    $totalram =~ s/([\d]+)([\.]*)(.*)$/$1/;
}
if ($usedram eq '') {
    if ($ram =~ /Mem:([\ ]+)([\d]+)([\ \t]*)([\d]+)/) {
        $usedram = $4;
        $usedram = $usedram / 1024;
        $usedram =~ s/([\d]+)([\.]*)(.*)$/$1/;
    }
}
$arch = `uname -m`;
if (-e '/etc/arch-release') {
    $distro = "Arch Linux $arch";
}
else {
    chomp($distro = `uname -o`);
    $distro .= " $arch";
}
if ($distro eq " $arch" and $arch =~ /(.+)/) {
    $distro = '';
    $distro = "Linux $arch";
}
if ($arch eq '' and $distro eq '') {
    $distro = "Unknown OS\n";
}
open CPU, '/proc/cpuinfo';
@cpu = <CPU>;
close CPU;
foreach $cpu (@cpu) {
    if ($cpu =~ /model name([\ \t]*): (.+)/) {
        $CPU = $2;
    }
    if ($cpu =~ /cpu MHz([\ \t]*): ([\d\.]+)/) {
        $freq = $2;
    }
}
if ($CPU eq '') {
    chomp($CPU = `uname -p`);
}
if (`uptime` =~ /up([\ \t]*)(.+)\, /) {
    $uptime = $2;
    if (not $uptime =~ /day/) {
        $uptime =~ s/,(.+)//;
    }
    else {
        $uptime =~ s/^([^\,]+),([\ \t]+)([^\,]+)(.+)/$1 & $3/;
    }
}
if ($distro =~ /Arch Linux/ or -e '/etc/frugalware-release') {
    $pkgs = `pacman -Q | wc -l`;
}
else {
    $pkgs = "Unknown\n";
}
if ($c1 eq '') {
    $c1 = "\e[0;34m";
    $c2 = $c1;
    $c2 =~ s/\[0/[1/;
}
@df = `df -TPh`;
foreach $df (@df) {
    if ($df =~ m[([\w]+)([\ \t]*)([\w\.]+)([\ \t]*)([\w\.]+)([\ \t]*)([\w\.]+)([\ \t]*)([\d]+)\% /(.*)] and not $1 =~ /tmpfs/) {
        $type = $1;
        $totalsize = $3;
        $used = $5;
        $free = $7;
        $usedprocent = " ($9%)";
        $mountpoint = "/$10";
    }
    $mountpoint =~ s[(.*)/(.+)$][$2];
    $mountpoint =~ s/(.+)/\u\L$1\E/g;
    if ($mountpoint eq '/') {
        $mountpoint = 'Root';
    }
    if ($mountpoint =~ /(.+)/) {
        if ($usedprocent eq ' (100%)') {
            $usedprocent = '';
        }
        push @partitions, " $c2 ${mountpoint}:$z $used / $totalsize$usedprocent ($type)";
    }
}
foreach $partition (@partitions) {
    next if $partition eq $lastpartition;
    push @p, $partition;
    $lastpartition = $partition;
}
$de = 'Desktop Environment';
if ($CPU =~ /([^\@]+)/) {
    $CPU = $1;
    $CPU =~ s/([\ \t]+)$//;
}
foreach $argv (@argvs) {
    if ($argv =~ /-n/) {
        $newlogo = 'TRUE';
        print "\n";
        print "$c1                  .o+                 ";
        print " $c2 OS:$z $distro";
        print "$c1                 `ooo/                ";
        print " $c2 Hostname:$z ";
        system 'uname -n';
        print "$c1                `+oooo:               ";
        print " $c2 Kernel:$z ";
        system 'uname -r';
        print "$c1               `+oooooo:              ";
        print " $c2 Uptime:$z $uptime\n";
        print "$c1               -+oooooo+:             ";
        if ($psx =~ /xfce4-session/) {
            print " $c2 ${de}:$z XFCE4\n";
        }
        elsif ($psx =~ /lxsession/) {
            print " $c2 ${de}:$z LXDE\n";
        }
        elsif ($psx =~ /gnome-session/) {
            print " $c2 ${de}:$z GNOME\n";
        }
        elsif ($psx =~ /ksmserver/) {
            print " $c2 ${de}:$z KDE\n";
        }
        else {
            print " $c2 Window Manager:$z $WM\n";
        }
        print "$c1             `/:-:++oooo+:            ";
        print " $c2 Packages:$z $pkgs";
        print "$c1            `/++++/+++++++:           ";
        print " $c2 RAM:$z $usedram MB / $totalram MB\n";
        print "$c1           `/++++++++++++++:          ";
        print " $c2 CPU:$z $CPU\n";
        print "$c1          `/+++o." . $c2 . 'ooooooo' . $c1 . 'oooo/`        ';
        print " $c2 CPU Freq:$z $freq MHz\n";
        print "$c2         " . $c1 . './.' . $c2 . 'ooosssso+osssssso' . $c1 . '+`       ';
        print " $c2 Shell:$z $SH\n";
        print "$c2        .oossssso-````/ossssss+`      ";
        print "$p[0]\n";
        print "$c2       -osssssso.      :ssssssso.     ";
        print "$p[1]\n";
        print "$c2      :osssssss/        osssso+++.    ";
        print "$p[2]\n";
        print "$c2     /ossssssss/        +ssssooo/-    ";
        print "$p[3]\n";
        print "$c2   `/ossssso+/:-        -:/+osssso+-  ";
        print "$p[4]\n";
        print "$c2  `+sso+:-`                 `.-/+oso: ";
        print "$p[5]\n";
        print "$c2 `++:.                           `-/+/";
        print "$p[6]\n";
        print "$c2 .`                                 `/$z";
        print "$p[7]\n\n";
    }
}
unless ($newlogo =~ /(.+)/) {
    print " $c2      ###      ###      !!!$z ";
    print " $c2 OS:$z $distro";
    print " $c2      ###      ###      !!!$z ";
    print " $c2 Hostname:$z ";
    system 'uname -n';
    print " $c2      ###      ###      !!!$z ";
    print " $c2 Kernel:$z ";
    system 'uname -r';
    print " $c2      ###      ###      !!!$z ";
    print " $c2 Uptime:$z $uptime\n";
    print " $c2  ####################  !!!$z ";
    if ($psx =~ /xfce4-session/) {
        print " $c2 ${de}:$z XFCE4\n";
    }
    elsif ($psx =~ /lxsession/) {
        print " $c2 ${de}:$z LXDE\n";
    }
    elsif ($psx =~ /gnome-session/) {
        print " $c2 ${de}:$z GNOME\n";
    }
    elsif ($psx =~ /ksmserver/) {
        print " $c2 ${de}:$z KDE\n";
    }
    else {
        print " $c2 Window Manager:$z $WM\n";
    }
    print " $c2  ####################  !!!$z ";
    print " $c2 Packages:$z $pkgs";
    print " $c2  ####################  !!!$z ";
    print " $c2 RAM:$z $usedram MB / $totalram MB\n";
    print " $c2      ###      ###      !!!$z ";
    print " $c2 CPU:$z $CPU\n";
    print " $c2      ###      ###      !!!$z ";
    print " $c2 CPU Freq:$z $freq MHz\n";
    print " $c2      ###      ###      !!!$z ";
    print " $c2 Shell:$z $SH\n";
    print " $c2      ###      ###      !!!$z ";
    print "$p[0]\n";
    print " $c2  ####################  !!!$z ";
    print "$p[1]\n";
    print " $c2  ####################  !!!$z ";
    print "$p[2]\n";
    print " $c2  ####################  !!!$z ";
    print "$p[3]\n";
    print " $c2      ###      ###         $z ";
    print "$p[4]\n";
    print " $c2      ###      ###      !!!$z ";
    print "$p[5]\n";
    print " $c2      ###      ###      !!!$z ";
    print "$p[6]\n";
    print " $c2      ###      ###      !!!$z ";
    print "$p[7]\n\n";
}
foreach $argv (@argvs) {
    if ($argv =~ /s/) {
        exec 'scrot -cd 5';
    }
}

Thanks for sharing Teo!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3205 2012-10-09 22:56:05

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: Conky v1.9 Thread

Im trying to find a way to my GPU info into conky and preferably in fahrenheit.

luke@crunchbang:~$ aticonfig --adapter=0 --od-gettemperature | grep 'Temperature' | cut --characters 36-38

Gives me

42

Which is obviously Celsius but is there a way to convert that to Fahrenheit?
Also is there anyway to get the GPU temp to work in this lua

${font}CPU Temp${lua gradbar {5,140,"${hwmon 0 temp 1}",159,80,2,10,1,0xFFFFFF,0.25,0x00FF00,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${hwmon 0 temp 1}°F

the way that hwmon or platform does?

Heres my video card info

luke@crunchbang:~$ aticonfig --list-adapters
* 0. 01:00.0 AMD Radeon HD 6700 Series 

* - Default adapter
luke@crunchbang:~$ aticonfig --odgt 

Default Adapter - AMD Radeon HD 6700 Series 
                  Sensor 0: Temperature - 42.00 C

Last edited by lwfitz (2012-10-09 22:57:23)

Offline

#3206 2012-10-09 23:43:05

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

lwfitz wrote:
42

Which is obviously Celsius but is there a way to convert that to Fahrenheit?
Also is there anyway to get the GPU temp to work in this lua

${font}CPU Temp${lua gradbar {5,140,"${hwmon 0 temp 1}",159,80,2,10,1,0xFFFFFF,0.25,0x00FF00,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${hwmon 0 temp 1}°F

the way that hwmon or platform does?

Have you tried:

temperature_unit
     Desired output unit of all objects displaying a temperature. Parameters are either "fahrenheit" or "celsius". The default unit is degree Celsius.

temperature_unit fahrenheit
TEXT

lm-sensors installed?

if yes:
What is the output of:

sensors

Platform might be a better way to go.  hwmon might load differently next time

RE: the LUA whatever you get for your GPU in conky could be used to replace "${hwmon 0 temp 1}" in that LUA code.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3207 2012-10-10 00:17:58

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

VastOne wrote:

Added Sector11's Clock

screenshot-10092012-051337pm.php

Looks good - found the problem:

open 'clock_conky.lua' ... the end looks like this:

--[[    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)

    if update_num > 5 then ]]
        go_clock_rings(display)
        go_gauge_rings(display)
    --end

end

comment out that: go_gauge_rings(display) line - or simply remove it (best)

--[[    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)

    if update_num > 5 then ]]
        go_clock_rings(display)
        --go_gauge_rings(display)
    --end

end

Done!

Last edited by Sector11 (2012-10-10 00:23:14)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3208 2012-10-10 00:29:15

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Conky v1.9 Thread

^ That did correct it, Thanks!

I think I like the clock better without the bg lua panel

screenshot-10092012-072745pm.php


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#3209 2012-10-10 00:43:43

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

VastOne wrote:

^ That did correct it, Thanks!

I think I like the clock better without the bg lua panel

screenshot-10092012-072745pm.php

make one more change:

--[[    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)

    if update_num > 5 then ]]
        go_clock_rings(display)
    --end

    cairo_surface_destroy(cs)
    cairo_destroy(display)
end

Add those two lined before the last 'end' (to avoid memory leaks)
unless mrpeachy or someone comes in and says not necessary.  big_smile

The background is better with light backgrounds, and a matter of opinion - and option if you will.

Last edited by Sector11 (2012-10-10 00:44:32)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3210 2012-10-10 01:33:35

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

sector11 will soon be putting me out of a job big_smile
not that i've been too active with conky recently

Last edited by mrpeachy (2012-10-10 01:35:21)

Offline

#3211 2012-10-10 02:48:37

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: Conky v1.9 Thread

Don't often come to this part of the forest ( hello everyone smile ), but - what's the procedure for asking for conky help, unrelated to anything people are talking about atm? Open a new thread, or just jump in here?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#3212 2012-10-10 02:49:34

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Conky v1.9 Thread

^ Jump in here John


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#3213 2012-10-10 03:25:34

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

mrpeachy wrote:

sector11 will soon be putting me out of a job big_smile
not that i've been too active with conky recently

Don't hold your breath mrpeachy, I can edit and tweak, I can't create.  big_smile

And to think, a year ago I bugged you numerous times with "How do I run it?  It won't start!"  hehehehehehe

So here's another --- blueish!
New conky alert.

I took a the lua clock, see earlier post, from one script added it to another lua called HUD (again compliments Voyager Linux) and put them together to fit my AMD Athlon II X3.

acv4i8Xv.jpg My first ever 'merged LUA scripts' - I'm getting better mrpeachy.

The conky:

#=== borrowed from: === & Voyager Linux === [url]http://voyager.legtux.org/[/url] =========
#                               conkyrc_orange
#
#  author  : SLK
#  version : v2011011601
#  license : Distributed under the terms of GNU GPL version 2 or later
#
#=== Sector11 09 Oct 12 =======================================================
# killall conky && conky -c ~/.conky/conky5/conkyrc_HUD2 &
###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_colour black
own_window_class Conky
own_window_title Clock

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type override
own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 200

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

minimum_size 250 0 ## width, height
maximum_width 250  ## width

gap_x 5 # left-right
gap_y 5 # up-down

alignment top_right
###################################################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont WenQuanYi Micro Hei Mono:size=8

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0
# Force UTF8? requires XFT ###
override_utf8_locale yes

draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color grey
default_outline_color black

default_color DCDCDC #220 220 220    Gainsboro
color0 8FBC8F #143 188 143    DarkSeaGreen
color1 778899 #119 136 153    LightSlateGray
color2 FF8C00 #255 140   0    DarkOrange
color3 7FFF00 #127 255   0    Chartreuse
color4 FFA07A #255 160 122    LightSalmon
color5 FFDEAD #255 222 173    NavajoWhite
color6 00BFFF #  0 191 255    DeepSkyBlue
color7 00FFFF #  0 255 255    Cyan
color8 FFFF00 #255 255   0    Yellow
color9 B22222 #178  34  34    FireBrick
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 0
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################

# Boolean value, if true, Conky will be forked to background when started.
background no

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load ~/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.3
#
lua_load ~/.conky/conky6/conky_HUD2.lua
lua_draw_hook_post main
#
#######################################################  End LUA Settings  ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1


TEXT




${goto 105}${font Anonymous Pro:bold:size=8}DISKS${font Anonymous Pro:bold:size=8} ${color0}${execi 15 hddtemp -n /dev/sda}°
${goto 110}${font Anonymous Pro:bold:size=7}${color1}size /${font}
${goto 105}${font Anonymous Pro:size=9}${color1} ${voffset -4}${fs_size /}
${goto 105}${font Anonymous Pro:bold:size=7}${color1}size /home${goto 220}${color8}Avg.${font}
${goto 105}${font Anonymous Pro:size=9}${color1} ${voffset -4}${fs_size /home}
${goto 30}${font Anonymous Pro:bold:size=8}${color}MEM
${goto 165}${font Anonymous Pro:bold:size=8}${color}CPU
${goto 180}${color0}${platform f71882fg.2560 temp 1}°${color}

${font Anonymous Pro:bold:size=8}  ${color}MB ${color0}${platform f71882fg.2560 temp 2}°${color}${goto 200}GPU ${color0}${nvidia temp}°${font}${color}

${goto 105}${color7}${font White Rabbit:size=22}${time %e}${color3}${goto 95}${font WenQuanYi Micro Hei Mono:size=10}${time %a}
${goto 105}${color7}${font WenQuanYi Micro Hei Mono:size=9}${time %b}${color3} ${font WenQuanYi Micro Hei Mono:size=12}${time %y}${font}

NOTE: 5 blank lines at the end.

conky_HUD2.lua

--==============================================================================
--                              conky_HUD.lua
--
--  author  : SLK
--  version : v2011062101
--  license : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================

require 'cairo'

--------------------------------------------------------------------------------
--                                                                    gauge DATA
gauge = {
{
    name='cpu',                    arg='cpu0',                  max_value=100,
    x=180,                         y=150,
    graph_radius=60,
    graph_thickness=5,
    graph_start_angle=0,
    graph_unit_angle=0.9,          graph_unit_thickness=0.9,
    graph_bg_colour=0xFFFF00,      graph_bg_alpha=0.3,
    graph_fg_colour=0xFFFF00,      graph_fg_alpha=0.0,
    hand_fg_colour=0xFFFF00,       hand_fg_alpha=1.0,
    txt_radius=60,                -- yellow
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xFFFF00,        txt_fg_alpha=0.8,
    graduation_radius=30,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFF00, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu1',                  max_value=100,
    x=180,                         y=150,
    graph_radius=50,
    graph_thickness=5,
    graph_start_angle=0,
    graph_unit_angle=0.9,          graph_unit_thickness=0.9,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=50,                -- green
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=0.8,
    graduation_radius=55,
    graduation_thickness=5,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu2',                  max_value=100,
    x=180,                         y=150,
    graph_radius=40,
    graph_thickness=5,
    graph_start_angle=0,
    graph_unit_angle=0.9,          graph_unit_thickness=0.9,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=40,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=0.8,
    graduation_radius=30,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu3',                  max_value=100,
    x=180,                         y=150,
    graph_radius=30,
    graph_thickness=5,
    graph_start_angle=0,
    graph_unit_angle=0.9,          graph_unit_thickness=0.9,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=30,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=0.8,
    graduation_radius=35,
    graduation_thickness=5,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='memperc',                arg='',                      max_value=100,
    x=40,                          y=115,
    graph_radius=34,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2,            graph_unit_thickness=2,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=20,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=0.8,
    graduation_radius=24,
    graduation_thickness=6,        graduation_mark_thickness=2,
    graduation_unit_angle=10,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=10.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='fs_used_perc',           arg='/',                     max_value=100,
    x=120,                         y=70,
    graph_radius=40,
    graph_thickness=4,
    graph_start_angle=210,
    graph_unit_angle=2,            graph_unit_thickness=2,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=32,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=0.8,
    graduation_radius=46,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=20,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='fs_used_perc',           arg='/home/',                max_value=100,
    x=120,                         y=70,
    graph_radius=50,
    graph_thickness=8,
    graph_start_angle=210,
    graph_unit_angle=2,            graph_unit_thickness=2,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=65,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=0.8,
    graduation_radius=58,
    graduation_thickness=4,        graduation_mark_thickness=2,
    graduation_unit_angle=20,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
}
-------------------------------------------------------------------------------
--                                                                 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


--------------------------------------------------------------------------------
--                                                                    clock DATA
-- HOURS
clock_h = {
    {
    name='time',                   arg='%H',                    max_value=12,
    x=120,                          y=200,
    graph_radius=53,
    graph_thickness=3,
    graph_unit_angle=30,           graph_unit_thickness=30,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.0,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.3,
    txt_radius=34,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x7FFF00,        txt_fg_alpha=0.9,
    graduation_radius=53,
    graduation_thickness=6,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    },
}
-- MINUTES
clock_m = {
    {
    name='time',                   arg='%M',                    max_value=60,
    x=120,                          y=200,
    graph_radius=57,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=6,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.1,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.3,
    txt_radius=65,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x7FFF00,        txt_fg_alpha=0.9,
    graduation_radius=57,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    },
}
-- SECONDS
clock_s = {
    {
    name='time',                   arg='%S',                    max_value=60,
    x=120,                          y=200,
    graph_radius=50,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=2,
    graph_bg_colour=0xFFFF00,      graph_bg_alpha=0.0,
    graph_fg_colour=0xFFFF00,      graph_fg_alpha=0.2,
    txt_radius=40,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0x778899,        txt_fg_alpha=0.9,
    graduation_radius=0,
    graduation_thickness=0,        graduation_mark_thickness=0,
    graduation_unit_angle=0,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0,
    },
}

--------------------------------------------------------------------------------
--                                                                 rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

-------------------------------------------------------------------------------
--                                                            angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
    local pos = current_angle + start_angle
    return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end

-------------------------------------------------------------------------------
--                                                              draw_clock_ring
-- displays clock
--
function draw_clock_ring(display, data, value)
    local max_value = data['max_value']
    local x, y = data['x'], data['y']
    local graph_radius = data['graph_radius']
    local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
    local graph_unit_angle = data['graph_unit_angle']
    local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
    local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']

    -- background ring
    cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi)
    cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
    cairo_set_line_width(display, graph_thickness)
    cairo_stroke(display)

    -- arc of value
    local val = (value % max_value)
    local i = 1
    while i <= val do
        cairo_arc(display, x, y, graph_radius,(  ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360)  )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2))
        cairo_set_source_rgba(display,rgb_to_r_g_b(graph_fg_colour,graph_fg_alpha))
        cairo_stroke(display)
        i = i + 1
    end
    local angle = (graph_unit_angle * i) - graph_unit_thickness

    -- graduations marks
    local graduation_radius = data['graduation_radius']
    local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
    local graduation_unit_angle = data['graduation_unit_angle']
    local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
    if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
        local nb_graduation = 360 / graduation_unit_angle
        local i = 1
        while i <= nb_graduation do
            cairo_set_line_width(display, graduation_thickness)
            cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2))
            cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
            cairo_stroke(display)
            cairo_set_line_width(display, graph_thickness)
            i = i + 1
        end
    end

    -- text
    local txt_radius = data['txt_radius']
    local txt_weight, txt_size = data['txt_weight'], data['txt_size']
    local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
    local movex = txt_radius * (math.cos((angle * 2 * math.pi / 360)-(math.pi/2)))
    local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2)))
    cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight);
    cairo_set_font_size (display, txt_size);
    cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha));
    cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3);
    cairo_show_text (display, value);
    cairo_stroke (display);
end

-------------------------------------------------------------------------------
--                                                               go_clock_rings
-- loads data and displays clock
--
function go_clock_rings(display)
    local function load_clock_rings(display, data)
        local str, value = '', 0
        str = string.format('${%s %s}',data['name'], data['arg'])
        str = conky_parse(str)
        value = tonumber(str)
        draw_clock_ring(display, data, value)
    end

    for i in pairs(clock_h) do
        load_clock_rings(display, clock_h[i])
    end
    for i in pairs(clock_m) do
        load_clock_rings(display, clock_m[i])
    end
    for i in pairs(clock_s) do
        load_clock_rings(display, clock_s[i])
    end
end


-------------------------------------------------------------------------------
--                                                                         MAIN
function conky_main()
    if conky_window == nil then
        return
    end

    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local display = cairo_create(cs)

    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)

    if update_num > 5 then
        go_gauge_rings(display)
        go_clock_rings(display)
    end

    cairo_surface_destroy(cs)
    cairo_destroy(display)
end

draw-bg.lua

--[[Background originally by londonali1010 (2009)
    ability to set any size for background mrpeachy 2011
    ability to set variables for bg in conkyrc dk75

  the change is that if you set width and/or height to 0
  then it assumes the width and/or height of the conky window

so:

Above and After TEXT  (requires a composite manager or it blinks!)

 lua_load ~/wea_conky/draw_bg.lua
 TEXT
 ${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}

OR Both above TEXT (no composite manager required - no blinking!)

 lua_load ~/wea_conky/draw_bg.lua
 lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
 TEXT

Note
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
  See below:        1  2 3 4 5 6        7

${lua conky_draw_bg corner_radius x_position y_position width height color alpha}

covers the whole window and will change if you change the minimum_size setting

1 = 20             corner_radius
2 = 0             x_position
3 = 0             y_position
3 = 0             width
5 = 0             height
6 = 0x000000      color
7 = 0.4           alpha

######### calendar function ##################################################

then to use it, you activate the calendar function BELOW TEXT like this

${lua luacal {settings}}

#${lua luacal {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gh=,gt=,gv=,sd=}}
#    x=x position top left
#    y=y position top left
#    tf=title font, eg "mono" must be in quotes
#    tfs=title font size
#    tc=title color
#    ta=title alpha
#    bf=body font, eg "mono" must be in quotes
#    bfs=body font size
#    bc=body color
#    ba=body alpha
#    hf=highlight font, eg "mono" must be in quotes
#    hfs=highlight font size
#    hc=highlight color
#    ha=highlight alpha
#    sp=spacer, eg " " or sp="0"... 0,1 or 2 spaces can help with positioning of non-monospaced fonts

#    gt=gap from title to body
#    gh=gap horizontal between columns
#    gv=gap vertical between rows
#    sd=start day, 0=Sun, 1=Mon

#    hstyle = heading style, 0=just days, 1=date insert
#    tdf=title date font, eg "mono" must be in quotes
#    tdfs=title date font size
#    tdc=title date color
#    tda=title date alpha

# test line
-- ${lua luacal {x=10,y=100,tf="Purisa",tfs=24,tc=0xf67e16,ta=1,bf="First Order",bfs=26,bc=0xecd32a,ba=1,hf="Purisa",hfs=18,hc=0xf67e16,ha=1,sp=" ",gh=40,gt=25,gv=20,sd=0,hstyle=1,tdf="First Order",tdfs=28,tdc=0xff0000,tda=1}}


]]

require 'cairo'
local    cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
-- ###### calendar function ##################################################
function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=,hstyle=,tdf=,tdfs=,tdc=,tda=}
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--############################################################################
if caltab.x==nil then
caltab=loadstring("return" .. caltab)()
end
local cal_x=caltab.x
local cal_y=caltab.y
local tfont=caltab.tf        or "mono"
local tfontsize=caltab.tfs    or 12
local tc=caltab.tc        or 0xffffff
local ta=caltab.ta        or 1
local bfont=caltab.bf        or "mono"
local bfontsize=caltab.bfs    or 12
local bc=caltab.bc        or 0xffffff
local ba=caltab.ba        or 1
local hfont=caltab.hf        or "mono"
local hfontsize=caltab.hfs    or 12
local hc=caltab.hc        or 0xff0000
local ha=caltab.ha        or 1
local spacer=caltab.sp        or " "
local gaph=caltab.gh        or 20
local gapt=caltab.gt        or 15
local gapl=caltab.gv        or 15
local sday=caltab.sd        or 0
local hstyle=caltab.hstyle    or 0
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
--############################################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
    if i<=start_day then
    dnum[i]="  "
    else
    dn=i-start_day
        if dn=="nil" then dn=0 end
        if dn<=9 then dn=(spacer .. dn) end
        if i>x then dn="" end
        dnum[i]=dn
        dnumh[i]=dn
        if dn==(spacer .. today) or dn==today then
        dnum[i]=""
        end
        if dn==(spacer .. today) or dn==today then
        dnumh[i]=dn
        place=i
        else dnumh[i]="  "
        end
    end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
if hstyle==0 then
    if tonumber(sday)==0 then
    dys={"SU","MO","TU","WE","TH","FR","SA"}
    else
    dys={"MO","TU","WE","TH","FR","SA","SU"}
    end
    --draw calendar titles
elseif hstyle==1 then
    if tonumber(sday)==0 then
    dys={"SU","MO"," ","  ","  ","FR","SA"}
    cairo_text_extents(cr,"MO",extents)
    local s=extents.x_advance+gaph
    local f=gaph*5
    local tdfont=caltab.tdf        or "mono"
    local tdfontsize=caltab.tdfs    or 12
    local tdc=caltab.tdc        or 0xffffff
    local tda=caltab.tda        or 1
    cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tdfontsize);
    local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
    cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
    local insert=os.date("%b %y")
    cairo_text_extents(cr,insert,extents)
    local w=extents.x_advance
    cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
    cairo_show_text (cr,insert)
    cairo_stroke (cr)
    else
    dys={"MO","TU"," ","  ","  ","SA","SU"}
    cairo_text_extents(cr,"TU",extents)
    local s=extents.x_advance+gaph
    local f=gaph*5
    local tdfont=caltab.tdf        or "mono"
    local tdfontsize=caltab.tdfs    or 12
    local tdc=caltab.tdc        or 0xffffff
    local tda=caltab.tda        or 1
    cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tdfontsize);
    local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
    cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
    local insert=os.date("%b %y")
    cairo_text_extents(cr,insert,extents)
    local w=extents.x_advance
    cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
    cairo_show_text (cr,insert)
    cairo_stroke (cr)
    end
end
--draw calendar titles
for i=1,7 do
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
    cairo_show_text (cr, dnum[i])
    cairo_stroke (cr)
    end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
    cairo_show_text (cr, dnumh[i])
    cairo_stroke (cr)
    end
end
--############################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function#######################################################

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3214 2012-10-10 03:29:33

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

johnraff wrote:

Don't often come to this part of the forest ( hello everyone smile ), but - what's the procedure for asking for conky help, unrelated to anything people are talking about atm? Open a new thread, or just jump in here?

VastOne wrote:

^ Jump in here John

Yea, come on in John, set a spell, hava java and we'll chat conky.

Simple requests instantly, complex requests within hours and the impossible for tomorrow, if mrpeachy, falldown, arclance, dk75 and or TeoBigusGeekus get involved.

I'll be sweeping the floor and serving the java. lol

Last edited by Sector11 (2012-10-10 03:41:22)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3215 2012-10-10 05:39:52

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: Conky v1.9 Thread

OK another spacing and margins question.

(The issue is sort of solved but it's a messy workaround I'd like to improve on.)
So, I've got 2 conkys at the top of the screen, one on the left showing RAM and CPU use and on the right with network activity. These come to the top of the pile so they're always visible, even over a maximized window, without needing a margin at the top of the screen. They occupy space in the title bar that's normally unused, see:
tZnRsbA
The problem is that the two RAM and CPU bars push the bottom of the conky window down, so that it covers the menu items of the app just underneath, making them unclickable.There's no extra blank space in the TEXT section of conkyrc, but something seems to be getting added to the window, making it 30px too high.

Anyway, what I did was add ${voffset 30} to the start of the text to push it to the bottom of the window, then gap_y -30 to push the window up off the top of the screen. This works, except on login the window isn't pushed up by the gap_y -30. (I've added a 1px white border so you can see the windows. The conky-netmon on the right has none of these issues.)
tZnRscA
You have to send it a HUP signal, like 'pkill -hup -f conkyrc-sysmon' or else make some small edit to the conkyrc file, then conky seems to notice that -30 vertical align. What I finally did was call that conky with this line in openbox's autostart.

(sleep 3; conky -q -c $HOME/.config/user/conkyrc-sysmon; sleep 2; pkill -hup -f conkyrc-sysmon ) &

It's not elegant. sad

Is there a nicer way of fixing this? Is it a conky bug?
(This is on #! Statler & conky is 1.8.0-1+squeeze1)

Here's the conkyrc:

background yes
update_interval 1.0
total_run_times 0

use_xft yes
xftfont Bitstream Vera Sans Mono:size=8
xftalpha 1.0

own_window yes
own_window_type normal
own_window_transparent yes
own_window_argb_visual yes
own_window_hints undecorated,above,sticky,skip_taskbar,skip_pager

double_buffer yes

minimum_size 200 0

draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
border_inner_margin 0
border_outer_margin 0
border_width 0

default_color white
default_shade_color black
default_outline_color black

alignment top_left
gap_x 55
gap_y -30

no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

use_spacer none

TEXT
${voffset 30}${color}RAM:${color #97C73F} $mem ${membar}
${color}CPU:${color #F08F22} $cpu% ${cpubar}

John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#3216 2012-10-10 06:22:37

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: Conky v1.9 Thread

Sector11 wrote:

Have you tried:

temperature_unit
     Desired output unit of all objects displaying a temperature. Parameters are either "fahrenheit" or "celsius". The default unit is degree Celsius.

temperature_unit fahrenheit
TEXT

lm-sensors installed?

if yes:
What is the output of:

sensors

Platform might be a better way to go.  hwmon might load differently next time

RE: the LUA whatever you get for your GPU in conky could be used to replace "${hwmon 0 temp 1}" in that LUA code.


Yes lm-sensors is installed but Ill have to post the output tomorrow when I get back into my office. 
hwmon vs platform...... I figured platform was better and more reliable (I think maybe I read that on here?).  I was actually reading that exact link right before I saw your response.
As far as that lua goes yeah I know it wasnt setup for GPU I was just using it as an example and wondering if I could use that for my GPU temp like with the CPU cuz I dont think my GPU temp shows in sensors. None of the temps were anywhere close to what

aticonfig --adapter=0 --od-gettemperature | grep 'Temperature' | cut --characters 36-38

gave me.


temperature_unit fahrenheit

Didnt make any difference when it came to my GPU temp. It still showed in celsius.

Thanks for the help buddy smile

Offline

#3217 2012-10-10 06:37:08

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

@johnraff try something like this:

gap_y 0
TEXT
${voffset -5}${color}RAM:${color #97C73F} $mem ${membar}
${color}CPU:${color #F08F22} $cpu% ${cpubar}${voffset -4}

Offline

#3218 2012-10-10 06:51:12

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

@lwfitz
which lua script are you trying to get the GPU temp to show up on?
in lua it would be easy to convert C to F
but where to put the code you would need depends on how the script was set up

Offline

#3219 2012-10-10 12:45:17

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

@ johnraff

Oooooooooo - conky v1.8.0 - the sweetheart of all conkys! It just worked!  If you never need the features of the newer conky versions lock that sucker in place and grab the DEB (conky-all) file for a backup.

mrpeachy wrote:

@johnraff try something like this:

gap_y 0
TEXT
${voffset -5}${color}RAM:${color #97C73F} $mem ${membar}
${color}CPU:${color #F08F22} $cpu% ${cpubar}${voffset -4}

In essence I agree with mrpeachy "gap_y 0" and but with NO ${voffset} commands.  I'm not totally convinced that it's the 'bars' that are pushing the conky down.

Mark Buck (kaivalagi) once mentioned that getting in the habit of using {} on all commands was a good practice and then showed an example of where not doing so messes with the conky.  Having said that that's the first thing I did.

Second was add the 'cpu0' to your commands - out of habit - not strictly necessary but I recall in the past (maybe with and earlier version of conky) where it said something to the affect "CPU missing adding cpu0 or 1", can't remember exactly.

Next I stripped out the # of the ${color} command it's not needed and conky uses that as a 'comment flag'.

adu1BJvS.jpg

What are the differences above TEXT in your two conkys?
Can you show the complete second conky?

This works perfectly here:

# killall conky && conky -c ~/conky/test274.johnraff.conky &
background yes
update_interval 1.0
total_run_times 0

use_xft yes
xftfont Bitstream Vera Sans Mono:size=8
xftalpha 1.0

own_window yes
own_window_type normal
own_window_transparent yes
own_window_argb_visual yes
own_window_hints undecorated,above,sticky,skip_taskbar,skip_pager

double_buffer yes

minimum_size 200 0

draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
border_inner_margin 0
border_outer_margin 0
border_width 0

default_color white
default_shade_color black
default_outline_color black

alignment top_left
gap_x 55
gap_y 0

no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

use_spacer none

TEXT
${color}RAM:${color 97C73F} ${mem} ${membar}
${color}CPU:${color F08F22} ${cpu cpu0}% ${cpubar cpu0}

I've put this in my autostart.sh file; rebooted, logged out and come back and it stays in place - shutdown and restarted all conkys with a batch file (added it in there as well) - it works perfect.

acjFj7Pz.jpg

That's why I'd like to see your second conky as well.

If all else fails, I'll install conky v1.8.0 (I run v1.9.0-2).

The two work:
aczwulTO.jpg

# killall conky && conky -c ~/conky/test275.johnraff.conky &
background yes
update_interval 1.0
total_run_times 0

use_xft yes
xftfont Bitstream Vera Sans Mono:size=8
xftalpha 1.0

own_window yes
own_window_type normal
own_window_transparent yes
own_window_argb_visual yes
own_window_hints undecorated,above,sticky,skip_taskbar,skip_pager

double_buffer yes

minimum_size 200 0

draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
border_inner_margin 0
border_outer_margin 0
border_width 0

default_color white
default_shade_color black
default_outline_color black

alignment top_right
gap_x 80
gap_y 0

no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

use_spacer none

TEXT
${color}Up:${color 97C73F} ${downspeedgraph eth0 5,170 FF0000 FFFF00 -t -l}
${color}Dn:${color F08F22} ${downspeedgraph eth0 5,170 FFFF00 FF0000 -t -l}

Last edited by Sector11 (2012-10-10 14:38:07)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3220 2012-10-10 12:50:02

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

mrpeachy wrote:

@lwfitz
which lua script are you trying to get the GPU temp to show up on?
in lua it would be easy to convert C to F
but where to put the code you would need depends on how the script was set up

See - now this I need to spy on to learn. big_smile
You haven't lost your place yet.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3221 2012-10-10 17:24:59

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: Conky v1.9 Thread

Well, this is sort of embarassing - trying mrpeachy's gap_y 0 fixed it right off, with or without a -5px ${voffset}. It was that 30px voffset that had been dragging the bottom of the window down. But I originally put that voffset in because the window was hanging down below the bars (and I wanted to get the bars down at the bottom) - honest! Anyway,whatever had been causing that is obviously now in the past, but the 30px voffset had been perpetuating the problem. roll

Anyway, along with returning gap_y to 0 (well, -1 in fact) and removing the voffset, I cleaned up the code according to sector11's suggestions and everything seems to be fine. smile

The two lines:

border_inner_margin 0
border_outer_margin 0

were making conky crash after a restart (not a HUP though) if there was no border set, so they're now removed.

Here's the netmon conky from the right hand side, just for your info (it's almost identical):

background yes
update_interval 0.3
total_run_times 0

use_xft yes
xftfont Bitstream Vera Sans Mono bold:size=12
xftalpha 1.0

own_window yes
own_window_type normal
own_window_transparent yes
own_window_argb_visual yes
own_window_hints undecorated,above,sticky,skip_taskbar,skip_pager

double_buffer yes

minimum_size 100 10
maximum_width 160

draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no

default_color white
default_shade_color black
default_outline_color black

alignment top_right
gap_x 65
gap_y 0

uppercase no

cpu_avg_samples 2
net_avg_samples 2
if_up_strictness address

override_utf8_locale no

TEXT
Dn: ${color FF2222}${downspeedgraph eth0 12,50 -l} ${alignr}${color}Up: ${color FFFF00}${upspeedgraph eth0 12,50 -l}

and the now working sysmon:

background yes
update_interval 1.0
total_run_times 0

use_xft yes
xftfont Bitstream Vera Sans Mono:size=8
xftalpha 1.0

own_window yes
own_window_type normal
own_window_transparent yes
own_window_argb_visual yes
own_window_hints undecorated,above,sticky,skip_taskbar,skip_pager

double_buffer yes

minimum_size 200 0

draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no

default_color white
default_shade_color black
default_outline_color black

alignment top_left
gap_x 55
gap_y -1

no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

use_spacer none

TEXT
${color}RAM:${color 97C73F} ${mem} ${membar}
${color}CPU:${color F08F22} ${cpu cpu0}% ${cpubar cpu0}

And many thanks for your help! vYTZ5aw


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#3222 2012-10-10 18:00:47

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: Conky v1.9 Thread

mrpeachy wrote:

@lwfitz
which lua script are you trying to get the GPU temp to show up on?
in lua it would be easy to convert C to F
but where to put the code you would need depends on how the script was set up

Im using your allcombined lua and Id like to use this line but instead of hwmon can I just insert the gpu command? whatever that happens to end up as?

 ${font}CPU Temp${lua gradbar {5,140,"${hwmon 0 temp 1}",159,80,2,10,1,0xFFFFFF,0.25,0x00FF00,1,0xFFFF00,1,0xFF0000,1}}${goto 220}${hwmon 0 temp 1}°F

Headed to the office right now and Ill post my sensors output. Thanks guys

Offline

#3223 2012-10-10 18:16:12

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

@ johnraff

Don't use the conky site for your variables (above TEXT) and settings (below TEXT) other than for general knowledge.  Those sites have been upgraded to reflect changes to Conky v1.9.0-2 that is now current.

For example:

border_inner_margin
border_outer_margin

did not exist for conky v1.8.0, it was simply:

border_margin

I'm embarrassed that I didn't catch that.

A long time ago I started saving those pages as HTML pages locally - and after a while I though "Why?" and deleted them.  I wish now I had kept them. I had "AboveTEXT-1.7.1.html, BelowTEXT-1.7.1.html" upto and including v1.8.1.  Bummer.

I learned a few things with this.  Your conkys are MUCH better than a 'panel' conky (for what you use them for) and have a very interesting side affect, for me at least.  Possibly you as well.

Right clicking on the 'menu bar' of the open program brings up the program menu.  Right clicking on the conky brings up the OpenBox Menu.
acjdxLIC.jpg

Now that's pretty slick in my books.  Thanks for that!

Now, when ever you do upgrade the conky program start your conkys in a terminal to see any errors.

If you look at conky help for v1.8.0 does it show the -D and -DD options?

  10 Oct 12 | 15:00:19 ~
         $ conky --help
Usage: conky [OPTION]...
Conky is a system monitor that renders text on desktop or to own transparent
window. Command line options will override configurations defined in config
file.
   -v, --version             version
   -q, --quiet               quiet mode
   -D, --debug               increase debugging output, ie. -DD for more debugging
   -c, --config=FILE         config file to load
   -C, --print-config        print the builtin default config to stdout
                             e.g. 'conky -C > ~/.conkyrc' will create a new default config
   -d, --daemonize           daemonize, fork to background
   -h, --help                help
   -a, --alignment=ALIGNMENT text alignment on screen, {top,bottom,middle}_{left,right,middle}
   -f, --font=FONT           font to use
   -X, --display=DISPLAY     X11 display to use
   -o, --own-window          create own window to draw
   -b, --double-buffer       double buffer (prevents flickering)
   -w, --window-id=WIN_ID    window id to draw
   -x X                      x position
   -y Y                      y position
   -t, --text=TEXT           text to render, remember single quotes, like -t '$uptime'
   -u, --interval=SECS       update interval
   -i COUNT                  number of times to update Conky (and quit)
   -p, --pause=SECS          pause for SECS seconds at startup before doing anything

  10 Oct 12 | 15:00:24 ~
         $ 

For example I did this:

draw_graph_borders no
border_margin 0
#border_outer_margin 0
border_width 0

and started your conky:
  10 Oct 12 | 15:03:28 ~
         $ conky -c ~/conky/test274.johnraff.conky -DD &
[1] 483

  10 Oct 12 | 15:03:40 ~
         $ Conky: /home/sector11/conky/test274.johnraff.conky: 24: no such configuration: 'border_margin'
DEBUG(0) [../../src/conky.c:5338]: reading contents from config file '/home/sector11/conky/test274.johnraff.conky'
DEBUG(1) [../../src/core.c:1225]: no templates to replace
DEBUG(1) [../../src/core.c:354]: Adding $cpu for CPU 0
DEBUG(1) [../../src/core.c:362]: Adding $cpubar for CPU 0
Conky: forked to background, pid is 488

Conky: desktop window (322) is root window
DEBUG(0) [../../src/x11.c:240]: Found ARGB Visual
Conky: window type - normal
Conky: drawing to created window (0x1a00002)
Conky: drawing to double buffer

There's that border margin. Hmmmmmm it also shows the CPU 0 Stuff I was talking about and yet I have it coded in.  ? hmm ?  Back to the drawing board on that one.

without the '-D' at all:

  10 Oct 12 | 15:09:05 ~
         $ conky -c ~/conky/test274.johnraff.conky &
[1] 591

  10 Oct 12 | 15:09:11 ~
         $ Conky: /home/sector11/conky/test274.johnraff.conky: 24: no such configuration: 'border_margin'
Conky: forked to background, pid is 596

Conky: desktop window (322) is root window
Conky: window type - normal
Conky: drawing to created window (0x1a00002)
Conky: drawing to double buffer
         $ 

So you can always check for errors.

Again, sorry you had a problem, but glad you brought it up and got it fixed.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3224 2012-10-10 18:19:37

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

lwfitz wrote:

Sorry about the double post.......... I got impatient and clicked twice on submit tongue

Mods:  Toss him in a chocolate coated hardrock candy cell and make him eat his way out!  lol
{been there - done that - the double post not the cell}
Don't sweat it - we've all done it.  big_smile

Last edited by Sector11 (2012-10-10 18:50:56)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

Help fund CrunchBang, donate to the project!

#3225 2012-10-10 19:08:53

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

dont think you could do it via the conkyrc setup method
would have to edit the script itself

the top of the script should be something like this:

--[[ by mrpeachy - 
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'

function rgb_to_r_g_b(col,alp)
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end

function conky_gradbar(bartab) -- {x=,y=,v="",vmax=,dn=,dw=,dh=,dg=,bc=,ba=,sc=,sa=,mc=,ma=,ec=,ea=} ################

add a new gpu function like this

--[[ by mrpeachy - 
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'

function rgb_to_r_g_b(col,alp)
return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end

conky_start=1
function conky_gpu()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then --as this function may use conky_parse("${cpu}")
--#########################################################################################################
--setup timer
local interval=10
local timer=(updates % interval)
if timer==0 or conky_start==1 then
local file = io.popen("aticonfig --adapter=0 --od-gettemperature | grep 'Temperature' | cut --characters 36-38")
local gpuc = file:read("*a")
gpuc = tonumber(gpu)
file:close()
conky_start=nil
end--of timer
--convert C to F
--°C  x  9/5 + 32 = °F
local gpuf=(gpuc*(9/5))+32
--call bar function
conky_gradbar ({5,140,gpuf,159,80,2,10,1,0xFFFFFF,0.25,0x00FF00,1,0xFFFF00,1,0xFF0000,1})
--#########################################################################################################
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
--return gpuf to conky
return gpuf
end-- end main function ###################################################################################


function conky_gradbar(bartab) -- {x=,y=,v="",vmax=,dn=,dw=,dh=,dg=,bc=,ba=,sc=,sa=,mc=,ma=,ec=,ea=} ################

in conkyrc do this in place of ${lua gradbar}

 ${font}GPU Temp${goto 220}${lua gpu}°F

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo