--- deskmenu-1.3.0.orig/Makefile +++ deskmenu-1.3.0/Makefile @@ -10,7 +10,9 @@ RCFILE = -DRCFILE=\".deskmenurc\" DEBUG = #-DDEBUG DEFINES = $(RCFILE) $(DEBUG) -PREFIX = /usr +# Next two lines were edited/added for Debian packaging +DESTDIR = +PREFIX = $(DESTDIR)/usr OBJS = $(PROG).o popup.o workspaces.o windows.o @@ -24,6 +26,11 @@ install: all install $(PROG) $(PREFIX)/bin + +#install-menu: deskmenu.menu-method +# install -m 0755 deskmenu.menu-method /etc/menu-methods/deskmenu +# echo "updating menus..." +# update-menus clean: rm -f $(PROG) $(OBJS) --- deskmenu-1.3.0.orig/popup.c +++ deskmenu-1.3.0/popup.c @@ -88,10 +88,71 @@ return menu_item; } + +void build_submenu(FILE *rc, GtkWidget *menu) +{ + char buf[1024], *lvalue, *rvalue; + + while(fgets(buf, sizeof buf, rc)) { + lvalue=strtok(buf, "="); + if(lvalue) { + if(!strcmp(lvalue, "menuitem")) { + lvalue=strtok(NULL, ":"); + if(lvalue) { + rvalue=strtok(NULL, "\n"); + if(rvalue) { + add_menu_item(GTK_MENU(menu), lvalue, run_program, strdup(rvalue)); + } + } + } + if(!strcmp(lvalue, "include")) { + rvalue=strtok(NULL, "\n"); + if(rvalue) { + FILE *irc = fopen(rvalue, "r"); + if(irc) { + build_submenu(irc, menu); + fclose(irc); + } + } + } + if(!strcmp(lvalue, "windowlist")) { + rvalue=strtok(NULL, "\n"); + if(rvalue) { + add_windows_menu(GTK_MENU(menu), rvalue); + } + } + if(!strcmp(lvalue, "workspaces")) { + rvalue=strtok(NULL, "\n"); + if(rvalue) { + add_workspace_menu(GTK_MENU(menu), rvalue); + } + } + if(!strcmp(lvalue, "divider")) { + add_menu_item(GTK_MENU(menu), NULL, NULL, NULL); + } + if(!strcmp(lvalue, "submenu")) { + rvalue=strtok(NULL, "\n"); + if(rvalue) { + GtkWidget *menu_item; + GtkWidget *submenu = gtk_menu_new(); + build_submenu(rc, submenu); + menu_item = add_menu_item(GTK_MENU(menu), + rvalue, NULL, NULL); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), submenu); + } + } + if(!strcmp(lvalue, "endmenu")) { + return; + } + } + } +} + + GtkWidget *build_menu(char *dir, char *file) { - GtkWidget *menu, *menu_item, *submenu=NULL; - char buf[1024], *rc_file, *lvalue, *rvalue; + GtkWidget *menu = 0; + char *rc_file; FILE *rc; #ifdef DEBUG @@ -104,75 +165,11 @@ exit(1); } - menu=gtk_menu_new(); sprintf(rc_file, "%s/%s", dir, file); - if((rc=fopen(rc_file, "r"))) - { - while(fgets(buf, sizeof buf, rc)) - { - lvalue=strtok(buf, "="); - if(lvalue) - { - if(!strcmp(lvalue, "menuitem")) - { - lvalue=strtok(NULL, ":"); - if(lvalue) - { - rvalue=strtok(NULL, "\n"); - if(rvalue) - { - add_menu_item(GTK_MENU(menu), lvalue, run_program, strdup(rvalue)); - submenu=NULL; - } - } - } - if(!strcmp(lvalue, "windowlist")) - { - rvalue=strtok(NULL, "\n"); - if(rvalue) - { - add_windows_menu(GTK_MENU(menu), rvalue); - submenu=NULL; - } - } - if(!strcmp(lvalue, "workspaces")) - { - rvalue=strtok(NULL, "\n"); - if(rvalue) - { - add_workspace_menu(GTK_MENU(menu), rvalue); - submenu=NULL; - } - } - if(!strcmp(lvalue, "divider")) - { - add_menu_item(GTK_MENU(menu), NULL, NULL, NULL); - submenu=NULL; - } - - if(!strcmp(lvalue, "submenu")) - { - rvalue=strtok(NULL, "\n"); - if(rvalue) - { - submenu=gtk_menu_new(); - menu_item=add_menu_item(GTK_MENU(menu), rvalue, NULL, NULL); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), submenu); - } - } - if(!strcmp(lvalue, "submenuitem")) - { - lvalue=strtok(NULL, ":"); - if(lvalue) - { - rvalue=strtok(NULL, "\n"); - if(rvalue && submenu) - add_menu_item(GTK_MENU(submenu), lvalue, run_program, strdup(rvalue)); - } - } - } - } + if((rc=fopen(rc_file, "r"))) { + menu = gtk_menu_new(); + build_submenu(rc, menu); } if(quit_menu) --- deskmenu-1.3.0.orig/example_rc +++ deskmenu-1.3.0/example_rc @@ -4,32 +4,36 @@ # # menuitem=label:command # submenu=label -# submenuitem=label:command +# endmenu= # divider= +# include=filename # windowlist=label # workspaces=label # -menuitem=XTerm:xterm -menuitem=File Manager:gmc --nodesktop +menuitem=Terminal:x-terminal-emulator +menuitem=Run Program:gmrun divider= submenu=Graphics -submenuitem=The Gimp:gimp -submenuitem=Electric Eyes:ee -submenuitem=Xv:xv +menuitem=The Gimp:gimp +menuitem=Electric Eyes:ee +menuitem=Xv:xv +endmenu= submenu=Multimedia -submenuitem=GQmpeg:gqmpeg -submenuitem=Audio Mixer:gmix +menuitem=GQmpeg:gqmpeg +menuitem=Audio Mixer:gmix +endmenu= submenu=Games -submenuitem=XBill:gnome-xbill -submenuitem=FreeCell:freecell +menuitem=XBill:gnome-xbill +menuitem=FreeCell:freecell +endmenu= -submenu=Settings -submenuitem=GNOME Control Center:gnomecc +divider= +include=/etc/deskmenurc.debian divider= --- deskmenu-1.3.0.orig/debian/preinst +++ deskmenu-1.3.0/debian/preinst @@ -0,0 +1,20 @@ +#!/bin/sh +set -e + +if [ "$1" = "upgrade" ]; then + if [ $2 ] && dpkg --compare-versions $2 le 1.3.0-4; then + cat < Wed, 3 Apr 2002 12:26:11 -0500 + +deskmenu (1.3.0-6) unstable; urgency=low + + * Fixed a spelling error in the description. + Closes: #124543 + + -- Brandon L. Griffith Mon, 31 Dec 2001 13:00:02 -0500 + +deskmenu (1.3.0-5) unstable; urgency=low + + * Thanks to a patch by Martin Hedenfalk deskmenu now has + support for the debian menuing system, thanks alot Martin. + * I rewrote the manpage to reflect the changes in the .deskmenurc syntax, as + well as expanded on it a little more. + * The syntax of the .deskmenurc has changed. Please look at the README.Debian + in this directory. + + -- Brandon L. Griffith Sun, 9 Sep 2001 01:40:51 -0400 + +deskmenu (1.3.0-4) unstable; urgency=low + + * Added a manpage. The program did not come with one so I whipped something + up from the info in the README + * Changed a section in the copyright that caused lintian to complain. + + -- Brandon L. Griffith Mon, 27 Aug 2001 09:50:16 -0400 + +deskmenu (1.3.0-3) unstable; urgency=low + + * Changed an entry in the sample deskmenurc which pointed to a program that + is obviously not in Debian. + * Fixed a typo in the program description. + Closes: #109119 + + -- Brandon L. Griffith Sat, 18 Aug 2001 23:46:26 -0400 + +deskmenu (1.3.0-2) unstable; urgency=low + + * Failed to add Build Depends + Closes: #108966 + + -- Brandon L. Griffith Fri, 17 Aug 2001 09:26:09 -0400 + +deskmenu (1.3.0-1) unstable; urgency=low + + * Initial Release. + * Closes wnpp bug filed for packaging + Closes: #108614 + + -- Brandon L. Griffith Wed, 15 Aug 2001 00:01:59 -0400 + +Local variables: +mode: debian-changelog +End: --- deskmenu-1.3.0.orig/debian/deskmenu.examples +++ deskmenu-1.3.0/debian/deskmenu.examples @@ -0,0 +1 @@ +example_rc --- deskmenu-1.3.0.orig/debian/deskmenu.menu-method +++ deskmenu-1.3.0/debian/deskmenu.menu-method @@ -0,0 +1,19 @@ +#!/usr/sbin/install-menu +compat="menu-1" + +!include menu.h + +supported + x11= "menuitem=" $title ":" $command"\n" + text= "menuitem=" $title ":" "xterm -T \"" $title "\" -e " $command"\n" +endsupported + +genmenu="deskmenurc.debian" + +startmenu="submenu=" $title "\n" +endmenu="endmenu=\n" + +userprefix="" +rootprefix="/etc" + +treewalk="(cm)" --- deskmenu-1.3.0.orig/debian/deskmenu.1 +++ deskmenu-1.3.0/debian/deskmenu.1 @@ -0,0 +1,101 @@ +.TH "deskmenu" "1" "1.3.x" +.SH "NAME" +.LP +deskmenu \- A root menu for X +.SH "SYNTAX" +.LP +deskmenu <\fIargument\fP> + +.SH "DESCRIPTION" +.LP +DeskMenu is a root menu program which is activated by +clicking the root window. +It is configured from a .deskmenurc file in your home +directory, see example_rc for more details. +.LP +You can use deskmenu for session management by making it the +last line of your .xinitrc and using the \-quit command line +option, which adds a quit option to the menu. +.LP +NOTE: Deskmenu will do nothing unless you have a ${HOME}/.deskmenurc file. +.br +This manpage is specific to the debian package of deskmenu. +.SH "OPTIONS" +.LP +.TP +\fB\-button=n\fR +Sets which mouse button is used to invoke deskmenu +.LP +The most common ways of invoking deskmenu +.LP +deskmenu \-button=1 +.br +deskmenu \-button=2 +.br +deskmenu \-button=3 +.SH "FILES" +.LP +\fI${HOME}/.deskmenurc\fP +.br +\fI/etc/deskmenurc.debian\fP +.SH "RCFILE" +.LP .deskmenurc +.br +# menuitem=label:command +.br +# submenu=label +.br +# menuitem=label:command +.br +# endmenu= +.br +# divider= +.br +# windowlist=label +.br +# workspaces=label +.br +# include=/path/to/include_file +.LP +menuitem=Terminal:x\-terminal\-emulator +.br +divider= +.br +submenu=Programs +.br +menuitem=The Gimp:gimp +.br +menuitem=Netscape:netscape +.br +endmenu= +.br +menu=Multimedia +.br +menuitem=GQmpeg:gqmpeg +.br +menuitem=Audio Mixer:gmix +.br +endmenu= +.br +divider= +.br +include=/etc/extra_menu +.br +divider= +.br +windowlist=Window List +.br +workspaces=Workspaces +.SH "AUTHORS" +.LP + Ken Lynch +.LP +This manpage was written for the Debian GNU/Linux package of +this program by +Brandon L. Griffith +because the origonal program did not include one. You are +free to edit, translate, convert, or otherwise do anything +you wish with this manpage. This program was patched with a diff from Martin Hedenfalk to allow submenu recursion. +.SH "SEE ALSO" +.LP +desklaunch(1) keylaunch(1) oroborus(1) --- deskmenu-1.3.0.orig/debian/README.Debian +++ deskmenu-1.3.0/debian/README.Debian @@ -0,0 +1,66 @@ +deskmenu for Debian GNU/Linux + +This package of deskmenu has been patched with a diff from Martin Hedenfalk +. This patch allows for deep submenu recursion, which in turn +allows for the debian menu-method to be available. In doing this the syntax for +the .deskmenurc has changed from the origonal syntax and is as follows: + +# menuitem=label:command +# menuitem=label:command +# divider= +# +# submenu=label +# menuitem=label:command +# menuitem=label:command +# menuitem=label:command +# endmenu= +# +# divider= +# include=/path/to/include.file +# divider= +# +# windowlist=label +# workspaces=label + +The example above is a little untrue, you cannot have whitespaces in front of +the menu hooks. I included them there for clarity, blank lines are ok in the +.deskmenurc file. Each time submenu= is defined it must be undefined with +endmenu=. This allows for deep recursion of submenus per the following example: + +submenu=Programs +submenu=Net +submenu=Browsers +menuitem=Netscape:/usr/bin/netscape +menuitem=Mozilla:/usr/bin/mozilla +menuitem=Opera:/usr/bin/opera +endmenu= +endmenu= +endmenu= + +A new menu hook has been added, it is include= +include= allows you to break your menu up into submenus, so you can have a +.deskmenurc that defines + +include=~/.deskmenu/network_programs.hook +include=~/.deskmenu/remote_machines_.hook +include=~/.deskmenu/graphics_programs_hook + +Each of these include files must start with the submenu= hook. The first +submenu= hook will be used to create the title (label) for the submenu on the +main menu. So network_programs.hook might look like: + +submenu=NetWork +submenu=Browsers +menuitem=Netscape:/usr/bin/netscape +menuitem=Mozilla:/usr/bin/mozilla +endmenu= +submenu=Games +menuitem=Net-Toe:x-terminal-emulator -e nettoe +endmenu= +endmenu= + +I hope this clears a few things up. The debian menu is located as +/etc/deskmenurc.debian and an example of it's inclusion is in the +/usr/doc/deskmenu/examples/example_rc file. + +Brandon L. Griffith --- deskmenu-1.3.0.orig/debian/postinst +++ deskmenu-1.3.0/debian/postinst @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +if [ "$1" = "configure" ]; then + if [ -x /usr/sbin/wm-menu-config ]; then + wm-menu-config deskmenu on; + fi +fi + +#DEBHELPER# --- deskmenu-1.3.0.orig/debian/postrm +++ deskmenu-1.3.0/debian/postrm @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +if [ "$1" = "remove" ]; then + if [ -x /usr/sbin/wm-menu-config ]; then + wm-menu-config deskmenu off + fi +fi + +#DEBHELPER# --- deskmenu-1.3.0.orig/debian/control +++ deskmenu-1.3.0/debian/control @@ -0,0 +1,15 @@ +Source: deskmenu +Section: x11 +Priority: optional +Maintainer: Brandon L. Griffith +Build-Depends: debhelper (>= 2.0), libgtk1.2-dev +Standards-Version: 3.5.2 + +Package: deskmenu +Architecture: any +Depends: ${shlibs:Depends} +Description: A root menu for X11 window managers + DeskMenu is a root menu program which is activated by clicking the root + window. It is configured from a .deskmenurc file in your home directory. + DeskMenu is useful for window managers which do not provide a menu such as + Oroborus. --- deskmenu-1.3.0.orig/debian/conffiles +++ deskmenu-1.3.0/debian/conffiles @@ -0,0 +1 @@ +/etc/menu-methods/deskmenu --- deskmenu-1.3.0.orig/debian/copyright +++ deskmenu-1.3.0/debian/copyright @@ -0,0 +1,20 @@ +This package was debianized by Brandon L. Griffith on +Fri, 10 Aug 2001 09:18:13 -0400. + +It was downloaded from +http://www.kensden.pwp.blueyonder.co.uk/Oroborus/download.htm + +Upstream Author: Ken Lynch + +Copyright: GNU/GPL + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 dated June, 1991. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. --- deskmenu-1.3.0.orig/debian/rules +++ deskmenu-1.3.0/debian/rules @@ -0,0 +1,69 @@ +#!/usr/bin/make -f + +export DH_VERBOSE=1 +export DH_COMPAT=2 + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + + touch configure-stamp + +build: configure-stamp build-stamp +build-stamp: + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #/usr/bin/docbook-to-man debian/deskmenu.sgml > deskmenu.1 + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs usr/bin + + # Add here commands to install the package into debian/deskmenu. + $(MAKE) install DESTDIR=$(CURDIR)/debian/deskmenu + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installmenu + dh_installman debian/deskmenu.1 + dh_installchangelogs CHANGES + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- deskmenu-1.3.0.orig/debian/docs +++ deskmenu-1.3.0/debian/docs @@ -0,0 +1 @@ +README