Difference between revisions of "Basic Tips for conky"

small improvements
imported>Excalibur1234
imported>Excalibur1234
(small improvements)
Line 8: Line 8:
=.conkyrc file=
=.conkyrc file=


The entire conky is created from one file. by default, it is called <code>.conkyrc</code> file and the path is:
The entire conky is created from one file. by default, it is called <code>.conkyrc</code> file and it's path is:
  ~/.conkyrc
  ~/.conkyrc
or a longer file path:
or a longer file path:
Line 14: Line 14:
Replace <code><username></code> with your user/account name.  
Replace <code><username></code> with your user/account name.  


All files with 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.
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.




Line 21: Line 21:


==First Part==
==First Part==
The first 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 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:===
===Examples:===
1. This will set the default font color of your conky to a white font. 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
  default_color white
  color1 0ab1ff
  color1 0ab1ff


2. This enables Xft and sets the default Xft font (DejaVuSansCondensed) and it's size (11):
'''2.''' This enables Xft and sets the default Xft font (DejaVuSansCondensed) and it's size (11):
  use_xft yes
  use_xft yes
  xftfont DejaVuSansCondensed:weight=Bold:pixelsize=11
  xftfont DejaVuSansCondensed:weight=Bold:pixelsize=11


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
  alignment top_right
  gap_x 18
  gap_x 18
  gap_y 20
  gap_y 20
Your conky gets placed in the top right corner of your desktop with a horizontal gap of 18 pixels and a vertical gap of 20 pixels.
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).




Line 43: Line 43:


==Second Part==
==Second Part==
The second part contains the displayed conky code. Every code line after the <code>TEXT</code> separator corresponds to one displayed conky 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.
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:===
===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:
  $color
  $color
  ${color1}
  ${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).


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
  $font
If you want a different font and font size 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>.conkyrc</code> code:
  ${font DejaVuSerif:size=9}
  ${font DejaVuSerif:size=9}


4. This code line displays the kernel you are using (using <code>$alignr</code> just yields a nicer formatting):
'''4.''' This code line displays the kernel you are using (using <code>$alignr</code> just yields a nicer formatting, it is not necessary):
Kernel: $alignr$kernel
Kernel: $alignr$kernel


5. This variable gives you the latest 3 manjaro blog entry titles (using rss). It checks for updates every 60 minutes.
'''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}
  ${rss http://manjaro.org/feed/ 60 item_titles 3}


6. Information about the root partition <code>/</code> of your manjaro installation is displayed using
'''6.''' Information about the root partition <code>/</code> of your manjaro installation is displayed using
  Root: ${alignr}${fs_used /} of ${fs_size /}
  Root: ${alignr}${fs_used /} of ${fs_size /}


7. Instead of example 4, you can use the following code to display the exact same information:
'''7.''' Instead of example 4, you can use the following code to display the exact same information:
  Kernel: $alignr${execi 3600 uname -r}
  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.  
Line 71: Line 71:
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 ....}</code>) can use a lot of hardware resources and/or make your computer unresponsive.
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.




Line 83: Line 83:




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. After that running one of the following commands should work:
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
  conky


  conky -d
  sleep 20 && conky


  sh -c "sleep 10 && conky"
  sh -c "sleep 20 && conky"
<code>sleep 20</code> delays the start of conky by 20 seconds after your Desktop Environment has started. adjust this value to your liking.


sleep 10 && conky


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


If you want to reload conky with the latest .conkyrc file (e.g. you changed a variable and want to see the consequences) use
  pkill conky && conky
  killall conky && conky -d




=More=
=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 copy and paste the parts you like the most into your own <code>.conkyrc</code> file. Later, it can get modified.
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]. Searching on the Internet for <code>.conkyrc</code> can yield a lot of great <code>.conkyrc</code> files, too.
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]. Searching on the Internet for <code>.conkyrc</code> can yield a lot of great <code>.conkyrc</code> files, too.


A detailed ArchWiki [https://wiki.archlinux.org/index.php/conky entry]exists. It contains a lot of useful information and links.
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].
The [http://conky.sourceforge.net/ homepage]of the conky project can be interesting, especially the [http://conky.sourceforge.net/documentation.html documentation].
Line 114: Line 115:
If (often colored) rings are missing in your conky, please install the following package:
If (often colored) rings are missing in your conky, please install the following package:
  yaourt -S conky-lua
  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.
[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==
==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.
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 an enter  
Open a terminal and enter  
  ip a
  ip a
in order to see all available network cards in your computer. A sample output looks like this:
in order to see all available network cards in your computer. A sample output looks like this: