1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-24 07:02:30 +01:00
Files
wmaker/util/Makefile.am
Carlos R. Mafra 1861880239 wmgenmenu: A Window Maker menu generator
The inspiration comes from Geir T. Kristiansen's 'genmenu' shell script
(http://gtk.no/genmenu) which I have been hapilly using for
the last 9 years or so.

That script generates the Window Maker menu by asking a few questions
and checks whether the applications in a predefined list exist in
the user's $PATH, so that the menu contains only the applications
which are guaranteed to exist and which the user cares about.

However I always thought it was a bit slow to finish, even
when having a file containing the answers to the questions to
be piped in.

And as Kristiansen states in his webpage, his script does not
support internationalization:

   "If you want internationalization I really suggest you rewrite
    genmenu from scratch anyway in a more sensible language and remove
    other limitations while you are at it."

so I decided to rewrite in C and make it support internationalization
(only English and German so far). While I am not sure yet if I removed
"other limitations while you are at it" I definitely made it finish faster.
This C program does not make you questions though.

But in the same spirit as the author of 'genmenu', who says:

    "Genmenu is a hack, deal with it, it just happens to serve my needs."

I present you 'wmgenmenu', which you can use like this:

wmgenmenu > /home/mafra/GNUstep/Defaults/WMRootMenu

and the menu is automatically generated from the list of
predefined apps which are contained in the C sources (wmgenmenu.h).

And when you generate the WMRootMenu as above, wmaker will automatically
load the new menu for you (due to the 'inotify' mechanism in wmaker-crm).

As for 'wmgenmenu' being faster than 'genmenu':

[mafra@Pilar:~]$ time ./genmenu.sh < answers.txt &> /dev/null

real    0m3.626s
user    0m0.968s
sys     0m1.830s

[mafra@Pilar:~]$ time wmgenmenu &> /dev/null

real    0m0.020s
user    0m0.006s
sys     0m0.013s
2010-02-21 11:51:00 +01:00

92 lines
2.3 KiB
Makefile

SUBDIRS = po
AUTOMAKE_OPTIONS = no-dependencies
pkgdatadir = $(datadir)/@PACKAGE@
bin_PROGRAMS = wxcopy wxpaste wdwrite wdread getstyle setstyle convertfonts \
seticons geticonset wmsetbg wmsetup wmagnify wmgenmenu
bin_SCRIPTS = wmaker.inst wm-oldmenu2new wkdemenu.pl
EXTRA_DIST = wmaker.inst.in bughint wm-oldmenu2new directjpeg.c wkdemenu.pl
AM_CPPFLAGS = -DLOCALEDIR=\"$(NLSDIR)\"
INCLUDES = $(DFLAGS) -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib \
@HEADER_SEARCH_PATH@ \
-DETCDIR=\"sysconfdir\" -DDATADIR=\"pkgdatadir\"
liblist= @LIBRARY_SEARCH_PATH@ @INTLIBS@
wdwrite_LDADD = $(top_builddir)/WINGs/libWUtil.la $(liblist)
wdread_LDADD = $(top_builddir)/WINGs/libWUtil.la $(liblist)
wxcopy_LDADD = @XLFLAGS@ @XLIBS@
wxpaste_LDADD = @XLFLAGS@ @XLIBS@
getstyle_LDADD = $(top_builddir)/WINGs/libWUtil.la $(liblist)
getstyle_SOURCES = getstyle.c fontconv.c
setstyle_LDADD = \
$(top_builddir)/WINGs/libWUtil.la \
@XLFLAGS@ @XLIBS@ $(liblist)
setstyle_SOURCES = setstyle.c fontconv.c
convertfonts_LDADD = $(top_builddir)/WINGs/libWUtil.la $(liblist)
convertfonts_SOURCES = convertfonts.c fontconv.c
seticons_LDADD= $(top_builddir)/WINGs/libWUtil.la $(liblist)
geticonset_LDADD= $(top_builddir)/WINGs/libWUtil.la $(liblist)
wmagnify_LDADD = \
$(top_builddir)/WINGs/libWINGs.la \
$(top_builddir)/WINGs/libWUtil.la \
$(top_builddir)/wrlib/libwraster.la \
@XFTLIBS@ @INTLIBS@ @DLLIBS@
wmsetup_LDADD = \
$(top_builddir)/WINGs/libWINGs.la \
$(top_builddir)/WINGs/libWUtil.la \
$(top_builddir)/wrlib/libwraster.la \
@XFTLIBS@ @INTLIBS@ @DLLIBS@
wmsetbg_LDADD = \
$(top_builddir)/WINGs/libWINGs.la \
$(top_builddir)/WINGs/libWUtil.la \
$(top_builddir)/wrlib/libwraster.la \
@XLFLAGS@ @XLIBS@ @XFTLIBS@ @INTLIBS@ @DLLIBS@
wmgenmenu_LDADD = \
$(top_builddir)/WINGs/libWUtil.la \
@INTLIBS@
CLEANFILES = wmaker.inst
wmaker.inst: $(srcdir)/wmaker.inst.in ./Makefile
@-rm -f wmaker.inst
@sed -e "s|#pkgdatadir#|$(pkgdatadir)|" \
-e "s|#sysconfdir#|$(sysconfdir)/WindowMaker|" \
-e "s|#version#|$(VERSION)|" \
-e "s|#bindir#|$(bindir)|" \
$(srcdir)/wmaker.inst.in >wmaker.inst
chmod 755 wmaker.inst
LIBTOOL = $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
.c.o:
$(QUIET)$(COMPILE) -c $<
.c.obj:
$(QUIET)$(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
$(QUIET)$(LTCOMPILE) -c -o $@ $<