V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
hanssx
V2EX  ›  Linux

polybar 预留空白失效

  •  
  •   hanssx · Mar 3, 2021 · 1980 views
    This topic created in 1881 days ago, the information mentioned may be changed or developed.

    cpu 的百分比显示,比如

    icon 8% 
    icon 18%
    

    我想让它在 polybar 上占的宽度一样,因为 cpu 百分比的变化会让整体 polybar 总是抖动,想变成这样

    icon  8%
    icon 18%
    

    我看 polybar wiki 上关于 token 的内容,好像设置了最小宽度依然不行,还是在抖动。https://github.com/polybar/polybar/wiki/Formatting

    [module/cpu]
    type = internal/cpu
    
    ; Seconds to sleep between updates
    ; Default: 1
    interval = 1
    
    ; Available tags:
    ;   <label> (default)
    ;   <bar-load>
    ;   <ramp-load>
    ;   <ramp-coreload>
    ;;format = <label> <ramp-coreload>
    format = <label>
    format-prefix = 
    format-prefix-foreground = ${color.yellow}
    
    ; Available tokens:
    ;   %percentage% (default) - total cpu load averaged over all cores
    ;   %percentage-sum% - Cumulative load on all cores
    ;   %percentage-cores% - load percentage for each core
    ;   %percentage-core[1-9]% - load percentage for specific core
    label = " %percentage:2:2%%"
    
    ; Spacing between individual per-core ramps
    ;;ramp-coreload-spacing = 1
    ;;ramp-coreload-0 = ${cpu.load0}
    ;;ramp-coreload-1 = ${cpu.load1}
    
    ;;ramp-load-0 = ${cpu.load0}
    ;;ramp-load-1 = ${cpu.load1}
    
    ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
    
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1004 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 87ms · UTC 19:09 · PVG 03:09 · LAX 12:09 · JFK 15:09
    ♥ Do have faith in what you're doing.