Basic Tips for conky

Revision as of 20:15, 21 July 2019 by imported>Dalto (General clean-up, remove outdated links/references, formatting)


Installation

Conky can be installed with this command:

pamac install conky


Configuration

Configuration file

Default Conky configuration file is located in:

~/.config/conky/conky.conf

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.


conky.conf can be edited with every text editor. It's code is split into two parts:


First Part - Window/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 these two accolade:

conky.config = {
}

Some rules to respect:

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:

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):

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

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

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:

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.


Second Part - What is displayed by conky

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.


The whole code belong between these two double bracket:

conky.text = [[
]]


Examples:

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

${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:

$font

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

${font DejaVuSerif:size=9}

4. 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):

Kernel: ${alignr}${kernel}

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

${rss http://manjaro.org/feed/ 60 item_titles 3}

6. Information about the root partition / 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 ${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:

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
sh -c "sleep 20 && conky"

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.


If you want to reload conky with the latest .conkyrc file (e.g. because you changed a variable and want to see the consequences) use one of the following commands:

killall conky && conky
pkill conky && conky


Troubleshooting & Tips

Missing rings

If (often colored) rings are missing in your conky, you may install the package conky-lua from AUR using your favorite package manager or with the command:

pamac build conky-lua


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 .conkyrc 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, enp9s0 is the name of your ethernet card and wlp2s0 is the name of your wireless network card. Replace all network card names (e.g. wlan0, eth0) in network variables in your .conkyrc file with your preferred network card name.


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.

To install Conky Manager install the package conky-manager from AUR using your favorite package manager or with the command:

pamac build conky-manager


See Also