can anyone split this conky code for me please?

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
User avatar
Logansfury
Level 8
Level 8
Posts: 2419
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

can anyone split this conky code for me please?

Post by Logansfury »

Hello all,

I have a new conky with one wonky line in it. It's huge and only partially displayed no matter how many times I have increased the width of the conky boundary.

Here is the line:

Code: Select all

${alignr}${offset -80}< ${exec lspci | grep VGA | sed 's/00:02.0 VGA compatible controller: //g' | sed 's/ Corporation//g' | sed 's/ Integrated Graphics Controller (primary) (rev 0c)//g'}
I would like VGA compatible controller: to be above the rest of the text printed in this line.

It currently looks like this:
Image

Can anyone help split this complicated line into two?

thanks for reading,

Logan
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
zcot
Level 9
Level 9
Posts: 2959
Joined: Wed Oct 19, 2016 6:08 pm

Re: can anyone split this conky code for me please?

Post by zcot »

Code: Select all

zcot@zcot-MS-7309:~$ exec lspci | grep VGA | sed 's/00:02.0 VGA compatible controller: //g' | sed 's/ Corporation//g' | sed 's/ Integrated Graphics Controller (primary) (rev 0c)//g'
01:00.0 VGA compatible controller: NVIDIA G71 [GeForce 7950 GT] (rev a1)
zcot@zcot-MS-7309:~$ exec lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation G71 [GeForce 7950 GT] (rev a1)
zcot@zcot-MS-7309:~$ exec lspci | grep VGA | sed 's/01:00.0 VGA compatible controller: //g' | sed 's/ Corporation//g' | sed 's/ Integrated Graphics Controller (primary) (rev 0c)//g'
NVIDIA G71 [GeForce 7950 GT] (rev a1)
zcot@zcot-MS-7309:~$ exec lspci | grep VGA | sed 's/01:00.0 VGA compatible controller: //g'
NVIDIA Corporation G71 [GeForce 7950 GT] (rev a1)
zcot@zcot-MS-7309:~$ exec lspci | grep VGA | sed 's/01:00.0 VGA compatible controller: //g' | sed 's/ Corporation//g'
NVIDIA G71 [GeForce 7950 GT] (rev a1)
User avatar
Logansfury
Level 8
Level 8
Posts: 2419
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: can anyone split this conky code for me please?

Post by Logansfury »

zcot wrote: Wed May 15, 2024 5:43 pm

Code: Select all

zcot@zcot-MS-7309:~$ exec lspci | grep VGA | sed 's/00:02.0 VGA compatible controller: //g' | sed 's/ Corporation//g' | sed 's/ Integrated Graphics Controller (primary) (rev 0c)//g'
01:00.0 VGA compatible controller: NVIDIA G71 [GeForce 7950 GT] (rev a1)
zcot@zcot-MS-7309:~$ exec lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation G71 [GeForce 7950 GT] (rev a1)
zcot@zcot-MS-7309:~$ exec lspci | grep VGA | sed 's/01:00.0 VGA compatible controller: //g' | sed 's/ Corporation//g' | sed 's/ Integrated Graphics Controller (primary) (rev 0c)//g'
NVIDIA G71 [GeForce 7950 GT] (rev a1)
zcot@zcot-MS-7309:~$ exec lspci | grep VGA | sed 's/01:00.0 VGA compatible controller: //g'
NVIDIA Corporation G71 [GeForce 7950 GT] (rev a1)
zcot@zcot-MS-7309:~$ exec lspci | grep VGA | sed 's/01:00.0 VGA compatible controller: //g' | sed 's/ Corporation//g'
NVIDIA G71 [GeForce 7950 GT] (rev a1)
Hello Zcot,

Thank you again so much for joining one of my threads to help :)

Code: Select all

zcot@zcot-MS-7309:~$ exec lspci | grep VGA | sed 's/01:00.0 VGA compatible controller: //g' | sed 's/ Corporation//g' | sed 's/ Integrated Graphics Controller (primary) (rev 0c)//g'
looks perfect. Now I can set "VGA Compatible Controller" to print on a line above and use your code to get an output of
NVIDIA G71 [GeForce 7950 GT] (rev a1)

