DesktopEntry.showIn

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

class DesktopEntry
@trusted
bool
showIn

Parameters

desktopEnvironment
Type: string

Name of desktop environment, usually detected by XDG_CURRENT_DESKTOP variable.

Examples

1 auto df = new DesktopFile();
2 df.notShowIn = ["GNOME", "MATE"];
3 assert(df.showIn("KDE"));
4 assert(df.showIn("awesome"));
5 assert(df.showIn(""));
6 assert(!df.showIn("GNOME"));
7 df.onlyShowIn = ["LXDE", "XFCE"];
8 assert(df.showIn("LXDE"));
9 assert(df.showIn("XFCE"));
10 assert(!df.showIn(""));
11 assert(!df.showIn("awesome"));
12 assert(!df.showIn("KDE"));
13 assert(!df.showIn("MATE"));

See Also

Meta