
我最近從 Debian 遷移到 Arch (到目前為止還很喜歡它),但我有一個輕微的用戶界面問題。我從 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>