Difference between revisions of "Conky (Italiano)"

From ArchWiki
Jump to: navigation, search
(Conky si sovrappone alle finestre)
(Allineamento alla pagina internazionale)
Line 4: Line 4:
 
{{i18n|Conky}}
 
{{i18n|Conky}}
  
{{out_of_date}}
+
{{translateme}}
{{Attenzione|Questa pagina è in fase di revisione e potrebbe non essere aggiornata. Seguite per ora le istruzioni della versione inglese.}}
+
{{Nota|Questo articolo è in fase di traduzione. Seguite per ora le istruzioni della versione inglese.}}
 +
 
 +
Conky è un monitor di sistema per X. È disponibile per sistemi Gnu/Linux e FreeBSD. ed è un software libero rilasciato con licenza GPL. Conky è in grado di monitorare molte variabili di sistena come CPU, memoria, swap, spazio su disco, temperatura, top, upload, download, messaggi di sistema, e molto altro (tramite script aggiuntivi per es.). É estramamente configurabile, comunque, la configurazione può essere un pò difficile da capire.Conky è un fork di torsmo.
  
==Introduzione==
 
Conky è un monitor di sistema per X. É disponibile per Linux e FreeBSD. É un software rilasciato sotto i termini della licenza BSD. Conky è in grado di monitorare molte variabili di sistena come CPU, memoria, swap, spazio su disco, temperatura, top, upload, download, messaggi di sistema, e molto altro (tramite script aggiuntivi per es.). É estramamente configurabile, comunque, la configurazione può essere un pò difficile da capire.Conky è un fork di torsmo.
 
 
==Installazione & Configurazione==
 
==Installazione & Configurazione==
 
*Conky è fornito dal repo extra di pacman
 
*Conky è fornito dal repo extra di pacman
 
  # pacman -S conky
 
  # pacman -S conky
