conky中的if-elseif-else构造无法正常工作。当我连接到wifi时,它应显示“无线”,当我连接到有线局域网时显示“有线”,当我没有网络连接时显示“无网络”。这是我这是不正常的Conky代码:conky中的if-else语句无法正常工作
${if_existing /proc/net/route wlan0}${color grey}wireless\
${else}\
${if_existing /proc/net/route eth0}${color grey}wired\
${else}\
${color grey}no network\
${endif}
的问题是,如果我有一个无线连接,没有从我的conkyrc上面写的行执行后。如果没有网络连接,它正在工作。
什么工作虽然,如果我只用一条if-else结构:
${if_existing /proc/net/route wlan0}${color grey}wireless\
${else}\
${color grey}no network\
${endif}
什么我在第一个片段做错了什么?
是的,这与我的答案是一致的:每个if都需要明确地关闭 – Alf