LoginSignup
2
1

More than 1 year has passed since last update.

Chromebook (Crostini) にLinuxアプリのアイコンを追加する

Posted at

通常、アプリケーションをインストールすると、下記パス内に ○○.desktop ファイルが作成されるが、Chrome OSのシェルフに表示されない場合がある。
今回は lxappearance を例に、アイコンを追加する方法を記録しておく。

インストール

インストールは、通常のDebian系Linux同様。

$ sudo apt install lxappearance

インストールが完了すると、下記パス内にショートカットアイコンになる ○○.desktop ファイルが作成されるのだが、Chrome OSのシェルフ内には追加されていない...

/usr/share/applications

カレントユーザー用にコピー

アイコンを表示させるためには、カレントユーザーのフォルダにコピーする必要がある。
コピーする場所は下記パスなのだが、初期状態では存在しない。( ~/home/《ユーザー名》 と同義)

~/.local/share/applications

まずはフォルダを作成する。

$ mkdir ~/.local/share/applications

作成したフォルダに移動して、先ほどの ○○.desktop ファイルをコピーしてくる。

$ cd .local/share/applications
$ cp /usr/share/applications/○○.desktop .

設定の修正

ファイルをコピーしてくるだけでは、表示されない事がある。
○○.desktop 内に NotShowIn=GNOME; Categories=Settings; が含まれているとシェルフ内には表示されない様なので、複数の値で構成されている場合は該当箇所のみを削除、該当する値のみで構成されている場合は行ごと削除。(表示名などは言語ごとの記載があるが、下記では日本語以外省略)
標準でインストールされている vi(vim) などで編集する。

[Desktop Entry]
Type=Application
Name=Customize Look and Feel
Name[ja]=ルックアンドフィールを設定します
GenericName=Customize Look and Feel
GenericName[ja]=ルックアンドフィールを設定します
Comment=Customizes look and feel of your desktop and applications
Comment[ja]=あなたのデスクトップとアプリケーションのルックアンドフィールを設定します
Keywords=windows;preferences;settings;theme;style;appearance;
Keywords[ja]=windows;preferences;settings;theme;style;appearance;
Icon=preferences-desktop-theme
Exec=lxappearance
NotShowIn=GNOME;KDE;XFCE;MATE;    # <- この設定に GNOME; が含まれていると表示されない
StartupNotify=true
Categories=GTK;Settings;DesktopSettings;X-LXDE-Settings;    # <- この設定に Settings; が含まれていると表示されない
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1