• Display Specific/Partial Terminal Output in Conky

    I would like to use Conky to display separately 1) GPU: Intel UHE Graphics 630, 2) Driver: i915, and 3) GPU Temp. I think I can figure out how to get the temp, but am having trouble displaying only the desired information for 1) and 2). I think the cut variables are what I need to learn.

    If I type lspci -vnn | grep VGA -A 12 into the terminal I get:

    00:02.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 630 (Desktop) [8086:3e92] (prog-if 00 [VGA controller])
    DeviceName: Onboard - Video
    Subsystem: Dell UHD Graphics 630 (Desktop) [1028:0868]
    Flags: bus master, fast devsel, latency 0, IRQ 128
    Memory at d0000000 (64-bit, non-prefetchable) [size=16M]
    Memory at c0000000 (64-bit, prefetchable) [size=256M]
    I/O ports at 4000 [size=64]
    [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel driver in use: i915
    Kernel modules: i915
    00:08.0 System peripheral [0880]: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model [8086:1911]

    Can anyone tell me how to display just the parts I want, please? Thanks, in advance.

  • @rocket Clearly my question either has no good answer or is uninteresting as written. Probably most people with integrated graphics don’t want to display this information. My thanks to the 23 who viewed the post. I am marking the post as solved to get it out of our field of vision.

  • @rocket start researching a bit on your own first may give the hints you need…

    first, you will need a command that gives out exactly the stuff you want to show as text inside conky… bas script or something else can do this…

    then find a way to format and show this with conky:


    ${offset 15}${color2}Title for what you want to show:
    ${color0}${execpi 60 command to show the text you want  to show}
  • @rocket
    Sorry, I’ve somehow missed your posting.
    It is actually quite easy to find info out of an output using bash scripts and command line tools.

    Graphics driver name:

    lspci -vnn | grep VGA -A12 | grep "Kernel driver in use" | awk '{print $NF}'

    GPU name:

    lspci -vnn | grep VGA | sed -e 's|^.*]: ||' -e 's|\[.*$||' -e 's|'"("'.*$||'

    EDIT: actually, a better for the latter:

    lspci -vnn | grep -A12 VGA | grep Subsystem: | sed -e 's| \[[0-9a-f].*$||' -e 's|^.*\[||' | tr -d ']'

    or something simpler:

    lspci -vnn | grep -A12 VGA | grep Subsystem: | cut -d '[' -f 2 | tr -d ']'

    EDIT: fixed typos caused by the browser (it changed some special chars while copying…)

  • @manuel is a bash king ;)

  • Thanks to you both. Manuel, your suggestion for displaying the GPU driver in the terminal worked perfectly, and I have it now in my .conkyrc file. The 3 suggestions for displaying the GPU name (intel integrated graphics), did not work, but returned the following:
    [[email protected] ~]$ lspci -vnn | grep VGA | sed -e ‘s|^.]: ||’ -e 's|[.$||’ -e ‘s|’"("’.*$||’
    sed: -e expression #2, char 8: unterminated s' command [[email protected] ~]$ lspci -vnn | grep -A12 VGA | grep Subsystem: | sed -e 's| \[[0-9a-f].*$||' -e 's|^.*[||' | tr -d ']' sed: -e expression #2, char 8: unterminateds’ command
    [[email protected] ~]$ lspci -vnn | grep -A12 VGA | grep Subsystem: | cut -d ‘[’ -f 2 | tr -d ‘]’
    [[email protected] ~]$

    Also, I am a non-technical user, but I find I often have questions about bash scripting – is there a resource I could refer to that would help me learn (from scratch)?
    Thanks very much.

  • a working conkyrc file:

    background yes
    double_buffer yes
    alignment top_right
    border_width 1
    cpu_avg_samples 2
    default_color white
    default_outline_color white
    default_shade_color white
    draw_borders no
    draw_graph_borders yes
    draw_outline no
    draw_shades no
    gap_x 450
    gap_y 20
    net_avg_samples 2
    no_buffers yes
    out_to_console no
    out_to_stderr no
    extra_newline no
    own_window yes
    own_window_type normal
    own_window_transparent yes
    own_window_colour 000000
    own_window_argb_visual no
    own_window_argb_value 0
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    minimum_size 170 0
    stippled_borders 0
    update_interval 2.0
    uppercase no
    use_spacer none
    show_graph_scale no
    show_graph_range no
    use_xft yes
    xftalpha 0.1
    xftfont Droid Sans:size=10
    color0 white
    color1 EAEAEA
    color2 FFA300
    color3 grey
    ${offset 15}${color0}GPU: ${color2}${execpi 60 lspci -vnn | grep -A12 VGA | grep Subsystem: | cut -d '[' -f 2 | tr -d ']'}
    ${offset 15}${color0}GPU driver in use: ${color2}${execpi 60 lspci -vnn | grep VGA -A12 | grep "Kernel driver in use" | awk '{print $NF}'}

    how it looks like as screenoutput:

  • @rocket
    Sorry, there were a typo on two of the four lines. The first and the last line were OK. In addition, the second one was trying to find wrong data…

    I’m editing them now, so now they should work soon.
    OK, now they should work. As I see it, you need only the first line and the last line. The second line was getting plain wrong info.

    Some bash tutorials:
    and also command

    man bash
  • @manuel first and last working here too ;) conky.png

  • @joekamprad
    Yeah. Copying special lines with a browser can remove some characters, as happened in this case too.
    So next time I have to copy them back from the forum and try again. 😅

  • @rocket
    Ok, I tried your input and none of the last three script lines returned the right info. For some reason your output has slightly different format than on my machine.
    I’ll check that a bit more and return a result soon.

  • GPU (works with your output):

    lspci -vnn | grep -A10 VGA | grep VGA | sed -e 's|^.* VGA .*]: ||' -e 's| '"\["'.*$||' -e 's| '"("'.*$||'

    Driver (as before):

    lspci -vnn | grep VGA -A12 | grep "Kernel driver in use" | awk '{print $NF}'

    Hope there are no more typos this time! 😅

  • @rocket may show the output of:

    lspci -vnn | curl -F 'f:1=<-' ix.io

  • @manuel said in Display Specific/Partial Terminal Output in Conky:

    lspci -vnn | grep -A10 VGA | grep VGA | sed -e 's|^.* VGA .*]: ||' -e 's| '"["'.*$||' -e 's| '"("'.*$||'

    is giving not completed s command

  • @joekamprad
    This works here and should work for @rocket:

    lspci -vnn | grep -A10 VGA | grep VGA | sed -e 's|\[[0-9a-f]*:[0-9a-f]*].*$||' -e 's|^.*]: ||'

    For some reason, some backslashes are dropped while copying it here. So don’t use it yet, I’ll test it first after copying here!

    OK, seems to work. Hopefully in your system too!

  • @manuel said in Display Specific/Partial Terminal Output in Conky:

    lspci -vnn | grep -A10 VGA | grep VGA | sed -e ‘s|[[0-9a-f]:[0-9a-f]].$||’ -e 's|^.]: ||’

     [email protected]> lspci -vnn | grep -A10 VGA | grep VGA | sed -e 's|\[[0-9a-f]*:[0-9a-f]*].*$||' -e 's|^.*]: ||'
    NVIDIA Corporation GK208B [GeForce GT 710]
  • @joekamprad
    Thanks for testing! So it is hard to put these here, when a few backslashes fade away…

  • OK. Now my conky lines are yielding the desired display:

    ${color5}${font :bold}GRAPHICS
    ${color}${font}GPU: ${alignr}${exec lspci -vnn | grep -A10 VGA | grep VGA | sed -e ‘s|^.* VGA .]: ||’ -e 's| ‘"["’.$||’ -e ‘s| ‘"("’.*$||’}
    Driver: ${alignr}${exec lspci -vnn | grep VGA -A12 | grep “Kernel driver in use” | awk ‘{print $NF}’}
    Display Resolution: ${alignr}${exec xdpyinfo | awk ‘/dimensions/{print $2}’}

    Thanks to joekamprad and manual. The Antergos community and forum are the most friendly, helpful, and non-judgmental out there. You guys have the right idea about what it should be. Thanks. The distro is the best, too. Manuel, thanks for the links to bash help.

display59 terminal46 conky14 specificpartial1 Posts 18Views 109
Log in to reply
Bloom Email Optin Plugin

Looks like your connection to Antergos Community Forum was lost, please wait while we try to reconnect.