Difference between revisions of "Basic Tips for conky"

imported>Excalibur1234
(Correct file name is conky.conf, not conky.conkyrc)
 
(19 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<languages/>
__TOC__
__TOC__
<translate>
==Installation== <!--T:37-->
Conky can be installed using the package manager
{{UserCmd|command=pamac install conky}}


===Configuration=== <!--T:38-->
All file names starting with a dot <code>.</code> are hidden files. If you want to see hidden files in your file manager, you need to make them visible. In most file managers this will be available in the options.
====Configuration file====
The default configuration file is located in {{ic|/usr/share/doc/conky-1.11.5_pre/conky.conf}} where version are subject to change.
Conky do not create a local conky folder so you will have to create beforehand
{{UserCmd|command=mkdir -p ~/.config/conky}}
Then copy the default to home
{{UserCmd|command=cp /usr/share/doc/conky-1.11.5_pre/conky.conf ~/.config/conky/conky.conf}}
The configuration file is a simple text file and the content written using [[https://www.lua.org/ |LUA syntax]] and is split into two parts


=Installation=
<!--T:39-->
* Configuration
* Text


Conky can be installed with this command:
===Conky configuration=== <!--T:40-->
sudo pacman -S conky
The first/upper part contains all the configuration settings for the entire conky. Things like the position of the conky on your screen, transparency settings, border settings, the default font and it's size, and how often your conky gets updated. The whole configuration belong between brackets like this
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.config = {
};</pre>
Some rules apply


 
* Every line end with <code>,</code>
=.conkyrc file=
* Non-boolean/numerical value should be placed between <code>'</code>
 
* Comment start with <code>--</code>
The entire conky is created from one file. by default, it is called <code>.conkyrc</code> and it's path is:
}}
~/.conkyrc
===Examples=== <!--T:41-->
or a longer file path:
/home/'''<username>'''/.conkyrc
Replace <code><username></code> with your user/account name.
 
All file names starting with a dot <code>.</code> are hidden files. If you want to see hidden files in your file manager, you need to make them visible. In most file managers you need to press <code>CTRL + H</code> to do that.
 
 
=Code=
The <code>.conkyrc</code> file can be edited with every text editor. It's code is split into two parts:
 
 
==First Part==
The first/upper part contains all the configuration settings for the entire conky. Things like the position of the conky on your screen, transparency settings, border settings, the default font and it's size, and how often your conky gets updated.
 
===Examples:===
'''1.''' This will set the default font color of your conky to white. Additionally, a <code>color1</code> gets set using a [http://html-color-codes.info/ Html Color Code]to a light blue:
'''1.''' This will set the default font color of your conky to white. Additionally, a <code>color1</code> gets set using a [http://html-color-codes.info/ Html Color Code]to a light blue:
default_color white
{{File|file=~/.config/conky/conky.conf|
color1 0ab1ff
content=<pre>conky.config = {
 
...
'''2.''' This enables Xft and sets the default Xft font (DejaVuSansCondensed) and it's size (11):
    default_color = 'white',    -- White default color
use_xft yes
    color1 = '0ab1ff',          -- Light blue
xftfont DejaVuSansCondensed:weight=Bold:pixelsize=11
...
 
};</pre>
}}
'''2.''' This enables Xft, set the default font (LiberationMono), make it bold and set it's size (8):
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.config = {
...
    use_xft = true,
    font = 'LiberationMono:bold:size=8',
...
};</pre>
}}
'''3.''' In order to position your conky on your screen, modify these settings:
'''3.''' In order to position your conky on your screen, modify these settings:
alignment top_right
{{File|file=~/.config/conky/conky.conf|
gap_x 18
content=<pre>conky.config = {
gap_y 20
...
Your conky gets placed in the top right corner of your desktop with a horizontal gap of 18 pixels (to your right screen edge) and a vertical gap of 20 pixels (to your top screen edge).
    alignment = 'top_right',    -- Conky gets placed in the top right corner of your desktop
    gap_x 18,                    -- with a horizontal gap of 18 pixels (to your right screen edge)
    gap_y 20,                    -- and a vertical gap of 20 pixels (to your top screen edge).
...
};</pre>
}}
'''4.''' In some case you can have multiple values for one setting, they will be separated by a coma:
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.config = {
...
    own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
...
};</pre>
}}
Use the command: <code>man conky</code>, and look into the '''CONFIGURATION SETTINGS''' section to see every settings available.


