Configuration
增加conky高度
有什麼辦法可以改變一個conky視窗的高度嗎?
.conkyrc
background no update_interval 1 cpu_avg_samples 2 net_avg_samples 2 override_utf8_locale yes double_buffer yes no_buffers yes text_buffer_size 2048 #imlib_cache_size 0 # Window specifications # own_window_class Conky own_window yes own_window_type desktop own_window_transparent yes own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager own_window_argb_visual yes border_inner_margin 0 border_outer_margin 0 minimum_size 200 200 maximum_width 200 alignment tr gap_x 0 gap_y 25 # Graphics settings # draw_shades no draw_outline no draw_borders no draw_graph_borders no # Text settings # use_xft yes xftfont Ubuntu:size=8 xftalpha 0.5 uppercase no temperature_unit celsius default_color FFFFFF # Lua Load # lua_load ~/.conky/draw_bg.lua lua_draw_hook_pre draw_bg lua_load ~/.conky/clock_rings.lua lua_draw_hook_post clock_rings TEXT ${voffset 8}${goto 25}${color FFFFFF}${font Ubuntu:size=16}${time %A}${font}${voffset -8}${alignr 50}${color FFFFFF}${font Ubuntu:size=38}${time %e}${font} ${color FFFFFF}${goto 25}${voffset -30}${color FFFFFF}${font Ubuntu:size=18}${time %b}${goto 75}${font Ubuntu:size=20}${time %Y}${font}${color 0B8904} ${voffset 150}${font Ubuntu:size=10}${font} ${font Ubuntu:size=12}${color FFFFFF}${alignr}${font} ${voffset -20}${alignr 50}${color FFFFFF}${font Ubuntu:size=38}${time %H}${font} ${alignr 50}${color FFFFFF}${font Ubuntu:size=38}${time %M}${font} ${voffset -95} ${color FFFFFF}${goto 23}${voffset 48}${cpu cpu0}% ${color 0B8904}${goto 23}CPU ${color FFFFFF}${goto 48}${voffset 23}${memperc}% ${color 0B8904}${goto 48}RAM ${color FFFFFF}${goto 73}${voffset 23}${swapperc}% ${color 0B8904}${goto 73}Swap ${color FFFFFF}${goto 98}${voffset 23}${fs_used_perc /}% ${color 0B8904}${goto 98}Disk ${color FFFFFF}${voffset 25}${alignr 62}${downspeed eth1}${goto 135}D ${color FFFFFF}${alignr 62}${upspeed eth1}${goto 135}U ${color 0B8904}${goto 123}Net ${color FFFFFF}${font Ubuntu:size=8}${goto 55}Uptime: ${goto 100}${uptime_short} ${color FFFFFF}${font Ubuntu:size=8}${goto 42}Processes: ${goto 100}${processes} ${color FFFFFF}${font Ubuntu:size=8}${goto 50}Running: ${goto 100}${running_processes}}
draw_bg lua 腳本
-- Change these settings to affect your background. -- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0. corner_r=0 -- Set the colour and transparency (alpha) of your background. bg_colour=0x000000 bg_alpha=.8 require 'cairo' function rgb_to_r_g_b(colour,alpha) return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha end function conky_draw_bg() if conky_window==nil then return end local w=conky_window.width local h=conky_window.height local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h) cr=cairo_create(cs) cairo_move_to(cr,corner_r,0) cairo_line_to(cr,w-corner_r,0) cairo_curve_to(cr,w,0,w,0,w,corner_r) cairo_line_to(cr,w,h-corner_r) cairo_curve_to(cr,w,h,w,h,w-corner_r,h) cairo_line_to(cr,corner_r,h) cairo_curve_to(cr,0,h,0,h,0,h-corner_r) cairo_line_to(cr,0,corner_r) cairo_curve_to(cr,0,0,0,0,corner_r,0) cairo_close_path(cr) cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha)) cairo_fill(cr) end
設置截圖
問題
我想增加背景(使用 lua 腳本繪製
conky_window.height
)以佔據整個螢幕高度。試過了
- 更改
minimum_size
沒有效果- 在底部添加線條沒有效果,請參閱http://imgur.com/KJ5uVD3
使固定
事實證明,
conky_window.height
lua 腳本使用的內容在 conky 重新啟動之間保留。註銷並重新登錄可解決此問題。改變minimum_size
作品。
只需在文件
${voffset 200}
末尾添加.conckyrc
並使用該值即可。
只需在
.conkyrc
.非常好的腳本順便說一句。