Linux file manager icons

Desktop entries

The XDG Desktop Entry specification defines a standard for applications to integrate into application menus of desktop environments implementing the XDG Desktop Menu specification.

Contents

Basics

Each desktop entry must have a Type and a Name key and can optionally define its appearance in the application menu.

The three available types are:

Application Defines how to launch an application and what MIME types it supports (used by XDG MIME Applications). With XDG Autostart Application entries can be started automatically by placing them in specific directories. Application entries use the .desktop file extension. See #Application entry. Link Defines a shortcut to a URL . Link entries use the .desktop file extension. Directory Defines the appearance of a submenu in the application menu. Directory entries use the .directory file extension.

The following sections will roughly explain how these are created and validated.

Application entry

Desktop entries for applications, or .desktop files, are generally a combination of meta information resources and a shortcut of an application. These files usually reside in /usr/share/applications/ or /usr/local/share/applications/ for applications installed system-wide, or

/.local/share/applications/ for user-specific applications. User entries take precedence over system entries.

File example

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 freedesktop specification.

Key definition

All recognized entries can be found on the freedesktop site. For example, the Type key defines three types of desktop entries: Application (type 1), Link (type 2) and Directory (type 3).

  • 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.
  • Name , GenericName and Comment often contain redundant values in the form of combinations of them, like:

This should be avoided, as it will only be confusing to users. The Name key should only contain the name, or maybe an abbreviation/acronym if available.

  • GenericName should state what you would generally call an application that does what this specific application offers (i.e. Firefox is a «Web Browser»).
  • Comment is intended to contain any useful additional information.

Validation

As some keys have become deprecated over time, you may want to validate your desktop entries using desktop-file-validate(1) which is part of the desktop-file-utils package. To validate, run:

This will give you very verbose and useful warnings and error messages.

Installation

Use desktop-file-install(1) to install desktop file into target directory. For example:

Update database of desktop entries

To make desktop entries defined in

Читайте также:  Как восстановление системы windows виста

/.local/share/applications work, run the following command:

Icons

Common image formats

Here is a short overview of image formats commonly used for icons.

Support for image formats for icons as specified by the freedesktop.org standard.

Extension Full Name and/or Description Graphics Type Container Format Supported
.png Portable Network Graphics Raster No Yes
.svg(z) Scalable Vector Graphics Vector No Yes (optional)
.xpm X PixMap Raster No Yes (deprecated)
.gif Graphics Interchange Format Raster No No
.ico MS Windows Icon Format Raster Yes No
.icns Apple Icon Image Raster Yes No

Converting icons

This article or section is a candidate for merging with ImageMagick#Usage.

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 use the convert tool (which is part of the imagemagick package) to convert it to a supported/recommended format, e.g.:

If you convert from a container format like ico , you will get all images that were encapsulated in the ico file in the form — .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 the identify tool (also part of the imagemagick package):

As you can see, the example ico file, although its name might suggest a single image of size 48×48, contains no less than 6 different sizes, of which one is even greater than 48×48, namely 128×128.

Alternatively, you can use icotool (from icoutils ) to extract png images from ico container:

For extracting images from .icns container, you can use icns2png (provided by libicns ):

Obtaining icons

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.

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 AUR have an 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 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 simply have no icon/logo yet.

Icon path

The freedesktop.org standard specifies in which order and directories programs should look for icons:

  1. $HOME/.icons (for backwards compatibility)
  2. $XDG_DATA_DIRS/icons
  3. /usr/share/pixmaps
Читайте также:  Activating windows with powershell

Tools

gendesk

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 openiconlibrary, if available. (The source for icons is configurable).

How to use

  • Add gendesk to makedepends
  • Start the prepare() function with:
  • Alternatively, if an icon is already provided ($pkgname.png, for instance). The -n flag is for not downloading an icon or using the default icon. Example:
  • $srcdir/$pkgname.desktop will be created and can be installed in the package() function with:
  • The icon can be installed with:
  • Use —name=’Program Name’ for choosing a name for the menu entry.
  • Use —exec=’/opt/some_app/elf —some-arg —other-arg’ for setting the exec field.
  • See the gendesk project for more information.

lsdesktopf

lsdesktopf AUR can list available .desktop files or search their contents.