I'll post a screenshot of the results.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
zcot
Level 9
Level 9
Posts: 2959
Joined: Wed Oct 19, 2016 6:08 pm

Re: can anyone split this conky code for me please?

Post by zcot »

No, that's not the point.

The 3 blocks of sed are only there to REMOVE the garbage. But in that case they were too specific, so I simply did an edit based on the actual output that my hardware was giving, -it make it to where the sed removals then worked correctly. And then you can see at last I just removed the 3rd sed because it wasn't relevant to my hardware anyway.

I suggest you do the same type of thing I showed and fine tune the line based on the output that your hardware is giving. Maybe you only need 1 sed? -but most certainly you don't need all 3 of those.
User avatar
Logansfury
Level 8
Level 8
Posts: 2419
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: can anyone split this conky code for me please?

Post by Logansfury »

zcot wrote: Wed May 15, 2024 5:59 pm No, that's not the point.

The 3 blocks of sed are only there to REMOVE the garbage. But in that case they were too specific, so I simply did an edit based on the actual output that my hardware was giving, -it make it to where the sed removals then worked correctly. And then you can see at last I just removed the 3rd sed because it wasn't relevant to my hardware anyway.

I suggest you do the same type of thing I showed and fine tune the line based on the output that your hardware is giving. Maybe you only need 1 sed? -but most certainly you don't need all 3 of those.
im sorry if I misunderstood the posted code, but I have it working!

How it used to look:
Image

After using part of your code:
Image


Changing set text set all the lines askew, I had to redo some offsets and voffsets but it looks perfect to me.

conkyrc

Code: Select all

conky.config = {
    background = false,
    font = 'FuraCode Nerd Font:pixelsize=9',
    use_xft = true,
    xftalpha = 1.0,
    update_interval = 4,
    total_run_times = 0,
    own_window = true,
    own_window_transparent = true,
    own_window_type = 'dock',
    own_window_class = 'Conky',
    own_window_argb_visual = true,
    own_window_argb_value = 255,
    own_window_colour = '#000',
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    double_buffer = true,
    draw_shades = false,
    draw_outline = false,
    draw_borders = false,
    draw_graph_borders = true,
    stippled_borders = 0,
    border_width = 0,
    default_color = '#BEC8CB',
    default_shade_color = '#BEC8CB',
    default_outline_color = '#BEC8CB',
    alignment = 'top_left',
    gap_x = 1340,
    gap_y = 65,
    no_buffers = true,
    cpu_avg_samples = 2,
    net_avg_samples = 2,
    use_spacer = 'none',
    maximum_width = 1200,
    minimum_height = 640,
    uppercase = true,
};

