#!/usr/bin/install-menu
# xdg desktop entry spec - sessions generation
# http://www.freedesktop.org/Standards/desktop-entry-spec
# Copyright 2005 - Bill Allombert
# Licensed under the GNU General Public License, version 2

!include menu.h

compat="menu-2"
outputencoding="UTF-8";
outputlanguage="C";

function AppEntry() =
	"[Desktop Entry]\n"
	"Encoding=UTF-8\n"
	"Type=Application\n"
	"Name=" title() "\n"
	ifnempty($generictitle, "GenericName=" $generictitle "\n")
	"Comment=" ifnempty($longtitle,$longtitle) "\n"
	ifnempty(icon(),"Icon=" icon() "\n")
	"Exec=" $command "\n"
        "\n"
        "[Window Manager]\n"
        "SessionManaged=true";

supported;
 wm = AppEntry();
endsupported;

startmenu = "";
endmenu = "";
submenutitle = "";

treewalk = "M";

genmenu = ifnempty($command,"X-Debian" replacewith($basesection,"/ ","--") 
           "-" tolower(replacewith($title,"/ ","__") ".desktop"));

rootsection = "";

prerun     = "rm -rf  '" prefix() "'";

removemenu = "rm -rf  '" prefix() "'";

preoutput = "";

rootprefix = "/var/lib/menu-xdg/xsessions";