It can also perform MIME-type-related searches. See XDG MIME Applications#lsdesktopf.

fbrokendesktop

The fbrokendesktop AUR Bash script detects broken Exec values pointing to non-existent paths. Without any arguments it uses preset directories in the DskPath array. It shows only broken .desktop with full path and filename that is missing.

Tips and tricks

Run a desktop file from a terminal

If gtk3 is installed, run gtk-launch application.desktop .

Or install the dex package and run dex /path/to/application.desktop .

Hide desktop entries

Firstly, copy the desktop entry file in question to

/.local/share/applications to avoid your changes being overwritten.

Then, to hide the entry in all environments, open the desktop entry file in a text editor and add the following line: NoDisplay=true .

To hide the entry in a specific desktop, add the following line to the desktop entry file: NotShowIn=desktop-name

where desktop-name can be option such as GNOME, Xfce, KDE etc. A desktop entry can be hidden in more than desktop at once — simply separate the desktop names with a semi-colon.

Modify environment variables

To set environment variables, copy the .desktop file from /usr/share/applications/ to $XDG_DATA_HOME/ (

/.local/share/applications/ ) and edit the Exec= command line by prepending env. For example:

Источник

Delightly Linux

How to Change the Icons for the Dolphin File Manager

⌚ March 28, 2014
The Dolphin file manager is probably one of the best file managers available given its features and bountiful customization options. Though designed with the K Desktop Environment (KDE) in mind, Dolphin can be installed and used in other desktop environments, such as Cinnamon, GNOME, and Xfce4.

However, when installed in another environment, Dolphin’s icons will default to the KDE Oxygen icon set and not match the system icons. This makes Dolphin appear incongruous, so is there a way to change Dolphin’s icons so they match the system’s icons?

For example, we can go from this:

Dolphin with the default Oxygen icons.

Dolphin with the Moka icon set.

Dolphin icons are managed separately, so they require System Settings, the central configuration center for KDE, in order to change them. Install System Settings:

Читайте также:  Обновление для проводника windows 10

To run it, open a terminal and enter systemsettings. Root privileges should not be necessary.

The main screen appears.

KDE System Settings

Under Common Appearance and Behavior, choose Application Appearance (usually with a double-click in non-KDE environments). In the following window, select Icons. A list of available icons from /usr/share/icons will appear.

Behold! A list of icons installed on the system.

Note that the icons must be present in /usr/share/icons, and all icon files and directories must have the 755 permission in order to appear. If not, they cannot be selected. Differing permissions might occur when copying icons from another directory. To change permissions, do so recursively.

Replace with the specific directory name.

After changing permissions, close and reopen System Settings to register the changes. The icons should now appear, but if not, then check that the icon directory is not within a subdirectory and make sure that the icons are organized in the expected format. For comparison, check how the icons are organized and grouped within other, working icon directories.

Select an icon set from the list, and click Apply. Close and reopen Dolphin for the changes to take effect completely.

Orange again! The Humanity icon set makes its appearance.

The new Dolphin icon settings are saved, so there is no need to open systemsettings again unless to change the icons to something else. Different users may have their own icons for Dolphin just as they can have their own system icons for their session customizations.

The elementary Xfce icon set makes Dolphin match the default Xubuntu 13.10 system icons.

Hydroxygen icons! If systemsettings can see the icons, then they can be applied to Dolphin.

Notice that the folder icons in Dolphin appear alike by using the same default folder icon. Thunar, for example, might show different icons for various folders, such as Downloads and Videos, but not Dolphin.

System Settings (systemsettings) does not convert special folder icons, so right-click the plain folder icons and choose new icons for them one at a time…or leave them be.

To change an icon, right-click the icon and choose Properties from the context menu.

Click the icon button (shown circled in red) to make another list of icons appear. The icons will be a combination of Oxygen and the current icon theme. Choose a new icon, and then click OK.

Here, the Moka icon theme shows specific folder icons. Yes, each icon was changed manually…one…by…one.

When changing icon themes, keep in mind that icons must be changed in two separate places: once for the system using the main system settings, and again for Dolphin using the KDE System Settings. Changing one does not automatically change the other unless inside KDE. This might require extra effort, but the results will make Dolphin feel welcome in a non-KDE desktop.

Источник

Оцените статью