i3blocks 配置在 Arch 安装上不起作用,但在 Debian 上运行良好

i3blocks 配置在 Arch 安装上不起作用,但在 Debian 上运行良好

我最近从 Debian 转到了 Arch(到目前为止我很喜欢它),但我遇到了一个小的 UI 问题。我从我的 debian 安装中拉出了我的 i3blocks 配置,但我的天气和音量模块由于某种原因没有加载,我可以找出原因。我希望有人能帮助我。

[weather]
command=curl wttr.in/Nottingham?format="%C" | sed 's/^//'
interval=1
#interval=1800
color=#64a964

# Volume indicator
[volume]
label=
instance=Master
#instance=PCM
interval=1
signal=10
command=/usr/share/i3blocks/volume 1 pulse
color=#64a964

配置中的其他模块加载正常(时间和日期),但我遇到这两个问题。天气脚本尤其令人困惑,因为它在终端中运行良好。

答案1

我已设法解决这些问题。

天气块

我通过将命令导出到其自己的单独脚本来解决天气块问题。然后我使用 i3blocks 来调用此脚本。不知道为什么,但这解决了问题。

  weather=$(curl -s wttr.in/Nottingham?format="%C" | sed 's/^/ /')
  echo $weather

然后在 i3blocks.conf 中

[weather]
command=/path/to/script
interval=1800

卷块

我检查了命令路径是否正确,因为我的 Arch 安装路径与我原来的 Debian 安装路径略有不同。我还注意到卷脚本不可执行,因此我使用以下命令对其进行了修改

chmod +x <filename>

相关内容