Difference between revisions of "Conky"

From ArchWiki
Jump to navigation Jump to search
m (added persian translation)
(→‎Configuration: Added documentation for how to create a default configuration file.)
 
(72 intermediate revisions by 18 users not shown)
Line 1: Line 1:
[[Category:Status monitoring and notification]]
+
[[Category:System monitors]]
[[fa:Conky]]
 
 
[[de:Conky]]
 
[[de:Conky]]
 
[[es:Conky]]
 
[[es:Conky]]
 +
[[fa:Conky]]
 
[[fr:Conky]]
 
[[fr:Conky]]
 
[[it:Conky]]
 
[[it:Conky]]
 
[[ja:Conky]]
 
[[ja:Conky]]
 
[[ru:Conky]]
 
[[ru:Conky]]
[[tr:Conky]]
+
[[zh-hans:Conky]]
[[zh-CN:Conky]]
+
{{Related articles start}}
 +
{{Related|Conky/Tips_and_tricks}}
 +
{{Related|Lm_sensors}}
 +
{{Related|Hddtemp}}
 +
{{Related articles end}}
 
{{Style|Lots of useless config dumps and unneeded complexity}}
 
{{Style|Lots of useless config dumps and unneeded complexity}}
''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.
 
  
== Installation and configuration ==
+
[[Wikipedia:Conky (software)|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.
 +
 
 +
== Installation ==
 +
 
 +
[[Install]] the {{Pkg|conky}} package. There are also alternative packages you can install from [[AUR]] with extra compile options enabled:
 +
 
 +
* {{AUR|conky-cli}} - conky without X11 dependencies
 +
* {{AUR|conky-lua}} - with Lua support
 +
* {{AUR|conky-lua-nv}} - with both Lua and Nvidia support
 +
 
 +
Some built in variables in conky require additional packages to be installed in order to be utilized, for example [[Hddtemp]] for hard drive tempurature and [[mpd]] for music.
 +
 
 +
Additional utility:
 +
* {{App|Conky Manager|Theme manager for Conky widgets. It provides options to start/stop, browse and edit Conky themes installed on the system.|http://www.teejeetech.in/p/conky-manager.html|{{Pkg|conky-manager}}}}
  
[[Install]] the {{Pkg|conky}} package. For alternative packages with more features, see [[#AUR packages]].
+
== Configuration ==
  
Create a local configuration file:
+
By default conky uses a configuration file located at {{ic|~/.config/conky/conky.conf}}. You can print out an example configuration with:
$ mkdir -p ~/.config/conky
 
$ conky -C > ~/.config/conky/conky.conf
 
  
Now you can edit {{ic|~/.config/conky/conky.conf}} to customize conky as you wish. For a few example configuration files, see [https://github.com/brndnmtthws/conky/wiki/User-Configs this page].
+
$ conky --print-config
  
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 inappropriate.
+
Furthermore, you can create a default configuration file with the following command:
  
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}}, but running ''conky'' as {{ic|root}} is not recommended, so you will need to add {{ic|''username''}} to the {{ic|log}} group:
+
$ mkdir -p ~/.config/conky && conky --print-config > ~/.config/conky/conky.conf
# usermod -aG log ''username''
 
  
=== AUR packages ===
+
If you prefer to have a configuration [[dotfile]] in home, you can create a file elsewhere and tell conky to use it using arguments.
  
In addition to the basic ''conky'' package, there are various [[AUR]] packages available with extra compile options enabled:
+
For example to tell conky to use a dotfile located in the user's home directory:
 +
$ conky --config=~/.conky.conf
  
* {{App|conky-cli|''Conky'' without X11 dependencies||{{AUR|conky-cli}}}}
+
Additional example configuration files are available at [https://github.com/brndnmtthws/conky/wiki/Configs this page].
* {{App|conky-lua|''Conky'' with Lua support||{{AUR|conky-lua}}}}
 
* {{App|conky-lua-nv|''Conky'' with both Lua and Nvidia support||{{AUR|conky-lua-nv}}}}
 
* {{App|conky-nvidia|''Conky'' with Nvidia support||{{AUR|conky-nvidia}}}}
 
  
== Tips and tricks ==
+
When editing your config file while conky is running, conky will update with the new changes every time you write to the file.
 +
 
 +
=== Dual screen ===
 +
 
 +
When using a dual screen configuration, you will need to play with a few options to place your ''conky'' window where you want it on the desktop.
 +
 
 +
By adjusting {{ic|gap_x}}, 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:
 +
alignment = 'top_left',
 +
gap_X = 840,
 +
The {{ic|alignment}} option is self-explanatory, the {{ic|gap_X}} is the distance, in pixels, from the left border of your screen.
 +
 
 +
{{ic|xinerama_head}} is an alternative useful option, the following will place the ''conky'' window at the top right of the second screen:
 +
alignment = 'top_right',
 +
xinerama_head = 2,
  
 
=== Config file syntax changed ===
 
=== Config file syntax changed ===
  
Since Conky 1.10, configuration files have been written with Lua syntax, like so:
+
Since Conky 1.10, configuration files have been written with a new [[Lua]] syntax, like so:
  
 
   conky.config = {
 
   conky.config = {
Line 61: Line 85:
 
A Lua script is available to convert from the old syntax to the new Lua syntax [https://github.com/brndnmtthws/conky/blob/master/extras/convert.lua here].
 
A Lua script is available to convert from the old syntax to the new Lua syntax [https://github.com/brndnmtthws/conky/blob/master/extras/convert.lua here].
  
If in doubt, or something doesn't work at all, you can start with the default config file:
+
== Fonts ==
 
 
  $ conky -C > conky.conf.default
 
 
 
=== Enable real transparency in KDE4 and Xfce4 ===
 
 
 
Since version 1.8.0 ''conky'' supports real transparency. To enable it add this line to {{ic|conky.conf}}:
 
 
 
own_window_transparent = true,
 
 
 
The above option is not desired with the {{ic|OWN_WINDOW_ARGB_VISUAL yes}} option.
 
This replaces the {{Pkg|feh}} method described below.
 
 
 
{{Note|1=[[Xfce]] requires enabled compositing, see [https://forum.xfce.org/viewtopic.php?pid=25939].}}
 
 
 
=== Autostart with Xfce4 ===
 
 
 
In {{ic|conky.conf}} file:
 
background = yes,
 
 
 
This variable will fork ''conky'' to your background. 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:
 
own_window = true,
 
own_window_type = 'override',
 
 
 
The {{ic|override}} takes ''conky'' out of the control of your window manager.
 
 
 
Add a {{ic|~/.config/autostart/conky.desktop}}:
 
[Desktop Entry]
 
Encoding=UTF-8
 
Version=0.9.4
 
Type=Application
 
Name=conky
 
Comment=
 
Exec=conky -d
 
StartupNotify=false
 
Terminal=false
 
Hidden=false
 
 
 
=== Prevent flickering ===
 
 
 
''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|"Module"}} section. The {{ic|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.
 
 
 
To enable double buffering, add the option
 
 
 
  double_buffer = true,
 
 
 
to your {{ic|conky.conf}}.
 
 
 
=== Custom colors ===
 
 
 
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]] will give you the color name. It is made of six hexadecimal digits (0-9, A-F).
 
Add this line in your configuration file for a custom color:
 
 
 
  color0 = 'white', --convention for standard named colors
 
  color1 = '00CC00', --convention for hex colors: no pound sign
 
 
 
Then, when editing the {{ic|TEXT}} section, use custom color number previously defined, for example {{ic|${color3} }}.
 
 
 
=== Dual Screen ===
 
 
 
When using a dual screen configuration, you will need to play with two options to place your ''conky'' window. 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:
 
alignment = 'top_left',
 
gap_X = 840,
 
 
 
The {{ic|alignment}} option is trivial, and {{ic|gap_X}} option is the distance, in pixels, from the left border of your screen.
 
 
 
The {{ic|xinerama_head}} option might also need to be set.
 
 
 
=== Do not minimize on Show Desktop ===
 
 
 
'''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.
 
 
 
If you do not use Compiz, try editing {{ic|conky.conf}} and adding/changing the following line:
 
 
 
own_window_type = 'override',
 
 
 
or
 
 
 
own_window_type = 'desktop',
 
 
 
Refer to ''conky''s man page for the exact differences. But the latter option enables you to snap windows to ''conky''s border using resize key-binds in e.g. Openbox, which the first one does not.
 
 
 
=== Integrate with GNOME ===
 
 
 
Some have experienced problems with ''conky'' showing up under [[GNOME]].
 
 
 
* Add these lines to {{ic|conky.conf}}:
 
 
 
own_window yes
 
own_window_type conky
 
own_window_transparent yes
 
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
 
 
 
If you still experience problems with transparency. You could add these lines.
 
own_window_argb_visual yes
 
own_window_argb_value 255
 
 
 
=== Integrate with Razor-qt ===
 
 
 
With ''conky'''s default configuration, its window might disappear from the desktop when you click on the latter. Add these lines to:
 
 
 
{{hc|conky.conf|own_window yes
 
own_window_class Conky
 
own_window_type normal
 
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
 
own_window_transparent yes
 
}}
 
 
 
=== Display package update information ===
 
 
 
* [[Pacman]] provides its own script called {{ic|checkupdates}} which displays package updates from the official repos. Use {{ic|<nowiki>${execpi 3600 checkupdates | wc -l}</nowiki>}} to display the total number of packages.
 
* [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.
 
* [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.
 
 
 
=== Display weather forecast ===
 
 
 
See [https://bbs.archlinux.org/viewtopic.php?id=37381 this thread].
 
 
 
=== Display a countdown timer ===
 
[https://github.com/orschiro/scriptlets/tree/master/ConkyTimer ConkyTimer] is a simple countdown timer that displays the remaining time of a defined task.
 
 
 
Start the timer using {{ic|conkytimer "<task description>" <min>}}.
 
 
 
=== Display RSS feeds ===
 
 
 
''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|conky.conf}} in the {{ic|TEXT}} section:
 
 
 
${rss https://planet.archlinux.org/rss20.xml 1 item_titles 10 }
 
If you want to display Arch Forum rss feed, add this line:
 
${rss https://bbs.archlinux.org/extern.php?action=feed&type=rss 1 item_titles 4}
 
where 1 is in minutes the refresh interval (15 mn is default),4 the number of items you wish to show.
 
 
 
=== Display rTorrent stats ===
 
 
 
See [https://bbs.archlinux.org/viewtopic.php?id=67304 this thread].
 
 
 
=== Display your WordPress blog stats ===
 
 
 
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].
 
 
 
=== Display number of new emails ===
 
==== Gmail ====
 
===== method 1 =====
 
Create a file named {{ic|gmail.py}} in a convenient location (this example uses {{ic|~/.scripts/}}) with the following [[Python]] code:
 
 
 
{{hc|gmail.py|<nowiki>
 
#!/usr/bin/env python
 
 
 
from urllib.request import FancyURLopener
 
  
email = 'your email' # @gmail.com can be left out
+
For displaying Unicode pictures and emoji with conky you will need a [[Fonts#Emoji_and_symbols|font]] that supports this and then configure conky to use the font with the Unicode you want to display. For example:
password  = 'your password'
 
  
url = 'https://%s:%s@mail.google.com/mail/feed/atom' % (email, password)
+
  ${font Symbola:size=48}☺${font}
  
opener = FancyURLopener()
+
=== Symbolic Fonts ===
page = opener.open(url)
 
  
contents = page.read().decode('utf-8')
+
Symbolic fonts are also very commonly used in more decorated conky configurations, some of the more popular ones include;
  
ifrom = contents.index('<fullcount>') + 11
+
* {{AUR|ttf-pizzadude-bullets}} - PizzaDude Bullet's font
ito  = contents.index('</fullcount>')
+
* {{AUR|otf-font-awesome-5-free}} - Font awesome icon from from http://fontawesome.com/
 +
* {{AUR|ttf-weather-icons}} - Erik flowers weather icon font with 222 glyphs
  
fullcount = contents[ifrom:ito]
+
== Autostart ==
  
print(fullcount + ' new')
+
Conky can be started automatically several different ways, as outlined in "[[Autostarting]]". Choose the one that works best for your window manager/desktop environment.
</nowiki>}}
 
  
===== method 2 =====
+
Conky has a configuration setting which will tell it to fork to the background. This may be desirable for some autostarting setups.
The following script does less "by hand", and uses more of the capabilities of Python.
 
  
{{hc|gmail.py|<nowiki>
+
In {{ic|conky.conf}}:
#! /usr/bin/env python
+
  conky.config = {
 
+
    background = true,
import urllib.request
 
from xml.etree import ElementTree as etree
 
 
 
# Enter your username and password below within quotes below, in place of ****.
 
# Set up authentication for gmail
 
auth_handler = urllib.request.HTTPBasicAuthHandler()
 
auth_handler.add_password(realm='mail.google.com',
 
                          uri='https://mail.google.com/',
 
                          user= '****',
 
                          passwd= '****')
 
opener = urllib.request.build_opener(auth_handler)
 
# ...and install it globally so it can be used with urlopen.
 
urllib.request.install_opener(opener)
 
 
 
gmail = 'https://mail.google.com/gmail/feed/atom'
 
NS = '{http://purl.org/atom/ns#}'
 
with urllib.request.urlopen(gmail) as source:
 
    tree = etree.parse(source)
 
fullcount = tree.find(NS + 'fullcount').text
 
 
 
print(fullcount + ' new')
 
</nowiki>}}
 
 
 
Add the following string to your {{ic|conky.conf}} in order the check your Gmail account for new email every five minutes (300 seconds) and display:
 
  ${execpi 300 python ~/.scripts/gmail.py}
 
 
 
===== method 3 =====
 
 
 
The same way, but with using {{ic|curl}}, {{ic|grep}} and {{ic|sed}}:
 
 
<nowiki>$ curl -s -u '''email''':'''password''' https://mail.google.com/mail/feed/atom | grep fullcount | sed 's/<[^0-9]*>//g'</nowiki>
 
 
 
replace ''email'' and ''password'' with your data.
 
 
===== method 4 =====
 
 
 
Alternatively, you can use [http://www.stunnel.org/ stunnel] which is provided by the {{Pkg|stunnel}} package.
 
 
 
The following configuration is taken from [https://github.com/brndnmtthws/conky/wiki/FAQ Conky's FAQ]
 
 
 
Modify {{ic|/etc/stunnel/stunnel.conf}} as follows, and then [[start]] {{ic|stunnel.service}}:
 
# 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
 
 
 
The only thing left is our {{ic|conky.conf}}:
 
imap localhost username * -i 120 -p 993
 
TEXT
 
Inbox: ${imap_unseen}/${imap_messages}
 
 
 
Here I used {{ic|*}} as the password for ''conky'' to ask for it at start, but you do '''not''' have to do it.
 
 
 
==== IMAP + SSL using Perl ====
 
 
 
''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
 
 
 
Create a file named {{ic|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 {{ic|conky.conf}}:
+
If you use a graphical desktop environment and wish to use a {{ic|conky.desktop}} file for autostarting, use the following:
${execpi 300 ~/.conky/imap.pl}
 
or wherever you saved the file.
 
  
If you use Gmail you might need to [http://www.google.com/accounts/IssuedAuthSubTokens?hide_authsub=1 generate] an application specific password.
+
{{hc|~/.config/autostart/conky.desktop|2=
 +
[Desktop Entry]
 +
Type=Application
 +
Name=conky
 +
Exec=conky --daemonize --pause=5
 +
StartupNotify=false
 +
Terminal=false}}
  
Alternatively, you can use stunnel as shown above: [[#Gmail]]
+
The {{ic|1=pause=5}} parameter delays ''conky'''s drawing for 5 seconds at startup to make sure that the desktop had time to load and is up.
  
==== IMAP using PHP ====
+
== Trouble Shooting ==
Another alternative using PHP. PHP needs to be installed and {{ic|1=extension=imap.so}} must be uncommented in {{ic|/etc/php/php.ini}}.
 
  
Then create a file named {{ic|imap.php}} in a location to be read by ''conky''. Make the file executable:
+
These are known issues people have with conky and their solutions.
$ chmod +x imap.php
 
  
In this file, add (with the appropriate changes):
+
=== Conky starts and doesn't display anything on the screen ===
  
#!/usr/bin/php
+
First check for syntax errors in your configuration file's text variable. Then double check that your user has permission to run every command inside your configuration file and that all needed packages are installed.
<?php
 
// See http://php.net/manual/function.imap-open.php for more information about
 
// the mailbox string in the first parameter of imap_open.
 
// This example is ready to use with Office 365 Exchange Mails,
 
// just replace your username (=email address) and the password.
 
$mbox = imap_open("{outlook.office365.com:993/imap/ssl/novalidate-cert}", "username", "password");
 
 
// Total number of emails
 
$nrTotal = imap_num_msg($mbox);
 
 
// Number of unseen emails. There are other ways using imap_status to count
 
// unseen messages, but they don't work with Office 365 Exchange. This one does.
 
$unseen = imap_search($mbox, 'UNSEEN');
 
$nrUnseen = $unseen ? count($unseen) : 0;
 
 
// Display the result, format as you like.
 
echo $nrUnseen.'/'.$nrTotal;
 
 
// Not needed, because the connection is closed after the script end.
 
// For the sake of clean public available scripts, we are nice to
 
// the imap server and close the connection manually.
 
imap_close($mbox);
 
  
Add to {{ic|conky.conf}}:
+
=== Transparency ===
  
${execpi 300 ~/.conky/imap.php}
+
Conky supports two different types of transparency. Pseudo-transparency and real transparency that requires a [[composite manager]] to be installed and running. If you enable real transparency and don't have a composite manager running your conky will not be alpha transparent with transparency enabled for fonts and images as well as the background.
  
or wherever you saved the file.
+
==== Pseudo-transparency ====
  
This script displays A/B where A is the number of unseen emails and B is the total number of mails in the mailbox. There are a lot of other informations available through a lot of PHP functions like with imap_Status (http://php.net/manual/function.imap-status.php). Just see the PHP docs about IMAP: http://php.net/manual/ref.imap.php.
+
Pseudo-transparency is enabled by default in conky. Pseudo-transparency works by copying the background image from the root window and using the relevant section as the background for conky. Some window managers set the background wallpaper to a level above the root window which can cause conky to have a grey background. To fix this issue you need to set it manually. An example with [[feh]] is:
  
=== Show graphic of active network interface ===
+
In {{ic|~/.xinitrc}}:
  
To test if a network inferface is currently active, you can use the test conky variable {{ic | if_existing}} on the {{ic | operstate}} of the interface. Here's an example for wlo1 :
+
  sleep 1 && feh --bg-center ~/background.png &
  
{{bc |draw_graph_borders yes
+
==== Enable real transparency ====
${if_existing /sys/class/net/wlo1/operstate up}
 
${color #0077ff}Net Down:$color ${downspeed wlo1}      ${color #0077ff}Net Up:$color ${upspeed wlo1}
 
${color #0077ff}${downspeedgraph wlo1 32,155 104E8B 0077ff} $alignr${color #0077ff}${upspeedgraph wlo1 32,155 104E8B 0077ff}
 
${endif}
 
}}
 
  
This is the expected result :
+
To enable real transparency, you must have a [[composite manager]] running and the following lines added to {{ic|.conkyrc}} inside the conky.config array:
  
http://i.imgur.com/pQQbsP6.png
+
  conky.config = {
 +
    own_window = true,
 +
    own_window_transparent = true,
 +
    own_window_argb_visual = true,
 +
    own_window_type = 'desktop',
 +
  }
  
=== Fix scrolling with UTF-8 multibyte characters ===
+
If window type "desktop" does not work try changing it to {{ic|normal}}. If that does not work try the other options: {{ic|dock}}, {{ic|panel}}, or {{ic|override}} instead.
  
The current version of ''conky'' (1.9.0) suffers from a [https://github.com/brndnmtthws/conky/issues/129 bug] 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}}
+
{{Note|1=[[Xfce]] requires enabled compositing, see [https://forum.xfce.org/viewtopic.php?pid=25939].}}
  
== User-contributed configuration examples ==
+
==== Semi-transparency ====
  
=== A sample rings script with nvidia support===
+
To achieve semi-transparency in real transparency mode, the following setup must be used in the conky configuration file:
  
See [https://gist.github.com/anonymous/85d052c0c23e58bc3666].
+
  conky.config = {
 +
    own_window = true,
 +
    own_window_transparent = false,
 +
    own_window_argb_visual = true,
 +
    own_window_argb_value = 90,
 +
    own_window_type = 'desktop',
 +
  }
  
== A note about symbolic fonts ==
+
To reduce the transparency of the conky window, one can increase the value of {{ic|own_window_argb_value}} towards 255.
  
Many of the more decorated {{ic|conky.conf}}'s use the fonts PizzaDude Bullets and Pie Charts for Maps. They are available from the AUR as {{AUR|ttf-pizzadude-bullets}} and {{AUR|ttf-piechartsformaps}}{{Broken package link|{{aur-mirror|ttf-piechartsformaps}}}} respectively, or they can be found and downloaded with a quick search and manually installed using the instructions in [[Fonts]].
+
=== Do not minimize on Show Desktop ===
  
== Fonts appear smaller than they should with Infinality ==
+
'''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.
  
If you notice that your ''conky'' fonts appear smaller than they should, or they do not 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.
+
If you do not use Compiz, try editing {{ic|conky.conf}} and adding/changing the following line:
  
== Universal method to enable true transparency ==
+
own_window_type = 'override',
  
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''. [[Pacman#Installing specific packages|Install]] {{Pkg|xcompmgr}} and {{Pkg|transset-df}}.
+
or
  
{{Note|This may conflict with any other compositing manager you are already using.}}
+
own_window_type = 'desktop',
  
Check ''xcompmgr'' documentation to help you decide which compositing options you would like to enable. The following is a common standard command.
+
Refer to {{man|1|conky}} [[man page]] for the exact differences. But the latter option enables you to snap windows to ''conky''s border using resize key-binds in e.g. Openbox, which the first one does not.
  
$ xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &
+
=== Integrate with GNOME Shell ===
  
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.
+
Some have experienced problems with ''conky'' showing up under [[GNOME]].
  
  $ transset-df .5 -n Conky
+
Add these lines to {{ic|conky.conf}}:
 +
  own_window = true,
 +
own_window_type = 'desktop',
  
This should give your ''conky'' window true transparency. If you get an error like:
+
=== Prevent flickering ===
 +
{{Expansion|Explain the steps to follow if there is no dbe module, probably in [[xorg]] rather than here with a link}}
 +
''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 with [[Xorg]] in {{ic|/etc/X11/xorg.conf}} with {{ic|Load "dbe"}} line in {{ic|"Module"}} section. The {{ic|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 as long as it is present within {{ic|/usr/lib/xorg/modules}}. The list of loaded modules can be checked with {{ic|grep LoadModule /var/log/Xorg.0.log}}.
  
No Window matching Conky exists!
+
To enable double buffering, add the {{ic|double_buffer}} option to {{ic|conky.conf}}:
  
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}}.
+
  conky.config = {
 
+
      double_buffer = true,
{{hc|$ xprop &#124; grep WM_NAME|2=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 {{ic|conky.conf}} has an option {{ic|own_window_type}} set to {{ic|panel}}, then this ''xprop'' invocation may show no output. Try using {{ic|dock}}, {{ic|normal}}, {{ic|override}} or {{ic|desktop}} instead.
 
 
 
Use this in {{ic|~/.xinitrc}} to have transparent ''conky'' after [[X]] starts up:
 
 
 
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &
 
conky -d; sleep 1 && transset-df .5 -n Conky
 
  
 
== See also ==
 
== See also ==
Line 453: Line 207:
 
* [https://github.com/brndnmtthws/conky Official website]
 
* [https://github.com/brndnmtthws/conky Official website]
 
* [http://conky.sourceforge.net/config_settings.html Official Conky variables for configuration]
 
* [http://conky.sourceforge.net/config_settings.html Official Conky variables for configuration]
 +
* [http://conky.sourceforge.net/variables.html Official Conky objects]
 
* [https://bbs.archlinux.org/viewtopic.php?id=39906 Conky Configs on arch forums]
 
* [https://bbs.archlinux.org/viewtopic.php?id=39906 Conky Configs on arch forums]
* [http://freshmeat.net/projects/conky/ Conky] on [[wikipedia:Freshmeat|Freshmeat]]
+
* [http://freecode.com/projects/conky/ Conky] on [[wikipedia:Freecode|Freecode]]
 
* [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?title=ConkyFAQ&oldid=12463 FAQ]
+
* [https://github.com/brndnmtthws/conky/wiki/FAQ FAQ]

Latest revision as of 19:56, 22 November 2019

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: Lots of useless config dumps and unneeded complexity (Discuss in Talk:Conky#)

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.

Installation

Install the conky package. There are also alternative packages you can install from AUR with extra compile options enabled:

Some built in variables in conky require additional packages to be installed in order to be utilized, for example Hddtemp for hard drive tempurature and mpd for music.

Additional utility:

  • Conky Manager — Theme manager for Conky widgets. It provides options to start/stop, browse and edit Conky themes installed on the system.
http://www.teejeetech.in/p/conky-manager.html || conky-manager

Configuration

By default conky uses a configuration file located at ~/.config/conky/conky.conf. You can print out an example configuration with:

$ conky --print-config

Furthermore, you can create a default configuration file with the following command:

$ mkdir -p ~/.config/conky && conky --print-config > ~/.config/conky/conky.conf

If you prefer to have a configuration dotfile in home, you can create a file elsewhere and tell conky to use it using arguments.

For example to tell conky to use a dotfile located in the user's home directory:

$ conky --config=~/.conky.conf

Additional example configuration files are available at this page.

When editing your config file while conky is running, conky will update with the new changes every time you write to the file.

Dual screen

When using a dual screen configuration, you will need to play with a few options to place your conky window where you want it on the desktop.

By adjusting gap_x, 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:

alignment = 'top_left',
gap_X = 840,

The alignment option is self-explanatory, the gap_X is the distance, in pixels, from the left border of your screen.

xinerama_head is an alternative useful option, the following will place the conky window at the top right of the second screen:

alignment = 'top_right',
xinerama_head = 2,

Config file syntax changed

Since Conky 1.10, configuration files have been written with a new Lua syntax, like so:

 conky.config = {
   -- Comments start with a double dash
   bool_value = true,
   string_value = 'foo',
   int_value = 42,
 }
 conky.text = [[
 $variable
 ${evaluated variable}
 ]]

Some examples below may still use the old syntax, which looks like this:

 bool_value yes
 string_value 'foo'
 int_value 42

A Lua script is available to convert from the old syntax to the new Lua syntax here.

Fonts

For displaying Unicode pictures and emoji with conky you will need a font that supports this and then configure conky to use the font with the Unicode you want to display. For example:

 ${font Symbola:size=48}☺${font} 

Symbolic Fonts

Symbolic fonts are also very commonly used in more decorated conky configurations, some of the more popular ones include;

Autostart

Conky can be started automatically several different ways, as outlined in "Autostarting". Choose the one that works best for your window manager/desktop environment.

Conky has a configuration setting which will tell it to fork to the background. This may be desirable for some autostarting setups.

In conky.conf:

conky.config = {
    background = true,
}

If you use a graphical desktop environment and wish to use a conky.desktop file for autostarting, use the following:

~/.config/autostart/conky.desktop
[Desktop Entry]
Type=Application
Name=conky
Exec=conky --daemonize --pause=5
StartupNotify=false
Terminal=false

The pause=5 parameter delays conky's drawing for 5 seconds at startup to make sure that the desktop had time to load and is up.

Trouble Shooting

These are known issues people have with conky and their solutions.

Conky starts and doesn't display anything on the screen

First check for syntax errors in your configuration file's text variable. Then double check that your user has permission to run every command inside your configuration file and that all needed packages are installed.

Transparency

Conky supports two different types of transparency. Pseudo-transparency and real transparency that requires a composite manager to be installed and running. If you enable real transparency and don't have a composite manager running your conky will not be alpha transparent with transparency enabled for fonts and images as well as the background.

Pseudo-transparency

Pseudo-transparency is enabled by default in conky. Pseudo-transparency works by copying the background image from the root window and using the relevant section as the background for conky. Some window managers set the background wallpaper to a level above the root window which can cause conky to have a grey background. To fix this issue you need to set it manually. An example with feh is:

In ~/.xinitrc:

 sleep 1 && feh --bg-center ~/background.png &

Enable real transparency

To enable real transparency, you must have a composite manager running and the following lines added to .conkyrc inside the conky.config array:

 conky.config = {
    own_window = true,
    own_window_transparent = true,
    own_window_argb_visual = true,
    own_window_type = 'desktop',
 }

If window type "desktop" does not work try changing it to normal. If that does not work try the other options: dock, panel, or override instead.

Note: Xfce requires enabled compositing, see [1].

Semi-transparency

To achieve semi-transparency in real transparency mode, the following setup must be used in the conky configuration file:

 conky.config = {
    own_window = true,
    own_window_transparent = false,
    own_window_argb_visual = true,
    own_window_argb_value = 90,
    own_window_type = 'desktop',
 }

To reduce the transparency of the conky window, one can increase the value of own_window_argb_value towards 255.

Do not minimize on Show Desktop

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.

If you do not use Compiz, try editing conky.conf and adding/changing the following line:

own_window_type = 'override',

or

own_window_type = 'desktop',

Refer to conky(1) 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.

Integrate with GNOME Shell

Some have experienced problems with conky showing up under GNOME.

Add these lines to conky.conf:

own_window = true,
own_window_type = 'desktop',

Prevent flickering

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: Explain the steps to follow if there is no dbe module, probably in xorg rather than here with a link (Discuss in Talk:Conky#)

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 with Xorg in /etc/X11/xorg.conf with Load "dbe" line in "Module" section. The xorg.conf file has been replaced (1.8.x patch upwards) by /etc/X11/xorg.conf.d which contains the particular configuration files. DBE is loaded automatically as long as it is present within /usr/lib/xorg/modules. The list of loaded modules can be checked with grep LoadModule /var/log/Xorg.0.log.

To enable double buffering, add the double_buffer option to conky.conf:

 conky.config = {
     double_buffer = true,
 }

See also