Manjaro Difference between revisions of "Basic Tips for conky/fr"

Difference between revisions of "Basic Tips for conky/fr"

From Manjaro
(Updating to match new version of source page)
(Updating to match new version of source page)
 
Line 5: Line 5:
{{UserCmd|command=pamac install conky}}
{{UserCmd|command=pamac install conky}}


<div class="mw-translate-fuzzy">
===Configuration===
===Configuration===
Tout fichier ayant un nom commençant par un point <code>.</code> est un fichier caché. Si vous voulez voir ces fichiers, il faudra les rendre visible, en activant l'option le permettant dans votre explorateur de fichier (ce qui peut être fait avec Ctrl+h dans certains).
Tout fichier ayant un nom commençant par un point <code>.</code> est un fichier caché. Si vous voulez voir ces fichiers, il faudra les rendre visible, en activant l'option le permettant dans votre explorateur de fichier (ce qui peut être fait avec Ctrl+h dans certains).
Line 14: Line 15:
{{UserCmd|command=cp /usr/share/doc/conky-1.11.5_pre/conky.conf ~/.config/conky/conky.conkyrc}}
{{UserCmd|command=cp /usr/share/doc/conky-1.11.5_pre/conky.conf ~/.config/conky/conky.conkyrc}}
Ce fichier est un bête document texte respectant la [[https://www.lua.org/ |syntaxe LUA]], et possède la propriété d'être découpé en deux parties bien distinctes
Ce fichier est un bête document texte respectant la [[https://www.lua.org/ |syntaxe LUA]], et possède la propriété d'être découpé en deux parties bien distinctes
</div>


* La configuration
* La configuration
* Du texte
* Du texte


<div class="mw-translate-fuzzy">
===Configuration de Conky===
===Configuration de Conky===
La partie la plus haute contient tous les éléments nécessaires à la configuration de conky, par exemple la position sur l'écran, la transparence, la gestion des bords, la fréquence de rafraîchissement ou encore la gestion de la police. Toutes les règles de configuration se trouvent alors dans des accolades comme ci-dessous
La partie la plus haute contient tous les éléments nécessaires à la configuration de conky, par exemple la position sur l'écran, la transparence, la gestion des bords, la fréquence de rafraîchissement ou encore la gestion de la police. Toutes les règles de configuration se trouvent alors dans des accolades comme ci-dessous
Line 24: Line 27:
};</pre>
};</pre>
Il y a cependant quelques règles
Il y a cependant quelques règles
</div>


<div class="mw-translate-fuzzy">
* Chaque ligne doit finir par <code>,</code>
* Chaque ligne doit finir par <code>,</code>
* Les valeurs qui ne sont ni des nombres ni des booléens (True/False) doivent être placé entre guillemets <code>'</code>
* Les valeurs qui ne sont ni des nombres ni des booléens (True/False) doivent être placé entre guillemets <code>'</code>
Line 67: Line 72:
}}
}}
On le répétera jamais assez, mais le manuel est votre meilleur allié : <code>man conky</code>, jetez un œil sous '''CONFIGURATION SETTINGS''' pour voir toutes les options disponibles.
On le répétera jamais assez, mais le manuel est votre meilleur allié : <code>man conky</code>, jetez un œil sous '''CONFIGURATION SETTINGS''' pour voir toutes les options disponibles.
</div>