*Editare il file di configurazione usandone uno di esempio preso dagli [http://conky.sourceforge.net/screenshots.html homeproject-screenshots]
+
*Editare il file di configurazione usando uno di esempio reperibile su [http://conky.sourceforge.net/screenshots.html homeproject-screenshot]
 
  $ nano ~/.conkyrc
 
  $ nano ~/.conkyrc
 +
*Alternatively, you can use the default config at {{Filename|/etc/conky/conky.conf}}:
 +
$ cp /etc/conky/conky.conf ~/.conkyrc
  
==Come prevenire lo sfarfallio==
+
==AUR packages==
Conky necessita del supporto Double Buffer Extension (DBE) dal X server per prevenire lo sfarfallio, perchè non può aggiornarsi abbastanza velocemente senza di esso. Può essere abilitato in /etc/X11/xorg.conf aggiungendo Load "dbe" nella Section "Module". Per abilitare anche in conky il double-buffer controlla di avere in ~/.conkyrc
+
 
 +
In addition to the basic conky package in the repos, there are various [[AUR]] packages available with extra compile options enabled.
 +
 
 +
*Install [http://aur.archlinux.org/packages.php?ID=11884 conky-cli] for conky sans X11 dependencies
 +
*Install [http://aur.archlinux.org/packages.php?ID=19156 conky-nvidia] for nvidia support.
 +
*Install [http://aur.archlinux.org/packages.php?ID=31589 conky-lua] for lua support.
 +
*Install [http://aur.archlinux.org/packages.php?ID=36405 conky-lua-nv] for both lua and nvidia support.
 +
 
 +
==Suggerimenti==
 +
===Abilitare la transparenza vera (KDE4)===
 +
Dalla versione 1.8.0 conky suppporta la transparenza vera. Per abilitarla (e farla funzionare bene con KDE4), aggiungere le seguenti righe a {{Filename|~/.conkyrc}}:
 +
own_window yes
 +
own_window_transparent yes
 +
own_window_argb_visual yes
 +
own_window_type normal
 +
own_window_class conky-semi
 +
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
 +
Si rimpiazzerà così il metodo feh descritto in seguito.
 +
 
 +
===Prevenire lo sfarfallio===
 +
Conky necessita del supporto Double Buffer Extension (DBE) dal X server per prevenire lo sfarfallio, perchè non può aggiornarsi abbastanza velocemente senza di esso. Può essere abilitato tramite {{Filename|/etc/X11/xorg.conf}} dalla riga {{Codeline|Load "dbe"}} in {{Codeline|Section "Module"}}. The xorg.conf file has been replaced (1.8.x patch upwards) by {{Filename|/etc/X11/xorg.conf.d}} which contains the particular configuration files. ''DBE'' is loaded automatically. 
 +
 
 +
To verify:
 +
# grep dbe /var/log/Xorg.0.log
 +
 
 +
Output (should be similar):
 +
# [    86.101] (II) LoadModule: "dbe"
 +
# [    86.101] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
 +
# [    86.111] (II) Module dbe: vendor="X.Org Foundation"
 +
 
 +
To enable double-buffer check to have in {{Filename|~/.conkyrc}}:
 +
# Place below the other options, not below TEXT or XY
 
  double_buffer yes
 
  double_buffer yes
==Integrazione con Kdesktop==
+
 
Conky con la configurazione screenshot di default causa problemi con la visualizzazione delle icone sul desktop. Per evitarlo basta seguire questi semplici passi
+
===Do not minimize on Show Desktop (Compiz)===
*Aggiungere queste righe a ~/.conkyrc
+
If the 'Show Desktop' button or keybinding minimizes conky along with all other windows, fire up compiz config settings manager, go to General Options and uncheck the "Hide Skip Taskbar Windows" option.
 +
 
 +
===Integrazione con KDesktop===
 +
Conky con la configurazione screenshot di default causa problemi con la visualizzazione delle icone sul desktop. Per evitarlo basta seguire questi semplici passi:
 +
*Aggiungere queste righe a {{Filename|~/.conkyrc}}:
 
  own_window yes
 
  own_window yes
 
  own_window_type normal
 
  own_window_type normal
 
  own_window_transparent yes
 
  own_window_transparent yes
  own_window_hints undecorated,below,sticky,skip_taskbar,skip_page
+
  own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
*Controllare di non avere questa impostazione cancellando la linea o commentandola con #
+
*Controllare di non avere questa impostazione cancellando la linea o commentandola
 
  minimum_size
 
  minimum_size
 
*Creare questo link simbolico per avere conky al login
 
*Creare questo link simbolico per avere conky al login
  $ ln -s /usr/bin/conky ~/.kde/Autostart/conkylink
+
  $ ln -s /usr/bin/conky ~/.kde/share/autostart/conkylink
 +
Per KDE4
 +
$ ln -s /usr/bin/conky ~/.kde4/Autostart/conkylink
 
*Installare feh
 
*Installare feh
 
  # pacman -S feh
 
  # pacman -S feh
*creare questo script per avere trasparenza con feh
+
*Creare uno script per abilitare la trasparenza al desktop
  $ nano -w ~/.kde/Autostart/fehconky  
+
Per KDE3
 +
  $ nano -w ~/.kde/share/autostart/fehconky  
  
 
  #!/bin/bash
 
  #!/bin/bash
 
  feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`
 
  feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`
usare --bg-center se l'immagine di sfondo è centrata
+
For KDE4 users
*Renderlo eseguibile
+
$ nano -w ~/.kde4/Autostart/fehconky
  $ chmod +x ~/.kde/Autostart/fehconky
+
 
*Invece di usare uno script potete eventualmente aggiungere queste righe al fondo di .conkyrc
+
#!/bin/bash
 +
feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"
 +
use {{Codeline|--bg-center}} if you use a centered wallpaper.
 +
*Make it executable
 +
  $ chmod +x ~/.kde/share/autostart/fehconky
 +
KDE4
 +
$ chmod +x ~/.kde4/Autostart/fehconky
 +
*Optionally instead using a script you can add the corresponding line to the bottom of {{Filename|.conkyrc}}
 
  $ nano ~/.conkyrc
 
  $ nano ~/.conkyrc
+
Per KDE3
 
  ${exec feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`}
 
  ${exec feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`}
 +
Per KDE4
 +
${exec feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"}
  
==Conky si sovrappone alle finestre==
+
===Display package update information===
Un problema comune è quello di conky che dopo l'avvio risulta non come parte dello sfondo ma va in sovrapposizione alle finetre, per ovviare a questo  è bene aggiungere  nel modo di avvio predefinito la riga
+
*[https://bbs.archlinux.org/viewtopic.php?id=68104 Paconky] - Displays package update information in a user-defined format. The output of this program can be included in Conky with the ${execpi} command.
 +
*[https://bbs.archlinux.org/viewtopic.php?id=53761 Scrolling Notifications] - Prints scrolling update notifications. From the author of Paconky.
 +
*[https://bbs.archlinux.org/viewtopic.php?id=57291 Perl Script] - Simpler and earlier script from the author of Paconky. Prints only the number of packages needing an update.
 +
*[https://bbs.archlinux.org/viewtopic.php?id=37284 Python Script] - Fairly configurable update notification program in Python.
 +
*[https://bbs.archlinux.org/viewtopic.php?pid=483742#p483742 Bash Script] - Bash script for users that have enabled ShowSize.
  
sleep X
+
===Visualizzazione previsioni meteo===
 +
See [http://bbs.archlinux.org/viewtopic.php?id=37381 this thread].
  
prima del comando che lancia conky,dove X è un valore che indica il tempo  che il vostro ambiente grafico impiega ad essere completamente caricato
+
===Visualizzazione feed RSS===
 +
Conky has the ability to display RSS feeds natively without the need for an outside script to run and output into conky. For example, to display the titles of the ten most recent Planet Arch updates and refresh the feed every minute you would put this into your {{Filename|.conkyrc}}:
  
== Riferimenti Esterni ==
+
${rss http://planet.archlinux.org/rss20.xml 1 item_titles 10 }
 +
 
 +
===Visualizzazione ranking Arch Linux su Distrowatch===
 +
See [http://bbs.archlinux.org/viewtopic.php?id=88779 this thread].
 +
 
 +
===Visualizzazione rTorrent===
 +
See [http://bbs.archlinux.org/viewtopic.php?id=67304 this thread].
 +
 
 +
===Visualizzazione numero di email (GMail)===
 +
Create a file named <code>gmail.py</code> in a convenient location (this example uses <code>~/.scripts/</code>) with the following [[Python]] code:
 +
import os
 +
 
 +
#Enter your username and password below within double quotes
 +
# eg. username="username" and password="password"
 +
username="****"
 +
password="****"
 +
com="wget -q -O - https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-certificate"
 +
 +
temp=os.popen(com)
 +
msg=temp.read()
 +
index=msg.find("<fullcount>")
 +
index2=msg.find("</fullcount>")
 +
fc=int(msg[index+11:index2])
 +
 +
if fc==0:
 +
    print "0 new"
 +
else:
 +
    print str(fc)+" new"
 +
 
 +
The above script did not work for me and my Google Apps account. I modified the script below to work with a Google App mail account [[Python]] code:
 +
import os
 +
 
 +
#Enter your domain, username and password below within double quotes
 +
# eg. domain="yourdomain.com", username="username" and password="password"
 +
domain="yourdomain.com"
 +
username="username"
 +
password="password"
 +
com="wget -q -O - https://mail.google.com/a/"+domain+"/feed/atom --http-user="+username+"@"+domain+" --http-password="+password+" --no-check-certificate"
 +
 +
temp=os.popen(com)
 +
msg=temp.read()
 +
index=msg.find("<fullcount>")
 +
index2=msg.find("</fullcount>")
 +
fc=int(msg[index+11:index2])
 +
 +
if fc==0:
 +
    print "0 new"
 +
else:
 +
    print str(fc)+" new"
 +
 
 +
Under Python3, the the above scripts will return an error at the print lines. In order to resolve this, change them to:
 +
if fc==0:
 +
    print ("0 new")
 +
else:
 +
    print (str(fc)+" new")
 +
 
 +
Add the following string to your <code>.conkyrc</code> in order the check your gmail account for new email every five minutes (300 seconds) and display: ''# new''
 +
${execpi 300 python ~/.scripts/gmail.py}
 +
 
 +
Alternatively, you can use [http://www.stunnel.org/ stunnel].
 +
pacman -S stunnel
 +
 
 +
The following configuration is taken from [http://conky.sourceforge.net/faq.html conky's FAQ]
 +
 
 +
Modify /etc/stunnel/stunnel.conf:
 +
# Service-level configuration for TLS server
 +
[imap]
 +
client = yes
 +
accept  = 143
 +
connect = imap.gmail.com:143
 +
protocol = imap
 +
sslVersion = TLSv1
 +
# Service-level configuration for SSL server
 +
[imaps]
 +
client = yes
 +
accept  = 993
 +
connect = imap.gmail.com:993
 +
 
 +
...and start stunnel:
 +
rc.d start stunnel
 +
 
 +
The only thing left is our conkyrc:
 +
imap localhost username * -i 120 -p 993
 +
TEXT
 +
Inbox: ${imap_unseen}/${imap_messages}
 +
 
 +
Here I used * as the password for conky to ask for it at start, but you do not ''have'' to do it.
 +
 
 +
===Visualizzazione nuove email (IMAP + SSL)===
 +
Conky has built in support for IMAP accounts, but does not support SSL. This can be provided using this script from [http://www.unix.com/shell-programming-scripting/115322-perl-conky-gmail-imap-unread-message-count.html this forum post]. This requires the Perl/CPAN Modules Mail::IMAPClient and IO::Socket::SSL which are in the perl-mail-imapclient and perl-io-socket-ssl packages
 +
 
 +
Create a file named imap.pl in a location to be read by conky. In this file add (with the appropriate changes):
 +
#!/usr/bin/perl
 +
 +
# gimap.pl by gxmsgx
 +
# description: get the count of unread messages on imap
 +
 +
use strict;
 +
use Mail::IMAPClient;
 +
use IO::Socket::SSL;
 +
 +
my $username = 'example.username';
 +
my $password = 'password123';
 +
 +
my $socket = IO::Socket::SSL->new(
 +
  PeerAddr => 'imap.server',
 +
  PeerPort => 993
 +
  )
 +
  or die "socket(): $@";
 +
 +
my $client = Mail::IMAPClient->new(
 +
  Socket  => $socket,
 +
  User    => $username,
 +
  Password => $password,
 +
  )
 +
  or die "new(): $@";
 +
 +
if ($client->IsAuthenticated()) {
 +
    my $msgct;
 +
 +
    $client->select("INBOX");
 +
    $msgct = $client->unseen_count||'0';
 +
    print "$msgct\n";
 +
}
 +
 +
$client->logout();
 +
 
 +
Add to .conkyrc:
 +
${execpi 300 ~/.conky/imap.pl}
 +
or wherever you saved the file.
 +
 
 +
Alternatively, you can use stunnel as shown above: [[Conky#How to display the number of new emails (Gmail) in Conky]]
 +
 
 +
== User-contributed configuration examples ==
 +
=== Graysky ===
 +
[[http://img9.imageshack.us/img9/3153/imageffj.jpg Screen shot]]
 +
 
 +
[[https://github.com/graysky2/configs/raw/master/dotfiles/.conkyrc Here]] it is - modify to fit your system.  Optimized for a quad core chip w/ several hdds (although one of them is not connected for this screenshot) and an nvidia graphics card.  You can easily modify this to a dual or single core system with one or whatever number of hdds.
 +
 
 +
==A sample rings script with nvidia support:==
 +
 
 +
<pre>
 +
1 # -- Conky settings -- #
 +
  2 background no
 +
  3 update_interval 1
 +
  4
 +
  5 cpu_avg_samples 2
 +
  6 net_avg_samples 2
 +
  7
 +
  8 override_utf8_locale yes
 +
  9
 +
10 double_buffer yes
 +
11 no_buffers yes
 +
12
 +
13 text_buffer_size 2048
 +
14 imlib_cache_size 0
 +
15
 +
16 # -- Window specifications -- #
 +
17
 +
18 own_window yes
 +
19 own_window_type normal
 +
20 own_window_transparent yes
 +
21 own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
 +
22
 +
23 border_inner_margin 0
 +
24 border_outer_margin 0
 +
25
 +
26 minimum_size 320 800
 +
27 maximum_width 320
 +
28
 +
29 alignment bottom_right
 +
30 gap_x 0
 +
31 gap_y 0
 +
32
 +
33 # -- Graphics settings -- #
 +
34 draw_shades no
 +
35 draw_outline no
 +
36 draw_borders no
 +
37 draw_graph_borders yes
 +
38
 +
39 # -- Text settings -- #
 +
40 use_xft yes
 +
41 xftfont MaiandraGD:size=24
 +
42 xftalpha 0.4
 +
43
 +
44 uppercase no
 +
45
 +
46 default_color 888888
 +
47
 +
48 # -- Lua Load -- #
 +
49 lua_load ~/conky/lua/lua.lua
 +
50 lua_draw_hook_pre ring_stats
 +
51
 +
52 TEXT
 +
53 ${alignr}${voffset 53}${goto 90}${font MaiandraGD:size=11}${time %A, %d %B %Y}
 +
54
 +
55
 +
56 ${voffset 5}${goto 164}${font MaiandraGD:size=16}${time %H:%M}
 +
57
 +
58
 +
59
 +
60 ${voffset -40}${goto 100}${font MaiandraGD:size=9}Kernel:${offset 70}Uptime:
 +
61 ${goto 90}${font MaiandraGD:size=9}$kernel${offset 40}$uptime
 +
62 ${voffset 57}${goto 117}${font snap:size=8}${cpu cpu0}%
 +
63 ${goto 117}${cpu cpu1}%
 +
64 ${goto 117}CPU
 +
65 ${voffset 19}${goto 145}${memperc}%
 +
66 ${goto 145}$swapperc%
 +
67 ${goto 145}MEM
 +
68 ${voffset 25}${goto 170}${nvidia gpufreq}
 +
69 ${goto 170}${nvidia memfreq}
 +
70 ${goto 170}GPU
 +
71 ${voffset 27}${goto 198}${totaldown ppp0}
 +
72 ${goto 198}${totalup ppp0}
 +
73 ${goto 205}NET
 +
74 ${voffset 21}
 +
75 ${goto 222}${fs_used /home}
 +
76 ${goto 230}DISK
 +
 
 +
</pre>
 +
*And the required lua.lua script:
 +
 
 +
<pre>
 +
1 --[[
 +
  2 Ring Meters by londonali1010 (2009)
 +
  3 
 +
  4 This script draws percentage meters as rings. It is fully customisable; all options are described in the script.
 +
  5 
 +
  6 IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if s    tatement on line 145 uses a delay to make sure that this does not happen. It calculates the length of the delay by the number of updat    es since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if state    ment (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0    .5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise    the update_num will not be reset and you will get an error.
 +
  7 
 +
  8 To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
 +
  9        lua_load ~/scripts/rings-v1.2.1.lua
 +
10        lua_draw_hook_pre ring_stats
 +
11 
 +
12 Changelog:
 +
13 + v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009)
 +
14 + v1.2 -- Added option for the ending angle of the rings (07.10.2009)
 +
15 + v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numer    ical value rather than a percentage (29.09.2009)
 +
16 + v1.0 -- Original release (28.09.2009)
 +
17 ]]
 +
18
 +
19 settings_table = {
 +
20        {
 +
21                -- Edit this table to customise your rings.
 +
22                -- You can create more rings simply by adding more elements to settings_table.
 +
23                -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
 +
24                name='time',
 +
25                -- "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 ''.
 +
26                arg='%I.%M',
 +
27                -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
 +
28                max=12,
 +
29                -- "bg_colour" is the colour of the base ring.
 +
30                bg_colour=0x888888,
 +
31                -- "bg_alpha" is the alpha value of the base ring.
 +
32                bg_alpha=0.3,
 +
33                -- "fg_colour" is the colour of the indicator part of the ring.
 +
34                fg_colour=0x888888,
 +
35                -- "fg_alpha" is the alpha value of the indicator part of the ring.
 +
36                fg_alpha=0.5,
 +
37                -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky wi    ndow.
 +
38                x=191, y=145,
 +
39                -- "radius" is the radius of the ring.
 +
40                radius=32,
 +
41                -- "thickness" is the thickness of the ring, centred around the radius.
 +
42                thickness=4,
 +
43                -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or n    egative.
 +
44                start_angle=0,
 +
45                -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negat    ive, but must be larger (e.g. more clockwise) than start_angle.
 +
46                end_angle=360
 +
47        },
 +
48        {
 +
49                name='time',
 +
50                arg='%M.%S',
 +
51                max=60,
 +
52                bg_colour=0x888888,
 +
53                bg_alpha=0.3,
 +
54                fg_colour=0x888888,
 +
55                fg_alpha=0.5,
 +
56                x=191, y=145,
 +
57                radius=37,
 +
58                thickness=4,
 +
59                start_angle=0,
 +
60                end_angle=360
 +
61        },
 +
62        {
 +
63                name='time',
 +
64                arg='%S',
 +
65                max=60,
 +
66                bg_colour=0x888888,
 +
67                bg_alpha=0.3,
 +
68                fg_colour=0x888888,
 +
69                fg_alpha=0.5,
 +
70                x=191, y=145,
 +
71                radius=42,
 +
72                thickness=4,
 +
73                start_angle=0,
 +
74                end_angle=360
 +
75        },
 +
76        {
 +
77                name='cpu',
 +
78                arg='cpu0',
 +
79                max=100,
 +
80                bg_colour=0x888888,
 +
81                bg_alpha=0.3,
 +
82                fg_colour=0x888888,
 +
83                fg_alpha=0.5,
 +
84                x=140, y=300,
 +
85                radius=26,
 +
86                thickness=5,
 +
87                start_angle=-90,
 +
88                end_angle=180
 +
89        },
 +
90        {
 +
91                name='cpu',
 +
92                arg='cpu1',
 +
93                max=100,
 +
94                bg_colour=0x888888,
 +
95                bg_alpha=0.3,
 +
96                fg_colour=0x888888,
 +
97                fg_alpha=0.5,
 +
98                x=140, y=300,
 +
99                radius=20,
 +
100                thickness=5,
 +
101                start_angle=-90,
 +
102                end_angle=180
 +
103        },
 +
104        {
 +
105                name='memperc',
 +
106                arg='',
 +
107                max=100,
 +
108                bg_colour=0x888888,
 +
109                bg_alpha=0.3,
 +
110                fg_colour=0x888888,
 +
111                fg_alpha=0.5,
 +
112                x=170, y=350,
 +
113                radius=26,
 +
114                thickness=5,
 +
115                start_angle=-90,
 +
116                end_angle=180
 +
117        },
 +
118        {
 +
119                name='swapperc',
 +
120                arg='',
 +
121                max=100,
 +
122                bg_colour=0x888888,
 +
123                bg_alpha=0.3,
 +
124                fg_colour=0x888888,
 +
125                fg_alpha=0.5,
 +
126                x=170, y=350,
 +
127                radius=20,
 +
128                thickness=5,
 +
129                start_angle=-90,
 +
130                end_angle=180
 +
131        },
 +
132        {
 +
133                name='time',
 +
134                arg='%d',
 +
135                max=31,
 +
136                bg_colour=0x888888,
 +
137                bg_alpha=0.3,
 +
138                fg_colour=0x888888,
 +
139                fg_alpha=0.5,
 +
140                x=191, y=145,
 +
141                radius=50,
 +
142                thickness=5,
 +
143                start_angle=-140,
 +
144                end_angle=-30
 +
145        },
 +
146        {
 +
147                name='time',
 +
148                arg='%m',
 +
149                max=12,
 +
150                bg_colour=0x888888,
 +
151                bg_alpha=0.3,
 +
152                fg_colour=0x888888,
 +
153                fg_alpha=0.5,
 +
154                x=191, y=145,
 +
155                radius=50,
 +
156                thickness=5,
 +
157                start_angle=30,
 +
158                end_angle=140
 +
159        },
 +
160 --      {
 +
161 --              name='fs_used_perc',
 +
162 --              arg='/',
 +
163 --              max=100,
 +
164 --              bg_colour=0x888888,
 +
165 --              bg_alpha=0.3,
 +
166 --              fg_colour=0x888888,
 +
167 --              fg_alpha=0.5,
 +
168 --              x=260, y=503,
 +
169 --              radius=26,
 +
170 --              thickness=5,
 +
171 --              start_angle=-90,
 +
172 --              end_angle=180
 +
173 --      },
 +
174        {
 +
175                name='fs_used_perc',
 +
176                arg='/home',
 +
177                max=100,
 +
178                bg_colour=0x888888,
 +
179                bg_alpha=0.3,
 +
180                fg_colour=0x888888,
 +
181                fg_alpha=0.5,
 +
182                x=260, y=503,
 +
183                radius=20,
 +
184                thickness=5,
 +
185                start_angle=-90,
 +
186                end_angle=180
 +
187        },
 +
188        {
 +
189                name='totalup',
 +
190                arg='ppp0',
 +
191                max=2,
 +
192                bg_colour=0x888888,
 +
193                bg_alpha=0.3,
 +
194                fg_colour=0x888888,
 +
195                fg_alpha=0.5,
 +
196                x=230, y=452,
 +
197                radius=20,
 +
198                thickness=5,
 +
199                start_angle=-90,
 +
200                end_angle=180
 +
201        },
 +
202        {
 +
203                name='totaldown',
 +
204                arg='ppp0',
 +
205                max=2,
 +
206                bg_colour=0x888888,
 +
207                bg_alpha=0.3,
 +
208                fg_colour=0x888888,
 +
209                fg_alpha=0.5,
 +
210                x=230, y=452,
 +
211                radius=26,
 +
212                thickness=5,
 +
213                start_angle=-90,
 +
214                end_angle=180
 +
215        },
 +
216        {
 +
217                name='nvidia',
 +
218                arg='gpufreq',
 +
219                max=475,
 +
220                bg_colour=0x888888,
 +
221                bg_alpha=0.3,
 +
222                fg_colour=0x888888,
 +
223                fg_alpha=0.5,
 +
224                x=200, y=401,
 +
225                radius=26,
 +
226                thickness=5,
 +
227                start_angle=-90,
 +
228                end_angle=180
 +
229        },
 +
230 {
 +
231                name='nvidia',
 +
232                arg='memfreq',
 +
233                max=700,
 +
234                bg_colour=0x888888,
 +
235                bg_alpha=0.3,
 +
236                fg_colour=0x888888,
 +
237                fg_alpha=0.5,
 +
238                x=200, y=401,
 +
239                radius=20,
 +
240                thickness=5,
 +
241                start_angle=-90,
 +
242                end_angle=180
 +
243        },
 +
244 }
 +
245
 +
246 require 'cairo'
 +
247
 +
248 function rgb_to_r_g_b(colour,alpha)
 +
249        return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
 +
250 end
 +
251
 +
252 function draw_ring(cr,t,pt)
 +
253        local w,h=conky_window.width,conky_window.height
 +
254
 +
255        local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
 +
256        local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
 +
257
 +
258        local angle_0=sa*(2*math.pi/360)-math.pi/2
 +
259        local angle_f=ea*(2*math.pi/360)-math.pi/2
 +
260        local t_arc=t*(angle_f-angle_0)
 +
261
 +
262        -- Draw background ring
 +
263
 +
264        cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
 +
265        cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
 +
266        cairo_set_line_width(cr,ring_w)
 +
267        cairo_stroke(cr)
 +
268
 +
269        -- Draw indicator ring
 +
270
 +
271        cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
 +
272        cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
 +
273        cairo_stroke(cr)
 +
274 end
 +
275
 +
276 function conky_ring_stats()
 +
277        local function setup_rings(cr,pt)
 +
278                local str=''
 +
279                local value=0
 +
280
 +
281                str=string.format('${%s %s}',pt['name'],pt['arg'])
 +
282                str=conky_parse(str)
 +
283
 +
284                value=tonumber(str)
 +
285                if value == nil then value = 0 end
 +
286                pct=value/pt['max']
 +
287
 +
288                draw_ring(cr,pct,p<nowiki><nowiki>Insert non-formatted text here</nowiki>'''Bold text'''</nowiki>t)
 +
289        end
 +
290
 +
291        if conky_window==nil then return end
 +
292        local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_w    indow.height)
 +
293
 +
294        local cr=cairo_create(cs)
 +
295
 +
296        local updates=conky_parse('${updates}')
 +
297        update_num=tonumber(updates)
 +
298
 +
299        if update_num>5 then
 +
300                for i in pairs(settings_table) do
 +
301                        setup_rings(cr,settings_table[i])
 +
302                end
 +
303        end
 +
304 end
 +
~             
 +
</pre>
 +
== A note about symbolic fonts ==
 +
 
 +
Many of the more decorated .conkyrc's use the fonts PizzaDude Bullets and Pie Charts for Maps. They are available from the AUR as 'ttf-pizzadude-bullets' and 'ttf-piechartsformaps' respectively, or they can be found and downloaded with a quick search and manually installed using the instructions in [[Fonts]].
 +
 
 +
== Universal method to enable true transparency ==
 +
 
 +
Transparency is a strange beast in Conky, but there is a way to universally apply true transparency with any environment or window manager by using xcompmgr and transset-df. Install xcompmgr from [extra] and transset-df from [community] with {{Codeline|pacman -Sy xcompmgr transset-df}}. These packages both have the same 3 dependencies, so this is the lightest method for composition available, for those of you using standalone window managers in order to achieve the leanest setup you can manage (or whatever reason you have :D)
 +
 
 +
NOTE: This may conflict with any other compositing manager you are already using.
 +
 
 +
Check xcompmgr documentation to help you decide which compositing options you would like to enable. The following is a common standard command.
 +
 
 +
<pre>
 +
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &
 +
</pre>
 +
 
 +
Make sure conky is running with {{Codeline|conky &}}. Use transset-df to enable transparency on the Conky window. Set '.5' to any value in the range 0 - 1.
 +
 
 +
<pre>
 +
transset-df .5 -n Conky
 +
</pre>
 +
 
 +
This should give your conky window true transparency. If you get an error like,
 +
{{Command|name=transset-df .5 -n Conky|output=No Window matching Conky exists!}}
 +
Verify that conky is running, and use xprop and click on the conky window to find the name you should pass to {{Codeline|transset-df}}.
 +
{{Command|name=xprop &#124; grep WM_NAME|output=WM_NAME(STRING) = "Conky (ArchitectLinux)"}}
 +
 
 +
In this case, "Conky" is right, but for you it may be different, so be sure to use your output instead. If ~/.conkyrc has {{Codeline|own_window_type panel}} then this xprop invocation may show now output. Try using any of the following options instead. {{Codeline|own_window_type {dock,normal,override,desktop}}}
 +
 
 +
Use this in ~/.xinitrc to have transparent conky run when you {{Codeline|startx}}.
 +
 
 +
<pre>
 +
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &
 +
conky -d; sleep 1 && transset-df .5 -n Conky
 +
</pre>
 +
 
 +
== External links ==
 +
*[http://bbs.archlinux.org/viewtopic.php?id=39906 Conky Configs on arch forums]
 
*[http://conky.sourceforge.net/ Official website]
 
*[http://conky.sourceforge.net/ Official website]
 
*[http://freshmeat.net/projects/conky/ Conky] on [[wikipedia:Freshmeat|Freshmeat]]
 
*[http://freshmeat.net/projects/conky/ Conky] on [[wikipedia:Freshmeat|Freshmeat]]
 
*[http://sourceforge.net/projects/conky/ Conky] on [[wikipedia:sourceforge.net|SourceForge]]
 
*[http://sourceforge.net/projects/conky/ Conky] on [[wikipedia:sourceforge.net|SourceForge]]
*[irc://chat.freenode.org/conky #conky] IRC chat channel on [[wikipedia:freenode|freenode]]
+
*[irc://chat.freenode.org/conky #conky] IRC chat channel on [[wikipedia:Freenode|freenode]]
*[http://novel.evilcoder.org/wiki/index.php/ConkyFAQ FAQ]
+
*[http://novel.evilcoder.org/wiki/index.php?title=ConkyFAQ&oldid=12463 FAQ]
 
+
[[User:Wolfanger|Wolfanger]] 03:12, 9 January 2008 (EST)
+

Revision as of 18:27, 7 September 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Tango-preferences-desktop-locale.pngThis article or section needs to be translated.Tango-preferences-desktop-locale.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Conky (Italiano)#)
Nota: Questo articolo è in fase di traduzione. Seguite per ora le istruzioni della versione inglese.

Conky è un monitor di sistema per X. È disponibile per sistemi Gnu/Linux e FreeBSD. ed è un software libero rilasciato con licenza GPL. Conky è in grado di monitorare molte variabili di sistena come CPU, memoria, swap, spazio su disco, temperatura, top, upload, download, messaggi di sistema, e molto altro (tramite script aggiuntivi per es.). É estramamente configurabile, comunque, la configurazione può essere un pò difficile da capire.Conky è un fork di torsmo.

Installazione & Configurazione

  • Conky è fornito dal repo extra di pacman
# pacman -S conky
$ nano ~/.conkyrc
$ cp /etc/conky/conky.conf ~/.conkyrc

AUR packages

In addition to the basic conky package in the repos, there are various AUR packages available with extra compile options enabled.

Suggerimenti

Abilitare la transparenza vera (KDE4)

Dalla versione 1.8.0 conky suppporta la transparenza vera. Per abilitarla (e farla funzionare bene con KDE4), aggiungere le seguenti righe a Template:Filename:

own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_class conky-semi
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

Si rimpiazzerà così il metodo feh descritto in seguito.

Prevenire lo sfarfallio

Conky necessita del supporto Double Buffer Extension (DBE) dal X server per prevenire lo sfarfallio, perchè non può aggiornarsi abbastanza velocemente senza di esso. Può essere abilitato tramite Template:Filename dalla riga Template:Codeline in Template:Codeline. The xorg.conf file has been replaced (1.8.x patch upwards) by Template:Filename which contains the particular configuration files. DBE is loaded automatically.

To verify:

# grep dbe /var/log/Xorg.0.log

Output (should be similar):

# [    86.101] (II) LoadModule: "dbe"
# [    86.101] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
# [    86.111] (II) Module dbe: vendor="X.Org Foundation"

To enable double-buffer check to have in Template:Filename:

# Place below the other options, not below TEXT or XY
double_buffer yes

Do not minimize on Show Desktop (Compiz)

If the 'Show Desktop' button or keybinding minimizes conky along with all other windows, fire up compiz config settings manager, go to General Options and uncheck the "Hide Skip Taskbar Windows" option.

Integrazione con KDesktop

Conky con la configurazione screenshot di default causa problemi con la visualizzazione delle icone sul desktop. Per evitarlo basta seguire questi semplici passi:

own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
  • Controllare di non avere questa impostazione cancellando la linea o commentandola
minimum_size
  • Creare questo link simbolico per avere conky al login
$ ln -s /usr/bin/conky ~/.kde/share/autostart/conkylink

Per KDE4

$ ln -s /usr/bin/conky ~/.kde4/Autostart/conkylink
  • Installare feh
# pacman -S feh
  • Creare uno script per abilitare la trasparenza al desktop

Per KDE3

$ nano -w ~/.kde/share/autostart/fehconky 
#!/bin/bash
feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`

For KDE4 users

$ nano -w ~/.kde4/Autostart/fehconky
#!/bin/bash
feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"

use Template:Codeline if you use a centered wallpaper.

  • Make it executable
$ chmod +x ~/.kde/share/autostart/fehconky

KDE4

$ chmod +x ~/.kde4/Autostart/fehconky
  • Optionally instead using a script you can add the corresponding line to the bottom of Template:Filename
$ nano ~/.conkyrc

Per KDE3

${exec feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`}

Per KDE4

${exec feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"}

Display package update information

  • Paconky - Displays package update information in a user-defined format. The output of this program can be included in Conky with the ${execpi} command.
  • Scrolling Notifications - Prints scrolling update notifications. From the author of Paconky.
  • Perl Script - Simpler and earlier script from the author of Paconky. Prints only the number of packages needing an update.
  • Python Script - Fairly configurable update notification program in Python.
  • Bash Script - Bash script for users that have enabled ShowSize.

Visualizzazione previsioni meteo

See this thread.

Visualizzazione feed RSS

Conky has the ability to display RSS feeds natively without the need for an outside script to run and output into conky. For example, to display the titles of the ten most recent Planet Arch updates and refresh the feed every minute you would put this into your Template:Filename:

${rss http://planet.archlinux.org/rss20.xml 1 item_titles 10 }

Visualizzazione ranking Arch Linux su Distrowatch

See this thread.

Visualizzazione rTorrent

See this thread.

Visualizzazione numero di email (GMail)

Create a file named gmail.py in a convenient location (this example uses ~/.scripts/) with the following Python code:

import os
 
#Enter your username and password below within double quotes
# eg. username="username" and password="password"
username="****"
password="****"
com="wget -q -O - https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-certificate"

temp=os.popen(com)
msg=temp.read()
index=msg.find("<fullcount>")
index2=msg.find("</fullcount>")
fc=int(msg[index+11:index2])

if fc==0:
   print "0 new"
else:
   print str(fc)+" new"

The above script did not work for me and my Google Apps account. I modified the script below to work with a Google App mail account Python code:

import os
 
#Enter your domain, username and password below within double quotes
# eg. domain="yourdomain.com", username="username" and password="password"
domain="yourdomain.com"
username="username"
password="password"
com="wget -q -O - https://mail.google.com/a/"+domain+"/feed/atom --http-user="+username+"@"+domain+" --http-password="+password+" --no-check-certificate"

temp=os.popen(com)
msg=temp.read()
index=msg.find("<fullcount>")
index2=msg.find("</fullcount>")
fc=int(msg[index+11:index2])

if fc==0:
   print "0 new"
else:
   print str(fc)+" new"

Under Python3, the the above scripts will return an error at the print lines. In order to resolve this, change them to:

if fc==0:
   print ("0 new")
else:
   print (str(fc)+" new")

Add the following string to your .conkyrc in order the check your gmail account for new email every five minutes (300 seconds) and display: # new

${execpi 300 python ~/.scripts/gmail.py}

Alternatively, you can use stunnel.

pacman -S stunnel

The following configuration is taken from conky's FAQ

Modify /etc/stunnel/stunnel.conf:

# Service-level configuration for TLS server
[imap]
client = yes
accept  = 143
connect = imap.gmail.com:143
protocol = imap
sslVersion = TLSv1
# Service-level configuration for SSL server
[imaps]
client = yes
accept  = 993
connect = imap.gmail.com:993

...and start stunnel:

rc.d start stunnel

The only thing left is our conkyrc:

imap localhost username * -i 120 -p 993
TEXT
Inbox: ${imap_unseen}/${imap_messages}

Here I used * as the password for conky to ask for it at start, but you do not have to do it.

Visualizzazione nuove email (IMAP + SSL)

Conky has built in support for IMAP accounts, but does not support SSL. This can be provided using this script from this forum post. This requires the Perl/CPAN Modules Mail::IMAPClient and IO::Socket::SSL which are in the perl-mail-imapclient and perl-io-socket-ssl packages

Create a file named imap.pl in a location to be read by conky. In this file add (with the appropriate changes):

#!/usr/bin/perl

# gimap.pl by gxmsgx
# description: get the count of unread messages on imap

use strict;
use Mail::IMAPClient;
use IO::Socket::SSL;

my $username = 'example.username'; 
my $password = 'password123'; 

my $socket = IO::Socket::SSL->new(
  PeerAddr => 'imap.server',
  PeerPort => 993
 )
 or die "socket(): $@";

my $client = Mail::IMAPClient->new(
  Socket   => $socket,
  User     => $username,
  Password => $password,
 )
 or die "new(): $@";

if ($client->IsAuthenticated()) {
   my $msgct;

   $client->select("INBOX");
   $msgct = $client->unseen_count||'0';
   print "$msgct\n";
}

$client->logout();

Add to .conkyrc:

${execpi 300 ~/.conky/imap.pl} 

or wherever you saved the file.

Alternatively, you can use stunnel as shown above: Conky#How to display the number of new emails (Gmail) in Conky

User-contributed configuration examples

Graysky

[Screen shot]

[Here] it is - modify to fit your system. Optimized for a quad core chip w/ several hdds (although one of them is not connected for this screenshot) and an nvidia graphics card. You can easily modify this to a dual or single core system with one or whatever number of hdds.

A sample rings script with nvidia support:

 1 # -- Conky settings -- #
  2 background no
  3 update_interval 1
  4 
  5 cpu_avg_samples 2
  6 net_avg_samples 2
  7 
  8 override_utf8_locale yes
  9 
 10 double_buffer yes
 11 no_buffers yes
 12 
 13 text_buffer_size 2048
 14 imlib_cache_size 0
 15 
 16 # -- Window specifications -- #
 17 
 18 own_window yes
 19 own_window_type normal
 20 own_window_transparent yes
 21 own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
 22 
 23 border_inner_margin 0
 24 border_outer_margin 0
 25 
 26 minimum_size 320 800
 27 maximum_width 320
 28 
 29 alignment bottom_right
 30 gap_x 0
 31 gap_y 0
 32 
 33 # -- Graphics settings -- #
 34 draw_shades no
 35 draw_outline no
 36 draw_borders no
 37 draw_graph_borders yes
 38 
 39 # -- Text settings -- #
 40 use_xft yes
 41 xftfont MaiandraGD:size=24
 42 xftalpha 0.4
 43 
 44 uppercase no
 45 
 46 default_color 888888
 47 
 48 # -- Lua Load -- #
 49 lua_load ~/conky/lua/lua.lua
 50 lua_draw_hook_pre ring_stats
 51 
 52 TEXT
 53 ${alignr}${voffset 53}${goto 90}${font MaiandraGD:size=11}${time %A, %d %B %Y}
 54 
 55 
 56 ${voffset 5}${goto 164}${font MaiandraGD:size=16}${time %H:%M}
 57 
 58 
 59 
 60 ${voffset -40}${goto 100}${font MaiandraGD:size=9}Kernel:${offset 70}Uptime:
 61 ${goto 90}${font MaiandraGD:size=9}$kernel${offset 40}$uptime
 62 ${voffset 57}${goto 117}${font snap:size=8}${cpu cpu0}%
 63 ${goto 117}${cpu cpu1}%
 64 ${goto 117}CPU
 65 ${voffset 19}${goto 145}${memperc}%
 66 ${goto 145}$swapperc%
 67 ${goto 145}MEM
 68 ${voffset 25}${goto 170}${nvidia gpufreq}
 69 ${goto 170}${nvidia memfreq}
 70 ${goto 170}GPU
 71 ${voffset 27}${goto 198}${totaldown ppp0}
 72 ${goto 198}${totalup ppp0}
 73 ${goto 205}NET
 74 ${voffset 21}
 75 ${goto 222}${fs_used /home}
 76 ${goto 230}DISK

  • And the required lua.lua script:
 1 --[[
  2 Ring Meters by londonali1010 (2009)
  3  
  4 This script draws percentage meters as rings. It is fully customisable; all options are described in the script.
  5  
  6 IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if s    tatement on line 145 uses a delay to make sure that this does not happen. It calculates the length of the delay by the number of updat    es since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if state    ment (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0    .5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise     the update_num will not be reset and you will get an error.
  7  
  8 To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
  9         lua_load ~/scripts/rings-v1.2.1.lua
 10         lua_draw_hook_pre ring_stats
 11  
 12 Changelog:
 13 + v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009)
 14 + v1.2 -- Added option for the ending angle of the rings (07.10.2009)
 15 + v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numer    ical value rather than a percentage (29.09.2009)
 16 + v1.0 -- Original release (28.09.2009)
 17 ]]
 18 
 19 settings_table = {
 20         {
 21                 -- Edit this table to customise your rings.
 22                 -- You can create more rings simply by adding more elements to settings_table.
 23                 -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
 24                 name='time',
 25                 -- "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 ''.
 26                 arg='%I.%M',
 27                 -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
 28                 max=12,
 29                 -- "bg_colour" is the colour of the base ring.
 30                 bg_colour=0x888888,
 31                 -- "bg_alpha" is the alpha value of the base ring.
 32                 bg_alpha=0.3,
 33                 -- "fg_colour" is the colour of the indicator part of the ring.
 34                 fg_colour=0x888888,
 35                 -- "fg_alpha" is the alpha value of the indicator part of the ring.
 36                 fg_alpha=0.5,
 37                 -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky wi    ndow.
 38                 x=191, y=145,
 39                 -- "radius" is the radius of the ring.
 40                 radius=32,
 41                 -- "thickness" is the thickness of the ring, centred around the radius.
 42                 thickness=4,
 43                 -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or n    egative.
 44                 start_angle=0,
 45                 -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negat    ive, but must be larger (e.g. more clockwise) than start_angle.
 46                 end_angle=360
 47         },
 48         {
 49                 name='time',
 50                 arg='%M.%S',
 51                 max=60,
 52                 bg_colour=0x888888,
 53                 bg_alpha=0.3,
 54                 fg_colour=0x888888,
 55                 fg_alpha=0.5,
 56                 x=191, y=145,
 57                 radius=37,
 58                 thickness=4,
 59                 start_angle=0,
 60                 end_angle=360
 61         },
 62         {
 63                 name='time',
 64                 arg='%S',
 65                 max=60,
 66                 bg_colour=0x888888,
 67                 bg_alpha=0.3,
 68                 fg_colour=0x888888,
 69                 fg_alpha=0.5,
 70                 x=191, y=145,
 71                 radius=42,
 72                 thickness=4,
 73                 start_angle=0,
 74                 end_angle=360
 75         },
 76         {
 77                 name='cpu',
 78                 arg='cpu0',
 79                 max=100,
 80                 bg_colour=0x888888,
 81                 bg_alpha=0.3,
 82                 fg_colour=0x888888,
 83                 fg_alpha=0.5,
 84                 x=140, y=300,
 85                 radius=26,
 86                 thickness=5,
 87                 start_angle=-90,
 88                 end_angle=180
 89         },
 90         {
 91                 name='cpu',
 92                 arg='cpu1',
 93                 max=100,
 94                 bg_colour=0x888888,
 95                 bg_alpha=0.3,
 96                 fg_colour=0x888888,
 97                 fg_alpha=0.5,
 98                 x=140, y=300,
 99                 radius=20,
100                 thickness=5,
101                 start_angle=-90,
102                 end_angle=180
103         },
104         {
105                 name='memperc',
106                 arg='',
107                 max=100,
108                 bg_colour=0x888888,
109                 bg_alpha=0.3,
110                 fg_colour=0x888888,
111                 fg_alpha=0.5,
112                 x=170, y=350,
113                 radius=26,
114                 thickness=5,
115                 start_angle=-90,
116                 end_angle=180
117         },
118         {
119                 name='swapperc',
120                 arg='',
121                 max=100,
122                 bg_colour=0x888888,
123                 bg_alpha=0.3,
124                 fg_colour=0x888888,
125                 fg_alpha=0.5,
126                 x=170, y=350,
127                 radius=20,
128                 thickness=5,
129                 start_angle=-90,
130                 end_angle=180
131         },
132         {
133                 name='time',
134                 arg='%d',
135                 max=31,
136                 bg_colour=0x888888,
137                 bg_alpha=0.3,
138                 fg_colour=0x888888,
139                 fg_alpha=0.5,
140                 x=191, y=145,
141                 radius=50,
142                 thickness=5,
143                 start_angle=-140,
144                 end_angle=-30
145         },
146         {
147                 name='time',
148                 arg='%m',
149                 max=12,
150                 bg_colour=0x888888,
151                 bg_alpha=0.3,
152                 fg_colour=0x888888,
153                 fg_alpha=0.5,
154                 x=191, y=145,
155                 radius=50,
156                 thickness=5,
157                 start_angle=30,
158                 end_angle=140
159         },
160 --      {
161 --              name='fs_used_perc',
162 --              arg='/',
163 --              max=100,
164 --              bg_colour=0x888888,
165 --              bg_alpha=0.3,
166 --              fg_colour=0x888888,
167 --              fg_alpha=0.5,
168 --              x=260, y=503,
169 --              radius=26,
170 --              thickness=5,
171 --              start_angle=-90,
172 --              end_angle=180
173 --      },
174         {
175                 name='fs_used_perc',
176                 arg='/home',
177                 max=100,
178                 bg_colour=0x888888,
179                 bg_alpha=0.3,
180                 fg_colour=0x888888,
181                 fg_alpha=0.5,
182                 x=260, y=503,
183                 radius=20,
184                 thickness=5,
185                 start_angle=-90,
186                 end_angle=180
187         },
188         {
189                 name='totalup',
190                 arg='ppp0',
191                 max=2,
192                 bg_colour=0x888888,
193                 bg_alpha=0.3,
194                 fg_colour=0x888888,
195                 fg_alpha=0.5,
196                 x=230, y=452,
197                 radius=20,
198                 thickness=5,
199                 start_angle=-90,
200                 end_angle=180
201         },
202         {
203                 name='totaldown',
204                 arg='ppp0',
205                 max=2,
206                 bg_colour=0x888888,
207                 bg_alpha=0.3,
208                 fg_colour=0x888888,
209                 fg_alpha=0.5,
210                 x=230, y=452,
211                 radius=26,
212                 thickness=5,
213                 start_angle=-90,
214                 end_angle=180
215         },
216         {
217                 name='nvidia',
218                 arg='gpufreq',
219                 max=475,
220                 bg_colour=0x888888,
221                 bg_alpha=0.3,
222                 fg_colour=0x888888,
223                 fg_alpha=0.5,
224                 x=200, y=401,
225                 radius=26,
226                 thickness=5,
227                 start_angle=-90,
228                 end_angle=180
229         },
230 {
231                 name='nvidia',
232                 arg='memfreq',
233                 max=700,
234                 bg_colour=0x888888,
235                 bg_alpha=0.3,
236                 fg_colour=0x888888,
237                 fg_alpha=0.5,
238                 x=200, y=401,
239                 radius=20,
240                 thickness=5,
241                 start_angle=-90,
242                 end_angle=180
243         },
244 }
245 
246 require 'cairo'
247 
248 function rgb_to_r_g_b(colour,alpha)
249         return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
250 end
251 
252 function draw_ring(cr,t,pt)
253         local w,h=conky_window.width,conky_window.height
254 
255         local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
256         local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
257 
258         local angle_0=sa*(2*math.pi/360)-math.pi/2
259         local angle_f=ea*(2*math.pi/360)-math.pi/2
260         local t_arc=t*(angle_f-angle_0)
261 
262         -- Draw background ring
263 
264         cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
265         cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
266         cairo_set_line_width(cr,ring_w)
267         cairo_stroke(cr)
268 
269         -- Draw indicator ring
270 
271         cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
272         cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
273         cairo_stroke(cr)
274 end
275 
276 function conky_ring_stats()
277         local function setup_rings(cr,pt)
278                 local str=''
279                 local value=0
280 
281                 str=string.format('${%s %s}',pt['name'],pt['arg'])
282                 str=conky_parse(str)
283 
284                 value=tonumber(str)
285                 if value == nil then value = 0 end
286                 pct=value/pt['max']
287 
288                 draw_ring(cr,pct,p<nowiki>Insert non-formatted text here'''Bold text'''</nowiki>t)
289         end
290 
291         if conky_window==nil then return end
292         local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_w    indow.height)
293 
294         local cr=cairo_create(cs)
295 
296         local updates=conky_parse('${updates}')
297         update_num=tonumber(updates)
298 
299         if update_num>5 then
300                 for i in pairs(settings_table) do
301                         setup_rings(cr,settings_table[i])
302                 end
303         end
304 end
~               

A note about symbolic fonts

Many of the more decorated .conkyrc's use the fonts PizzaDude Bullets and Pie Charts for Maps. They are available from the AUR as 'ttf-pizzadude-bullets' and 'ttf-piechartsformaps' respectively, or they can be found and downloaded with a quick search and manually installed using the instructions in Fonts.

Universal method to enable true transparency

Transparency is a strange beast in Conky, but there is a way to universally apply true transparency with any environment or window manager by using xcompmgr and transset-df. Install xcompmgr from [extra] and transset-df from [community] with Template:Codeline. These packages both have the same 3 dependencies, so this is the lightest method for composition available, for those of you using standalone window managers in order to achieve the leanest setup you can manage (or whatever reason you have :D)

NOTE: This may conflict with any other compositing manager you are already using.

Check xcompmgr documentation to help you decide which compositing options you would like to enable. The following is a common standard command.

xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &

Make sure conky is running with Template:Codeline. Use transset-df to enable transparency on the Conky window. Set '.5' to any value in the range 0 - 1.

transset-df .5 -n Conky

This should give your conky window true transparency. If you get an error like, Template:Command Verify that conky is running, and use xprop and click on the conky window to find the name you should pass to Template:Codeline. Template:Command

In this case, "Conky" is right, but for you it may be different, so be sure to use your output instead. If ~/.conkyrc has Template:Codeline then this xprop invocation may show now output. Try using any of the following options instead. Template:Codeline}

Use this in ~/.xinitrc to have transparent conky run when you Template:Codeline.

xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &
conky -d; sleep 1 && transset-df .5 -n Conky

External links