自前のLinuxアプリにアイコンをつけてデスクトップから起動

自前のLinuxアプリにアイコンをつけてデスクトップから起動

Linuxアプリを /usr/share/applications に登録すればデスクトップからアイコンとして扱うことができるようだ
アプリにアイコンを登録すればGUIアプリになるのではなく、システムに登録する流儀らしい
ChromebookでもLinuxアプリのアイコンをデスクトップ(シェルフ)に登録できる
Emacsのデスクトップ設定ファイルは以下のようになっていた
アイコンは /usr/share/icons に入れるかフルパス指定すればよい模様
/usr/share/applications/emacs24.desktop
Copied!
[Desktop Entry]
Version=1.0
Name=GNU Emacs 24 (GUI)
GenericName=Text Editor
Comment=GNU Emacs is an extensible, customizable text editor - and more
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
TryExec=/usr/bin/emacs24
Exec=/usr/bin/emacs24 %F
Icon=emacs24
Type=Application
Terminal=false
Categories=Utility;Development;TextEditor;
StartupWMClass=Emacs
Keywords=Text;Editor;

インストールと検証には以下のコマンドを使う
$ update-desktop-database 情報を更新
$ desktop-file-validate desktopファイルを検証
$ desktop-file-install desktop ファイルをインストール
FreeDesktop.orgというところで仕様が決められているらしい
コマンド名とか仕様とかがダサいのはこれのせい?

Linuxユーザには常識なのかもしれないがMacとは流儀が違うので往生した...
Macでは xxx.app というフォルダ内にスクリプトとかアイコンとかを登録するとGUIアプリになるのだが


Powered by Helpfeel