===Texte affiché par Conky===
===Texte affiché par Conky===
Line 74: Line 80:
<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
The whole code belong between these two double bracket:
The whole code belong between these two double bracket:
{{File|file=~/.config/conky/conky.conkyrc|
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
content=<pre>conky.text = [[
]];</pre>
]];</pre>
Line 80: Line 86:
===Examples===
===Examples===
'''1.''' You can choose the color of your font using one of the following variables:
'''1.''' You can choose the color of your font using one of the following variables:
{{File|file=~/.config/conky/conky.conkyrc|
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
content=<pre>conky.text = [[
...
...
Line 96: Line 102:
<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
'''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:
{{File|file=~/.config/conky/conky.conkyrc|
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
content=<pre>conky.text = [[
...
...
Line 103: Line 109:
]];</pre>
]];</pre>
}}
}}
If you want a different font (DejaVuSerif) and font size (9) in your conky, use this command in your <code>.conkyrc</code> code:
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.conkyrc|
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
content=<pre>conky.text = [[
...
...
Line 112: Line 118:
}}
}}
'''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):
'''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.conkyrc|
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
content=<pre>conky.text = [[
Kernel: ${alignr}${kernel}
Kernel: ${alignr}${kernel}
Line 118: Line 124:
}}
}}
'''4.''' This variable gives you the latest 3 manjaro blog entry titles (using rss). It checks for updates every 60 minutes.
'''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.conkyrc|
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
content=<pre>conky.text = [[
${rss http://manjaro.org/feed/ 60 item_titles 3}
${rss http://manjaro.org/feed/ 60 item_titles 3}
Line 124: Line 130:
}}
}}
'''5.''' Information about the root partition <code>/</code> of your manjaro installation is displayed using
'''5.''' Information about the root partition <code>/</code> of your manjaro installation is displayed using
{{File|file=~/.config/conky/conky.conkyrc|
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
content=<pre>conky.text = [[
Root: ${alignr}${fs_used /} of ${fs_size /}
Root: ${alignr}${fs_used /} of ${fs_size /}
Line 130: Line 136:
}}
}}
'''6.''' Instead of example 3, you can use the following code to display the exact same information:
'''6.''' Instead of example 3, you can use the following code to display the exact same information:
{{File|file=~/.config/conky/conky.conkyrc|
{{File|file=~/.config/conky/conky.conf|
content=<pre>conky.text = [[
content=<pre>conky.text = [[
Kernel: ${alignr}${execi 3600 uname -r}
Kernel: ${alignr}${execi 3600 uname -r}
Line 152: Line 158:
<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
===Running conky===
===Running conky===
If you want to display a conky on your desktop a {{ic|~/.config/conky/conky.conkyrc}} file with code in it is required. Next, open a terminal and run conky pointing to the file
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.conkyrc}}
{{UserCmd|command=conky -c ~/.config/conky/conky.conf}}
or to run as background daemon
or to run as background daemon
{{UserCmd|command=conky -d -c ~/.config/conky/conky.conkyrc}}
{{UserCmd|command=conky -d -c ~/.config/conky/conky.conf}}
</div>
</div>


Line 164: Line 170:


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
{{UserCmd|command=conky -c ~/.config/conky/conky.conkyrc &}}
{{UserCmd|command=conky -c ~/.config/conky/conky.conf &}}
{{UserCmd|command=sleep 20 && conky -c ~/.config/conky/conky.conkyrc &}}
{{UserCmd|command=sleep 20 && conky -c ~/.config/conky/conky.conf &}}
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
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
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.conkyrc}}
{{UserCmd|command=killall conky && conky -c ~/.config/config/conky.conf}}
</div>
</div>


Line 189: Line 195:
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
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}}
{{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>.conkyrc</code> text section with the interface name(s) you retrieved from the above command.
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.
</div>
</div>



Latest revision as of 08:01, 5 July 2023

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

Installation

Conky peut être installé en utilisant le gestionnaire de paquets

user $ pamac install conky COPY TO CLIPBOARD


Configuration

Tout fichier ayant un nom commençant par un point . est un fichier caché. Si vous voulez voir ces fichiers, il faudra les rendre visible, en activant l'option le permettant dans votre explorateur de fichier (ce qui peut être fait avec Ctrl+h dans certains).

Fichiers de configuration

Les fichiers de configuration par défaut qont présents dans /usr/share/doc/conky-1.11.5_pre/conky.conf, pensez juste à changer le numéro de version par le votre. Conky ne créer pas de fichiers ou de dossiers de configuration local à l'utilisateur, il faudra donc créer d'abord le dossier avec :

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

Et ensuite copier le fichier de configuration à l'intérieur

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


Ce fichier est un bête document texte respectant la [|syntaxe LUA], et possède la propriété d'être découpé en deux parties bien distinctes

  • La configuration
  • Du texte

Configuration de Conky

La partie la plus haute contient tous les éléments nécessaires à la configuration de conky, par exemple la position sur l'écran, la transparence, la gestion des bords, la fréquence de rafraîchissement ou encore la gestion de la police. Toutes les règles de configuration se trouvent alors dans des accolades comme ci-dessous

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

Il y a cependant quelques règles

  • Chaque ligne doit finir par ,
  • Les valeurs qui ne sont ni des nombres ni des booléens (True/False) doivent être placé entre guillemets '
  • Un commentaire commence par --

Exemples

1. L'exemple ci-dessous donnera une couleur blanche au texte de Conky. Accessoirement, color1 permet grâce au code couleur HTML d'obtenir un bleu assez clair :

~/.config/conky/conky.conkyrc
conky.config = {
...
    default_color = 'white',    -- Blanc par défaut
    color1 = '0ab1ff',          -- Bleu clair
...
};

2. Ici, nous activons Xft, changeons la police de base (LiberationMono), la mettons en gras et changeons sa taille (8):

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

3. Afin de changer la position de Conky sur votre écran, modifiez les valeurs suivantes :

~/.config/conky/conky.conkyrc
conky.config = {
...
    alignment = 'top_right',     -- Pour le placer dans le coin en haut à droite
    gap_x 18,                    -- avec un écart horizontal de 18 pixels (par apport au coin)
    gap_y 20,                    -- et un écart vertical de 20 pixel (toujours par apport au coin).
...
};

4. Dans certaines situations, il se peut que vous ayez plusieurs valeurs pour un seul paramètre. Il faudra alors les séparer avec une virgule, comme suit :

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

On le répétera jamais assez, mais le manuel est votre meilleur allié : man conky, jetez un œil sous CONFIGURATION SETTINGS pour voir toutes les options disponibles.

Texte affiché par Conky

La seconde partie contient le code qui sera affiché par Conky. Chaque ligne correspond à une indication qui figurera sur Conky. Il y en a tout un tas et nous ne pourrons toutes les exposer ici, alors vous savez que seule le manuel pourra vous guider entièrement dans cette tâche infernale : man conky, regardez en-deçà de OBJECTS/VARIABLES pour connaître toutes les options et variables disponibles.

Info
Les lignes à l'intérieur de conky.text seront imprimées à l'identique. Ex : si vous laissez une ligne vide dans le fichier, Conky affichera une ligne vide.

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

Cookies help us deliver our services. By using our services, you agree to our use of cookies.