ターミナル(CLI)を介して/usr/share/cinnamon/appletに新しく追加されたCinnamonアプレットをどのようにロード(パネルに追加)しますか?

ターミナル(CLI)を介して/usr/share/cinnamon/appletに新しく追加されたCinnamonアプレットをどのようにロード(パネルに追加)しますか?

以下を使用してシナモンパネルを編集できることがわかりましたdconf

dconf read /org/cinnamon/enabled-applets
['panel1:left:0:[email protected]:0', 'panel1:left:1:[email protected]:1', 'panel1:left:2:[email protected]:2', 'panel1:right:2:[email protected]:3', 'panel1:right:3:[email protected]:4', 'panel1:right:4:[email protected]:5', 'panel1:right:5:[email protected]:6', 'panel1:right:6:[email protected]:7', 'panel1:right:7:[email protected]:8', 'panel1:right:8:[email protected]:9', 'panel1:right:9:[email protected]:10', 'panel1:right:10:[email protected]:11', 'panel1:right:11:[email protected]:12', 'panel1:right:12:[email protected]:13', 'panel1:right:1:temperature@fevimu:14']

アプレットを追加および削除できましたが、dconf writeGUIで有効になっているアプレット(パネルの右クリック - >アプレット)および/またはGUIを介して一度追加した後にのみ可能でした。

/usr/share/cinnamon/appletsターミナルコマンドで追加したアプレットを追加/ロードするにはどうすればよいですか?

ベストアンサー1

Githubで使用シナリオとオーバーライドの提案を受けてスクリプトを作成しました。

# edit panel
# editing /usr/share/glib-2.0/schemas/org.cinnamon.gschema.xml or 10_cinnamon.gschema.override
schema_override_file=/usr/share/glib-2.0/schemas/10_cinnamon.gschema.override
if [ ! -e "$schema_override_file" ]; then
    echo '[org.cinnamon]' | sudo tee "$schema_override_file" > /dev/null
fi

changed_panel=`grep 'panel1:right:' /usr/share/glib-2.0/schemas/org.cinnamon.gschema.xml | perl -pe 's/ *.{1,2}default.//g' | perl -pe 's/(right:)([0-9]+)/$1.($2+2)/eg' | perl -pe "s/]/, 'panel1:right:0:mem-monitor-text\@datanom.net', 'panel1:right:1:temperature\@fevimu']/"`

echo "enabled-applets=$changed_panel" | sudo tee --append "$schema_override_file" > /dev/null
sudo glib-compile-schemas /usr/share/glib-2.0/schemas

おすすめ記事