Page 1 of 5 123 ... LastLast
Results 1 to 10 of 48

Thread: Easy configuring conky with conkyconf

  1. #1

    Default Easy configuring conky with conkyconf

    Overview

    conky is a light-weight powerful monitoring tool that displays information about CPU load and temperature, file systems and RAM usage, hard disk IO and temperature, network traffic, top CPU and memory processes, weather forecast and many other things.


    conkyconf is a bash script that generates a conky system or user configuration file based on the information gathered from your system. It has several options which let you add a few things you want to monitor. In addition to this script, the conkyconf package includes a lua script that adds functionality that can't be done in conky alone and improves conky's appearance. conkyconf has the following dependencies under openSUSE:

    Code:
    The following NEW packages are going to be installed:
      conky conky-devel conkyconf conkyweather hddtemp imlib2 imlib2-loaders tolua++

    Credits

    The conky version installed with conkyconf is the one with nvidia support I branched from @malcolmlewis's repo - thanks go to him! It allows conky to monitor nvidia graphics card frequency and temperature. I added curl and rss support to Malcolm's build - the latter is needed by conkyconf - as well as hddtemp prerequisite.

    conkyweather, also installed with conkyconf, is based on google weather by Hardik Mehta. Thanks go to him too!


    Installation

    To install conkyconf with all dependencies, just install my repo (if you don't have it already) and the package:

    Code:
    su -l
    zypper ar http://download.opensuse.org/repositories/home:/please_try_again/openSUSE_11.4/  PTA
    zypper refresh 
    zypper in conkyconf
    Basic Usage

    To write a basic conky configuration, just type:

    Code:
    conkyconf
    Kde users might want to type the following instead:

    Code:
    conkyconf -k
    This command creates the file .conkyrc in the user's home directory (~/.conkyrc).

    The difference between conkyconf an conkyconf -k resides in this conky setting:

    Code:
    --- /root/.conkyrc.kde  2011-08-30 20:51:58.000000000 -0700
    +++ /root/.conkyrc      2011-08-30 20:52:20.000000000 -0700
    @@ -17,7 +17,7 @@
     own_window_type normal
     own_window_transparent yes
     own_window_class Conky
    -own_window_argb_visual yes
    +own_window_argb_visual no
     own_window_colour 082103
     own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

    To achieve conky's transparency under kde (and some xfce but not the one in openSUSE 11.4), own_window_argb_visual has to be set to no. Older conkyconf versions used to write a different config file for KDE. Now the conky wrapper (conky.sh) installed with the package takes care of that. There is also a function setargb in the lua script which can switch this value while initializing conky but I wasn't too happy with this function and disabled it by default.

    You can create a standard or KDE-specific system-wide conky configuration by using respectively:

    Code:
    conkyconf -s
    or
    Code:
    conkyconf -sk
    However the conky wrapper won't modify the system-wide /etc/conky/conky.conf in user's session. And it's not necessary to create a system-wide configuration for conky - but the feature exists.

    The basic configuration file generated by conkyconf while used without options displays:

    • Current Date & time and system uptime
    • CPU(s) info and load
    • available and used RAM
    • CPU & Mainboard temperature (if sensors were found). Critical temperatures are displayed in red.
    • Default network interface up and down traffic
    • local IP, gateway and DNS
    • space utilization of mounted filesystems (in GB and percentage)
    • top 5 CPU processes
    • top 3 memory processes


    Everytime you run conkyconf, the configuration file gets overwritten with the new settings. When the configuration file has been changed, such as after running conkyconf, conky reloads itself to reflect the new configuration. It is sometimes necessary to kill and restart conky.


    Display options

    conkyconf has several options that can be used to add other monitoring panels. Each option as a short and a long name.

    You can print the available options with:

    Code:
    conkyconf -h
    -d --diskio
    Monitors write/read IO and temperature of all found hard disks.

    -N --nvidia
    Monitors nvidia GPU frequency and temperature. This option is ignored if the nvidia module is not loaded or the conky version used doesn't have nvidia support.
    The temperature sensor might not be available on older nvidia chipsets (such as GeForce 6150). In this case N/AC will be displayed (I'll fix this detail later). A lua function defined in /etc/conky/conky.lua returns the temperature in red if it exceeds the threshold given by the sensor.

    -w --weather
    -f --forecast
    Weather and weather forecast. Simply use -wf for both. These options requires conkyweather, installed with conkyconf.

    -g --geo <location>
    Specifies the geographical location as City,Country State for weather info and forecast above. You have to use this option, as the default location defined in conkyconf is unlikely to be your place. Don't try too many locations or you will get banned fom Google weather site (it happened to me). Last time I checkecd, locations like the following were valid:

    -g London,UK
    -g Sydney,AU
    -g Austin,TX
    -g Paris,FR

    You can (and you should) also modify the default location by editing /usr/bin/conkyconf as root and changing the value of the variable LOC in the script. Then you won't have to specify it on the command line.

    -r --rss <RSS feed>
    Displays RSS feed in one line of horizontal scrolling text. The default rss feed for openSUSE is 'http://forums.opensuse.org/external.php?type=RSS2'. It can be changed in /usr/bin/conkyconf. Horizontal scrolling doesn't work properly in conky 1.8.0. It got fixed in conky 1.8.1 at the cost of new line parsing. Basically both conky versions are buggy, but I would say that the bug in 1.8.1 is worse. It prevents conky from parsing strings returned by the lua script (or by any external command) correctly as soon as they include more they one line. Thus conkyconf checks which conky version is installed and generates a configuration file accordingly. Version 1.8.0 makes internally a better use of the lua functions but the appearance of conky shows no difference.

    -l --log <logfile>
    -n --lines <lines>
    Displays the <lines> number of lines of the given logfile. You need read access to this file. It doesn't work very well because of the bugs mentioned above.


    other options

    -k --kde
    generates a config file appropriate for kde transparency

    -i --interval <n.n>
    This option sets the given update interval in ~/.conkyrc but doesn't overwrite other settings or variables. The default update interval is 1 second. Increasing this value will drasticaly reduce conky's CPU usage. You can try

    Code:
    conkyconf -i 5
    and (just for fun):
    Code:
    conkyconf -i 0.1
    and watch the difference.

    -p --print
    prints the generated config file to standard output rather than writing it - useful for testing.


    other variables you can change

    You can change several default values in the script itself. Some of them have can be set by command line options.

    Code:
    variables/default value        cli option        	 
    
    LOC="Victoria,BC"	      -g --geo	        # City/State, province or country for weather info.
    interval=1.0		      -i --interval	# Update interval  
    log=/var/log/messages	      -l --log          # default log file				 	
    lines=5			      -n --lines        # number of log lines to display
    
    
    topcpu=5				        # Number of top CPU processes to display - 0 to disable
    topmem=3				        # Number of top MEM processes to display - 0 to disable
    vspace=3				        # vertical space in pixels between panels
    alignment=top_right		                # top_left, top_right, bottom_left, bottom_right, none
    Colors

    There are 5 color themes predefined in conkyconf. The one used by default is determined by the first 3 letters of the Distributor ID returned by lsb_release: sus fed man arc and ubu - or the first 3 letters of the value stored in the variable OS in all other cases. You can overwrite some of all colors in the theme by uncommenting these colors and changing their value:

    Code:
    # You can define some colors here to overwrite the distro themes.
    # You have to to define the colors here if the distro colors are not defined!
    # !!! When specifying the color value in hex, omit the leading hash (#) !!! 
    
    #own_window_color=black
    #default_color=white
    #label_color=goldenrod	
    #caption_color=white
    #hr_color=white
    #fs_color=white
    #fs_used_color=red
    #fs_free_color=green
    #weather_label_color=yellow
    #weather_color=yellow
    #value_color=yellow
    #frame_color=ivory1
    #forecast_color=LightGray
    #critical_color=red
    #fs_pct_color=yellow
    #cpu_pct_color=white
    #shade_color=black
    #outline_color=black
    #uptime_color=DarkOrange1
    #netup_color=red
    #netdown_color=yellow
    #proc_run_color=red
    #forecasticon_color=LightGray
    #rss_color=yellow
    
    # !!! The following colors must be specified in hex.
    #fs_bar_color=00ff00
    #cpubar_color=ffa500
    #cpugd1_color=ffe421
    #cpugd2_color=ff0000
    #netdowngd1_color=000000
    #netdowngd2_color=00ff00
    #netdupgd1_color=000000
    #netdupgd2_color=ff0000
    #log_color=af0000


    More settings from here

    conkyconf covers only a few of the many conky variables. You can modify the ~/.conkyrc file created by conkyconf to suit your needs. Be aware though that this file will be overwritten next time you run conkyconf. For more info, read the documentation about conky variables and config file settings.


    The conky wrapper

    The conky wrapper (/usr/bin/conky.sh) is a small bash script that you can use to start conky. It checks if conky is already running before starting it - don't use it if you want to launch several instances of conky! It set the value of own_window_argb_visual to yes or no by checking the value of the environment variable DESKTOP_SESSION. This variable is set by kdm and gdm. It won't work if your kde session is not called 'kde'. It works for me because I try to organize things in the way that seems the most clean and the most logical to me, and so my kde session is called 'kde'. If yours is called 'default' - as explained in this post by jdmcdaniel3, either modify your session name or the conky wrapper, or don't use it. It is only useful if you often switch between KDE an other desktops and want to preserve conky's transparency. Transparency only works under KDE when compositing (desktop effects) is enable. Most people use desktop effects under KDE and there are on by default. However, the conky wrapper checks if KDE compositing is enable and if not, starts the simple compositing manager xcompmgr (if present), providing a way to have conky's transparency under KDE without desktop effects.


    compositor

    Compositor is a bash script that set/unset composting on the fly under various desktops. As I originally wrote it to test conky transparency, it is included in conkyconf.


    Autostarting conky

    conkyconf includes /etc/xdg/autostart/conky.desktop wich starts conky.sh by default in Gnome, XFCE, LXDE and other sessions evaluating the files in /etc/xdg/autostart, such as openbox-session running xdg-autostart in ~/.config/openbox/autostart.sh:

    Code:
    # Run XDG autostart things.  By default don't run anything desktop-specific
    # See xdg-autostart --help more info
    DESKTOP_ENV="OPENBOX"
    if which /usr/lib64/openbox/xdg-autostart >/dev/null; then
      /usr/lib64/openbox/xdg-autostart $DESKTOP_ENV
    fi
    To prevent the conky wrapper from starting automatically, you can disable it in the desktop's sessions and autostart setup or edit the /etc/xdg/autostart/conky.desktop and change these values:

    Code:
    --- /etc/xdg/autostart/conky.desktop.orig       2011-08-31 11:02:49.000000000 -0700
    +++ /etc/xdg/autostart/conky.desktop    2011-08-31 11:03:34.000000000 -0700
    @@ -6,7 +6,7 @@
     Exec=conky.sh
     StartupNotify=false
     Terminal=false
    -Hidden=false
    +Hidden=true
     X-KDE-autostart-phase=2
     NotShowIn=KDE;
    -X-GNOME-Autostart-enabled=true
    +X-GNOME-Autostart-enabled=false
    To start conky rather than the wrapper, replace Exec=conky.sh with Exec=conky.

    To autostart conky or conky.sh in kde, create the file ~/.kde4/Autostart/conky.desktop with the following content:

    Code:
    [Desktop Entry]
    Encoding=UTF-8
    Version=1.0
    Type=Application
    Name=conky
    Exec=conky
    StartupNotify=false
    Terminal=false
    Hidden=false
    X-KDE-autostart-phase=2
    OnlyShowIn=KDE;
    X-KDE-autostart-phase=2 is needed to start conky after the saved session, so that it doesn't get both restored and autostarted. This variable seems to be evaluated only in ~/.kde4/Autostart but NOT in ~/.config/autostart (and the system-wide /etc/xdg/autostart). Alternatively, you can add excludeApps=conky in the [General] section of ~/.kde4/share/config/ksmserverrc to exclude conky from sessions.

    To autostart conky in icewm-session, create the file ~/.icewm/startup with following content:

    Code:
    #!/bin/bash
    ( sleep 1 && conky.sh )

  2. #2

    Default Re: Easy configuring conky with conkyconf

    Another broken thing in Conky 1.8.1 is apcupsd support. Since it was working in the previous version, I reversed a patch to restore apcupsd.c and apcupsd.h from the previous version. It worked (as shown on the picture right). Not sure how clever it was, but it worked on all distros I applied the patch. The reverse patched version of conky is available in my repo. This version should get installed together with conkyconf.
    I also added an option in conkyconf to monitor ups status, load,charge and time left. It requires the apcupsd daemon to run. If apcupsd is not running, the option wil be ignored.
    If apcupsd is not installed, you can install it with zypper:
    Code:
    zypper in apcupsd
    conkyconf options

    monitors option
    • Current Date & time and system uptime
    • CPU(s) info and load
    • available and used RAM
    • CPU & Mainboard temperature
    • Default network interface up and down traffic
    • local IP, gateway and DNS
    • space utilization of mounted filesystems
    • top 5 CPU processes
    • top 3 memory processes
    none
    • ups status,load, charge, time left

    -u --ups
    • Nvidia GPU frequency and temperature

    -N -nvidia
    • Hard disk read/write IO and temperature

    -d --diskio
    • Weather info
    • Weather forecast
    • location

    * Or set the default value of LOC in /usr/bin/conkyconf
    to match your location.

    -w --weather
    -f --forecast
    -g --geo
    <location>
    • rss feed

    * or set the devault value of sus_rss in /usr/sbin/conkyconf

    -r --rss
    <url>
    • latest n lines of a log
    -l --log <file>
    -n --lines <n>
    • update interval (in seconds with 1 decimal place)

    -i --interval
    <n.m>
    • KDE transparency

    -k --kde




    Short options can be combined if they don't have arguments. Here's the ~/.conkyrc generated by conkyconf -wfduNr on my system. This file doesn't show all conky's variables. Everything in red in the example below is returned to conky by the lua script /etc/conky/conky.lua, included in the conkyconf package.

    Code:
    # check http://conky.sourceforge.net/config_settings.html for the list of settings
    # Check http://conky.sourceforge.net/variables.html for the list of variables
    
    background yes
    
    font 7x13
    # Use Xft?
    use_xft yes
    xftfont Bitstream Vera Sans Mono:size=9
    xftalpha 0.8
    override_utf8_locale no
    short_units
    
    update_interval 1.0
    total_run_times 0
    
    own_window yes
    own_window_type normal
    own_window_transparent yes
    own_window_class Conky
    own_window_argb_visual no
    own_window_colour 082103
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    
    double_buffer yes
    minimum_size 320 5
    maximum_width 320
    max_text_width 0
    
    draw_shades yes
    draw_outline no
    draw_borders no
    draw_graph_borders yes
    stippled_borders 5
    border_inner_margin 0
    border_outer_margin 0
    border_width 1
    
    default_color white 
    default_shade_color black 
    default_outline_color black
    color0 PaleGreen
    color1 DarkSeaGreen
    color2 SeaGreen
    color3 GreenYellow
    color4 red
    color5 white
    color6 DarkOliveGreen3
    color7 DarkOliveGreen2
    color8 white
    color9 ForestGreen
    default_bar_size 115 10
    
    alignment top_right
    gap_x 8
    gap_y 2 
    
    no_buffers yes
    uppercase no
    cpu_avg_samples 2
    net_avg_samples 2
    use_spacer none
    
    top_name_width 18
    top_cpu_separate false
    
    lua_load /etc/conky/conky.lua
    lua_startup_hook init
    
    TEXT
    ${if_running plasma-desktop}${voffset 35}${endif}${color}${time %a, %d %b %Y, %H:%M:%S} ${goto 190}${color0}Uptime:${color DarkOrange1} ${uptime}
    ${color2}${stippled_hr}
    ${color0}Linux Kernel: ${color8}${kernel} on ${machine}
    ${color0}CPU Details:  ${color8}${machine}, $freq(MHz)
    ${color0}CPU1:${offset +4}${lua_parse cpubar 1 ffa500 ffffff}${goto 165}${color0}CPU2:${offset +4}${lua_parse cpubar 2 ffa500 ffffff}
    ${voffset 3}${color0}RAM used:${color8}${alignr 160} ${mem} ($memperc%)${goto 165}${lua_parse temperature CPU}
    ${color0}Available RAM:${color8}${goto 100}${memmax}${goto 165}${lua_parse temperature MB}
    ${color9}${cpugraph 3dba19 aecf4c -t -l}
    ${if_running apcupsd}${apcupsd localhost 3551}${if_match "${apcupsd_model}" != "N/A"}${voffset 3}${color1}APC: ${color6}${apcupsd_model}${color2}${hr}
    ${color6}status${goto 60}load${goto 190}charge${goto 250}time left
    ${lua_parse apcbar 7cdd17 white}${endif}${endif}
    ${voffset 3}${color1}Nvidia Gfx card ${color2}${hr}
    ${color0}GPU Frequency:${color8}${goto 110}${nvidia gpufreq} Mhz ${lua_parse gputemp temp}
    ${color0}Mem Frequency:${color8}${goto 110}${nvidia memfreq} Mhz${goto 165}${color0}Image quality:${color8}${alignr}${nvidia imagequality} 
    ${if_up eth0}${voffset 3}${color1}Network ${color}($nodename) ${color2}${hr}
     ${color}eth0: ${color0}Down:${color yellow1} ${downspeed eth0}/s${color0}${goto 190}Up:${color OrangeRed1} ${upspeed eth0}/s
     ${color9}${downspeedgraph eth0 24,150 000000 91ec31} ${color9}${upspeedgraph eth0 24,150 000000 ec3131}
     ${color0}Address: ${color}${addr eth0}${alignr}${color0}TCP Connections: ${color}${tcp_portmon 1 65535 count}
     ${if_gw}${color0}gateway: ${color}${gw_ip}$endif${alignr}${color0}dns: ${color}${nameserver}${endif}
    ${voffset 3}${color1}File Systems ${color2}${hr}
    ${if_mounted /}${color3}/${goto 80}${alignr}${color4}${fs_used /}${color}/${alignr 10}${color5}${fs_size /}${goto 200}${alignr}${lua_parse fsbar / 7fff00 white}${endif}
    ${if_mounted /usr}${color3}/usr${goto 80}${alignr}${color4}${fs_used /usr}${color}/${alignr 10}${color5}${fs_size /usr}${goto 200}${alignr}${lua_parse fsbar /usr 7fff00 white}${endif}
    ${if_mounted /local}${color3}/local${goto 80}${alignr}${color4}${fs_used /local}${color}/${alignr 10}${color5}${fs_size /local}${goto 200}${alignr}${lua_parse fsbar /local 7fff00 white}${endif}
    ${if_mounted /var}${color3}/var${goto 80}${alignr}${color4}${fs_used /var}${color}/${alignr 10}${color5}${fs_size /var}${goto 200}${alignr}${lua_parse fsbar /var 7fff00 white}${endif}
    ${if_mounted /home}${color3}/home${goto 80}${alignr}${color4}${fs_used /home}${color}/${alignr 10}${color5}${fs_size /home}${goto 200}${alignr}${lua_parse fsbar /home 7fff00 white}${endif}
    ${if_mounted /srv}${color3}/srv${goto 80}${alignr}${color4}${fs_used /srv}${color}/${alignr 10}${color5}${fs_size /srv}${goto 200}${alignr}${lua_parse fsbar /srv 7fff00 white}${endif}
    ${if_mounted /misc}${color3}/misc${goto 80}${alignr}${color4}${fs_used /misc}${color}/${alignr 10}${color5}${fs_size /misc}${goto 200}${alignr}${lua_parse fsbar /misc 7fff00 white}${endif}
    ${voffset 3}${color1}Disk IO ${color2}${hr}
    ${color0}dev${alignr 165}write${alignr 122}read${alignr 90}temp
    ${color3}sda${alignr 110}${color white}${diskio_write sda}${alignr 50}${color8}${diskio_read sda}${alignr 20}${color white}${hddtemp /dev/sda}${lua_parse deg}${alignr 5}${color9}${diskiograph sda 12,70 3dba19 aecf4c 0 -t -l}
    ${color3}sdb${alignr 110}${color white}${diskio_write sdb}${alignr 50}${color8}${diskio_read sdb}${alignr 20}${color white}${hddtemp /dev/sdb}${lua_parse deg}${alignr 5}${color9}${diskiograph sdb 12,70 3dba19 aecf4c 0 -t -l}
    ${color3}sdc${alignr 110}${color white}${diskio_write sdc}${alignr 50}${color8}${diskio_read sdc}${alignr 20}${color white}${hddtemp /dev/sdc}${lua_parse deg}${alignr 5}${color9}${diskiograph sdc 12,70 3dba19 aecf4c 0 -t -l}
    ${voffset 3}${color1}Processes:${color} ${processes}  ${color1}Running:${color red1} ${running_processes} ${color2}${hr 1}
    ${alignc}${color0}(top 5 sorted by CPU usage)
    ${color0}NAME${alignr 110}PID${alignr 60}CPU%${alignr 20}MEM%
    ${lua_parse top cpu 1}${top name 1}${alignr 80}${top pid 1}${alignr 45}${top cpu 1}${alignr 20}${top mem 1}
    ${lua_parse top cpu 2}${top name 2}${alignr 80}${top pid 2}${alignr 45}${top cpu 2}${alignr 20}${top mem 2}
    ${lua_parse top cpu 3}${top name 3}${alignr 80}${top pid 3}${alignr 45}${top cpu 3}${alignr 20}${top mem 3}
    ${lua_parse top cpu 4}${top name 4}${alignr 80}${top pid 4}${alignr 45}${top cpu 4}${alignr 20}${top mem 4}
    ${lua_parse top cpu 5}${top name 5}${alignr 80}${top pid 5}${alignr 45}${top cpu 5}${alignr 20}${top mem 5}
    ${alignc}${color0}(top 3 sorted by MEM usage)
    ${color0}NAME${alignr 110}PID${alignr 60}CPU%${alignr 20}MEM%
    ${lua_parse top mem 1}${top_mem name 1}${alignr 80}${top_mem pid 1}${alignr 45}${top_mem cpu 1}${alignr 20}${top_mem mem 1}
    ${lua_parse top mem 2}${top_mem name 2}${alignr 80}${top_mem pid 2}${alignr 45}${top_mem cpu 2}${alignr 20}${top_mem mem 2}
    ${lua_parse top mem 3}${top_mem name 3}${alignr 80}${top_mem pid 3}${alignr 45}${top_mem cpu 3}${alignr 20}${top_mem mem 3}
    ${voffset 3}${color1}Weather ${color6} (Victoria,BC)${color2}${hr 1}
    ${font weather:size=45}${alignr 30} ${lua_parse weather_icon /usr/bin/conkyweather "Victoria,BC"}${font}${voffset -50}
    ${color6}Temperature:${goto 100}${color7}${execi 1800 /usr/bin/conkyweather "Victoria,BC" ct}
    ${color6}Conditions:${goto 100}${color7}${execi 1800 /usr/bin/conkyweather "Victoria,BC" cc}
    ${color6}Humidity:${goto 100}${color7}${execi 1800 /usr/bin/conkyweather "Victoria,BC" ch}
    ${color6}Wind:${goto 100}${color7}${execi 1800 /usr/bin/conkyweather "Victoria,BC" cw}
    ${voffset 3}${offset 12}${color aaaaaa}${execi 3600 /usr/bin/conkyweather "Victoria,BC" dl}
    ${offset 12}${color aaaaaa}${font weather:size=36}${execi 3600 /usr/bin/conkyweather "Victoria,BC" fcp}${font}
    ${offset 12}${color aaaaaa}${execi 3600 /usr/bin/conkyweather "Victoria,BC" fct}
    ${voffset -3}${color2}${hr}
    ${offset 10}${scroll 44 ${color yellow}${rss http://www.planetsuse.org/global/rss20.xml 1 item_titles 10 1}}
    #
    ${voffset -3}${color2}${hr 1}

  3. #3

    Default Re: Easy configuring conky with conkyconf

    What doesn't work ... or not so well.

    • To work around the new line parsing bug in version 1.8.1, I never return more than 1 line of text from the lua script. This makes ~/.conkysrc longer and using more lua calls. The ~/.conkysrc generated by conkyconf while using conky 1.8.0 is significantly shorter. This version also supports apcupsd (I had to reverse patch version 1.8.1 to regain this feature as I explained before).

    • When monitoring rss feed from this forum (or others), you'll get garbage from non UTF-8 titles containing special characters. It might also prevent conky from starting. In this case, just rerun conkyconf withouth the option -r or choose another rss feed.

    • I didn't manage to right justify correctly the Disk IO write an read columns and didn't want to use a new line and negative vertical offset (because the result was worse at the end).

    • I could not make Conky print the degree symbol (°) with the workaround suggested on Conky's site:
      Code:
      ${iconv_start UTF-8 ISO_8859-1}° ${iconv_stop}
      iconv didn't recognize UTF-8 but used the value of $LANG (for example en_US.UTF-8). It would have required to read this variable before, which wouldn't have been a big problem if it had worked, but even by converting from the right charset, I wasn't able to print the degree symbol. So I applied the following trick which might probably not work for everyone.

      • Use this setting in ~/.conkyrc:
        Code:
        override_utf8_locale no
      • Set this (constant) variable in /etc/conky/conky.lua:
        Code:
        local DEG   = "°C"
        and use a lua_parse in conky to get this value. From what I can see now, the degree symbol is displayed correctly on all machines I have tested so far. If it doesn't work for you, because you're using another charset, try to change this symbol in /etc/conky/conky.lua.

  4. #4

    Default Re: Easy configuring conky with conkyconf

    conkyconf v. 2.6

    • New options added for tcp ports and Internet ip monitoring
    • More efficient syntax error checking
    • Default update interval set to 5s instead of 1s.


    monitors cli options conkyconf variables/default
    • Internet IP address

    The external IP will be checked every 10 minutes. You can set another interval in the variable ipCheck in conkyconf.
    -I --ip ipCheck (600)
    • tcp ports (tcp_portmon)

    By default all tcp ports (1-65535) are monitored. ssh and nfs connections are highlighted in red ; connections to the local machine are displaye in grey.
    -t -tcp
    • first tcp port to monitor (default:1)
    -b --begin <port> startport (1)
    • last tcp port to monitor (default: 65535)

    -e --end <port>
    endport (65535)
    • number of tcp connections to display (default 5)
    -c --connections <n> toptcp (5)




    The .conkyrc of the example at right was generated with the command:
    Code:
    conkyconf -uIt -c 20
    Other examples:

    monitoring first 10 connections on tcp ports 22 to 2049 (including ssh and nfs connections)
    Code:
    conkyconf -t -b 22 -e 2049 -c 20
    monitoring only ssh connections on port 22. Since the -c option is not specified, the first 5 connections will be displayed by default.
    Code:
    conkyconf -t -b 22 -e 22

  5. #5

    Default Re: Easy configuring conky with conkyconf


  6. #6

    Default Re: Easy configuring conky with conkyconf

    Quote Originally Posted by please_try_again View Post
    To achieve conky's transparency under kde (and some xfce but not the one in openSUSE 11.4), own_window_argb_visual has to be set to no. Older conkyconf versions used to write a different config file for KDE. Now the conky wrapper (conky.sh) installed with the package takes care of that. There is also a function setargb in the lua script which can switch this value while initializing conky but I wasn't too happy with this function and disabled it by default.
    It's actually the opposite. own_window_argb_visual has to be set to yes for KDE and no for Gnome. conky.sh does it right though. The only issue I still have with KDE transparency is that it doesn't work the first time I start KDE after switching this value - I don't know why since conky.sh is started from ~/.kde4/Autostart (and not ~/.config/autostart!) with the option X-KDE-autostart-phase=2, so it gets started after plasma and the panel and is not saved in the session. Adding a delay of 3 and even 10 seconds in conky.sh didn't help. It only occures the first time though. The issue resolves on it's own at next KDE login, or by killing ans restarting conky, or by manually editing ~/.conkyrc before starting KDE and setting own_window_argb_visual to yes.

    Notice that it happens in both cases with and without desktop effects (when desktop effects are disabled, the conky wrapper starts xcompmgr - if available - to achieve transparency).

  7. #7

    Default Re: Easy configuring conky with conkyconf

    Possibles values of own_window_argb_visual for conky transparency

    wm compositing on off
    KDE 4.7.1 (ArchLinux) on_windows_argb_visual yes yes*
    KDE 4.6.5 (Fedora 15) on_windows_argb_visual yes yes*
    KDE 4.6.0 (openSUSE 11.4) on_windows_argb_visual yes yes*
    Gnome2 & Gnome3 fallback on_windows_argb_visual yes or no no
    Gnome3 (gnome-shell) on_windows_argb_visual yes or no N/A
    Xfce 4.8.0 + xfwm4 4.8.1 (GTK+-2.22.1 - openSUSE 11.4) on_windows_argb_visual yes or no no
    Xfce 4.8.0 + xfwm4 4.8.1 (GTK+-2.24.4 - Fedora 15) on_windows_argb_visual yes yes*
    Xfce 4.8.0 + xfwm4 4.8.1 (GTK+-2.24.6 - ArchLinux) on_windows_argb_visual yes yes*
    xcompmgr compositing
    LXDE + Openbox/ Openbox stand alone on_windows_argb_visual yes or no no
    icewm on_windows_argb_visual no no
    sawfish on_windows_argv_visual yes or no no
    fvwm2 on_windows_argv_visual yes or no no




    * requires xcompmgr for transparency.

    This version of the conky wrapper tries to achieve transparency in all cases:

    Code:
    #! /bin/bash
    
    # switches the value of own_window_argb_visual for transparency.
    # is has to be set to "yes" under KDE and "no" under the 
    # other desktops.
     
    # Transparency under KDE only works if compositing is enabled. 
    # uncomment the line below to start conky when KDE compositing
    # is disabled. if xcompmgr is installed, it will be started
    # to provide soft shadows, translucency and a smooth fade effect.
    # If neither KDE nor xcompmgr compositing is available, conky
    # will have a black background :-(
    COMPOSITING=no 
    xcompmgr_options="-c -f -t-5 -l-5 -r4.2 -o.55"
    
    cfg=/etc/conky/conky.conf
    [ -f ~/.conkyrc ] && cfg=~/.conkyrc
    [ -w $cfg ] || echo "You're not allow to write $cfg"
    argb=$(awk '/own_window_argb_visual/ { print $2 }' $cfg)
    [ "x$argb" == "x" ] && exit
    
    case $DESKTOP_SESSION in
    kde*)
    if [ "$(kreadconfig --file kwinrc --group Compositing --key Enabled)" == "false" ] ; then
        if [ "x$COMPOSITING" == "xno" ] ; then
            which xcompmgr &>/dev/null && ( ps nc -C  xcompmgr >/dev/null || xcompmgr $xcompmgr_options & )
        else
            exec echo "compositing is off"
        fi
    fi
    [ "$argb" == "no" ] && sed -i 's/own_window_argb_visual.*/own_window_argb_visual yes/' $cfg
    ;;
    
    xfce*)
    compositing=$(xfconf-query -c xfwm4 -p /general/use_compositing)
    if [ "$compositing" == "false" ] ; then
        if [ "x$COMPOSITING" == "xno" ] ; then
            which xcompmgr &>/dev/null && ( ps nc -C  xcompmgr >/dev/null || xcompmgr $xcompmgr_options & )
            sleep 1
        else
            [ "$argb" == "yes" ] && sed -i 's/own_window_argb_visual.*/own_window_argb_visual no/' $cfg
        fi
    fi
    ;;
    
    *) [ "$argb" == "yes" ] && sed -i 's/own_window_argb_visual.*/own_window_argb_visual no/' $cfg ;;
    esac
    
    ps nc -C conky >/dev/null || exec conky
    echo "conky is already running"

  8. #8

    Default Re: Easy configuring conky with conkyconf

    Is this thread still active?

    I'm not new to Linux but I am too openSuse. How can I change all the temp readings to read imperial/standard. I live in the US.

  9. #9

    Default Re: Easy configuring conky with conkyconf

    Quote Originally Posted by ackernan View Post
    Is this thread still active?

    I'm not new to Linux but I am too openSuse. How can I change all the temp readings to read imperial/standard. I live in the US.
    Good question! I don't know why I never worried about that. I have no excuse. I'll have to add an option --- but OBS has been down for me for about 36 hours now.

    For now, if you have installed conkyweather (it is automatically installed with conkyconf) you can apply this patch to get the temperature in F.

    Code:
    --- ./share/conkyweather/currentTemp.xslt.orig  2012-04-13 16:52:04.717571660 -0700
    +++ ./share/conkyweather/currentTemp.xslt       2012-04-13 16:52:40.233289021 -0700
    @@ -21,7 +21,7 @@
      
            
         <xsl:template match="weather">
    -        <xsl:value-of select="current_conditions/temp_c/@data"/>
    -        <xsl:text> C</xsl:text>
    +        <xsl:value-of select="current_conditions/temp_f/@data"/>
    +        <xsl:text> F</xsl:text>
         </xsl:template>
     </xsl:stylesheet>
    
    --- ./bin/conkyweather.orig     2012-04-13 16:44:07.507932242 -0700
    +++ ./bin/conkyweather  2012-04-13 16:44:22.642237953 -0700
    @@ -30,7 +30,7 @@
     #echo $CONDITIONS
     
     # s=standard units, m=metric units
    -UNITS=m
    +UNITS=s
     
     # where this script and the XSLT lives
     RUNDIR=/usr/share/conkyweather
    In case you don't know how to apply the patch and for anyone else, here's how to proceed:

    • save the code above in a text file that you call conkyweather.patch and place in /tmp
    • type:
      Code:
      $ cd /usr
      $ sudo patch -b -p0 < /tmp/conkyweather.patch

    It should modify the files /usr/bin/conkyweather and /usr/share/conkyweather/currentTemp.xslt.

    If the patch doesn't work (got broken by copy/pasting), replace the text in red with the text in blue in these two files.

  10. #10

    Default Re: Easy configuring conky with conkyconf

    OK. It was simply missing in conkyweather. I didn't write this program. I think the author, Hardik Mehta, lives in Germany. I use celsius and never paid attention. So I added this feature in conkyweather as well as an option in conkyconf to turn it on. You should update conkyconf and conkyweather.

    To display the temperature in farhrenheit, use the option -F.
    Example: to display weather + weather forecast in F:

    Code:
    conkyconf -wfF
    Without the option -F, conkyconf will use celsius by default.

    You can combine different options with conkyconf.

    Example:
    Code:
    conkyconf -wfFduNt
    = displays weather + weather forecast in F, monitors disk IO, UPS, Nvidia graphics card and (by default) 5 tcp/ip connections.

Page 1 of 5 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •