Difference between revisions of "Basic Tips for conky"

no edit summary
imported>Dalto
(Added warning about contents being out of date)
imported>Yoy0
Line 10: Line 10:




=.conkyrc file=
=Configuration file=


The entire conky is created from one file. by default, it is called <code>.conkyrc</code> and it's path is:
Default Conky configuration file is located in:
  ~/.conkyrc
  ~/.config/conky/conky.conf
or a longer file path:
or a longer file path:
  /home/'''<username>'''/.conkyrc
  /home/'''<username>'''/.config/conky/conky.conf
Replace <code><username></code> with your user/account name.  
Replace <code><username></code> with your user/account name.  


Line 21: Line 21:


=Code=
=Code=
The <code>.conkyrc</code> file can be edited with every text editor. It's code is split into two parts:  
<code>conky.conf</code> can be edited with every text editor. It's code is split into two parts:  




==First Part==
==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 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 <code>,</code>
Non-boolean/numerical value should be placed between <code>'</code>
Comment start with <code>--</code>


===Examples:===
===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
  conky.config = {
color1 0ab1ff
    default_color = 'white',    -- White default color
 
    color1 = '0ab1ff',          -- Light blue
'''2.''' This enables Xft and sets the default Xft font (DejaVuSansCondensed) and it's size (11):
}
  use_xft yes
'''2.''' This enables Xft, set the default font (LiberationMono), make it bold and set it's size (8):
xftfont DejaVuSansCondensed:weight=Bold:pixelsize=11
  conky.config = {
 
    use_xft = true,
    font = 'LiberationMono:bold:size=8',
}
'''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
  conky.config = {
gap_x 18
    alignment = 'top_right',    -- Conky gets placed in the top right corner of your desktop
gap_y 20
    gap_x 18,                    -- with a horizontal gap of 18 pixels (to your right screen edge)
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).
    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: <code>man conky</code>, and look into the '''CONFIGURATION SETTINGS''' section to see every settings available.


A great [http://conky.sourceforge.net/config_settings.html documentation]of all possible configuration settings and their arguments is available.
A great [http://conky.sourceforge.net/config_settings.html documentation]of all possible configuration settings and their arguments is available.
{{warning|Is this link still relevant ?}}


This part ends with a code line containing only one word: <code>TEXT</code>
==Second Part==
 
The second part contains the displayed conky code. Every code line 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. Use the command: <code>man conky</code>, and look into the '''OBJECTS/VARIABLES''' section to see every objects/variables available.
{{warning|Again, is this link still relevant ?}}


==Second Part==
The whole code belong between these two double bracket:
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.
conky.text = [[
]]


===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).
Line 63: Line 85:


'''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):
'''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
  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.
Line 72: Line 94:


'''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 82: Line 104:
=Running conky=
=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:
If you want to display a conky on your desktop a <code>.config/conky/conky.conf</code> file with code in it is required. Next, open a terminal and run conky:
  conky
  conky
or  
or  
Anonymous user