Home
Packages
Forums
Wiki
GitLab
Security
AUR
Download
コンテンツにスキップ
メインメニュー
メインメニュー
サイドバーに移動
非表示
案内
メインページ
目次
コミュニティに貢献
最近の出来事
おまかせ表示
特別ページ
交流
ヘルプ
貢献
最近の更新
最近の議論
新しいページ
統計
リクエスト
ArchWiki
検索
検索
表示
アカウント作成
ログイン
個人用ツール
アカウント作成
ログイン
デスクトップエントリのソースを表示
ページ
議論
日本語
閲覧
ソースを閲覧
履歴を表示
ツール
ツール
サイドバーに移動
非表示
操作
閲覧
ソースを閲覧
履歴を表示
全般
リンク元
関連ページの更新状況
ページ情報
表示
サイドバーに移動
非表示
←
デスクトップエントリ
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
[[Category:パッケージ開発] [[en:Desktop entries]] デスクトップエントリは [[Xorg|X Window System]] で動作するプログラムの挙動を指定する [http://www.freedesktop.org/wiki/ freedesktop.org] の仕様です。デスクトップエントリは設定ファイルとしてアプリケーションの起動方法やメニューとアイコンの表示方法を定義します。最も一般的なデスクトップエントリは {{ic|.desktop}} と {{ic|.directory}} ファイルです。この記事では有用な標準仕様のデスクトップエントリを作成する方法を簡単に説明します。主にパッケージ作成者やメンテナを対象にしていますが、ソフトウェアの開発者なども読む価値があると思われます。 デスクトップエントリには大きくわけて3つのタイプがあります: ; アプリケーション : アプリケーションのショートカット ; リンク : ウェブリンクのショートカット。 ; ディレクトリ : メニューエントリのメタデータのコンテナ。 以下のセクションではこれらのエントリを作成したり修正する方法をざっと説明しています。 == アプリケーションエントリ == アプリケーションのデスクトップエントリ、または {{ic|.desktop}} ファイルは、基本的にメタ情報の集合でありアプリケーションのショートカットです。これらのファイルは基本的に、システム全体でインストールしたアプリケーションなら {{ic|/usr/share/applications}} または {{ic|/usr/local/share/applications}} に、ユーザー個別にインストールしたアプリケーションなら {{ic|~/.local/share/applications}} に入っています。ユーザーのエントリはシステムのエントリよりも優先されます。 === サンプルファイル === Following is an example of its structure with additional comments. The example is only meant to give a quick impression, and does not show how to utilize all possible entry keys. The complete list of keys can be found in the [http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html freedesktop.org specification]. [Desktop Entry] Type=Application # Indicates the type as listed above Version=1.0 # The version of the desktop entry specification to which this file complies Name=jMemorize # The name of the application Comment=Flash card based learning tool # A comment which can/will be used as a tooltip Exec=jmemorize # The executable of the application. Icon=jmemorize # The name of the icon that will be used to display this entry Terminal=false # Describes whether this application needs to be run in a terminal or not Categories=Education;Languages;Java; # Describes the categories in which this entry should be shown === キーの定義 === All Desktop recognized desktop entries can be found [http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html on the freedesktop.org site]. For example, the {{Ic|Type}} key defines three types of desktop entries: Application (type 1), Link (type 2) and Directory (type 3). * {{Ic|Version}} key does not stand for the version of the application, but for the version of the desktop entry specification to which this file complies. * {{Ic|Name}}, {{Ic|GenericName}} and {{Ic|Comment}} often contain redundant values in the form of combinations of them, like: Name=Pidgin Internet Messenger GenericName=Internet Messenger or Name=NoteCase notes manager Comment=Notes Manager This should be avoided, as it will only be confusing to users. The {{Ic|Name}} key should only contain the name, or maybe an abbreviation/acronym if available. * {{Ic|GenericName}} should state what you would generally call an application that does what this specific application offers (i.e. Firefox is a "Web Browser"). * {{Ic|Comment}} is intended to contain any usefull additional information. ==== 非推奨 ==== There are quite some keys that have become deprecated over time as the standard has matured. The best/simplest way is to use the tool {{Ic|desktop-file-validate}} which is part of the package {{Pkg|desktop-file-utils}}. To validate, run $ desktop-file-validate <your desktop file> This will give you very verbose and useful warnings and error messages. == アイコン == === 一般的な画像フォーマット === 以下はアイコンとしてよく使われている画像フォーマットの簡単な概要です。 {| class="wikitable" align="center" |+ [http://standards.freedesktop.org/icon-theme-spec/latest/ar01s02.html freedesktop.org の仕様] で指定されているアイコンとしてサポートされる画像フォーマット ! 拡張子 ! フルネームまたは説明 ! グラフィック形式 ! コンテナフォーマット ! サポート |- !align="left" | .[[wikipedia:ja:Portable Network Graphics|png]] | Portable Network Graphics | [[wikipedia:Raster graphics|ラスタ]] | bgcolor="red" | no | bgcolor="#00cc00"| yes |- !align="left" | .[[wikipedia:ja:Scalable Vector Graphics|svg(z)]] | Scalable Vector Graphics | [[wikipedia:Vector graphics|ベクタ]] | bgcolor="red" | no | bgcolor="#66cc00"| yes (optional) |- !align="left" | .[[wikipedia:X PixMap|xpm]] | X PixMap | [[wikipedia:Raster graphics|ラスタ]] | bgcolor="red" | no | bgcolor="yellow"| yes (deprecated) |- !align="left" | .[[wikipedia:Graphics Interchange Format|gif]] | Graphics Interchange Format | [[wikipedia:Raster graphics|ラスタ]] | bgcolor="red" | no | bgcolor="red"| no |- !align="left" | .[[wikipedia:ICO (icon image file format)|ico]] | MS Windows Icon Format | [[wikipedia:Raster graphics|ラスタ]] | bgcolor="#00cc00" | yes | bgcolor="red"| no |- !align="left" | .[[wikipedia:Apple Icon Image|icns]] | Apple Icon Image | [[wikipedia:Raster graphics|ラスタ]] | bgcolor="#00cc00"| yes | bgcolor="red"| no |- |} === アイコンの変換 === If you stumble across an icon which is in a format that is not supported by the freedesktop.org standard (like ''gif'' or ''ico''), you can '''convert''' (which is part of the '''imagemagick''' package) it to a supported/recommended format, e.g.: $ convert <icon name>.gif <icon name>.png If you convert from a container format like ''ico'', you will get all images that were encapsulated in the ''ico'' file in the form ''<icon name>-<number>.png''. If you want to know the size of the image, or the number of images in a container file like ''ico'' you can use '''identify''' (also part of the '''imagemagick''' package) $ identify /usr/share/vlc/vlc48x48.ico /usr/share/vlc/vlc48x48.ico[0] ICO 32x32 32x32+0+0 8-bit DirectClass 84.3kb /usr/share/vlc/vlc48x48.ico[1] ICO 16x16 16x16+0+0 8-bit DirectClass 84.3kb /usr/share/vlc/vlc48x48.ico[2] ICO 128x128 128x128+0+0 8-bit DirectClass 84.3kb /usr/share/vlc/vlc48x48.ico[3] ICO 48x48 48x48+0+0 8-bit DirectClass 84.3kb /usr/share/vlc/vlc48x48.ico[4] ICO 32x32 32x32+0+0 8-bit DirectClass 84.3kb /usr/share/vlc/vlc48x48.ico[5] ICO 16x16 16x16+0+0 8-bit DirectClass 84.3kb As you can see, the example ''ico'' file, although its name might suggest a single image of size 48x48, contains no less than 6 different sizes, of which one is even greater than 48x48, namely 128x128. And to give a bit of motivation on this subject, at the point of writing this section (2008-10-27), the 128x128 size was missing in the ''vlc'' package (0.9.4-2). So the next step would be to look at the vlc PKGBUILD and check whether this icon format was not in the source package to begin with (in that case we would inform the vlc developers), or whether this icon was somehow omitted from the Arch-specific package (in that case we can file a bug report at [https://bugs.archlinux.org/ the Arch Linux bug tracker]). (''Update:'' this bug has now been [https://bugs.archlinux.org/task/11923 fixed], so as you can see, your work will not be in vain.) === アイコンの取得 === Although packages that already ship with a .desktop-file most certainly contain an icon or a set of icons, there is sometimes the case when a developer has not created a .desktop-file, but may ship icons, nonetheless. So a good start is to look for icons in the source package. You can i.e. first filter for the extension with '''find''' and then use '''grep''' to filter further for certain buzzwords like the package name, "icon", "logo", etc, if there are quite a lot of images in the source package. $ find /path/to/source/package -regex ".*\.\(svg\|png\|xpm\|gif\|ico\)$" If the developers of an application do not include icons in their source packages, the next step would be to search on their web sites. Some projects, like i.e. ''tvbrowser'' have an [http://enwiki.tvbrowser.org/index.php/Banners,_Logos_and_other_Promotion_Material artwork/logo page] where additional icons may be found. If a project is multi-platform, there may be the case that even if the linux/unix package does not come with an icon, the Windows package might provide one. If the project uses a [[wikipedia:Version control system|Version control system]] like CVS/SVN/etc. and you have some experience with it, you also might consider browsing it for icons. If everything fails, the project might simple have no icon/logo yet. == ツール == === gendesk === {{Pkg|gendesk}} started as an Arch Linux-specific tool for generating .desktop files by fetching the needed information directly from PKGBUILD files. Now it is a general tool that takes command-line arguments. Icons can be automatically downloaded from [http://openiconlibrary.sourceforge.net/ openiconlibrary], if available. (The source for icons can easily be changed in the future). ==== 使用方法 ==== * Add {{Ic|gendesk}} to makedepends * Start the {{Ic|prepare()}} function with: {{bc|gendesk --pkgname "$pkgname" --pkgdesc "$pkgdesc"}} * Alternatively, if an icon is already provided ($pkgname.png, for instance). The {{Ic|-n}} flag is for not downloading an icon or using the default icon. Example: {{bc|gendesk -n --pkgname "$pkgname" --pkgdesc "$pkgdesc"}} * {{Ic|$srcdir/$pkgname.desktop}} will be created and can be installed in the {{Ic|package()}} function with: {{bc|install -Dm644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"}} * The icon can be installed with: {{bc|install -Dm644 "$pkgname.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"}} * Use {{Ic|1=--name='Program Name'}} for choosing a name for the menu entry. * Use {{Ic|1=--exec='/opt/some_app/elf --with-ponies'}} for setting the exec field. * See the [https://github.com/xyproto/gendesk gendesk project] for more information. == 参照 == * [[DeveloperWiki:Removal of desktop files]] * [[Wikipedia:.desktop|desktop wikipedia article]] * [http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html recognized desktop entry keys] * [http://freedesktop.org/wiki/Specifications/desktop-entry-spec freedesktop.org desktop entry specification] * [http://freedesktop.org/wiki/Specifications/icon-theme-spec freedesktop.org icon theme specification] * [http://freedesktop.org/wiki/Specifications/menu-spec freedesktop.org menu specification] * [http://freedesktop.org/wiki/Specifications/basedir-spec freedesktop.org basedir specification] * [http://freedesktop.org/wiki/Howto_desktop_files information for developers]
このページで使用されているテンプレート:
テンプレート:AUR
(
ソースを閲覧
)
テンプレート:Bc
(
ソースを閲覧
)
テンプレート:G
(
ソースを閲覧
)
テンプレート:Hc
(
ソースを閲覧
)
テンプレート:Ic
(
ソースを閲覧
)
テンプレート:Man
(
ソースを閲覧
)
テンプレート:No
(
ソースを閲覧
)
テンプレート:Note
(
ソースを閲覧
)
テンプレート:Pkg
(
ソースを閲覧
)
テンプレート:R
(
ソースを閲覧
)
テンプレート:Tip
(
ソースを閲覧
)
テンプレート:TranslationStatus
(
ソースを閲覧
)
テンプレート:Y
(
ソースを閲覧
)
テンプレート:Yes
(
ソースを閲覧
)
デスクトップエントリ
に戻る。
検索
検索
デスクトップエントリのソースを表示
話題を追加