conky.text = [[
#leet chars: ┤┤└└┴┴┐┐││┘┘┌┌├├┬┬┼┼┴┴── ││ ▽▼△▲▵▴▾▿
${alignr}${offset 250}--------------------------------
${alignr}${offset 0}┌──────── ${nodename}${font} ─────────────
${alignr}${offset -110}${uid_name 1000}${font} ──────┐
${alignr}${offset -110}< ${exec lsb_release -ds | sed 's/"//g'} > Distro ─┤
${alignr}${offset -110}< ${kernel} > Kernel ─┤
${alignr}${offset -110}< ${uptime_short} > Uptime ─┘
${voffset 0}
${alignr}${offset -30}┌──────────
${alignr}${offset -80}│
${alignr}${offset -75} VGA Compatible Controller: ────────────┘ 
${alignr}${offset -80}< ${exec lspci | grep VGA | sed 's/01:00.0 VGA compatible controller: //g' | sed 's/ Corporation//g' | sed 's/ Integrated Graphics Controller (primary) (rev 0c)//g'} > GPU
${alignr}${offset -150}< ${exec xdpyinfo | awk '/dimensions/{print $2}'} > Res
${voffset -6}
${alignr}${offset -45}< ${exec setxkbmap -query | grep layout | awk '{print $2}'} > Locale ────────────────┐
${alignr}${offset -45}│
${alignr}${offset -45}│
${voffset -10}
${alignr}${offset -75}< ${exec sensors | grep "RPM" | cut -c14-25} > Fan Speed ──────────┐
${alignr}${offset -75}│
${alignr}${offset -75}┌────── Temperatures ───────────────┤
${alignr}${offset -165}├─ Core0 < ${execi 5 sensors|grep 'Core 0'| awk -F'+' '{print $2}' | awk -F'.' '{print $1}'} °C >${alignr}${offset -75}│
${alignr}${offset -165}├─ Core1 < ${execi 5 sensors|grep 'Core 1'| awk -F'+' '{print $2}' | awk -F'.' '{print $1}'} °C >${alignr}${offset -75}│
${alignr}${offset -165}├─ Core2 < ${execi 5 sensors|grep 'Core 2'| awk -F'+' '{print $2}' | awk -F'.' '{print $1}'} °C >${alignr}${offset -75}│
${alignr}${offset -165}└─ Core3 < ${execi 5 sensors|grep 'Core 3'| awk -F'+' '{print $2}' | awk -F'.' '{print $1}'} °C >${alignr}${offset -75}│
${alignr}${offset -75}│
${alignr}${offset -75}┌───── < ${execi 1000 cat /proc/cpuinfo|grep 'model name'|sed -e 's/model name.*: //'|uniq|cut -c 1-36|sed 's/(R)//g'|sed 's/(TM)//g'|sed 's/CPU     //g'} > ──────────┤
${alignr}${offset -325}│${offset 250}│
${alignr}${offset -260}└─── Processes${offset 185}│
${alignr}${offset -175}< ${top name 1}  ${top cpu 1} >${offset 100}│
${alignr}${offset -175}< ${top name 2}  ${top cpu 2} >${offset 100}│
${alignr}${offset -175}< ${top name 3}  ${top cpu 2} >${offset 100}│
${alignr}${offset -175}< ${top name 4}  ${top cpu 2} >${offset 100}│
${alignr}${offset -75}│
${voffset 15}
${alignr}${offset -75}< $memperc% | $mem/$memmax ${color #BEC8CB}${membar 5,50}${color} > RAM ──────────┐
${alignr}${offset -75}│
${voffset 10}
${alignr}${offset -75}${addr wls1} : ${wireless_essid wls1} : SSID ────────────┐
${alignr}${offset -115}UP < ${color #BEC8CB}${upspeedgraph wls1 15,130 BCC3C3 BCC3C3}${color} >${voffset -15}${offset 40}│
${alignr}${offset -110}${voffset 10}DOWN < ${color #BEC8CB}${downspeedgraph wls1 15,130 BCC3C3 BCC3C3}${color} >${voffset -25}${offset 40}└─
${voffset 20}
${alignr}${offset -75}${exec cat /sys/class/power_supply/BAT0/capacity} : Battery ───────────────────┐
${alignr}${offset -95}< ${exec acpi | grep "Battery 0" | awk '{print $4}'} | ${battery_percent BAT0}% > BAT 0 < ${color #BEC8CB}${battery_bar 5,110 BAT0}${color} >
${alignr}${offset -140}<${exec upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state"} >
${alignr}${offset -120}<${exec upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "to\ full"} >
${alignr}${offset -210}${voffset -12}< remaining:${exec upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "time to empty" | awk '{print $4}'} hrs >
${voffset -2}
${alignr}${offset -60}Hard Drive ─────────────────┐
${alignr}${offset -70}< ${fs_used_perc}% > Root < ${color #BEC8CB}${fs_bar 5,120 /}${color} >${offset 10}│
${alignr}${offset -70}< ${fs_used_perc /home}% > Home < ${color #BEC8CB}${fs_bar 5,120 /home}${color} >${offset 10}│
${alignr}${offset -10} < ${swapperc}% > Swap < ${color #BEC8CB}${swapbar 5,120}${color} >${offset 10}└────────────
# ${alignr}${offset -640}volume: ${exec amixer sget Master | grep 'Right:' | awk -F'[][]' '{ print $2 }'}

]];
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
Post Reply

Return to “Compiz, Conky, Docks & Widgets”