wmmount (1.0beta2-7.1) direct (non packaging) changes

Summary

 config/system.wmmount.eg |   13 +--
 wmmount.c                |   18 ++++-
 wmmount.man              |  162 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 182 insertions(+), 11 deletions(-)

    
download this patch

Patch contents

--- wmmount-1.0beta2.orig/wmmount.man
+++ wmmount-1.0beta2/wmmount.man
@@ -0,0 +1,162 @@
+.\" -*- nroff-*-
+.TH WMMOUNT 1x "October 1999" "Debian Project" "wmmount"
+.SH NAME
+wmmount \- the WindowMaker universal mount point
+.SH SYNOPSIS
+.B wmmount
+[ -- [-h|-help|--help] [-s] [-w] [-a] [-display <display>]
+[-position <position>] [-b <color>] ]
+.SH DESCRIPTION
+.B wmmount
+mounts and umounts filesystems using a simple interface on a 64x64
+miniwindow and a configuration file. It can also launch commands
+on the mount points, for example Midnight Commander, \fBmc\fP(1).
+.PP
+.B wmmount 
+is configured using a configuration file, ~/.wmmount (or
+/etc/system.wmmountrc). Its format is documented on the
+"\fIConfiguration\fP" section below.
+.PP
+To mount a file system, click the left most button on the bottom
+strip. To move between mounts, click the right arrow button (goes
+"forward") and left arrow button (goes "back"). To launch the
+configured command, click the icon you defined.
+.SS OPTIONS
+You need to put "--" in front of every argument that relates to dockapp
+settings.
+.TP
+.B \-h, \-help, \-\-help
+displays a brief help message
+.TP
+.B \-s
+start up without groundplate
+.TP
+.B \-w
+start up withdrawn (for Window Maker)
+.TP
+.B \-a
+use an smaller window (for AfterStep's Wharf)
+.TP
+.B \-display <display>
+selects target display
+.TP
+.B \-position <position>
+specifies the start up position in +x+y format
+.TP
+.B \-b <color>
+specifies the back color
+.SH CONFIGURATION
+The configuration file has a semi rigid format, and is case
+sensitive. A # starts a comment, and lines consisting entirely of
+whitespace are ignored. There are some key-value pairs that control
+the behaviour and appearance of \fBwmmount\fP, namely:
+.TP
+.B mountcmd=<command>
+specifies the command used to mount a file system. If omitted,
+\fImount %m &\fP will be used.
+.TP
+.B umountcmd=<command>
+specifies the command used to unmount a file system. If omitted,
+\fIumount %m &\fP will be used.
+.TP
+.B opencmd=<command>
+specifies the command to run when the mount icon is clicked. If
+omitted, \fIx-terminal-emulator -e mc %m\fP will be used.
+.TP
+.B namecolor=<color>
+specifies the color used for the mount name text. If omitted, black is
+used.
+.TP
+.B namefont=<font>
+specifies the font used for the mount name text. This is an X Font
+specification. See xlsfonts(1x). If omitted, helvetica, bold, 11 pt is
+used.
+.TP
+.B usagecolor=<color>
+specifies the color used for the capacity readout. If omitted, gray90
+is used.
+.TP
+.B usagefont=<font>
+specifies the font used for the capacity readout. This is an X Font
+specification. See xlsfonts(1x). If omitted, helvetica, medium,
+oblique, 11 pt is used.
+.TP
+.B ledcolor=<color>
+specifies the color used for the led. If omitted, green is used.
+.PP
+As you may have guessed by now, the special string \fI%m\fP in command
+specification is substituted with the corresponding \fBmount point\fP.
+Likewise, \fI%n\fP will be replaced with the \fBname of the mountpoint\fP.
+The string \fI%%\fP will be replaced with '%'.
+.PP
+Icons are specified like this:
+.TP
+.B icon <icon file>
+.PP
+At least \fBone\fP icon has to be specified, there's a maximum of 20
+icons. The details of the mountpoint(s) are specified like this
+(ordering and indentation \fIis\fP important, there are \fIno\fP blank
+lines between keys):
+.PP
+\fBmountpoint \fP<\fImountpoint\fP>
+.br
+\fBname=\fP<\fIname\fP>
+.br
+\fBiconnumber=\fP<\fInumber\fP>
+.br
+\fBusagedisplay=\fP<\fI0\fP|\fI1\fP|\fI2\fP|\fI3\fP>
+.TP
+.I mountpoint
+is the actual mountpoint. This value is substituted wherever %m
+appears on the commands described above.
+.TP
+.I name
+is the name displayed on for that particular mount.
+.TP
+.I number
+is the icon number used. The first icon is number 0, and the same icon
+can be used multiple times.
+.TP
+.I usagedisplay
+this key specifies that kind of capacity information will be
+displayed. Value of usagedisplay can be 0 (none), 1 (available), 2 (used)
+or 3 (percentage used). The quantities, with values 1 or 2, are in bytes
+(kB, MB or GB).
+.SH FILES
+.TP
+.I ~/.wmmount
+user configuration file.
+.TP
+.I /etc/system.wmmount
+system-wide configuration file.
+.TP
+.I /etc/fstab
+static information about the filesystems.
+.TP
+.I /usr/share/wmmount
+directory which contains several icons that can be used with wmmount.
+.PP
+A maximum of 20 mountnames can be specified.
+.SH BUGS
+Does not read symlinks properly when testing for mounted filesystems.
+So, if it incorrectly reports devices as mounted, make sure the mountpoint
+specified in the config file does not include symlinks.
+.sp
+Version 1.0-beta1 of wmmount had different configuration file syntax
+and different way of argument handling. You may experience segfaults
+if trying to use old style configuration files with newer versions
+(>= 1.0-beta2). You can use the gen-wmmountrc script to generate a
+new wmmount config file from your /etc/fstab file contents.
+.SH "SEE ALSO"
+.BR df (1),
+.BR mount (1),
+.BR fstab (5),
+.BR nfs (5),
+.BR gen-wmmountrc (1), 
+.BR wmaker (1x).
+.SH AUTHORS
+.B wmmount
+was written by Sam Hawker <shawkie@geocities.com>.
+.sp
+This manual page was written by Marcelo Magallon <mmagallo@debian.org>,
+and is GNU Copyright 1998 Marcelo Magallon. Later updated by Josip Rodin.
--- wmmount-1.0beta2.orig/wmmount.c
+++ wmmount-1.0beta2/wmmount.c
@@ -30,13 +30,13 @@
 
 /* System-wide config file
  */
-#define SYSCONFIG "/usr/X11R6/lib/X11/wmmount/system.wmmount"
+#define SYSCONFIG "/etc/system.wmmount"
 
 /* Config file defaults
  */
 #define MOUNTCMD  "/bin/mount %m"
 #define UMOUNTCMD "/bin/umount %m"
-#define OPENCMD   "/usr/X11R6/bin/nxterm -T '%n - %m' -e mc %m"
+#define OPENCMD   "/usr/bin/x-terminal-emulator -T '%n - %m' -e mc %m"
 #define NAMEFONT  "-*-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*"
 #define USAGEFONT "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*"
 
@@ -462,7 +462,7 @@
   f=fopen(filename, "r");
   free(filename);
   if(f==NULL) {
-    fprintf(stderr, "%s: User config file not found\n", dockapp_argv[0]);
+/*  fprintf(stderr, "%s: User config file not found\n", dockapp_argv[0]); */
     filename=SYSCONFIG;
     f=fopen(filename, "r");
     if(f==NULL) {
@@ -601,6 +601,10 @@
   if(font==NULL)
     font=NAMEFONT;
   xfs=XLoadQueryFont(dockapp_d, font);
+  if(xfs==NULL) {
+    fprintf(stderr, "wmmount: font %s not found\n", font);
+    exit(1);
+  }
 
   f_name=xfs->fid;
   namex=6-xfs->min_bounds.lbearing;
@@ -613,6 +617,10 @@
   if(font==NULL)
     font=USAGEFONT;
   xfs=XLoadQueryFont(dockapp_d, USAGEFONT);
+  if(xfs==NULL) {
+    fprintf(stderr, "wmmount: font %s not found\n", font);
+    exit(1);
+  }
   
   f_usage=xfs->fid;
   usagex=6-xfs->min_bounds.lbearing;
@@ -863,7 +871,9 @@
   if(pid==0) {
     if(path!=NULL)
       chdir(path);
-    execv(argv[0], argv);
+    if(execvp(argv[0], argv) == -1) {
+      perror(argv[0]);
+    }
     free(argv);
     free(buf);
     exit(127);
--- wmmount-1.0beta2.orig/config/system.wmmount.eg
+++ wmmount-1.0beta2/config/system.wmmount.eg
@@ -7,8 +7,7 @@
 # under certain conditions
 # See the README file for a more complete notice.
 
-# This configuration file to be saved as
-# /usr/X11R6/lib/X11/wmmount/system.wmmount or as ~/.wmmount.
+# This configuration file to be saved as /etc/system.wmmount or as ~/.wmmount.
 
 # Commands must appear (without a '#') at the beginning of the line.
 
@@ -25,7 +24,7 @@
 # Tell wmmount what to do when you double-click on the information box.
 # This entry may be ommitted.
 
-#opencmd=/usr/X11R6/bin/nxterm -T '%n - %m' -e mc %m
+#opencmd=x-terminal-emulator -T '%n - %m' -e mc %m
 #opencmd=kfmclient exec %m
 
 # Choose fonts for the information box.
@@ -39,10 +38,10 @@
 # Ensure all icons exist and are accessible.
 # At least one icon must be specified.
 
-icon /usr/X11R6/lib/X11/wmmount/cdrom.xpm
-icon /usr/X11R6/lib/X11/wmmount/floppy.xpm
-icon /usr/X11R6/lib/X11/wmmount/zip.xpm
-icon /usr/X11R6/lib/X11/wmmount/harddisk.xpm
+icon /usr/share/wmmount/cdrom.xpm
+icon /usr/share/wmmount/floppy.xpm
+icon /usr/share/wmmount/zip.xpm
+icon /usr/share/wmmount/harddisk.xpm
 
 # Give details of all mountpoints.