终端下awk是对齐的。yq-ysy 写了:对不起,我也不知道。因为这种表格式的对齐,程序写起来很麻烦……eagle5678 写了:股票这个字怎对齐,好像alg跟awk都管不了
股票价格,每个股票不一样,需要对读取的数据进行判断,有多少位,
然后针对位数少的,统统用空格补齐缺失的位数,然后在逐个排列……
使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell桌面
- eagle5678
- 帖子: 1900
- 注册时间: 2006-07-08 14:07
Re: 使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell
- hai1212
- 帖子: 156
- 注册时间: 2009-09-15 10:26
- 系统: Ubuntu、WIN7、XP、WIN8
- 联系:
Re: 使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell桌面
又来挖了,换了新系统Ubuntu mate22.04后,重装confy及CONKY-colors后日历无法显示了。字体也装了。就是没有日历显示出来!!
代码: 全选
######################
# - Conky settings - #
######################
update_interval 1
total_run_times 0
net_avg_samples 1
cpu_avg_samples 1
imlib_cache_size 0
double_buffer yes
no_buffers yes
format_human_readable
#####################
# - Text settings - #
#####################
use_xft yes
xftfont WenQuanYi Micro Hei:size=8
override_utf8_locale yes
text_buffer_size 2048
#############################
# - Window specifications - #
#############################
own_window_class Conky
own_window yes
own_window_type normal
own_window_argb_visual true
own_window_argb_value yes
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
alignment top_right
gap_x 25
gap_y 40
minimum_size 200 600
maximum_width 200
default_bar_size 60 8
#########################
# - Graphics settings - #
#########################
draw_shades no
default_color white
color0 cyan
color1 green
color2 orange
color3 green
TEXT
${font WenQuanYi Micro Hei:style=Bold:size=8}系统状态 $stippled_hr${font}
##############
# - SYSTEM - #
##############
${color0}${voffset -2}${font ConkyColorsLogos:size=19}l${font}${color}${goto 32}${voffset -10}主机名: ${alignr}${color2}${nodename}${color}
${color0}${voffset 6}${font ConkyColorsLogos:size=19}u${font}${color}${goto 32}${voffset -14}内核版本: ${alignr}${color2}${kernel}${color}
${goto 32}开机时长: ${alignr}${color2}${uptime}${color}
# |--UPDATES
${goto 32}等待升级: ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 360 aptitude search "~U" | wc -l | tail}${color}${font} ${color2}个软件包${color}
# |--CPU
${offset 1}${color0}${font Poky:size=16}P${font}${offset -11}${voffset 5}${cpubar cpu0 4,18}${color}${voffset -16}${goto 32}CPU1 负荷: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu1}%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core0' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font} ${color2}${cpugraph cpu1 8,50 }${color}
${goto 32}CPU2 负荷: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu2}%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core1' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font} ${color2}${cpugraph cpu2 8,50 }${color}
${goto 32}CPU3 负荷: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu3}%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core2' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font} ${color2}${cpugraph cpu3 8,50 }${color}
${goto 32}CPU4 负荷: ${font Ubuntu:style=Bold:size=8}${color1}${cpu cpu4}%${font} ${alignr}${font Ubuntu:style=Bold:size=8}${color1}${execi 30 sensors | grep 'Core3' | awk '{print $3}' | sed 's/+//' | sed 's/\.0//g'}${color}${font} ${color2}${cpugraph cpu4 8,50 }${color}
# |--MEM
${color0}${font Poky:size=16}M${font}${color}${goto 32}${voffset -12}内存占用率: ${font Ubuntu:style=Bold:size=8}${color1}$memperc% ${color}${font}
${offset 1}${voffset 2}${color0}${membar 4,18}${color}${goto 32}${voffset -2}剩余: ${font Ubuntu:style=Bold:size=8}${color2}${memeasyfree}${color}${font} 使用: ${font Ubuntu:style=Bold:size=8}${color2}${mem}${color}${font}
# |--PROC
${voffset -5}${color0}${font Poky:size=15}a${font}${color}${goto 32}${voffset -10}最占用资源的进程: ${color2}${alignr 13}CPU${alignr}RAM${color}
${voffset -1}${goto 49}${color2}${top name 1}${color}${font Ubuntu:style=Bold:size=8}${color1} ${goto 140}${top cpu 1}${alignr }${top mem 1}${color}${font}
${voffset -1}${goto 49}${color2}${top name 2}${color}${font Ubuntu:style=Bold:size=8}${color1} ${goto 140}${top cpu 2}${alignr }${top mem 2}${color}${font}
${voffset -1}${goto 49}${color2}${top name 3}${color}${font Ubuntu:style=Bold:size=8}${color1} ${goto 140}${top cpu 3}${alignr }${top mem 3}${color}${font}
#############
# - CLOCK - #
#############
${voffset -4}${font WenQuanYi Micro Hei:style=Bold:size=8}日期时间 $stippled_hr${font}
${voffset 4}${goto 20}${font clockfaces:size=40}O${font}
${voffset -35}${goto 30}${font zoraclockH:size=30}${color2}${execpi 120 /usr/share/conkycolors/bin/conkyClock hour}${color}${font}
${voffset -38}${goto 24}${font zoraclockM:size=40}${color2}${execpi 60 /usr/share/conkycolors/bin/conkyClock minute}${color}${font}
${goto 87}${voffset -50}${font Ubuntu:style=Bold:size=19}${color2}${time %H}${time :%M}${time :%S}${color}${font}
${goto 100}${voffset 0}${time %Y年 %b%d日}${voffset 8}
${goto 100}${voffset -8}${font WenQuanYi Micro Hei:style=Bold:size=8}${color2}${time %A}${color}${font}
${goto 100}${voffset 0}${font WenQuanYi Micro Hei:size=8}${alignc}${execpi 600 ~/.conkycolors/bin/lunar}${font}
################
# - CALENDAR - #
################
${voffset -8}${color0}${font Poky:size=20}D${font}${voffset -10}${goto 28}${font Ubuntu:style=Bold:size=10}${offset -17}${voffset 4}${time %d}${font}${color}${voffset -1}${font Monospace:size=9}${execpi 300 DJS=`date +%_d`; cal -h | sed 's/日 一 二 三 四 五 六/${font WenQuanYi Micro Hei Mono:size=10}日 一 二 三 四 五 六${font Monospace:size=9}/' |sed '2,8!d'| sed '/./!d' | sed 's/^/${goto 58} /'| sed 's/$/ /' | sed 's/^/ /' | sed /" $DJS "/s/" $DJS "/" "'${font Arial:style=Bold:size=10}${voffset -2}${offset 0}${color1} '"$DJS"'${color}${font Monospace:size=9}'" "/}${voffset -1}
${voffset 60}${font WenQuanYi Micro Hei:size=8}今夜月相${font}
${goto 10}${font weather:size=30}${execpi 300 ~/.conkycolors/bin/mond}${font}
${voffset 0}
#############
# - PHOTO - #
#############
# For a working photo widget you need to specify a file or directory in conkyPhoto or conkyPhotoRandom script in ~/.conkycolors/bin /usr/share/conkycolors/bin folders
${voffset 29}${font WenQuanYi Micro Hei:style=Bold:size=8}我的相册 $stippled_hr${font}
${execi 60 ~/.conkycolors/bin/conkyPhotoRandom}${image /tmp/conkyPhoto.png -s 198x126 -p 14,464}
${voffset 67}
###############
# - NETWORK - #
###############
${voffset 9}${font WenQuanYi Micro Hei:style=Bold:size=8}网络 $stippled_hr${font}
#|--enp4s0
${if_up enp4s0}
${voffset -13}${color0}${font VariShapes Solid:size=14}q${font}${color}${goto 32}${voffset -6}上传: ${font Ubuntu:style=Bold:size=8}${color1}${upspeed enp4s0}${color}${font} ${alignr}${color2}${upspeedgraph enp4s0 8,60 }${color}
${goto 32}总计: ${font Ubuntu:style=Bold:size=8}${color2}${totalup enp4s0}${color}${font}
${voffset -2}${color0}${font VariShapes Solid:size=14}Q${font}${color}${goto 32}${voffset -6}下载: ${font Ubuntu:style=Bold:size=8}${color1}${downspeed enp4s0}${color}${font} ${alignr}${color2}${downspeedgraph enp4s0 8,60 }${color}
${goto 32}总计: ${font Ubuntu:style=Bold:size=8}${color2}${totaldown enp4s0}${color}${font}
${voffset -2}${color0}${font Poky:size=13}w${font}${color}${goto 32}${voffset -4}本地 IP: ${alignr}${color1}${addr enp4s0}${color}
${goto 32}对外 IP: ${alignr}${color1}${execi 3600 /usr/share/conkycolors/bin/conkyIp}${color}
${else}${voffset 4}${color0}${font PizzaDude Bullets:size=12}4${font}${color}${goto 32}网络不可用${voffset 14}$endif
# To Do List #
${voffset -10}${offset -1}${font WenQuanYi Micro Hei Regular:style=Bold:pixelsize=15}${color AAFFA7}日程安排 $stippled_hr${font}
${font WenQuanYi Micro Hei:style=Bold:pixelsize=13}${color3}
${voffset -12}${execi 60 cat ~/notepad.txt | fold -w60}${color}
- yq-ysy
- 论坛版主
- 帖子: 4639
- 注册时间: 2008-07-19 12:44
- 来自: 广西(桂)南宁(邕)
Re: 使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell桌面
十几年写的,都忘了。hai1212 写了: ↑2024-08-21 22:38 又来挖了,换了新系统Ubuntu mate22.04后,重装confy及CONKY-colors后日历无法显示了。字体也装了。就是没有日历显示出来!!代码: 全选
################ # - CALENDAR - # ################ ${voffset -8}${color0}${font Poky:size=20}D${font}${voffset -10}${goto 28}${font Ubuntu:style=Bold:size=10}${offset -17}${voffset 4}${time %d}${font}${color}${voffset -1}${font Monospace:size=9}${execpi 300 DJS=`date +%_d`; cal -h | sed 's/日 一 二 三 四 五 六/${font WenQuanYi Micro Hei Mono:size=10}日 一 二 三 四 五 六${font Monospace:size=9}/' |sed '2,8!d'| sed '/./!d' | sed 's/^/${goto 58} /'| sed 's/$/ /' | sed 's/^/ /' | sed /" $DJS "/s/" $DJS "/" "'${font Arial:style=Bold:size=10}${voffset -2}${offset 0}${color1} '"$DJS"'${color}${font Monospace:size=9}'" "/}${voffset -1} ${voffset 60}${font WenQuanYi Micro Hei:size=8}今夜月相${font} ${goto 10}${font weather:size=30}${execpi 300 ~/.conkycolors/bin/mond}${font} ${voffset 0}
(1)检查一下调用的命令,在你使用的发行版上是否还存在,或者该命令所要求的格式是否有更新变化。
也就是 execpi 后面的那一句。
execpi 300 DJS=`date +%_d`; cal -h
(2)检查一下字体调用的名称和路径是否正确
font WenQuanYi Micro Hei Mono:size=10
- hai1212
- 帖子: 156
- 注册时间: 2009-09-15 10:26
- 系统: Ubuntu、WIN7、XP、WIN8
- 联系:
Re: 使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell桌面
谢谢版主!好的,我去翻下看,
Monospace字体不知道是哪个!!!
这是正则表达式吧?命令不是很懂。去学习下!(1)检查一下调用的命令,在你使用的发行版上是否还存在,或者该命令所要求的格式是否有更新变化。
也就是 execpi 后面的那一句。
字体有在!(2)检查一下字体调用的名称和路径是否正确
font WenQuanYi Micro Hei Mono:size=10
代码: 全选
{voffset -1}${font Monospace:size=9}${execpi 300 DJS=`date +%_d`; cal -h | sed 's/日 一 二 三 四 五 六/${font WenQuanYi Micro Hei:size=10}日 一 二 三 四 五 六${font Monospace:size=9}/' |sed '2,8!d'| sed '/./!d' | sed 's/^/${goto 58} /'| sed 's/$/ /' | sed 's/^/ /' | sed /" $DJS "/s/" $DJS "/" "'${font Arial:style=Bold:size=10}${voffset -2}${offset 0}${color1} '"$DJS"'${color}${font Monospace:size=9}'" "/}${voffset -1}
- yq-ysy
- 论坛版主
- 帖子: 4639
- 注册时间: 2008-07-19 12:44
- 来自: 广西(桂)南宁(邕)
Re: 使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell桌面
关键是 cal -h 这个命令,毕竟这脚本是十几年前写的了,我现在用的Linux发行版就没有这个命令。
你用的Linux发行版有没有,在终端下试运行一下就知道了。
如果没有这个命令,就安装这个命令的软件包,或者修改脚本换另一个可以用的命令。
看看你的Linux发行版有没有“字体管理”这类软件,
像我现在用的Linux发行版,用“字体管理”搜索“Monospace”,找到的是“GWMonospace”。 有命令,字体正确,那么就应该能显示了。
- hai1212
- 帖子: 156
- 注册时间: 2009-09-15 10:26
- 系统: Ubuntu、WIN7、XP、WIN8
- 联系:
Re: 使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell桌面
感谢,大佬每次的回复都是学习的动力啊。虽然命令难学,但总要掌握一点,一小点一小点来!!
- hai1212
- 帖子: 156
- 注册时间: 2009-09-15 10:26
- 系统: Ubuntu、WIN7、XP、WIN8
- 联系:
Re: 使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell桌面
感谢,大佬每次的回复都是学习的动力啊。虽然命令难学,但总要掌握一点,一小点一小点来!!
- hai1212
- 帖子: 156
- 注册时间: 2009-09-15 10:26
- 系统: Ubuntu、WIN7、XP、WIN8
- 联系:
Re: 使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell桌面
有安装了字体管理工具,但搜索没找到Monospaces字体,就把字体都换成WenQuanYi Micro Hei了。
安装了命令包ncal,可以运行cal -h!
还是没显示出来。
会不会是原来安装condy配置时一些包没装好呢。但这些包都没了!就只运行了以下代码!
还是在学习路上!现在至少能看的下这代码了!还看了https://conky.sourceforge.net/variables.html。那真是晕头转向!!哈哈!!
代码: 全选
################
# - CALENDAR - #
################
${voffset -8}${color0}${font Poky:size=20}D${font}${voffset -10}${goto 28}${font Ubuntu:style=Bold:size=10}${offset -17}${voffset 4}${time %d}${font}${color}${voffset -1}${font WenQuanYi Micro Hei:size=9}${execpi 300 DJS=`date +%_d`; cal -h | sed 's/日 一 二 三 四 五 六/${font WenQuanYi Micro Hei:size=10}日 一 二 三 四 五 六${font WenQuanYi Micro Hei:size=9}/' |sed '2,8!d'| sed '/./!d' | sed 's/^/${goto 58} /'| sed 's/$/ /' | sed 's/^/ /' | sed /" $DJS "/s/" $DJS "/" "'${font WenQuanYi Micro Hei:style=Bold:size=10}${voffset -2}${offset 0}${color1} '"$DJS"'${color}${font WenQuanYi Micro Hei:size=9}'" "/}${voffset -1}
会不会是原来安装condy配置时一些包没装好呢。但这些包都没了!就只运行了以下代码!
代码: 全选
sudo apt-get install aptitude curl lm-sensors conky-all
- yq-ysy
- 论坛版主
- 帖子: 4639
- 注册时间: 2008-07-19 12:44
- 来自: 广西(桂)南宁(邕)
Re: 使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell桌面
有可能是现在的 cal 命令更新了格式,不支持 -h 参数了。
你可以直接使用 cal 命令(不带任何参数),看看它显示什么。
如果你对输出的格式不满意,用 cal --help 看它的提示:加什么参数,会输出什么。
之后就可以把这个命令和参数放进 conky 里,替换掉原来的 cal -h 看看能否显示。
可以预测的是,显示结果会有点乱,这个时候你就要学习 sed 程序的语法了,
在 conky 里就是用 sed 来调整排版布局的。
如果怕麻烦,就在网上找最新的 conky 脚本来用,国外的网友玩这个的多。
十几年前我精力旺盛,也是像你一样从零开始研究的。
弄好了这个脚本,写了这教程,到现在就再也没碰过,所以很多东西都忘了。
能帮助你的可能也就到此为止了,剩下的你要自己加油!
- hai1212
- 帖子: 156
- 注册时间: 2009-09-15 10:26
- 系统: Ubuntu、WIN7、XP、WIN8
- 联系:
Re: 使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell桌面
嗯,好的!谢谢大佬!也是啊,接触Ubuntu也十几年了!哈哈!学学sed看看!书放哪里都“相扑”了!
- hai1212
- 帖子: 156
- 注册时间: 2009-09-15 10:26
- 系统: Ubuntu、WIN7、XP、WIN8
- 联系:
Re: 使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell桌面
问下各位大佬,家里的电脑可以一样的系统Ubuntu mate22.04,可以安装conky_colors。另一台就不行了!提示如下!!这是什么原因??看不懂!!
代码: 全选
cc -Wall -std=c99 src/conky-colors.c src/conkycover.c src/conkyplayer.c src/conkyrc_cairo.c src/conkyrc_ring.c src/conkyrc_board.c src/conkyrc_default.c src/conkyrc_slim.c src/conkyrc_sls.c src/coverposition.c src/finddir.c src/help.c src/options.c src/photoposition.c src/themes.c src/translations.c src/variables.c src/confinstall.c src/utils.c src/initialize.c -o conky-colors
src/conkyrc_cairo.c: In function ‘conkyrc_cairo’:
src/conkyrc_cairo.c:118:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
118 | else
| ^~~~
src/conkyrc_cairo.c:121:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
121 | if (dark == True || black == True)
| ^~
src/conkyrc_board.c: In function ‘conkyrc_board’:
src/conkyrc_board.c:124:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
124 | else
| ^~~~
src/conkyrc_board.c:127:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
127 | fprintf(fp,"%s ", color3);
| ^~~~~~~
src/finddir.c: In function ‘initialize_finddir’:
src/finddir.c:37:68: warning: ‘/.conkycolors’ directive output may be truncated writing 13 bytes into a region of size between 1 and 256 [-Wformat-truncation=]
37 | snprintf(info.datadir[FINDDIR_LOCAL], FINDDIR_CHAR_LEN, "%s/.conkycolors", path);
| ^~~~~~~~~~~~~
src/finddir.c:37:9: note: ‘snprintf’ output between 14 and 269 bytes into a destination of size 256
37 | snprintf(info.datadir[FINDDIR_LOCAL], FINDDIR_CHAR_LEN, "%s/.conkycolors", path);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/string.h:26,
from src/options.c:2:
/usr/include/features.h:194:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
194 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
| ^~~~~~~
src/options.c: In function ‘options’:
src/options.c:228:25: warning: format not a string literal and no format arguments [-Wformat-security]
228 | snprintf(player, 31, key+2);
| ^~~~~~~~
src/themes.c: In function ‘themes’:
src/themes.c:141:46: warning: format not a string literal and no format arguments [-Wformat-security]
141 | snprintf(color3, 31, color1);
| ^~~~~~
src/translations.c: In function ‘translation’:
src/translations.c:364:54: warning: ‘Мережа недосту�...’ directive output truncated writing 33 bytes into a region of size 31 [-Wformat-truncation=]
364 | snprintf(nonet, 31, "Мережа недоступна");
| ~~~~~~~~~~~~~~~~^
src/translations.c:364:17: note: ‘snprintf’ output 34 bytes into a destination of size 31
364 | snprintf(nonet, 31, "Мережа недоступна");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/translations.c:366:58: warning: ‘Інформация про ...’ directive output truncated writing 61 bytes into a region of size 31 [-Wformat-truncation=]
366 | snprintf(noweather, 31, "Інформация про погоду недоступна");
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
src/translations.c:366:17: note: ‘snprintf’ output 62 bytes into a destination of size 31
366 | snprintf(noweather, 31, "Інформация про погоду недоступна");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/translations.c:327:54: warning: ‘Мрежата е недос...’ directive output truncated writing 38 bytes into a region of size 31 [-Wformat-truncation=]
327 | snprintf(nonet, 31, "Мрежата е недостъпна");
| ~~~~~~~~~~~~~~~~^~~~
src/translations.c:327:17: note: ‘snprintf’ output 39 bytes into a destination of size 31
327 | snprintf(nonet, 31, "Мрежата е недостъпна");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/translations.c:329:58: warning: ‘Няма информаци�...’ directive output truncated writing 49 bytes into a region of size 31 [-Wformat-truncation=]
329 | snprintf(noweather, 31, "Няма информация за времето");
| ~~~~~~~~~~~~~~~~^~~~~~~~~~
src/translations.c:329:17: note: ‘snprintf’ output 50 bytes into a destination of size 31
329 | snprintf(noweather, 31, "Няма информация за времето");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/translations.c:339:61: warning: ‘Pidgin не е старти�...’ directive output truncated writing 33 bytes into a region of size 31 [-Wformat-truncation=]
339 | snprintf(nopidgin, 31, "Pidgin не е стартиран");
| ~~~~~~~~~~~~~~~~~~~~^
src/translations.c:339:17: note: ‘snprintf’ output 34 bytes into a destination of size 31
339 | snprintf(nopidgin, 31, "Pidgin не е стартиран");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/translations.c:292:58: warning: ‘Информация о по...’ directive output truncated writing 57 bytes into a region of size 31 [-Wformat-truncation=]
292 | snprintf(noweather, 31, "Информация о погоде недоступна");
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
src/translations.c:292:17: note: ‘snprintf’ output 58 bytes into a destination of size 31
292 | snprintf(noweather, 31, "Информация о погоде недоступна");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from src/utils.c:2:
/usr/include/features.h:194:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
194 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
| ^~~~~~~
/usr/bin/ld: /tmp/cc2uRl4F.o:(.bss+0x0): multiple definition of `i'; /tmp/cc2vVisy.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [<内置>:conky-colors] 错误 1
- yq-ysy
- 论坛版主
- 帖子: 4639
- 注册时间: 2008-07-19 12:44
- 来自: 广西(桂)南宁(邕)
Re: 使用CONKY-colors配置和汉化conky完全教程,兼容13.04版Unity桌面和Gnome-Shell桌面
编译的事情我不懂。hai1212 写了: ↑2024-09-27 8:17 问下各位大佬,家里的电脑可以一样的系统Ubuntu mate22.04,可以安装conky_colors。另一台就不行了!提示如下!!这是什么原因??看不懂!!代码: 全选
cc -Wall -std=c99 src/conky-colors.c src/conkycover.c src/conkyplayer.c src/conkyrc_cairo.c src/conkyrc_ring.c src/conkyrc_board.c src/conkyrc_default.c src/conkyrc_slim.c src/conkyrc_sls.c src/coverposition.c src/finddir.c src/help.c src/options.c src/photoposition.c src/themes.c src/translations.c src/variables.c src/confinstall.c src/utils.c src/initialize.c -o conky-colors src/conkyrc_cairo.c: In function ‘conkyrc_cairo’: src/conkyrc_cairo.c:118:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 118 | else | ^~~~ src/conkyrc_cairo.c:121:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 121 | if (dark == True || black == True) | ^~ src/conkyrc_board.c: In function ‘conkyrc_board’: src/conkyrc_board.c:124:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 124 | else | ^~~~ src/conkyrc_board.c:127:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 127 | fprintf(fp,"%s ", color3); | ^~~~~~~ src/finddir.c: In function ‘initialize_finddir’: src/finddir.c:37:68: warning: ‘/.conkycolors’ directive output may be truncated writing 13 bytes into a region of size between 1 and 256 [-Wformat-truncation=] 37 | snprintf(info.datadir[FINDDIR_LOCAL], FINDDIR_CHAR_LEN, "%s/.conkycolors", path); | ^~~~~~~~~~~~~ src/finddir.c:37:9: note: ‘snprintf’ output between 14 and 269 bytes into a destination of size 256 37 | snprintf(info.datadir[FINDDIR_LOCAL], FINDDIR_CHAR_LEN, "%s/.conkycolors", path); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/string.h:26, from src/options.c:2: /usr/include/features.h:194:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] 194 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" | ^~~~~~~ src/options.c: In function ‘options’: src/options.c:228:25: warning: format not a string literal and no format arguments [-Wformat-security] 228 | snprintf(player, 31, key+2); | ^~~~~~~~ src/themes.c: In function ‘themes’: src/themes.c:141:46: warning: format not a string literal and no format arguments [-Wformat-security] 141 | snprintf(color3, 31, color1); | ^~~~~~ src/translations.c: In function ‘translation’: src/translations.c:364:54: warning: ‘Мережа недосту�...’ directive output truncated writing 33 bytes into a region of size 31 [-Wformat-truncation=] 364 | snprintf(nonet, 31, "Мережа недоступна"); | ~~~~~~~~~~~~~~~~^ src/translations.c:364:17: note: ‘snprintf’ output 34 bytes into a destination of size 31 364 | snprintf(nonet, 31, "Мережа недоступна"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/translations.c:366:58: warning: ‘Інформация про ...’ directive output truncated writing 61 bytes into a region of size 31 [-Wformat-truncation=] 366 | snprintf(noweather, 31, "Інформация про погоду недоступна"); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ src/translations.c:366:17: note: ‘snprintf’ output 62 bytes into a destination of size 31 366 | snprintf(noweather, 31, "Інформация про погоду недоступна"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/translations.c:327:54: warning: ‘Мрежата е недос...’ directive output truncated writing 38 bytes into a region of size 31 [-Wformat-truncation=] 327 | snprintf(nonet, 31, "Мрежата е недостъпна"); | ~~~~~~~~~~~~~~~~^~~~ src/translations.c:327:17: note: ‘snprintf’ output 39 bytes into a destination of size 31 327 | snprintf(nonet, 31, "Мрежата е недостъпна"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/translations.c:329:58: warning: ‘Няма информаци�...’ directive output truncated writing 49 bytes into a region of size 31 [-Wformat-truncation=] 329 | snprintf(noweather, 31, "Няма информация за времето"); | ~~~~~~~~~~~~~~~~^~~~~~~~~~ src/translations.c:329:17: note: ‘snprintf’ output 50 bytes into a destination of size 31 329 | snprintf(noweather, 31, "Няма информация за времето"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/translations.c:339:61: warning: ‘Pidgin не е старти�...’ directive output truncated writing 33 bytes into a region of size 31 [-Wformat-truncation=] 339 | snprintf(nopidgin, 31, "Pidgin не е стартиран"); | ~~~~~~~~~~~~~~~~~~~~^ src/translations.c:339:17: note: ‘snprintf’ output 34 bytes into a destination of size 31 339 | snprintf(nopidgin, 31, "Pidgin не е стартиран"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/translations.c:292:58: warning: ‘Информация о по...’ directive output truncated writing 57 bytes into a region of size 31 [-Wformat-truncation=] 292 | snprintf(noweather, 31, "Информация о погоде недоступна"); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ src/translations.c:292:17: note: ‘snprintf’ output 58 bytes into a destination of size 31 292 | snprintf(noweather, 31, "Информация о погоде недоступна"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from src/utils.c:2: /usr/include/features.h:194:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] 194 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" | ^~~~~~~ /usr/bin/ld: /tmp/cc2uRl4F.o:(.bss+0x0): multiple definition of `i'; /tmp/cc2vVisy.o:(.bss+0x0): first defined here collect2: error: ld returned 1 exit status make: *** [<内置>:conky-colors] 错误 1
你可以在搜索引擎里搜索这些出错信息,看看能不能找到答案。
例如,刚才我试着百度了一下,发现一篇:
https://zhuanlan.zhihu.com/p/576844360
原因可能是你的文本编辑器的“自动缩进”都是帮你加上四个空格,而你的 Tab 会被视作 8 个空格。
解决方法是手动敲四个空格代替 Tab 就好了,虽然我很喜欢 Tab。(或者反过来,用Tab代替四个空格)