Text shifting on widget[Solved]

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.
Locked
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 1298 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 LockBot on Tue Mar 28, 2023 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
PC: Intel i5 6600K @4.5Ghz, 1TB NVMe SSD, 32GiB 3000Mhz DDR4, GTX1080 running Mint 21.3
Laptop: Asus UM425UAZ running LMDE 6
User avatar
zcot
Level 9
Level 9
Posts: 2828
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.3
Laptop: Asus UM425UAZ running LMDE 6
Locked

Return to “Compiz, Conky, Docks & Widgets”