https://wiki.archlinux.org/api.php?action=feedcontributions&user=Haggy87&feedformat=atomArchWiki - User contributions [en]2024-03-29T10:57:56ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Conky&diff=286491Conky2013-12-06T11:53:03Z<p>Haggy87: /* Do not minimize on Show Desktop */</p>
<hr />
<div>[[Category:Status monitoring and notification]]<br />
[[es:Conky]]<br />
[[fr:Conky]]<br />
[[it:Conky]]<br />
[[ru:Conky]]<br />
[[tr:Conky]]<br />
[[zh-CN:Conky]]<br />
Conky is a system monitor software for the X Window System. It is available for GNU/Linux and FreeBSD. It is free software released under the terms of the GPL license. Conky is able to monitor many system variables including CPU, memory, swap, disk space, temperature, top, upload, download, system messages, and much more. It is extremely configurable, however, the configuration can be a little hard to understand. Conky is a fork of torsmo.<br />
<br />
== Installation and configuration ==<br />
<br />
* [[pacman|Install]] the {{Pkg|conky}} package which is available in the [[official repositories]].<br />
* Edit the {{ic|~/.conkyrc}} config file using an example configuration file from [http://conky.sourceforge.net/screenshots.html homeproject-screenshot]<br />
When editing your config file, you will see immediately the effect of any change as soon as you save it. There is no need to log out/log in your X session. So best is to test all kind of options, one by one, save the configuration file and see the change on your conky window, and correct if your change is unappropriated.<br />
* Alternatively, you can use the default config at {{ic|/etc/conky/conky.conf}}:<br />
$ cp /etc/conky/conky.conf ~/.conkyrc<br />
Best is to use a local {{ic|~/.conkyrc}} config.<br />
As many apps, conky will first try to look for a local {{ic|.conkyrc}} file. If this one doesn't exist, then it will read the default one in {{ic|/etc/conky}}.<br />
<br />
In case you store your configuration locally, e.g. in your home directory, you will not be able to read any log files unless you do some changes. One of the nice features of conky is to pipe to your desktop some {{ic|/var/log/}} files to read all kinds of log messages. Most of these files can only be read by {{ic|root}}, and you will thus need to {{ic|sudo}} conky. Starting conky as {{ic|root}} is not recommended, so you will need to make this following changes:<br />
$ usermod -aG log username<br />
You add {{ic|username}} to the {{ic|log group}}. Now {{ic|username}} can read log files, and you will be able to redirect log messages with conky on your desktop.<br />
<br />
* If conky does not accept changes -- e.g. minimum_size -- you made to {{ic|~/.conkyrc}} make sure you cleared {{ic|/etc/conky/conky.conf}} or commented out the relevant section.Best is to remove files in {{ic|/etc/conky/}}, as conky will keep reading them and this can give you some Xorg error messages.<br />
<br />
== AUR packages ==<br />
<br />
In addition to the basic '''conky''' package, there are various [[AUR]] packages available with extra compile options enabled:<br />
<br />
* {{App|conky-cli|Conky without X11 dependencies||{{AUR|conky-cli}}}}<br />
* {{App|conky-lua|Conky with Lua support||{{AUR|conky-lua}}}}<br />
* {{App|conky-lua-nv|Conky with both Lua and Nvidia support||{{AUR|conky-lua-nv}}}}<br />
* {{App|conky-nvidia|Conky with Nvidia support||{{AUR|conky-nvidia}}}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Enable real transparency in KDE4 and Xfce4 ===<br />
<br />
Since version 1.8.0, Conky suppports real transparency. To enable it add this line to {{ic|~/.conkyrc}}:<br />
own_window_transparent yes<br />
<br />
The above option is not desired with the {{ic|OWN_WINDOW_ARGB_VISUAL yes}} option.<br />
This replaces the {{Pkg|feh}} method described below.<br />
<br />
=== Autostart with Xfce4 ===<br />
<br />
In {{ic|.conkyrc}} file:<br />
background yes<br />
<br />
This variable will fork Conky to your background.<br />
If you want to make your window always visible on your desktop, sticky across all workspaces and not showing in your taskbar, add these arguments:<br />
own_window yes<br />
own_window_type override<br />
The override option makes your window out of control of your window manager.<br />
<br />
Add a {{ic|~/.config/autostart/conky.desktop}}:<br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Version=0.9.4<br />
Type=Application<br />
Name=conky<br />
Comment=<br />
Exec=conky -d<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
<br />
=== Prevent flickering ===<br />
<br />
Conky needs Double Buffer Extension (DBE) support from the X server to prevent flickering because it cannot update the window fast enough without it. It can be enabled in {{ic|/etc/X11/xorg.conf}} with {{ic|Load "dbe"}} line in {{ic|Section "Module"}}. The xorg.conf file has been replaced (1.8.x patch upwards) by {{ic|/etc/X11/xorg.conf.d}} which contains the particular configuration files. ''DBE'' is loaded automatically.<br />
<br />
To enable double-buffer check to have in {{ic|~/.conkyrc}}:<br />
# Place below the other options, not below TEXT or XY<br />
double_buffer yes<br />
<br />
=== Custom colors ===<br />
<br />
Aside the classic preset colors (white, black, yellow...), you can set your own custom color using the color name code. To determine the code of a color, use a color selector app. The basic {{Pkg|gcolor2}} package in the [[Official Repositories|official repositories]] will give you the color name. It is made of six hexadecimal digits (0-9, A-F).<br />
Add this line in your configuration file for a custom color:<br />
color1 Colorname1<br />
color2 Colorname2<br />
Then, when editing the TEXT section, use custom color number previously defined.<br />
<br />
=== Dual Screen ===<br />
<br />
When using a dual screen configuration, you will need to play with two options to place your conky window.<br />
Let's say you are running a 1680X1050 pixels resolution, and you want the window on middle top of your left monitor, you will use this:<br />
alignment top_left<br />
gap_X 840<br />
The alignment option is trivial, and gap_X option is the distance, in pixels, from the left border of your screen.<br />
<br />
=== Do not minimize on Show Desktop ===<br />
<br />
'''Using Compiz:''' If the 'Show Desktop' button or key-binding minimizes Conky along with all other windows, start the Compiz configuration settings manager, go to "General Options" and uncheck the "Hide Skip Taskbar Windows" option.<br />
<br />
If you do not use Compiz, try editing {{ic|~/.conkyrc}} and adding/changing the following line:<br />
<br />
own_window_type override<br />
<br />
or<br />
<br />
own_window_type desktop<br />
<br />
Refer to conkys man page for the exact differences. But the latter option enables you to snap windows to conkys border using resize key-binds in e.g. Openbox, which the first one does not.<br />
<br />
=== Integrate with Gnome 3 ===<br />
<br />
Some have experienced problems with Conky showing up under Gnome 3.<br />
*Add these lines to {{ic|~/.conkyrc}}:<br />
own_window yes<br />
own_window_type conky<br />
own_window_transparent yes<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
<br />
If you still experience problems with transparency. You could add these lines.<br />
own_window_argb_visual yes<br />
own_window_argb_value 255<br />
<br />
=== Integrate with KDE ===<br />
<br />
Conky with screenshot configuration generate problems with icons visualization. So there are some steps to follow.<br />
* Add these lines to {{ic|~/.conkyrc}}:<br />
own_window yes<br />
own_window_type normal<br />
own_window_transparent yes<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
* If this setting is on, comment it out or delete the line:<br />
minimum_size<br />
* To automatically start Conky, create this symlink:<br />
** KDE4:<br />
$ ln -s /usr/bin/conky ~/.kde4/Autostart/conkylink<br />
** KDE3:<br />
$ ln -s /usr/bin/conky ~/.kde/share/autostart/conkylink<br />
* Install the {{Pkg|feh}} package which is available in the official repositories.<br />
* Make a script to allow transparency with the desktop<br />
In KDE4 edit {{ic|~/.kde4/Autostart/fehconky}}:<br />
<br />
#!/bin/bash<br />
feh --bg-scale "$(sed -n 's/wallpaper=//p' ~/.kde4/share/config/plasma-desktop-appletsrc)"<br />
<br />
In KDE3 edit {{ic|~/.kde/share/autostart/fehconky}}:<br />
<br />
#!/bin/bash<br />
feh --bg-scale $(dcop kdesktop KBackgroundIface currentWallpaper 1)<br />
<br />
use {{ic|--bg-center}} if you use a centered wallpaper.<br />
<br />
* Make it executable:<br />
** KDE4:<br />
$ chmod +x ~/.kde4/Autostart/fehconky<br />
** KDE3:<br />
$ chmod +x ~/.kde/share/autostart/fehconky<br />
* Instead of using a script, you can add the corresponding line to the bottom of {{ic|~/.conkyrc}}<br />
** For KDE4<br />
${exec feh --bg-scale "$(sed -n 's/wallpaper=//p' ~/.kde4/share/config/plasma-desktop-appletsrc)"}<br />
** For KDE3<br />
${exec feh --bg-scale $(dcop kdesktop KBackgroundIface currentWallpaper 1)}<br />
<br />
=== Integrate with Razor-qt ===<br />
<br />
With Conky's default configuration, its window might disappear from the desktop when you click on the latter.<br />
Add these lines to: <br />
{{hc|~/.conkyrc|own_window yes<br />
own_window_class Conky<br />
own_window_type normal<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
own_window_transparent yes<br />
}}<br />
<br />
=== Display package update information ===<br />
<br />
* [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 {{ic|<nowiki>${execpi}</nowiki>}} command.<br />
* [https://bbs.archlinux.org/viewtopic.php?id=53761 Scrolling Notifications] - Prints scrolling update notifications. From the author of Paconky.<br />
* [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.<br />
* [https://bbs.archlinux.org/viewtopic.php?id=37284 Python Script] - Fairly configurable update notification program in [[Python]].<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=483742#p483742 Bash Script] - [[Bash]] script for users that have enabled ShowSize.<br />
<br />
=== Display weather forecast ===<br />
<br />
See [https://bbs.archlinux.org/viewtopic.php?id=37381 this thread].<br />
<br />
=== Display RSS feeds ===<br />
<br />
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 {{ic|~/.conkyrc}} in the TEXT section:<br />
<br />
${rss https://planet.archlinux.org/rss20.xml 1 item_titles 10 }<br />
If you want to display Arch Forum rss feed, add this line:<br />
${rss https://bbs.archlinux.org/extern.php?action=feed&type=rss 1 item_titles 4}<br />
where 1 is in minutes the refresh interval (15 mn is default),4 the number of items you wish to show.<br />
<br />
=== Display Distrowatch Arch Linux ranking ===<br />
<br />
See [https://bbs.archlinux.org/viewtopic.php?id=88779 this thread].<br />
<br />
=== Display rTorrent stats ===<br />
<br />
See [https://bbs.archlinux.org/viewtopic.php?id=67304 this thread].<br />
<br />
=== Display your WordPress blog stats ===<br />
<br />
This can be achieved by using the in python written extension named [http://evilshit.wordpress.com/2013/04/20/conkypress-a-wordpress-stats-visualization-tool-for-your-desktop/ ConkyPress].<br />
<br />
=== Display number of new emails (Gmail) ===<br />
<br />
Create a file named {{ic|gmail.py}} in a convenient location (this example uses {{ic|~/.scripts/}}) with the following [[Python]] code:<br />
<br />
{{hc|gmail.py|<nowiki><br />
#!/usr/bin/env python<br />
<br />
from urllib.request import FancyURLopener<br />
<br />
email = 'your email' # @gmail.com can be left out<br />
password = 'your password'<br />
<br />
url = 'https://%s:%s@mail.google.com/mail/feed/atom' % (email, password)<br />
<br />
opener = FancyURLopener()<br />
page = opener.open(url)<br />
<br />
contents = page.read().decode('utf-8')<br />
<br />
ifrom = contents.index('<fullcount>') + 11<br />
ito = contents.index('</fullcount>')<br />
<br />
fullcount = contents[ifrom:ito]<br />
<br />
print(fullcount + ' new')<br />
</nowiki>}}<br />
<br />
You can also use Python's urllib as follows.<br />
<br />
{{hc|gmail.py|<nowiki><br />
#! /usr/bin/env python<br />
<br />
import urllib.request<br />
from xml.etree import ElementTree as etree<br />
<br />
# Enter your username and password below within quotes below, in place of ****.<br />
# Set up authentication for gmail<br />
auth_handler = urllib.request.HTTPBasicAuthHandler()<br />
auth_handler.add_password(realm='New mail feed',<br />
uri='https://mail.google.com/',<br />
user= '****',<br />
passwd= '****')<br />
opener = urllib.request.build_opener(auth_handler)<br />
# ...and install it globally so it can be used with urlopen.<br />
urllib.request.install_opener(opener)<br />
<br />
gmail = 'https://mail.google.com/gmail/feed/atom'<br />
NS = '{http://purl.org/atom/ns#}'<br />
with urllib.request.urlopen(gmail) as source:<br />
tree = etree.parse(source)<br />
fullcount = tree.find(NS + 'fullcount').text<br />
<br />
print(fullcount + ' new')<br />
</nowiki>}}<br />
<br />
Add the following string to your {{ic|~/.conkyrc}} in order the check your Gmail account for new email every five minutes (300 seconds) and display:<br />
${execpi 300 python ~/.scripts/gmail.py}<br />
<br />
==== Other Methods ====<br />
<br />
The same way, but with using {{ic|curl}}, {{ic|grep}} and {{ic|sed}}:<br />
<br />
$ curl -s -u '''email''':'''password''' https://mail.google.com/mail/feed/atom | grep fullcount | sed 's/<[^0-9]*>//g'<br />
<br />
replace '''email''' and '''password''' with your data.<br />
<br />
Alternatively, you can use [http://www.stunnel.org/ stunnel] which is provided by the {{Pkg|stunnel}} package.<br />
<br />
The following configuration is taken from [http://conky.sourceforge.net/faq.html Conky's FAQ]<br />
<br />
Modify {{ic|/etc/stunnel/stunnel.conf}} as follows, and then start the {{ic|stunnel}} [[Daemon|daemon]]:<br />
# Service-level configuration for TLS server<br />
[imap]<br />
client = yes<br />
accept = 143<br />
connect = imap.gmail.com:143<br />
protocol = imap<br />
sslVersion = TLSv1<br />
# Service-level configuration for SSL server<br />
[imaps]<br />
client = yes<br />
accept = 993<br />
connect = imap.gmail.com:993<br />
<br />
The only thing left is our {{ic|~/.conkyrc}}:<br />
imap localhost username * -i 120 -p 993<br />
TEXT<br />
Inbox: ${imap_unseen}/${imap_messages}<br />
<br />
Here I used * as the password for Conky to ask for it at start, but you do not ''have'' to do it.<br />
<br />
=== Display new emails (IMAP + SSL) ===<br />
<br />
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 {{AUR|perl-mail-imapclient}} and {{Pkg|perl-io-socket-ssl}} packages<br />
<br />
Create a file named {{ic|imap.pl}} in a location to be read by Conky. In this file, add (with the appropriate changes):<br />
#!/usr/bin/perl<br />
<br />
# gimap.pl by gxmsgx<br />
# description: get the count of unread messages on imap<br />
<br />
use strict;<br />
use Mail::IMAPClient;<br />
use IO::Socket::SSL;<br />
<br />
my $username = 'example.username'; <br />
my $password = 'password123'; <br />
<br />
my $socket = IO::Socket::SSL->new(<br />
PeerAddr => 'imap.server',<br />
PeerPort => 993<br />
)<br />
or die "socket(): $@";<br />
<br />
my $client = Mail::IMAPClient->new(<br />
Socket => $socket,<br />
User => $username,<br />
Password => $password,<br />
)<br />
or die "new(): $@";<br />
<br />
if ($client->IsAuthenticated()) {<br />
my $msgct;<br />
<br />
$client->select("INBOX");<br />
$msgct = $client->unseen_count||'0';<br />
print "$msgct\n";<br />
}<br />
<br />
$client->logout();<br />
<br />
Add to {{ic|~/.conkyrc}}:<br />
${execpi 300 ~/.conky/imap.pl} <br />
or wherever you saved the file.<br />
<br />
If you use Gmail you might need to [http://www.google.com/accounts/IssuedAuthSubTokens?hide_authsub=1 generate] an application specific password.<br />
<br />
Alternatively, you can use stunnel as shown above: [[Conky#How to display the number of new emails (Gmail) in Conky]]<br />
<br />
=== Fix scrolling with UTF-8 multibyte characters ===<br />
<br />
The current version of conky (1.9.0) suffers from a bug (http://sourceforge.net/p/conky/bugs/341/) where scrolling text increments by byte, not by character, resulting in text containing multibyte characters to disappear and reappear while scrolling. A package with a patch fixing this bug can be found in the AUR: {{AUR|conky-utfscroll}}<br />
<br />
== User-contributed configuration examples ==<br />
<br />
=== Graysky ===<br />
<br />
[[http://img9.imageshack.us/img9/3153/imageffj.jpg Screenshot]].<br />
<br />
[[https://raw.github.com/graysky2/configs/5fbe513918dfe8066f87e670108318464902afae/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.<br />
<br />
=== A sample rings script with nvidia support===<br />
<br />
{{bc|1=<br />
# -- Conky settings -- #<br />
background no<br />
update_interval 1<br />
<br />
cpu_avg_samples 2<br />
net_avg_samples 2<br />
<br />
override_utf8_locale yes<br />
<br />
double_buffer yes<br />
no_buffers yes<br />
<br />
text_buffer_size 2048<br />
imlib_cache_size 0<br />
<br />
# -- Window specifications -- #<br />
<br />
own_window yes<br />
own_window_type normal<br />
own_window_transparent yes<br />
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below<br />
<br />
border_inner_margin 0<br />
border_outer_margin 0<br />
<br />
minimum_size 320 800<br />
maximum_width 320<br />
<br />
alignment bottom_right<br />
gap_x 0<br />
gap_y 0<br />
<br />
# -- Graphics settings -- #<br />
draw_shades no<br />
draw_outline no<br />
draw_borders no<br />
draw_graph_borders yes<br />
<br />
# -- Text settings -- #<br />
use_xft yes<br />
xftfont MaiandraGD:size=24<br />
xftalpha 0.4<br />
<br />
uppercase no<br />
<br />
default_color 888888<br />
<br />
# -- Lua Load -- #<br />
lua_load ~/conky/lua/lua.lua<br />
lua_draw_hook_pre ring_stats<br />
<br />
TEXT<br />
${alignr}${voffset 53}${goto 90}${font MaiandraGD:size=11}${time %A, %d %B %Y}<br />
<br />
<br />
${voffset 5}${goto 164}${font MaiandraGD:size=16}${time %H:%M}<br />
<br />
<br />
<br />
${voffset -40}${goto 100}${font MaiandraGD:size=9}Kernel:${offset 70}Uptime:<br />
${goto 90}${font MaiandraGD:size=9}$kernel${offset 40}$uptime<br />
${voffset 57}${goto 117}${font snap:size=8}${cpu cpu0}%<br />
${goto 117}${cpu cpu1}%<br />
${goto 117}CPU<br />
${voffset 19}${goto 145}${memperc}%<br />
${goto 145}$swapperc%<br />
${goto 145}MEM<br />
${voffset 25}${goto 170}${nvidia gpufreq}<br />
${goto 170}${nvidia memfreq}<br />
${goto 170}GPU<br />
${voffset 27}${goto 198}${totaldown ppp0}<br />
${goto 198}${totalup ppp0}<br />
${goto 205}NET<br />
${voffset 21}<br />
${goto 222}${fs_used /home}<br />
${goto 230}DISK<br />
}}<br />
<br />
And the required lua.lua script:<br />
<br />
{{bc|1=<br />
--[[<br />
Ring Meters by londonali1010 (2009)<br />
<br />
This script draws percentage meters as rings. It is fully customisable; all options are described in the script.<br />
<br />
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 statement 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 updates 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 statement (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.<br />
<br />
To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):<br />
lua_load ~/scripts/rings-v1.2.1.lua<br />
lua_draw_hook_pre ring_stats<br />
<br />
Changelog:<br />
+ v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009)<br />
+ v1.2 -- Added option for the ending angle of the rings (07.10.2009)<br />
+ v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009)<br />
+ v1.0 -- Original release (28.09.2009)<br />
]]<br />
<br />
settings_table = {<br />
{<br />
-- Edit this table to customise your rings.<br />
-- You can create more rings simply by adding more elements to settings_table.<br />
-- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.<br />
name='time',<br />
-- "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 ''.<br />
arg='%I.%M',<br />
-- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.<br />
max=12,<br />
-- "bg_colour" is the colour of the base ring.<br />
bg_colour=0x888888,<br />
-- "bg_alpha" is the alpha value of the base ring.<br />
bg_alpha=0.3,<br />
-- "fg_colour" is the colour of the indicator part of the ring.<br />
fg_colour=0x888888,<br />
-- "fg_alpha" is the alpha value of the indicator part of the ring.<br />
fg_alpha=0.5,<br />
-- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.<br />
x=191, y=145,<br />
-- "radius" is the radius of the ring.<br />
radius=32,<br />
-- "thickness" is the thickness of the ring, centred around the radius.<br />
thickness=4,<br />
-- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.<br />
start_angle=0,<br />
-- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle.<br />
end_angle=360<br />
},<br />
{<br />
name='time',<br />
arg='%M.%S',<br />
max=60,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=191, y=145,<br />
radius=37,<br />
thickness=4,<br />
start_angle=0,<br />
end_angle=360<br />
},<br />
{<br />
name='time',<br />
arg='%S',<br />
max=60,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=191, y=145,<br />
radius=42,<br />
thickness=4,<br />
start_angle=0,<br />
end_angle=360<br />
},<br />
{<br />
name='cpu',<br />
arg='cpu0',<br />
max=100,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=140, y=300,<br />
radius=26,<br />
thickness=5,<br />
start_angle=-90,<br />
end_angle=180<br />
},<br />
{<br />
name='cpu',<br />
arg='cpu1',<br />
max=100,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=140, y=300,<br />
radius=20,<br />
thickness=5,<br />
start_angle=-90,<br />
end_angle=180<br />
},<br />
{<br />
name='memperc',<br />
arg='',<br />
max=100,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=170, y=350,<br />
radius=26,<br />
thickness=5,<br />
start_angle=-90,<br />
end_angle=180<br />
},<br />
{<br />
name='swapperc',<br />
arg='',<br />
max=100,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=170, y=350,<br />
radius=20,<br />
thickness=5,<br />
start_angle=-90,<br />
end_angle=180<br />
},<br />
{<br />
name='time',<br />
arg='%d',<br />
max=31,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=191, y=145,<br />
radius=50,<br />
thickness=5,<br />
start_angle=-140,<br />
end_angle=-30<br />
},<br />
{<br />
name='time',<br />
arg='%m',<br />
max=12,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=191, y=145,<br />
radius=50,<br />
thickness=5,<br />
start_angle=30,<br />
end_angle=140<br />
},<br />
-- {<br />
-- name='fs_used_perc',<br />
-- arg='/',<br />
-- max=100,<br />
-- bg_colour=0x888888,<br />
-- bg_alpha=0.3,<br />
-- fg_colour=0x888888,<br />
-- fg_alpha=0.5,<br />
-- x=260, y=503,<br />
-- radius=26,<br />
-- thickness=5,<br />
-- start_angle=-90,<br />
-- end_angle=180<br />
-- },<br />
{<br />
name='fs_used_perc',<br />
arg='/home',<br />
max=100,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=260, y=503,<br />
radius=20,<br />
thickness=5,<br />
start_angle=-90,<br />
end_angle=180<br />
},<br />
{<br />
name='totalup',<br />
arg='ppp0',<br />
max=2,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=230, y=452,<br />
radius=20,<br />
thickness=5,<br />
start_angle=-90,<br />
end_angle=180<br />
},<br />
{<br />
name='totaldown',<br />
arg='ppp0',<br />
max=2,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=230, y=452,<br />
radius=26,<br />
thickness=5,<br />
start_angle=-90,<br />
end_angle=180<br />
},<br />
{<br />
name='nvidia',<br />
arg='gpufreq',<br />
max=475,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=200, y=401,<br />
radius=26,<br />
thickness=5,<br />
start_angle=-90,<br />
end_angle=180<br />
},<br />
{<br />
name='nvidia',<br />
arg='memfreq',<br />
max=700,<br />
bg_colour=0x888888,<br />
bg_alpha=0.3,<br />
fg_colour=0x888888,<br />
fg_alpha=0.5,<br />
x=200, y=401,<br />
radius=20,<br />
thickness=5,<br />
start_angle=-90,<br />
end_angle=180<br />
},<br />
}<br />
<br />
require 'cairo'<br />
<br />
function rgb_to_r_g_b(colour,alpha)<br />
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha<br />
end<br />
<br />
function draw_ring(cr,t,pt)<br />
local w,h=conky_window.width,conky_window.height<br />
<br />
local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']<br />
local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']<br />
<br />
local angle_0=sa*(2*math.pi/360)-math.pi/2<br />
local angle_f=ea*(2*math.pi/360)-math.pi/2<br />
local t_arc=t*(angle_f-angle_0)<br />
<br />
-- Draw background ring<br />
<br />
cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)<br />
cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))<br />
cairo_set_line_width(cr,ring_w)<br />
cairo_stroke(cr)<br />
<br />
-- Draw indicator ring<br />
<br />
cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)<br />
cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))<br />
cairo_stroke(cr)<br />
end<br />
<br />
function conky_ring_stats()<br />
local function setup_rings(cr,pt)<br />
local str=''<br />
local value=0<br />
<br />
str=string.format('${%s %s}',pt['name'],pt['arg'])<br />
str=conky_parse(str)<br />
<br />
value=tonumber(str)<br />
if value == nil then value = 0 end<br />
pct=value/pt['max']<br />
<br />
draw_ring(cr,pct,p<nowiki><nowiki>Insert non-formatted text here</nowiki>'''Bold text'''</nowiki>t)<br />
end<br />
<br />
if conky_window==nil then return end<br />
local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_w indow.height)<br />
<br />
local cr=cairo_create(cs)<br />
<br />
local updates=conky_parse('${updates}')<br />
update_num=tonumber(updates)<br />
<br />
if update_num>5 then<br />
for i in pairs(settings_table) do<br />
setup_rings(cr,settings_table[i])<br />
end<br />
end<br />
end <br />
}}<br />
<br />
== A note about symbolic fonts ==<br />
<br />
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]].<br />
<br />
== Fonts appear smaller than they should ==<br />
<br />
If you notice that your conky fonts appear smaller than they should, or they don't align properly, it could be caused by a default setting in the infinality freetype2 patch. This setting can cause some programs to display fonts at 72 DPI instead of 96 even if the rest of your system is set to 96. If you notice a problem open {{ic|/etc/fonts/infinality/infinality.conf}} search for the section on DPI and change 72 to 96.<br />
<br />
== Universal method to enable true transparency ==<br />
<br />
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 {{ic|pacman -S 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)<br />
<br />
NOTE: This may conflict with any other compositing manager you are already using.<br />
<br />
Check xcompmgr documentation to help you decide which compositing options you would like to enable. The following is a common standard command.<br />
<br />
$ xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &<br />
<br />
Make sure conky is running with {{ic|conky &}}. Use transset-df to enable transparency on the Conky window. Set '.5' to any value in the range 0 - 1.<br />
<br />
$ transset-df .5 -n Conky<br />
<br />
This should give your conky window true transparency. If you get an error like, <br />
{{hc|$ transset-df .5 -n Conky|No Window matching Conky exists!}}<br />
Verify that conky is running, and use xprop and click on the conky window to find the name you should pass to {{ic|transset-df}}. <br />
{{hc|$ xprop &#124; grep WM_NAME|2=WM_NAME(STRING) = "Conky (ArchitectLinux)"}}<br />
<br />
In this case, "Conky" is right, but for you it may be different, so be sure to use your output instead. If {{ic|~/.conkyrc}} has {{ic|own_window_type panel}} then this xprop invocation may show now output. Try using any of the following options instead. {{ic|<nowiki>own_window_type {dock,normal,override,desktop}</nowiki>}}<br />
<br />
Use this in {{ic|~/.xinitrc}} to have transparent conky run when you {{ic|startx}}.<br />
<br />
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &<br />
conky -d; sleep 1 && transset-df .5 -n Conky<br />
<br />
== See also ==<br />
<br />
* [http://conky.sourceforge.net/config_settings.html Official Conky Configuration Settings]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=39906 Conky Configs on arch forums]<br />
* [http://conky.sourceforge.net/ Official website]<br />
* [http://freshmeat.net/projects/conky/ Conky] on [[wikipedia:Freshmeat|Freshmeat]]<br />
* [http://sourceforge.net/projects/conky/ Conky] on [[wikipedia:sourceforge.net|SourceForge]]<br />
* [irc://chat.freenode.org/conky #conky] IRC chat channel on [[wikipedia:Freenode|freenode]]<br />
* [http://novel.evilcoder.org/wiki/index.php?title=ConkyFAQ&oldid=12463 FAQ]</div>Haggy87