短期解决方案

短期解决方案

我正在使用锁二conky 主题在我只连接主显示器时工作得很好,但当我为双显示器设置添加第二个显示器时,小部件显示不在我想要的位置。我希望它显示在主显示器的中央,但如果第二个显示器位于主显示器的右侧,conky 小部件将显示在主显示器的右上角。

那么有没有什么方法可以解决这个问题,比如让 conky 忽略第二台显示器?

作为参考,我的配置文件如下。

background no
own_window yes
own_window_type normal
own_window_class Conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
alignment mm
gap_x 0
#575
gap_y 0
#310
use_xft yes
xftfont Source Sans Pro:size=18
xftalpha 0.1
update_interval 15.0
uppercase yes
double_buffer yes
own_window_argb_visual yes
own_window_argb_value 0
draw_shades yes
default_shade_color 000000
default_color ffffff
color1 2d2d2d
#2d2d2d
#4A2B45
#382536
#3F2E2F
#000000
TEXT
${alignc}${color}I T ${color1}L ${color}I S ${color1}A S T I M E
${alignc}${if_match ${exec date +"%M"} < 35}${if_match ${exec date +"%M"} >= 15}${if_match ${exec date +"%M"} < 20}${color}${endif}${endif}A ${color1}C ${if_match   ${exec date +"%M"} >= 15}${if_match ${exec date +"%M"} < 20}${color}${endif}${endif}Q U A R T E R ${color1}D C
${alignc}${if_match ${exec date +"%M"} >= 20}${if_match ${exec date +"%M"} < 30}${color}${endif}${endif}T W E N T Y ${if_match ${exec date +"%M"} >= 25}${if_match   ${exec date +"%M"} < 30}${color}${endif}${else}${color1}${endif}${if_match ${exec date +"%M"} >= 5}${if_match ${exec date +"%M"} < 10}${color}${endif}${endif}F I V  E ${color1}X
${alignc}${if_match ${exec date +"%M"} >= 30}${if_match ${exec date +"%M"} < 35}${color}${endif}${endif}H A L F ${color1}B ${if_match ${exec date +"%M"} >=          10}${if_match ${exec date +"%M"} < 15}${color}${endif}${endif}T E N ${color1}F T O
${alignc}${else}${if_match ${exec date +"%M"} >= 45}${if_match ${exec date +"%M"} < 50}${color}${endif}${endif}A ${color1}C ${if_match ${exec date +"%M"} >=         45}${if_match ${exec date +"%M"} < 50}${color}${endif}${endif}Q U A R T E R ${color1}D C
${alignc}${if_match ${exec date +"%M"} >= 35}${if_match ${exec date +"%M"} < 45}${color}${endif}${endif}T W E N T Y ${if_match ${exec date +"%M"} < 40}${if_match    ${exec date +"%M"} >= 35}${color}${endif}${else}${color1}${endif}${if_match ${exec date +"%M"} >= 55}${color}${endif}F I V E ${color1}X
${alignc}H A L F B ${if_match ${exec date +"%M"} >= 50}${if_match ${exec date +"%M"} < 55}${color}${endif}${endif}T E N ${color1}F ${color}T O${color1}
${alignc}${endif}${if_match ${exec date +"%M"} < 35}${if_match ${exec date +"%M"} >= 5}${color}${endif}${endif}P A S T ${color1}E R U ${if_match ${exec date +"%M"}  < 35}${if_match ${exec date +"%I"} == 9}${color}${else}${color1}${endif}N I N E
${alignc}${if_match ${exec date +"%I"} == 1}${color}${else}${color1}${endif}O N E ${if_match ${exec date +"%I"} == 6}${color}${else}${color1}${endif}S I X           ${if_match ${exec date +"%I"} == 3}${color}${else}${color1}${endif}T H R E E
${alignc}${if_match ${exec date +"%I"} == 4}${color}${else}${color1}${endif}F O U R ${if_match ${exec date +"%I"} == 5}${color}${else}${color1}${endif}F I V E       ${if_match ${exec date +"%I"} == 2}${color}${else}${color1}${endif}T W O
${alignc}${if_match ${exec date +"%I"} == 8}${color}${else}${color1}${endif}E I G H T ${if_match ${exec date +"%I"} == 11}${color}${else}${color1}${endif}E L E V E N
${alignc}${if_match ${exec date +"%I"} == 7}${color}${else}${color1}${endif}S E V E N ${if_match ${exec date +"%I"} == 12}${color}${else}${color1}${endif}T W E L V E
${alignc}${if_match ${exec date +"%I"} == 10}${color}${else}${color1}${endif}T E N ${else}${if_match ${exec date +"%I"} == 8}${color}${else}${color1}${endif}N I N E
${alignc}${if_match ${exec date +"%I"} == 12}${color}${else}${color1}${endif}O N E ${if_match ${exec date +"%I"} == 5}${color}${else}${color1}${endif}S I X          ${if_match ${exec date +"%I"} == 2}${color}${else}${color1}${endif}T H R E E
${alignc}${if_match ${exec date +"%I"} == 3}${color}${else}${color1}${endif}F O U R ${if_match ${exec date +"%I"} == 4}${color}${else}${color1}${endif}F I V E       ${if_match ${exec date +"%I"} == 1}${color}${else}${color1}${endif}T W O
${alignc}${if_match ${exec date +"%I"} == 7}${color}${else}${color1}${endif}E I G H T${if_match ${exec date +"%I"} == 10}${color}${else}${color1}${endif} E L E V E N
${alignc}${if_match ${exec date +"%I"} == 6}${color}${else}${color1}${endif}S E V E N${if_match ${exec date +"%I"} == 11}${color}${else}${color1}${endif} T W E L V E
${alignc}${if_match ${exec date +"%I"} == 9}${color}${else}${color1}${endif}T E N ${endif}${color1}S E ${if_match ${exec date +"%M"} < 5}${color}${endif}O C L O C K

答案1

短期解决方案

您可以按住Alt键并左键单击 Conky 窗口,然后将其拖动到所需的位置。

长期解决方案

您的 conky 对齐设置mm为“中间-中间”。当您有一台显示器处于 1680x1050 分辨率时,这可以正常工作。您的“会说话的时钟”的左上角位于像素列号 500 行列号 300 附近。查看代码很难判断。

当您有两个活动显示器时,并且第二个显示器的分辨率为 1024x768,它会将虚拟桌面扩展至 2704x1050,并且现在mm转换到主显示器右边框附近(第 1100 列附近)。

解决方案是将对齐方式设置为主显示器的左上角,并调整 x 和 y 间隙。从 Conky 资源文件中删除以下几行:

alignment mm
gap_x 0
#575
gap_y 0
#310

现在添加以下几行:

alignment tl
gap_x 500
gap_y 300

保存文件(但不要退出),conky 将立即在您的屏幕上重新绘制。继续调整gap_xgap_y直到完全居中。您可能希望在第二台显示器上打开编辑器以加快编辑过程。开始在 +/- 100 的大间隙中工作,然后减少到 +/- 50... {25, 12, 6, 3, 1} 以微调位置。

相关内容