===Conky text=== <!--T:42-->
The second part contains the displayed conky code. Every code line corresponds to one displayed line on your desktop. There are a lot of available for displaying and modifying all kinds of information. Use the command: <code>man conky</code>, and look into the '''OBJECTS/VARIABLES''' section to see every objects/variables available.
{{BoxInfo|Info|The lines in the '''conky.text''' section is printed exactly as is. E.g. if you create an empty line between sections - conky will display an empty line.}}


A great [http://conky.sourceforge.net/config_settings.html documentation]of all possible configuration settings and their arguments is available.
The whole code belong between these two double bracket:
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
]];</pre>
}}
===Examples=== <!--T:43-->
'''1.''' You can choose the color of your font using one of the following variables:
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
...
${color}
${color1}
...
]];</pre>
}}


This part ends with a code line containing only one word: <code>TEXT</code>
<!--T:44-->
 
 
==Second Part==
The second part contains the displayed conky code. Every code line after the <code>TEXT</code> separator corresponds to one displayed line on your desktop. There are a lot of [http://conky.sourceforge.net/variables.html variables]available for displaying and modifying all kinds of information.
 
===Examples:===
'''1.''' You can choose the color of your font using one of the following variables:
$color
${color1}
Every variable is marked with a <code>$</code> sign and by <code>{ }</code> brackets (only needed, if the variable contains more than one word).
Every variable is marked with a <code>$</code> sign and by <code>{ }</code> brackets (only needed, if the variable contains more than one word).


<!--T:45-->
'''2.''' You can call the default font (and it's size) with this command:
'''2.''' You can call the default font (and it's size) with this command:
$font
{{File|file=~/.config/conky/conky.conf|
If you want a different font (DejaVuSerif) and font size (9) in your conky, use this command in your <code>.conkyrc</code> code:
content=<pre>conky.text = [[
${font DejaVuSerif:size=9}
...
 
$font
'''4.''' This code line displays the text "Kernel: " and the kernel you are using (using <code>$alignr</code> just yields a nicer formatting, it is not necessary: <code>$alignr</code> aligns all following text on the right of your conky):
...
Kernel: $alignr$kernel
]];</pre>
}}
If you want a different font (DejaVuSerif) and font size (9) in your conky, use this command in your <code>.conf</code> code:
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
...
${font DejaVuSerif:size=9}
...
]];</pre>
}}
'''3.''' This code line displays the text "Kernel: " and the kernel you are using (using <code>$alignr</code> just yields a nicer formatting, it is not necessary: <code>$alignr</code> aligns all following text on the right of your conky):
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
Kernel: ${alignr}${kernel}
]];</pre>
}}
'''4.''' This variable gives you the latest 3 manjaro blog entry titles (using rss). It checks for updates every 60 minutes.
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
${rss http://manjaro.org/feed/ 60 item_titles 3}
]];</pre>
}}
'''5.''' Information about the root partition <code>/</code> of your manjaro installation is displayed using
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
Root: ${alignr}${fs_used /} of ${fs_size /}
]];</pre>
}}
'''6.''' Instead of example 3, you can use the following code to display the exact same information:
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
Kernel: ${alignr}${execi 3600 uname -r}
]];</pre>
}}


