Linux安装使用Conky

安装conky
sudo yum install conky
安装sensors
sudo yum install lm-sensors
设置开机自启

在GNOME Tweaks中将conky加入开机自启

复制文件
sudo cp /etc/conky/conky.conf ~/.conkyrc
设置配置文件
sudo vim ~/.conkyrc

配置文件内容

conky.config = {
    own_window_argb_visual = true,
    own_window_argb_value = 0,
    own_window_transparent = true,
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    alignment = 'top_right',
    background = true,
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'lightgrey',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'DejaVu Sans Mono:size=12',
    gap_x = 10,
    gap_y = 60,
    minimum_height = 260,
    minimum_width = 5,
    maximum_width = 400,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_class = 'Conky',
    own_window_type = 'desktop',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 3.0,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true
}

conky.text = [[
 ${color grey}${font StyleBats:size=16}S${font OpenLogos:size=10}  System$stippled_hr
    ${color yellow}User:${alignr}${exec whoami}
    Kernel: ${alignr}$kernel
    Battery:${alignr}${battery_percent BAT1}% 
    Temp: ${alignr}${acpitemp} °C
    File systems:
    / ${fs_used /}/${fs_size /} ${fs_bar 6 /}

    ${color grey}${font PizzaDude Bullets:size=16}T${font :size=10}   Date&Time $stippled_hr
    ${color green}${font :size=11} ${time %Y/%m/%e  %H:%M:%S}${alignr}   Week:${time %w}
    ${color grey}Uptime:${color #A080F0}     $uptime
     
    ${color grey} ${font StyleBats:size=16}V${font OpenLogos:size=10}   CPU&MEM $stippled_hr
    ${color green}${font OpenLogos:size=10} CPU@${freq}MHz: ${cpu cpu1}%${alignr}${cpubar cpu1 8,60}
    ${color green} CPU@${freq}MHz: ${cpu cpu2}%${alignr}${cpubar cpu2 8,60}
     
    ${color grey}${font StyleBats:size=16}T${font OpenLogos:size=10}  Thread$stippled_hr
    ${color grey}Name                     PID            CPU%          ${alignr}MEM%
    ${color #FF8C00} ${top name 1}      ${top pid 1}     ${top cpu 1} ${alignr}${top mem 1}
    ${color #FFA54F} ${top name 2}      ${top pid 2}     ${top cpu 2} ${alignr}${top mem 2}
    ${color #FFD700} ${top name 3}      ${top pid 3}     ${top cpu 3} ${alignr}${top mem 3}
    ${color #FFEC8B} ${top name 4}      ${top pid 4}     ${top cpu 4} ${alignr}${top mem 4}
     
    ${color grey}${font StyleBats:size=16}E${font :size=10}   MEMORY $stippled_hr
    ${color #F05020}RAM : $mem/$memmax - $memperc% ${membar 6}
    ${color green}Swap : $swap/$swapmax  ${swapbar 6}
    /:  ${fs_used /}/${fs_size /}         ${fs_bar 6 /}
    /boot: ${fs_used /boot}/${fs_size /boot}   ${fs_bar 6 /boot}
     
    ${color grey} ${font PizzaDude Bullets:size=16}@${font OpenLogos:size=10}   NETWORK $stippled_hr
    ${color #FF8C00}IP:${addr wlp2s0}
    GateWay:$gw_ip
    Up: ${upspeed wlp2s0}  - Down: ${downspeed wlp2s0}
    ${color red} LAN:
    ${color green} Download: ${downspeedf enpvirbr01s0 } KB/s $alignr ${totaldown virbr0 }
    ${color #40E0D0} Upload: ${upspeedf virbr0 } KB/s $alignr ${totalup virbr0 }
    ${color red} WLAN:
    ${color green} Download: ${downspeedf wlp2s0} KB/s $alignr ${totaldown wlp2s0}
    ${color #40E0D0} Upload: ${upspeedf wlp2s0} KB/s $alignr ${totalup wlp2s0}
     
    ${color grey}${font StyleBats:size=16}C ${font :size=10} CPU Temp:$stippled_hr${font OpenLogos:size=10}$color
    ${color blue}${exec sensors | grep 'Core 0'}
    ${color blue}${exec sensors | grep 'Core 1'}
    ${color blue}${exec sensors | grep 'Core 2'}
    ${color blue}${exec sensors | grep 'Core 3'}
]]

上面的conky.text中的电池名称通过以下命令查看修改

upower -i `upower -e | grep 'BAT'`

在这里插入图片描述
wlan名称通过以下命令查看修改

ip addr
conky &  #开启conky
kill `pidof conky`   #关闭conky# conky &     //启动conky

效果如下图
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值