[other] 关于conky背景透明问题
Tofloor
poster avatar
cqzjzp
deepin
2024-01-11 11:46
Author

我的conky效果如下,配置是在论坛里拔出来的,想把这个背景搞成全透明的,该怎么修改呢?,请大家帮忙指点一下,谢谢!!我在后面把配置文件贴出来,再次感谢

透明模式.jpg

Reply Favorite View the author
All Replies
cqzjzp
deepin
2024-01-11 11:47
#1

配置文件:

default_color white
double_buffer yes
no_buffers yes
update_interval 5 # update_interval 1
total_run_times 0
own_window yes ##yes
own_window_type normal ## normal /override /desktop
own_window_transparent yes ##true/yes/no
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

own_window_colour 000000
own_window_argb_visual yes ##true/yes
own_window_argb_value 0

double_buffer yes
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders n0
minimum_size 100 3
maximum_width 250
default_color ffffff
default_shade_color 000000
default_outline_color 000000
alignment top_right
gap_x 10
gap_y 0 # gap_y 100
cpu_avg_samples 2

override_utf8_locale no
uppercase no # set to yes if you want all text to be in uppercase
use_spacer none
use_xft yes
xftfont WenQuanYi Zen Hei:pixelsize=12
override_utf8_locale yes
use_spacer none
TEXT
​{font LCD:style=Bold:pixelsize=30}{alignc}​{time %H:%M}{font WenQuanYi Zen Hei:pixelsize=14}
​{alignc}{time %Y年%b%d日 星期%a}
${hr}
​{font WenQuanYi Zen Hei:pixelsize=18}{alignc}​{exec sed -n '3p' HOME/conky/conky-weather.db}
​{font WenQuanYi Zen Hei:pixelsize=13} {exec sed -n '4p' ​HOME/conky/conky-weather.db} {font WenQuanYi Zen Hei:pixelsize=12}​{exec sed -n '5p' HOME/conky/conky-weather.db}
​{font WenQuanYi Zen Hei:pixelsize=12}{exec sed -n '6p' $HOME/conky/conky-weather.db}
​{exec sed -n '7p' HOME/conky/conky-weather.db}
${hr}
​{font WenQuanYi Zen Hei:pixelsize=18}{alignc}​{exec sed -n '9p' HOME/conky/conky-weather.db}
​{font WenQuanYi Zen Hei:pixelsize=12} {exec sed -n '10p' ​HOME/conky/conky-weather.db} {exec sed -n '11p' $HOME/conky/conky-weather.db}
​{exec sed -n '12p' HOME/conky/conky-weather.db} ​{exec sed -n '13p' HOME/conky/conky-weather.db} 空气质量: ​{exec sed -n '14p' HOME/conky/conky-weather.db}
${hr}
​{font WenQuanYi Zen Hei:pixelsize=18}{alignc}​{exec sed -n '16p' HOME/conky/conky-weather.db}
​{font WenQuanYi Zen Hei:pixelsize=12} {exec sed -n '17p' ​HOME/conky/conky-weather.db} {exec sed -n '18p' $HOME/conky/conky-weather.db}
​{exec sed -n '19p' HOME/conky/conky-weather.db} ​{exec sed -n '20p' HOME/conky/conky-weather.db} 空气质量: ​{exec sed -n '21p' HOME/conky/conky-weather.db}
${hr}
​{font WenQuanYi Zen Hei:pixelsize=14}{alignc}[ 提醒 ]
​{exec head -5 HOME/conky/todo.txt}
​{hr}{font WenQuanYi Zen Hei:pixelsize=12}
​{color #98c2c7}主机名: {color}​alignrnodename
​{color #98c2c7}内核: {color}​alignrkernel
#​{color #98c2c7}CPU占用率: {color}​alignr{cpu}%
​{color #98c2c7}CPU占用率: {color} ​{freq_g dyn}GHz {cpu cpu}%
${cpubar cpu}
​{color #98c2c7}CPU温度: {color}​alignr{acpitemp}℃
​{color #98c2c7}内存使用:{color} ​mem/memmax - $memperc%
${membar}
​{color #98c2c7}已开机: {color}​alignruptime
​{image HOME/conky/moji-weather/weather-day00.png -p -2,70 -s 40x40 -n}​{image HOME/conky/moji-weather/weather-day02.png -p -2,165 -s 40x40 -n}​{image HOME/conky/moji-weather/weather-day03.png -p -2,240 -s 40x40 -n}

Reply View the author
cqzjzp
deepin
2024-01-11 12:06
#2

哦,对了,系统中的窗口特效我也打开了

Reply View the author
老咸鱼
deepin
2024-01-11 22:18
#3

own_window yes #设置conky的窗口属性
own_window_type dock 'normal', 'dock', 'panel', 'desktop', 'override'. #开启conky背景透明
own_window_transparent no #窗口透明
own_window_colour 000000 #设置conky窗口背景颜色
own_window_argb_visual yes
own_window_argb_value 26 #透明度

大概意思,自己对一下,没有的可以自己添加

Reply View the author
ljq790615
deepin
2024-01-12 19:11
#4

我以前发过代码,每行都有注释,可以查看下。

image.png

Reply View the author
ljq790615
deepin
2024-01-12 19:14
#5

conky.config = {
-- 各种设置
-- 修订:2023-03-25

-- 在屏幕的右上角放置 conky 窗口,则设置 alignment 为 top_right
alignment = 'top_right',
-- CPU 监视的平均样本数
cpu_avg_samples = 2,
-- 设置默认字体颜色
default_color = 'white',
-- 默认轮廓颜色
default_outline_color = 000000,
-- 默认着色颜色
default_shade_color = 000000,
-- 是否开启双缓冲绘图
double_buffer = true,
-- 是否绘制文字外框
draw_borders = false,
-- 是否绘制图表外框
draw_graph_borders = true,
-- 是否绘制字体阴影
draw_shades = true,
--是否绘制轮廓
draw_outline = false,
-- 设置 conky 窗口到屏幕边缘的距离,gap_x、gap_y 的单位上像素
gap_x = 8,
gap_y = 16,
-- 最小窗口尺寸 宽 (高)
minimum_size = 196,4,
-- 最大窗口像素尺寸
maximum_width = 292,
-- 是否从已用内存中减去(文件系统)缓冲区
no_buffers = true,
-- 创建自己绘制的窗口
own_window = true,
-- 设置窗口类型
own_window_class = 'Conky',
own_window_type = 'normal',
-- 是否开启窗口透明(true/false)
own_window_transparent = true,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
-- 是否使用ARGB 可用于实现真正的透明度
own_window_argb_visual = true,
-- 启用ARGB视觉效果时,使用此选项可修改使用的Alpha通道值。
-- 有效范围是0-255,其中0是0%不透明度,255是100%不透明度。
own_window_argb_value = 0,
-- 是否强制UTF8?需要XFT
override_utf8_locale = true,
-- Conky在退出前更新的总次数。Zero让Conky一直更新
total_run_times = 0,
-- 使用Xft(抗锯齿字体)
use_xft = true,
-- 如果希望所有文本都大写,则设置 uppercase 为 true
uppercase = false,
use_spacer = false,
-- 更新时间间隔,单位 秒
update_interval = 1.0,
-- 要使用的Xft字体设置。
xftfont = 'Microsoft YaHei:pixelsize=13',

};

Reply View the author