Text shifting on widget[Solved]

Add functionality to your desktop
Forum rules
Before you post please read how to get help
Post Reply
User avatar
Grayfox
Level 4
Level 4
Posts: 332
Joined: Sun May 21, 2017 5:10 am
Location: In a hole

Text shifting on widget[Solved]

Post by Grayfox »

I am making some conky widgets, while most are done and have no real issues.
The network one has an issue where the text for "speed" and "total" which I have put in ${alignc} tags shifts around.

Is their way to ensure it is locked to the centre of the widget?
network.conf.png
network.conf.png (8.73 KiB) Viewed 286 times
This is the code.

Code: Select all

conky.config = {
    alignment = 'middle_middle',
    background = false,
    border_width = 1,
    cpu_avg_samples = 1,
    default_color = 'white',
    default_outline_color = 'black',
    default_shade_color = 'black',
    double_buffer = true,
    draw_borders = true,
    draw_graph_borders = false,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    gap_x = 0,
    gap_y = -140,
    maximum_width = 200,
    minimum_height = 10,
    minimum_width = 250,
    net_avg_samples = 1,
    out_to_console = false,
    out_to_stderr = false,  
    override_utf8_locale = true,
    own_window = true,
    own_window_argb_visual = false,
    own_window_colour = '222D32',
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    own_window_transparent = false,    
    own_window_type = 'normal',    
    show_graph_scale = false,
    show_graph_range = false,
    stippled_borders = 0,
    update_interval = 1,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true,
}

conky.text = [[
${font Liberation Sans Narrow:size=16}${color #FFFFFF}${alignc}Network
${color #808080}${voffset -10}${hr 2}
${font Nimbus Sans Narrow:size=14}${color #FFFFFF}${voffset -10}IP Address:${alignr}${exec command curl https://ipinfo.io/ip}
${color #808080}${voffset -10}${hr 2}
${font Nimbus Sans Narrow:size=14}${color #FFFFFF}${voffset -10}${upspeed enp5s0}${alignc}↑Speed↓${alignr}${downspeed enp5s0}
${color #808080}${voffset -10}${hr 2}
${font Nimbus Sans Narrow:size=14}${color #FFFFFF}${voffset -10}${totalup enp5s0}${alignc}↑Total↓${alignr}${totaldown enp5s0}
${voffset -25}
]]
Last edited by Grayfox on Thu Sep 29, 2022 6:47 pm, edited 1 time in total.
PC: Intel i5 6600K @4.5Ghz, 1TB NVMe SSD, 32GiB 3000Mhz DDR4, GTX1080 running Mint 21
Laptop: Asus UM425UAZ running Mint 21
User avatar
zcot
Level 8
Level 8
Posts: 2098
Joined: Wed Oct 19, 2016 6:08 pm

Re: Text shifting on widget

Post by zcot »

Showing 1 line, break it into 2 statements, print the center ↑Speed↓ by itself, for example:

Code: Select all

${font Nimbus Sans Narrow:size=14}${color #FFFFFF}${voffset -10}↑Speed↓
${font Nimbus Sans Narrow:size=14}${color #FFFFFF}${voffset -10}${voffset -14}${upspeed enp5s0}${alignr}${downspeed enp5s0}
${color #808080}${voffset -10}${hr 2}
User avatar
Grayfox
Level 4
Level 4
Posts: 332
Joined: Sun May 21, 2017 5:10 am
Location: In a hole

Re: Text shifting on widget

Post by Grayfox »

Thanks that fixed it.
PC: Intel i5 6600K @4.5Ghz, 1TB NVMe SSD, 32GiB 3000Mhz DDR4, GTX1080 running Mint 21
Laptop: Asus UM425UAZ running Mint 21
Post Reply

Return to “Compiz, Conky, Docks & Widgets”