Function DesktopEntry.showIn

Check if desktop file should be shown in menu of specific desktop environment.

bool showIn (
  string desktopEnvironment
) @trusted;

Parameters

NameDescription
desktopEnvironment Name of desktop environment, usually detected by XDG_CURRENT_DESKTOP variable.

See Also

Registered OnlyShowIn Environments, notShowIn, onlyShowIn

Example

auto df = new DesktopFile();
df.notShowIn = ["GNOME", "MATE"];
assert(df.showIn("KDE"));
assert(df.showIn("awesome"));
assert(df.showIn(""));
assert(!df.showIn("GNOME"));
df.onlyShowIn = ["LXDE", "XFCE"];
assert(df.showIn("LXDE"));
assert(df.showIn("XFCE"));
assert(!df.showIn(""));
assert(!df.showIn("awesome"));
assert(!df.showIn("KDE"));
assert(!df.showIn("MATE"));