first commit
This commit is contained in:
52
etc_org/menu-methods/menu-xdg
Executable file
52
etc_org/menu-methods/menu-xdg
Executable file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/install-menu
|
||||
# xdg menu spec - menu generation
|
||||
# http://www.freedesktop.org/Standards/menu-spec
|
||||
# Also used as /etc/menu-methods/menu-xdg
|
||||
# Copyright 2004 - Chris Cheney <ccheney@debian.org>
|
||||
# Licensed under the GNU General Public License, version 2.
|
||||
|
||||
!include menu.h
|
||||
|
||||
compat="menu-2"
|
||||
outputencoding="UTF-8";
|
||||
outputlanguage="C";
|
||||
|
||||
function Dirs() =
|
||||
ifempty($section,ifroot(
|
||||
"<AppDir>/var/lib/menu-xdg/applications</AppDir>\n"
|
||||
"<DirectoryDir>/var/lib/menu-xdg/desktop-directories/menu-xdg</DirectoryDir>\n",
|
||||
"<DirectoryDir>"
|
||||
parent(parent(prefix()))
|
||||
"/.local/share/desktop-directories/menu-xdg</DirectoryDir>\n"));
|
||||
|
||||
function DirEntry() =
|
||||
Dirs()
|
||||
"<Name>" title() "</Name>\n"
|
||||
"<Directory>" "debian" replacewith(tolower($section),"/ ","--") ".directory" "</Directory>\n"
|
||||
"<Include>\n"
|
||||
"<Category>" "X-Debian" replacewith($section,"/ ","--") "</Category>\n"
|
||||
"</Include>\n";
|
||||
|
||||
|
||||
supported;
|
||||
x11 = ;
|
||||
text = ;
|
||||
endsupported;
|
||||
|
||||
startmenu = "<Menu>\n" DirEntry();
|
||||
endmenu = "</Menu>\n";
|
||||
submenutitle = "";
|
||||
|
||||
treewalk = "(M)";
|
||||
|
||||
genmenu = "debian-menu.menu";
|
||||
|
||||
prerun = "rm -rf " prefix() "/debian-menu.menu";
|
||||
|
||||
rootsection = "";
|
||||
|
||||
preoutput = "<!DOCTYPE Menu PUBLIC \"-//freedesktop//DTD Menu 0.8//EN\"\n \"http://www.freedesktop.org/standards/menu-spec/menu-0.8.dtd\">\n<!-- Automatically generated do not edit -->\n";
|
||||
|
||||
rootprefix = "/var/lib/menu-xdg/menus";
|
||||
|
||||
userprefix = ".config/menus";
|
62
etc_org/menu-methods/xdg-desktop-entry-spec-apps
Executable file
62
etc_org/menu-methods/xdg-desktop-entry-spec-apps
Executable file
@ -0,0 +1,62 @@
|
||||
#!/usr/bin/install-menu
|
||||
# xdg desktop entry spec - applications generation
|
||||
# http://www.freedesktop.org/Standards/desktop-entry-spec
|
||||
# Copyright 2004 - Chris Cheney
|
||||
# Licensed under the GNU General Public License, version 2.
|
||||
|
||||
!include lang.h
|
||||
!include menu.h
|
||||
|
||||
compat="menu-2"
|
||||
outputencoding="UTF-8";
|
||||
outputlanguage="C";
|
||||
|
||||
function name() =
|
||||
"Name=" title() "\n"
|
||||
forall(sections_translations(),"lang",
|
||||
"Name[" $lang "]=" translate($lang,title())
|
||||
"\n");
|
||||
|
||||
function comment() =
|
||||
"Comment=" $longtitle "\n"
|
||||
forall(sections_translations(),"lang",
|
||||
"Comment[" $lang "]=" translate($lang,$longtitle)
|
||||
"\n");
|
||||
|
||||
|
||||
function AppEntry($terminal) =
|
||||
"[Desktop Entry]\n"
|
||||
"Type=Application\n"
|
||||
"Encoding=UTF-8\n"
|
||||
name()
|
||||
ifnempty($longtitle, comment())
|
||||
ifnempty($generictitle,"GenericName=" $generictitle "\n")
|
||||
ifnempty(icon(),"Icon=" icon() "\n")
|
||||
"Exec=" $command "\n"
|
||||
"Terminal=" $terminal "\n"
|
||||
"Categories=X-Debian" replacewith($basesection,"/ ","--") ";\n";
|
||||
|
||||
supported;
|
||||
x11 = AppEntry("false");
|
||||
text = AppEntry("true");
|
||||
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/applications/menu-xdg";
|
||||
|
||||
userprefix = ".local/share/applications/menu-xdg";
|
59
etc_org/menu-methods/xdg-desktop-entry-spec-dirs
Executable file
59
etc_org/menu-methods/xdg-desktop-entry-spec-dirs
Executable file
@ -0,0 +1,59 @@
|
||||
#!/usr/bin/install-menu
|
||||
# xdg desktop entry spec - directory generation
|
||||
# http://www.freedesktop.org/Standards/desktop-entry-spec
|
||||
# Copyright 2004 - Chris Cheney
|
||||
# Licensed under the GNU General Public License, version 2.
|
||||
|
||||
!include lang.h
|
||||
!include menu.h
|
||||
|
||||
compat="menu-2"
|
||||
|
||||
outputencoding="UTF-8";
|
||||
outputlanguage="C";
|
||||
|
||||
function section() =
|
||||
"Name=" title() "\n"
|
||||
forall(sections_translations(),"lang",
|
||||
"Name[" $lang "]=" translate($lang,title())
|
||||
"\n");
|
||||
|
||||
function comment() =
|
||||
"Comment=" $longtitle "\n"
|
||||
forall(sections_translations(),"lang",
|
||||
"Comment[" $lang "]=" translate($lang,$longtitle)
|
||||
"\n");
|
||||
|
||||
function DirEntry() =
|
||||
"[Desktop Entry]\n"
|
||||
"Type=Directory\n"
|
||||
"Encoding=UTF-8\n"
|
||||
section()
|
||||
ifnempty($longtitle, comment())
|
||||
"Icon=" ifelse(icon(),icon(),
|
||||
"debian" replacewith(tolower($section),"/ ","--")) "\n";
|
||||
|
||||
supported;
|
||||
x11 = ;
|
||||
text = ;
|
||||
endsupported;
|
||||
|
||||
startmenu = "";
|
||||
endmenu = "";
|
||||
submenutitle = DirEntry();
|
||||
|
||||
treewalk = "M";
|
||||
|
||||
genmenu = ifempty($command,tolower("debian" replacewith($section,"/ ","--") ".directory"));
|
||||
|
||||
rootsection = "";
|
||||
|
||||
prerun = "rm -rf '" prefix() "'";
|
||||
|
||||
removemenu = "rm -rf '" prefix() "'";
|
||||
|
||||
preoutput = "";
|
||||
|
||||
rootprefix = "/var/lib/menu-xdg/desktop-directories/menu-xdg";
|
||||
|
||||
userprefix = ".local/share/desktop-directories/menu-xdg";
|
63
etc_org/menu-methods/xdg-desktop-entry-spec-sessions
Executable file
63
etc_org/menu-methods/xdg-desktop-entry-spec-sessions
Executable file
@ -0,0 +1,63 @@
|
||||
#!/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 lang.h
|
||||
!include menu.h
|
||||
|
||||
compat="menu-2"
|
||||
outputencoding="UTF-8";
|
||||
outputlanguage="C";
|
||||
|
||||
function has_session() = shell("grep -l -e '^/usr/share/xsessions/' '/var/lib/dpkg/info/" $package ".list' 2>/dev/null");
|
||||
|
||||
function name() =
|
||||
"Name=" title() "\n"
|
||||
forall(sections_translations(),"lang",
|
||||
"Name[" $lang "]=" translate($lang,title())
|
||||
"\n");
|
||||
|
||||
function comment() =
|
||||
"Comment=" $longtitle "\n"
|
||||
forall(sections_translations(),"lang",
|
||||
"Comment[" $lang "]=" translate($lang,$longtitle)
|
||||
"\n");
|
||||
|
||||
function AppEntry() =
|
||||
"[Desktop Entry]\n"
|
||||
"Encoding=UTF-8\n"
|
||||
"Type=Application\n"
|
||||
name()
|
||||
ifnempty($longtitle, comment())
|
||||
ifnempty($generictitle, "GenericName=" $generictitle "\n")
|
||||
ifnempty(icon(),"Icon=" icon() "\n")
|
||||
"Exec=" $command "\n"
|
||||
"\n"
|
||||
"[Window Manager]\n"
|
||||
"SessionManaged=true\n";
|
||||
|
||||
supported;
|
||||
wm = AppEntry();
|
||||
endsupported;
|
||||
|
||||
startmenu = "";
|
||||
endmenu = "";
|
||||
submenutitle = "";
|
||||
|
||||
treewalk = "M";
|
||||
|
||||
genmenu = ifnempty($command,ifempty(has_session(),
|
||||
"X-Debian" replacewith($basesection,"/ ","--")
|
||||
"-" tolower(replacewith($title,"/ ","__") ".desktop")));
|
||||
|
||||
rootsection = "";
|
||||
|
||||
prerun = "rm -rf '" prefix() "'";
|
||||
|
||||
removemenu = "rm -rf '" prefix() "'";
|
||||
|
||||
preoutput = "";
|
||||
|
||||
rootprefix = "/var/lib/menu-xdg/xsessions";
|
Reference in New Issue
Block a user