'''5.''' This variable gives you the latest 3 manjaro blog entry titles (using rss). It checks for updates every 60 minutes.
===execi=== <!--T:46-->
${rss http://manjaro.org/feed/ 60 item_titles 3}
 
'''6.''' Information about the root partition <code>/</code> of your manjaro installation is displayed using
Root: ${alignr}${fs_used /} of ${fs_size /}
 
'''7.''' Instead of example 4, you can use the following code to display the exact same information:
Kernel: $alignr${execi 3600 uname -r}
The variable <code>${execi 3600 XXXX}</code> runs the <code>XXXX</code> bash code in your terminal every 3600 seconds and displays the result in your conky. The result of the <code>uname -r</code> bash command is your currently used kernel name.  
The variable <code>${execi 3600 XXXX}</code> runs the <code>XXXX</code> bash code in your terminal every 3600 seconds and displays the result in your conky. The result of the <code>uname -r</code> bash command is your currently used kernel name.  


<!--T:47-->
Use any bash command instead of <code>XXXX</code> you can think of. The bash commands can be as long and complicated as you want.  
Use any bash command instead of <code>XXXX</code> you can think of. The bash commands can be as long and complicated as you want.  


Warning: Using complicated bash commands (e.g. which call other programs or use large files) with low intervals (e.g. <code>${execi 2 XXXX}</code> runs the <code>XXXX</code> code once every 2 seconds and displays it's result in your conky) can use a lot of hardware resources and/or make your computer unresponsive.
<!--T:48-->
 
{{BoxInfo|Warning|Using complicated bash commands (e.g. which call other programs or use large files) with low intervals (e.g. <code>${execi 2 XXXX}</code> runs the <code>XXXX</code> code once every 2 seconds and displays it's result in your conky) can use a lot of hardware resources and/or make your computer unresponsive.}}
 
=Running conky=
 
If you want to display a conky on your desktop a <code>.conkyrc</code> file with code in it is required. Next, open a terminal and run conky:
conky
or
conky -d
if you want to run conky as a background daemon.
 
 
If you want to run conky automatically after each boot of your computer, you need to find out how to autostart a program. This depends on the Desktop Manager you are using. Putting one of the following commands into your autostart folder/file/script/command should work:
conky
 
sleep 20 && conky


conky -p 20
===Running conky=== <!--T:49-->
If you want to display a conky on your desktop a {{ic|~/.config/conky/conky.conf}} file with code in it is required. Next, open a terminal and run conky pointing to the file
{{UserCmd|command=conky -c ~/.config/conky/conky.conf}}
or to run as background daemon
{{UserCmd|command=conky -d -c ~/.config/conky/conky.conf}}


sh -c "sleep 20 && conky"
<!--T:50-->
If you want to run conky automatically after each boot of your computer, you need to find out how to autostart a program. This depends on the Desktop Manager you are using. The next is examples of how to run conky from your system autostart folder/file/script/command.
<code>sleep 20</code> and <code>-p 20</code> delay the start of conky by 20 seconds after your Desktop Environment has started. Adjust this value to your liking.
<code>sleep 20</code> and <code>-p 20</code> delay the start of conky by 20 seconds after your Desktop Environment has started. Adjust this value to your liking.


<!--T:51-->
{{UserCmd|command=conky -c ~/.config/conky/conky.conf &}}
{{UserCmd|command=sleep 20 && conky -c ~/.config/conky/conky.conf &}}


If you want to reload conky with the latest <code>.conkyrc</code> file (e.g. because you changed a variable and want to see the consequences) use one of the following commands:
<!--T:52-->
killall conky && conky
When you change the running conky configuration file - conky will reload. But if you changed one of your dependency scripts (e.g. because you changed a variable and want to see the consequences) you will have to reload conky
 
{{UserCmd|command=killall conky && conky -c ~/.config/config/conky.conf}}
pkill conky && conky
 
 
=More=
 
After having read everything about conky, it is time to create your own. The easiest way for beginners is to look at screenshots of conkys (and the corresponding <code>.conkyrc</code> files) and copy and paste the parts you like into your own <code>.conkyrc</code> file. Later, you can modify your <code>.conkyrc</code> code to your liking.
A dedicated conky thread in the Manjaro Forum with a lot of <code>.conkyrc</code> files and screenshots is available [https://forum.manjaro.org/index.php?topic=2991.0 here]. A massive conky thread is available in the [http://ubuntuforums.org/showthread.php?t=281865 Ubuntu forum]. Also, there are [https://www.reddit.com/r/conky multiple] [https://www.reddit.com/r/Conkyporn reddit] threads about conky.
Searching on the Internet for <code>.conkyrc</code> can yield a lot of great <code>.conkyrc</code> files, too.
 
A detailed [https://wiki.archlinux.org/index.php/conky Arch Wiki entry]exists. It contains a lot of useful information and links.
 
The [http://conky.sourceforge.net/ homepage]of the conky project can be interesting, especially the [http://conky.sourceforge.net/documentation.html documentation].
 
A forum discussion thread about this Manjaro Wiki page is available [https://forum.manjaro.org/index.php?topic=16844.0 here]
 
 
=Troubleshooting & Tips=
 
 
==Missing rings==
If (often colored) rings are missing in your conky, please install the following package:
yaourt -S conky-lua
[https://wiki.manjaro.org/index.php?title=AUR#Searching_for_and_Installing_Software_From_the_AUR Here]is help for installing packages from the Arch User Repository, in case you need it.
 
 
==Missing network information==
If network information is missing like download speed or network name (SSID), you need to replace the network card name in network variables in the <code>.conkyrc</code> file with your network card name.
 
Open a terminal and enter
ip a
in order to see all available network cards in your computer. A sample output looks like this:
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> ....
2: enp9s0: <BROADCAST,MULTICAST,UP,LOWER_UP> .....
3: wlp2s0: <BROADCAST,MULTICAST> .....
In this case, <code>enp9s0</code> is the name of your ethernet card and <code>wlp2s0</code> is the name of your wireless network card. Replace all network card names (e.g. <code>wlan0</code>, <code>eth0</code>) in network variables in your <code>.conkyrc</code> file with your preferred network card name.
 
 
==FAQ==
A detailed FAQ is available [http://conky.sourceforge.net/faq.html here]
 
 
 
 
=Alternative: Conky Manager=
 
For everybody, who does not like to look at conky code and mess around in config files or who just wants a quick and simple conky, Conky Manager is great. Conky Manager offers a simple GUI for managing and customizing conkys. Additional theme packs are available, too.
 
==Installation==
yaourt -S conky-manager
In case this installation fails, to to install
yaourt -S conky-manager-bzr
[https://wiki.manjaro.org/index.php?title=AUR#Searching_for_and_Installing_Software_From_the_AUR Here]is help for installing packages from the Arch User Repository.


==Additional information==
===Troubleshooting & Tips=== <!--T:53-->
Recently, a new version of [http://www.teejeetech.in/2014/06/conky-manager-v2-released.html Conky Manager]has been released. Shortly after, a couple of [http://www.teejeetech.in/2014/06/conky-manager-v2-themes.html theme][http://www.teejeetech.in/2014/07/my-conky-themes-update-2.html packs].


There are also [http://www.teejeetech.in/2013/07/super-conky-package.html theme][http://www.teejeetech.in/2013/07/deluxe-conky-theme-pack.html packs]available for the previous version. Full compatibility is not guaranteed, but they are definitely worth a try.
====Missing rings==== <!--T:54-->


A [https://www.youtube.com/watch?v=Va2rnyZJe10 Youtube]video with basic tips is available as well.
<!--T:55-->
To be able to use LUA scripts to execute drawing functions like clock rings - you will a conky package compiled with LUA support. Either build the package the package {{ic|conky-lua}} from [[Arch_User_Repository|AUR]] or install the {{ic|conky-lua-nv}} from the official repo.


====Missing network information==== <!--T:56-->
If network information is missing like download speed or network name (SSID), you need to replace the network interfaces in the configuration file with your network interface name. To get the names of your interfaces - open a terminal and execute
{{UserCmd|command=ip a | grep ' state UP' | cut -d' ' -f2 | cut -d':' -f1}}
Use the output from the command. Interface names starting with <code>en</code> is ethernet interface and names starting with <code>wl</code> is wireless interfaces. Replace all network interfaces names with (e.g. <code>wlan0</code>, <code>eth0</code>) in your <code>.conf</code> text section with the interface name(s) you retrieved from the above command.


===Conky Manager=== <!--T:57-->
An application named Conky manager exist but has not been updated for years and the configurations found in the package may work or they may not. You may install it - it can be a used as an inspiration but you should not rely on it. If you still think you it is a must have - you can build the package {{ic|conky-manager}} using [[Arch_User_Repository|AUR]]
{{UserCmd|command=pamac build conky-manager}}


[[Category:Contents Page]]
==See Also== <!--T:58-->
* The [https://github.com/brndnmtthws/conky/wiki Conky website]
* The [https://wiki.archlinux.org/index.php/conky Arch Wiki] page for Conky
</translate>
[[Category:Contents Page{{#translation:}}]]
[[Category:Applications{{#translation:}}]]

Latest revision as of 21:37, 20 June 2023

Other languages:
Deutsch • ‎English • ‎Türkçe • ‎español • ‎français • ‎português do Brasil • ‎русский • ‎فارسی

Installation

Conky can be installed using the package manager

user $ pamac install conky COPY TO CLIPBOARD


Configuration

All file names starting with a dot . are hidden files. If you want to see hidden files in your file manager, you need to make them visible. In most file managers this will be available in the options.

Configuration file

The default configuration file is located in /usr/share/doc/conky-1.11.5_pre/conky.conf where version are subject to change. Conky do not create a local conky folder so you will have to create beforehand

user $ mkdir -p ~/.config/conky COPY TO CLIPBOARD


Then copy the default to home

user $ cp /usr/share/doc/conky-1.11.5_pre/conky.conf ~/.config/conky/conky.conf COPY TO CLIPBOARD


The configuration file is a simple text file and the content written using [|LUA syntax] and is split into two parts

  • Configuration
  • Text

Conky configuration

The first/upper part contains all the configuration settings for the entire conky. Things like the position of the conky on your screen, transparency settings, border settings, the default font and it's size, and how often your conky gets updated. The whole configuration belong between brackets like this

~/.config/conky/conky.conf
conky.config = {
};

Some rules apply

  • Every line end with ,
  • Non-boolean/numerical value should be placed between '
  • Comment start with --

Examples

1. This will set the default font color of your conky to white. Additionally, a color1 gets set using a Html Color Codeto a light blue:

~/.config/conky/conky.conf
conky.config = {
...
    default_color = 'white',    -- White default color
    color1 = '0ab1ff',          -- Light blue
...
};

2. This enables Xft, set the default font (LiberationMono), make it bold and set it's size (8):

~/.config/conky/conky.conf
conky.config = {
...
    use_xft = true,
    font = 'LiberationMono:bold:size=8',
...
};

3. In order to position your conky on your screen, modify these settings:

~/.config/conky/conky.conf
conky.config = {
...
    alignment = 'top_right',     -- Conky gets placed in the top right corner of your desktop
    gap_x 18,                    -- with a horizontal gap of 18 pixels (to your right screen edge)
    gap_y 20,                    -- and a vertical gap of 20 pixels (to your top screen edge).
...
};

4. In some case you can have multiple values for one setting, they will be separated by a coma:

~/.config/conky/conky.conf
conky.config = {
...
    own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',
...
};

Use the command: man conky, and look into the CONFIGURATION SETTINGS section to see every settings available.

Conky text

The second part contains the displayed conky code. Every code line corresponds to one displayed line on your desktop. There are a lot of available for displaying and modifying all kinds of information. Use the command: man conky, and look into the OBJECTS/VARIABLES section to see every objects/variables available.

Info
The lines in the conky.text section is printed exactly as is. E.g. if you create an empty line between sections - conky will display an empty line.

The whole code belong between these two double bracket:

~/.config/conky/conky.conf
conky.text = [[
]];

Examples

1. You can choose the color of your font using one of the following variables:

~/.config/conky/conky.conf
conky.text = [[
...
${color}
${color1}
...
]];

Every variable is marked with a $ sign and by { } brackets (only needed, if the variable contains more than one word).

2. You can call the default font (and it's size) with this command:

~/.config/conky/conky.conf
conky.text = [[
...
$font
...
]];

If you want a different font (DejaVuSerif) and font size (9) in your conky, use this command in your .conf code:

~/.config/conky/conky.conf
conky.text = [[
...
${font DejaVuSerif:size=9}
...
]];

3. This code line displays the text "Kernel: " and the kernel you are using (using $alignr just yields a nicer formatting, it is not necessary: $alignr aligns all following text on the right of your conky):

~/.config/conky/conky.conf
conky.text = [[
Kernel: ${alignr}${kernel}
]];

4. This variable gives you the latest 3 manjaro blog entry titles (using rss). It checks for updates every 60 minutes.

~/.config/conky/conky.conf
conky.text = [[
${rss http://manjaro.org/feed/ 60 item_titles 3}
]];

5. Information about the root partition / of your manjaro installation is displayed using

~/.config/conky/conky.conf
conky.text = [[
Root: ${alignr}${fs_used /} of ${fs_size /}
]];

6. Instead of example 3, you can use the following code to display the exact same information:

~/.config/conky/conky.conf
conky.text = [[
Kernel: ${alignr}${execi 3600 uname -r}
]];

execi

The variable ${execi 3600 XXXX} runs the XXXX bash code in your terminal every 3600 seconds and displays the result in your conky. The result of the uname -r bash command is your currently used kernel name.

Use any bash command instead of XXXX you can think of. The bash commands can be as long and complicated as you want.


Warning
Using complicated bash commands (e.g. which call other programs or use large files) with low intervals (e.g. ${execi 2 XXXX} runs the XXXX code once every 2 seconds and displays it's result in your conky) can use a lot of hardware resources and/or make your computer unresponsive.

Running conky

If you want to display a conky on your desktop a ~/.config/conky/conky.conf file with code in it is required. Next, open a terminal and run conky pointing to the file

user $ conky -c ~/.config/conky/conky.conf COPY TO CLIPBOARD


or to run as background daemon

user $ conky -d -c ~/.config/conky/conky.conf COPY TO CLIPBOARD


If you want to run conky automatically after each boot of your computer, you need to find out how to autostart a program. This depends on the Desktop Manager you are using. The next is examples of how to run conky from your system autostart folder/file/script/command. sleep 20 and -p 20 delay the start of conky by 20 seconds after your Desktop Environment has started. Adjust this value to your liking.

user $ conky -c ~/.config/conky/conky.conf & COPY TO CLIPBOARD


user $ sleep 20 && conky -c ~/.config/conky/conky.conf & COPY TO CLIPBOARD


When you change the running conky configuration file - conky will reload. But if you changed one of your dependency scripts (e.g. because you changed a variable and want to see the consequences) you will have to reload conky

user $ killall conky && conky -c ~/.config/config/conky.conf COPY TO CLIPBOARD


Troubleshooting & Tips

Missing rings

To be able to use LUA scripts to execute drawing functions like clock rings - you will a conky package compiled with LUA support. Either build the package the package conky-lua from AUR or install the conky-lua-nv from the official repo.

Missing network information

If network information is missing like download speed or network name (SSID), you need to replace the network interfaces in the configuration file with your network interface name. To get the names of your interfaces - open a terminal and execute

user $ ip a COPY TO CLIPBOARD


Use the output from the command. Interface names starting with en is ethernet interface and names starting with wl is wireless interfaces. Replace all network interfaces names with (e.g. wlan0, eth0) in your .conf text section with the interface name(s) you retrieved from the above command.

Conky Manager

An application named Conky manager exist but has not been updated for years and the configurations found in the package may work or they may not. You may install it - it can be a used as an inspiration but you should not rely on it. If you still think you it is a must have - you can build the package conky-manager using AUR

user $ pamac build conky-manager COPY TO CLIPBOARD


See Also