1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-02 22:25:48 +01:00

Initial revision

This commit is contained in:
scottc
1998-09-29 22:36:29 +00:00
commit 9d2e6ef9f1
527 changed files with 138651 additions and 0 deletions

58
util/Makefile.am Normal file
View File

@@ -0,0 +1,58 @@
AUTOMAKE_OPTIONS = no-dependencies
pkgdatadir = $(datadir)/@PACKAGE@
bin_PROGRAMS = wxcopy wxpaste wdwrite getstyle setstyle seticons geticonset wmsetbg
bin_SCRIPTS = wmaker.inst dockit
EXTRA_DIST = wmaker.inst.in bughint dockit
INCLUDES = @DFLAGS@ -I$(top_srcdir)/wrlib @XCFLAGS@ @LIBPL_INC_PATH@ @GFXFLAGS@
wdwrite_LDADD = @LIBPL_LIBS@ @X_EXTRA_LIBS@
wxcopy_LDADD = @XLFLAGS@ @XLIBS@
wxpaste_LDADD = @XLFLAGS@ @XLIBS@
getstyle_LDADD = @LIBPL_LIBS@ @X_EXTRA_LIBS@
setstyle_LDADD = @LIBPL_LIBS@ @X_EXTRA_LIBS@
seticons_LDADD= @LIBPL_LIBS@ @X_EXTRA_LIBS@
geticonset_LDADD= @LIBPL_LIBS@ @X_EXTRA_LIBS@
wmsetbg_LDADD = @LIBPL_LIBS@ -L$(top_builddir)/wrlib -lwraster @XLFLAGS@\
@GFXLIBS@ @XLIBS@ -lm
getstyle_SOURCES = getstyle.c
setstyle_SOURCES = setstyle.c
seticons_SOURCES = seticons.c
geticonset_SOURCES = geticonset.c
wxcopy_SOURCES = wxcopy.c
wxpaste_SOURCES = wxpaste.c
wdwrite_SOURCES = wdwrite.c
wmsetbg_SOURCES = wmsetbg.c
CLEANFILES = wmaker.inst
wmaker.inst: $(srcdir)/wmaker.inst.in $(srcdir)/Makefile
-rm -f wmaker.inst
sed -e "s:#pkgdatadir#:$(pkgdatadir):" \
-e "s/#version#/$(VERSION)/" \
-e "s:#bindir#:$(bindir):" \
$(srcdir)/wmaker.inst.in >wmaker.inst
chmod 755 wmaker.inst

407
util/Makefile.in Normal file
View File

@@ -0,0 +1,407 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = /bin/sh
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
CC = @CC@
CPP_PATH = @CPP_PATH@
DFLAGS = @DFLAGS@
GFXFLAGS = @GFXFLAGS@
GFXLIBS = @GFXLIBS@
I18N = @I18N@
I18N_MB = @I18N_MB@
ICONEXT = @ICONEXT@
INTLIBS = @INTLIBS@
LIBPL_INC_PATH = @LIBPL_INC_PATH@
LIBPL_LIBS = @LIBPL_LIBS@
LN_S = @LN_S@
MAKEINFO = @MAKEINFO@
MOFILES = @MOFILES@
NLSDIR = @NLSDIR@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
REDUCE_APPICONS = @REDUCE_APPICONS@
SHAPE = @SHAPE@
SOUND = @SOUND@
VERSION = @VERSION@
WPMOFILES = @WPMOFILES@
XCFLAGS = @XCFLAGS@
XGETTEXT = @XGETTEXT@
XLFLAGS = @XLFLAGS@
XLIBS = @XLIBS@
XSHM = @XSHM@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LOCALE = @X_LOCALE@
pixmapdir = @pixmapdir@
wprefsdir = @wprefsdir@
AUTOMAKE_OPTIONS = no-dependencies
pkgdatadir = $(datadir)/@PACKAGE@
bin_PROGRAMS = wxcopy wxpaste wdwrite getstyle setstyle seticons geticonset wmsetbg
bin_SCRIPTS = wmaker.inst dockit
EXTRA_DIST = wmaker.inst.in bughint dockit
INCLUDES = @DFLAGS@ -I$(top_srcdir)/wrlib @XCFLAGS@ @LIBPL_INC_PATH@ @GFXFLAGS@
wdwrite_LDADD = @LIBPL_LIBS@ @X_EXTRA_LIBS@
wxcopy_LDADD = @XLFLAGS@ @XLIBS@
wxpaste_LDADD = @XLFLAGS@ @XLIBS@
getstyle_LDADD = @LIBPL_LIBS@ @X_EXTRA_LIBS@
setstyle_LDADD = @LIBPL_LIBS@ @X_EXTRA_LIBS@
seticons_LDADD= @LIBPL_LIBS@ @X_EXTRA_LIBS@
geticonset_LDADD= @LIBPL_LIBS@ @X_EXTRA_LIBS@
wmsetbg_LDADD = @LIBPL_LIBS@ -L$(top_builddir)/wrlib -lwraster @XLFLAGS@\
@GFXLIBS@ @XLIBS@ -lm
getstyle_SOURCES = getstyle.c
setstyle_SOURCES = setstyle.c
seticons_SOURCES = seticons.c
geticonset_SOURCES = geticonset.c
wxcopy_SOURCES = wxcopy.c
wxpaste_SOURCES = wxpaste.c
wdwrite_SOURCES = wdwrite.c
wmsetbg_SOURCES = wmsetbg.c
CLEANFILES = wmaker.inst
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../src/config.h
CONFIG_CLEAN_FILES =
PROGRAMS = $(bin_PROGRAMS)
DEFS = @DEFS@ -I. -I$(srcdir) -I../src
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
wxcopy_OBJECTS = wxcopy.o
wxcopy_DEPENDENCIES =
wxcopy_LDFLAGS =
wxpaste_OBJECTS = wxpaste.o
wxpaste_DEPENDENCIES =
wxpaste_LDFLAGS =
wdwrite_OBJECTS = wdwrite.o
wdwrite_DEPENDENCIES =
wdwrite_LDFLAGS =
getstyle_OBJECTS = getstyle.o
getstyle_DEPENDENCIES =
getstyle_LDFLAGS =
setstyle_OBJECTS = setstyle.o
setstyle_DEPENDENCIES =
setstyle_LDFLAGS =
seticons_OBJECTS = seticons.o
seticons_DEPENDENCIES =
seticons_LDFLAGS =
geticonset_OBJECTS = geticonset.o
geticonset_DEPENDENCIES =
geticonset_LDFLAGS =
wmsetbg_OBJECTS = wmsetbg.o
wmsetbg_DEPENDENCIES =
wmsetbg_LDFLAGS =
SCRIPTS = $(bin_SCRIPTS)
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
SOURCES = $(wxcopy_SOURCES) $(wxpaste_SOURCES) $(wdwrite_SOURCES) $(getstyle_SOURCES) $(setstyle_SOURCES) $(seticons_SOURCES) $(geticonset_SOURCES) $(wmsetbg_SOURCES)
OBJECTS = $(wxcopy_OBJECTS) $(wxpaste_OBJECTS) $(wdwrite_OBJECTS) $(getstyle_OBJECTS) $(setstyle_OBJECTS) $(seticons_OBJECTS) $(geticonset_OBJECTS) $(wmsetbg_OBJECTS)
all: Makefile $(PROGRAMS) $(SCRIPTS)
.SUFFIXES:
.SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu util/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-binPROGRAMS:
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
distclean-binPROGRAMS:
maintainer-clean-binPROGRAMS:
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
done
.c.o:
$(COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core *.core
clean-compile:
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
wxcopy: $(wxcopy_OBJECTS) $(wxcopy_DEPENDENCIES)
@rm -f wxcopy
$(LINK) $(wxcopy_LDFLAGS) $(wxcopy_OBJECTS) $(wxcopy_LDADD) $(LIBS)
wxpaste: $(wxpaste_OBJECTS) $(wxpaste_DEPENDENCIES)
@rm -f wxpaste
$(LINK) $(wxpaste_LDFLAGS) $(wxpaste_OBJECTS) $(wxpaste_LDADD) $(LIBS)
wdwrite: $(wdwrite_OBJECTS) $(wdwrite_DEPENDENCIES)
@rm -f wdwrite
$(LINK) $(wdwrite_LDFLAGS) $(wdwrite_OBJECTS) $(wdwrite_LDADD) $(LIBS)
getstyle: $(getstyle_OBJECTS) $(getstyle_DEPENDENCIES)
@rm -f getstyle
$(LINK) $(getstyle_LDFLAGS) $(getstyle_OBJECTS) $(getstyle_LDADD) $(LIBS)
setstyle: $(setstyle_OBJECTS) $(setstyle_DEPENDENCIES)
@rm -f setstyle
$(LINK) $(setstyle_LDFLAGS) $(setstyle_OBJECTS) $(setstyle_LDADD) $(LIBS)
seticons: $(seticons_OBJECTS) $(seticons_DEPENDENCIES)
@rm -f seticons
$(LINK) $(seticons_LDFLAGS) $(seticons_OBJECTS) $(seticons_LDADD) $(LIBS)
geticonset: $(geticonset_OBJECTS) $(geticonset_DEPENDENCIES)
@rm -f geticonset
$(LINK) $(geticonset_LDFLAGS) $(geticonset_OBJECTS) $(geticonset_LDADD) $(LIBS)
wmsetbg: $(wmsetbg_OBJECTS) $(wmsetbg_DEPENDENCIES)
@rm -f wmsetbg
$(LINK) $(wmsetbg_LDFLAGS) $(wmsetbg_OBJECTS) $(wmsetbg_LDADD) $(LIBS)
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
$(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
else if test -f $(srcdir)/$$p; then \
echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
$(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
else :; fi; fi; \
done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
list='$(bin_SCRIPTS)'; for p in $$list; do \
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = util
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
info:
dvi:
check: all
$(MAKE)
installcheck:
install-exec: install-binPROGRAMS install-binSCRIPTS
@$(NORMAL_INSTALL)
install-data:
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall: uninstall-binPROGRAMS uninstall-binSCRIPTS
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
$(mkinstalldirs) $(DATADIR)$(bindir) $(DATADIR)$(bindir)
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-binPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-generic
clean: clean-binPROGRAMS clean-compile clean-tags clean-generic \
mostlyclean
distclean: distclean-binPROGRAMS distclean-compile distclean-tags \
distclean-generic clean
-rm -f config.status
maintainer-clean: maintainer-clean-binPROGRAMS maintainer-clean-compile \
maintainer-clean-tags maintainer-clean-generic \
distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile uninstall-binSCRIPTS install-binSCRIPTS tags \
mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
distdir info dvi installcheck install-exec install-data install \
uninstall all installdirs mostlyclean-generic distclean-generic \
clean-generic maintainer-clean-generic clean mostlyclean distclean \
maintainer-clean
wmaker.inst: $(srcdir)/wmaker.inst.in $(srcdir)/Makefile
-rm -f wmaker.inst
sed -e "s:#pkgdatadir#:$(pkgdatadir):" \
-e "s/#version#/$(VERSION)/" \
-e "s:#bindir#:$(bindir):" \
$(srcdir)/wmaker.inst.in >wmaker.inst
chmod 755 wmaker.inst
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

29
util/README Normal file
View File

@@ -0,0 +1,29 @@
bughint- gathers some information for bug reporting
dockit- a Tcl/Tk for docking applications that normally can't be docked.
This utility is obsolete. Use the Emulate Application Icon
item in the attributes panel, instead.
geticonset- outputs the current set of icon assignments. Good for making
themes.
setstyle- load style settings from a style file and setup WindowMaker
getstyle - gets current style settings and save into a file
seticons- merges icon definitions into WMWindowAttributes file
wmaker.inst- quick and dirty script to install necessary files from
global configuration to user's directory. Look in the script to
adapt it to your site.
wxcopy- copy input file or stdin into X cutbuffer
wxpaste- copy content of X cutbuffer into stdout
wmsetbg- set the workspace background into a image and make it persist between
sessions.
wdwrite- write data into the defaults database (configuration files).

42
util/bughint Executable file
View File

@@ -0,0 +1,42 @@
#!/bin/sh
#
# Use this to gather data about your system and send me
# the sysinfo.txt file with your bugreport, plus any error
# messages you've received. This program should be run under X.
#
echo gathering information for bug tracking...
uname -a > sysinfo.txt
echo "=============== xdpyinfo ================" >> sysinfo.txt
xdpyinfo >> sysinfo.txt
echo "=============== env ================" >> sysinfo.txt
env >> sysinfo.txt
echo "=============== ldconfig ================" >> sysinfo.txt
if [ `uname` = 'Linux' ]; then
/sbin/ldconfig -p >> sysinfo.txt
else
/sbin/ldconfig -r >> sysinfo.txt
fi
echo "=============== config.cache ================" >> sysinfo.txt
cat ../config.cache ../Version >> sysinfo.txt 2> /dev/null
cat config.cache Version >> sysinfo.txt 2> /dev/null
echo "=============== configuration dir ===========" >> sysinfo.txt
WDIR=$HOME/gnustep/Library/WindowMaker
if [ -d $WDIR ]; then
for i in preferences menu app_options winitrc shortcuts; do
if [ -f $WDIR/$i ]; then
echo "============== $i ========" >> sysinfo.txt
cat $WDIR/$i >> sysinfo.txt
fi
done
else
echo "No config directory found" >> sysinfo.txt
fi
gzip -9 sysinfo.txt
echo done.

298
util/dockit Executable file
View File

@@ -0,0 +1,298 @@
#!/bin/sh
# Only run the following line once \
exec wish -f $0 $@
##########################################
#Copyright 1998 Kenneth W. Persinger Jr. #
# Written for WindowMaker #
##########################################
# You can add the full path for Xprop here.
set xprop xprop
###############################
# DO NOT EDIT BELOW THIS LINE #
###############################
global xprop;
global instance;set instance ""
global class;set class ""
global command; set command ""
global Version;set Version "V1.3"
global Version
global instance
global class
global command
wm withdraw .
wm group . .
toplevel .dockit -class Dockit
wm group .dockit .dockit
wm command .dockit "$argv0 $argv"
wm iconname .dockit "Dockit ${Version}"
wm protocol .dockit WM_DELETE_WINDOW {exit}
wm focusmodel .dockit passive
wm title .dockit "Dockit ${Version}"
wm geometry .dockit 309x157+440+412
wm maxsize .dockit 1265 994
wm minsize .dockit 1 1
wm overrideredirect .dockit 0
wm resizable .dockit 0 0
wm deiconify .dockit
label .dockit.msgbar \
-anchor nw -borderwidth 1 -justify left -relief raised \
-text ""
label .dockit.instlbl \
-borderwidth 1 -relief raised -text Instance
label .dockit.cllbl \
-borderwidth 1 -relief raised -text Class
label .dockit.comlbl \
-borderwidth 1 -relief raised -text Command
entry .dockit.instent -textvariable instance
entry .dockit.clent -textvariable class
entry .dockit.coment -textvariable command
button .dockit.create \
-padx 9 -pady 3 -text {Create Icon} -command {docreate}
button .dockit.exit \
-padx 9 -pady 3 -text Quit -command exit
button .dockit.grab \
-padx 9 -pady 3 -text Grab -command {dograb}
button .dockit.help \
-padx 9 -pady 3 -text Help -command {dohelp}
###################
# SETTING GEOMETRY
###################
place .dockit.msgbar \
-x 5 -y 120 -width 296 -height 33 -anchor nw -bordermode ignore
place .dockit.instlbl \
-x 5 -y 5 -width 76 -height 23 -anchor nw -bordermode ignore
place .dockit.cllbl \
-x 5 -y 30 -width 76 -height 23 -anchor nw -bordermode ignore
place .dockit.comlbl \
-x 5 -y 55 -width 76 -height 23 -anchor nw -bordermode ignore
place .dockit.instent \
-x 85 -y 5 -width 216 -height 22 -anchor nw -bordermode ignore
place .dockit.clent \
-x 85 -y 30 -width 216 -height 22 -anchor nw -bordermode ignore
place .dockit.coment \
-x 85 -y 55 -width 216 -height 22 -anchor nw -bordermode ignore
place .dockit.create \
-x 5 -y 80 -width 77 -height 36 -anchor nw -bordermode ignore
place .dockit.exit \
-x 230 -y 80 -width 72 -height 36 -anchor nw -bordermode ignore
place .dockit.grab \
-x 80 -y 80 -width 77 -height 36 -anchor nw -bordermode ignore
place .dockit.help \
-x 155 -y 80 -width 77 -height 36 -anchor nw -bordermode ignore
############
# Bindings #
############
bind all <Leave> {message ""}
bind .dockit.instlbl <Enter> {message "Instance name goes here.
(the 1st string of WM_CLASS)"}
bind .dockit.instent <Enter> {message "Instance name goes here.
(the 1st string of WM_CLASS)"}
bind .dockit.cllbl <Enter> {message "Class name goes here.
(the 2nd string of WM_CLASS)"}
bind .dockit.clent <Enter> {message "Class name goes here.
(the 2nd string of WM_CLASS)"}
bind .dockit.comlbl <Enter> {message "The command to execute goes here.
(all of WM_COMMAND)"}
bind .dockit.coment <Enter> {message "The command to execute goes here.
(all of WM_COMMAND)"}
bind .dockit.create <Enter> {message "Create you custom AppIcon."}
bind .dockit.exit <Enter> {message "Exit Dockit!"}
bind .dockit.help <Enter> {message "Help with creating AppIcons,
and for these commands."}
bind .dockit.grab <Enter> {message "Grab AppInfo from a running App."}
###################
# Actual Code #
###################
proc message {message} {
.dockit.msgbar configure -text $message
}
proc docreate {} {
global Version
global instance
global class
global command
if {$command == ""} {
tk_dialog .error "DockIt ${Version}: ERROR" \
"You must supply a command line. Otherwise your icon would do nothing!" \
"" "" "Doh!"
} else {
set insttmp $instance
set classtmp $class
set commandtmp $command
if {$insttmp == ""} { set insttmp "dockit" }
if {$classtmp == ""} { set classtmp "DockedApp" }
toplevel .$insttmp -class $classtmp
wm command .$insttmp "$commandtmp"
wm group .$insttmp .$insttmp
label .$insttmp.l1 -text "
Great! Your new App-Icon should be finished now.
once you have dragged it to the Dock, Click Finish.
If your Icon doesn't Dock, or does not appear,
Try again. If problems persist, see Dockit's Help."
button .$insttmp.b1 -text "Finish" -command "destroy .$insttmp"
pack .$insttmp.l1
pack .$insttmp.b1
wm title .$insttmp "Dockit ${Version}: Confirmation"
}
}
proc dohelp {} {
global Version
set HLPTXT { Dockit V1.2
General Info:
Dockit is a tool designed to provide the ability to Dock
poorly coded programs within WindowMaker.
This is not a 100% accurate solution. It was not designed to be.
It will however, generate a dockable icon 99% of the time.
for that other 1%, you will need to edit by hand.
Troubleshooting:
Error: 'window name starts with an upper-case letter':
This is a limitation of Tcl/Tk.
window/pathnames cannot start with an uppercase letter.
This behavior is most noticable in Netscape's Navigator.
It's instance is 'Navigator'
A work-around to this limitation, is to double-define your App
settings. (ex:'navigator', and 'Navigator')
Error: couldn't execute "xprop": no such file or directory
This means that /usr/X11R6/bin (or its equivilent)
is not defined in your path.
You must add this to your path.
AppIcon does not appear as it should:
This could happen for a number of reasons.
A: You have NoAppIcon defined for that particular App.
B: One word: El Ni~no
App Closes, but Dots do not appear/ Cannot remove Icon from the Dock:
This is the result of a VERY poorly coded App.
As far as WIndowMaker can tell, the program is still running.
The only real fix for this, is CTRL + ALT + BACKSPACE
}
toplevel .userhelp -class Dockit
wm group .userhelp .dockit
wm iconname .userhelp "Dockit HELP"
wm focusmodel .userhelp passive
wm geometry .userhelp 456x635
wm maxsize .userhelp 1265 1265
wm minsize .userhelp 1 1
wm overrideredirect .userhelp 0
wm resizable .userhelp 1 1
wm deiconify .userhelp
wm title .userhelp "Dockit ${Version}: HELP"
label .userhelp.text \
-anchor nw -justify left -borderwidth 1 \
-text $HLPTXT
place .userhelp.text \
-x 0 -y 0 -anchor nw -bordermode ignore
}
proc dograb {} {
global xprop
global class
global instance
global command
catch "open ~/GNUstep/.AppInfo/xprop1 w+" m1
exec ${xprop} >@ $m1
seek $m1 0
set tmpmsg [read $m1]
set tmpmsg [split $tmpmsg \n]
close $m1
#Make sure we are the leader
foreach junk $tmpmsg {
if {[string match "WM_TRANSIENT_FOR(WINDOW): window id \# *" $junk]} {
dograb+ [lindex $junk 4] NNNN
return 1
} elseif {[string match "*window id # of group leader: *" $junk]} {
dograb+ [lindex $junk 6] NNNN
return 1
}
}
set tclass [lindex $tmpmsg [lsearch -glob $tmpmsg *WM_CLASS*]]
set tclass [split $tclass ,]
set class [string trim [lindex $tclass 1] \ \"]
set instance [string tolower \
[string trim [lindex [lindex $tclass 0] 2] \ \"]]
set tcom [lindex $tmpmsg [lsearch -glob $tmpmsg *WM_COMMAND*]]
set tcom [split [lindex $tcom 2] \,]
set tcom [split [join $tcom] \"]
set command [join [join $tcom]]
}
proc dograb+ {winid sourcewin} {
global xprop
global class
global instance
global command
catch "open ~/GNUstep/.AppInfo/xprop1 w+" m1
exec ${xprop} -id $winid >@ $m1
seek $m1 0
set tmpmsg [read $m1]
set tmpmsg [split $tmpmsg \n]
# Make sure we arent hitting a Loop, where we show ourself as
# The group leader.
if { ![string match $sourcewin $winid]} {
# recurse to the toplevel leader.
foreach junk $tmpmsg {
if {[string match "WM_TRANSIENT_FOR(WINDOW): window id # *" $junk]} {
dograb+ [lindex $junk 4] $winid
return 1
} elseif {[string match "*window id # of group leader: *" $junk]} {
dograb+ [lindex $junk 6] $winid
return 1
}
}
}
set tclass [lindex $tmpmsg [lsearch -glob $tmpmsg *WM_CLASS*]]
set tclass [split $tclass ,]
set class [string trim [lindex $tclass 1] \ \"]
set instance [string tolower \
[string trim [lindex [lindex $tclass 0] 2] \ \"]]
set tcom [lindex $tmpmsg [lsearch -glob $tmpmsg *WM_COMMAND*]]
set tcom [split [lindex $tcom 2] \,]
set tcom [split [join $tcom] \"]
set command [join [join $tcom]]
close $m1
}

132
util/geticonset.c Normal file
View File

@@ -0,0 +1,132 @@
/* geticonset.c - outputs icon configuration from WindowMaker to stdout
*
* WindowMaker window manager
*
* Copyright (c) 1997, 1998 Alfredo K. Kojima
*
* This program 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdlib.h>
#include <stdio.h>
#include <proplist.h>
#include <string.h>
#include "../src/wconfig.h"
char *ProgName;
char*
defaultsPathForDomain(char *domain)
{
char path[1024];
char *gspath, *tmp;
gspath = getenv("GNUSTEP_USER_ROOT");
if (gspath) {
strcpy(path, gspath);
strcat(path, "/");
} else {
char *home;
home = getenv("HOME");
if (!home) {
printf("%s:could not get HOME environment variable!\n", ProgName);
exit(0);
}
strcpy(path, home);
strcat(path, "/GNUstep/");
}
strcat(path, DEFAULTS_DIR);
strcat(path, "/");
strcat(path, domain);
tmp = malloc(strlen(path)+2);
strcpy(tmp, path);
return tmp;
}
int
main(int argc, char **argv)
{
proplist_t window_name, icon_key, window_attrs, icon_value;
proplist_t all_windows, iconset;
proplist_t keylist;
char *path;
int i;
ProgName = argv[0];
if (argc>2 || (argc==2 && strcmp(argv[1], "-h")==0)) {
printf("Syntax:\n%s [<iconset file>]\n", argv[0]);
exit(1);
}
path = defaultsPathForDomain("WMWindowAttributes");
all_windows = PLGetProplistWithPath(path);
if (!all_windows) {
printf("%s:could not load WindowMaker configuration file \"%s\".\n",
ProgName, path);
exit(1);
}
iconset = PLMakeDictionaryFromEntries(NULL, NULL, NULL);
keylist = PLGetAllDictionaryKeys(all_windows);
icon_key = PLMakeString("Icon");
for (i=0; i<PLGetNumberOfElements(keylist); i++) {
proplist_t icondic;
window_name = PLGetArrayElement(keylist, i);
if (!PLIsString(window_name))
continue;
window_attrs = PLGetDictionaryEntry(all_windows, window_name);
if (window_attrs && PLIsDictionary(window_attrs)) {
icon_value = PLGetDictionaryEntry(window_attrs, icon_key);
if (icon_value) {
icondic = PLMakeDictionaryFromEntries(icon_key, icon_value,
NULL);
PLInsertDictionaryEntry(iconset, window_name, icondic);
}
}
}
if (argc==2) {
proplist_t val;
val = PLMakeString(argv[1]);
PLSetFilename(iconset, val);
PLSave(iconset, NO);
} else {
puts(PLGetDescriptionIndent(iconset, 0));
}
exit(0);
}

178
util/getstyle.c Normal file
View File

@@ -0,0 +1,178 @@
/* getstyle.c - outputs style related options from WindowMaker to stdout
*
* WindowMaker window manager
*
* Copyright (c) 1997, 1998 Alfredo K. Kojima
*
* This program 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdlib.h>
#include <stdio.h>
#include <proplist.h>
#include <string.h>
#include "../src/wconfig.h"
/* table of style related options */
static char *options[] = {
"TitleJustify",
"WindowTitleFont",
"MenuTitleFont",
"MenuTextFont",
"IconTitleFont",
"ClipTitleFont",
"DisplayFont",
"HighlightColor",
"HighlightTextColor",
"ClipTitleColor",
"CClipTitleColor",
"FTitleColor",
"PTitleColor",
"UTitleColor",
"FTitleBack",
"PTitleBack",
"UTitleBack",
"MenuTitleColor",
"MenuTextColor",
"MenuDisabledColor",
"MenuTitleBack",
"MenuTextBack",
"IconBack",
NULL
};
/* table of theme related options */
static char *theme_options[] = {
"WorkspaceBack",
NULL
};
char *ProgName;
void
print_help()
{
printf("usage: %s [-options] [<style file>]\n", ProgName);
puts("options:");
puts(" -h print help");
puts(" -t get theme options too");
}
char*
defaultsPathForDomain(char *domain)
{
char path[1024];
char *gspath, *tmp;
gspath = getenv("GNUSTEP_USER_ROOT");
if (gspath) {
strcpy(path, gspath);
strcat(path, "/");
} else {
char *home;
home = getenv("HOME");
if (!home) {
printf("%s:could not get HOME environment variable!\n", ProgName);
exit(0);
}
strcpy(path, home);
strcat(path, "/GNUstep/");
}
strcat(path, DEFAULTS_DIR);
strcat(path, "/");
strcat(path, domain);
tmp = malloc(strlen(path)+2);
strcpy(tmp, path);
return tmp;
}
int
main(int argc, char **argv)
{
proplist_t prop, style, key, val;
char *path;
int i, theme_too=0;
char *style_file = NULL;
ProgName = argv[0];
if (argc>1) {
for (i=1; i<argc; i++) {
if (strcmp(argv[i], "-t")==0) {
theme_too++;;
} else if (argv[i][0] != '-') {
style_file = argv[i];
} else {
print_help();
exit(1);
}
}
}
path = defaultsPathForDomain("WindowMaker");
prop = PLGetProplistWithPath(path);
if (!prop) {
printf("%s:could not load WindowMaker configuration file \"%s\".\n",
ProgName, path);
exit(1);
}
style = PLMakeDictionaryFromEntries(NULL, NULL, NULL);
for (i=0; options[i]!=NULL; i++) {
key = PLMakeString(options[i]);
val = PLGetDictionaryEntry(prop, key);
if (val)
PLInsertDictionaryEntry(style, key, val);
}
if (theme_too) {
for (i=0; theme_options[i]!=NULL; i++) {
key = PLMakeString(theme_options[i]);
val = PLGetDictionaryEntry(prop, key);
if (val)
PLInsertDictionaryEntry(style, key, val);
}
}
if (style_file) {
val = PLMakeString(style_file);
PLSetFilename(style, val);
PLSave(style, NO);
} else {
puts(PLGetDescriptionIndent(style, 0));
}
exit(0);
}

126
util/seticons.c Normal file
View File

@@ -0,0 +1,126 @@
/* seticons.c - sets icon configuration in WindowMaker
*
* WindowMaker window manager
*
* Copyright (c) 1997, 1998 Alfredo K. Kojima
*
* This program 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdlib.h>
#include <stdio.h>
#include <proplist.h>
#include <string.h>
#include "../src/wconfig.h"
char *ProgName;
char*
defaultsPathForDomain(char *domain)
{
char path[1024];
char *gspath, *tmp;
gspath = getenv("GNUSTEP_USER_ROOT");
if (gspath) {
strcpy(path, gspath);
strcat(path, "/");
} else {
char *home;
home = getenv("HOME");
if (!home) {
printf("%s:could not get HOME environment variable!\n", ProgName);
exit(0);
}
strcpy(path, home);
strcat(path, "/GNUstep/");
}
strcat(path, DEFAULTS_DIR);
strcat(path, "/");
strcat(path, domain);
tmp = malloc(strlen(path)+2);
strcpy(tmp, path);
return tmp;
}
int
main(int argc, char **argv)
{
proplist_t window_name, icon_key, window_attrs, icon_value;
proplist_t all_windows, iconset;
proplist_t keylist;
int i;
char *path;
ProgName = argv[0];
if (argc!=2) {
printf("Syntax:\n%s <iconset file>\n", argv[0]);
exit(1);
}
path = defaultsPathForDomain("WMWindowAttributes");
all_windows = PLGetProplistWithPath(path);
if (!all_windows) {
printf("%s:could not load WindowMaker configuration file \"%s\".\n",
ProgName, path);
exit(1);
}
iconset = PLGetProplistWithPath(argv[1]);
if (!iconset) {
printf("%s:could not load icon set file \"%s\".\n", ProgName, argv[1]);
exit(1);
}
keylist = PLGetAllDictionaryKeys(iconset);
icon_key = PLMakeString("Icon");
for (i=0; i<PLGetNumberOfElements(keylist); i++) {
window_name = PLGetArrayElement(keylist, i);
if (!PLIsString(window_name))
continue;
icon_value = PLGetDictionaryEntry(iconset, window_name);
if (!icon_value || !PLIsDictionary(icon_value))
continue;
window_attrs = PLGetDictionaryEntry(all_windows, window_name);
if (window_attrs) {
if (PLIsDictionary(window_attrs)) {
PLMergeDictionaries(window_attrs, icon_value);
}
} else {
PLInsertDictionaryEntry(all_windows, window_name, icon_value);
}
}
PLSave(all_windows, YES);
exit(0);
}

102
util/setstyle.c Normal file
View File

@@ -0,0 +1,102 @@
/* setstyle.c - loads style related options to wmaker
*
* WindowMaker window manager
*
* Copyright (c) 1997, 1998 Alfredo K. Kojima
*
* This program 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdlib.h>
#include <stdio.h>
#include <proplist.h>
#include <string.h>
#include "../src/wconfig.h"
char *ProgName;
char*
defaultsPathForDomain(char *domain)
{
char path[1024];
char *gspath, *tmp;
gspath = getenv("GNUSTEP_USER_ROOT");
if (gspath) {
strcpy(path, gspath);
strcat(path, "/");
} else {
char *home;
home = getenv("HOME");
if (!home) {
printf("%s:could not get HOME environment variable!\n", ProgName);
exit(0);
}
strcpy(path, home);
strcat(path, "/GNUstep/");
}
strcat(path, DEFAULTS_DIR);
strcat(path, "/");
strcat(path, domain);
tmp = malloc(strlen(path)+2);
strcpy(tmp, path);
return tmp;
}
int
main(int argc, char **argv)
{
proplist_t prop, style;
char *path;
ProgName = argv[0];
if (argc!=2) {
printf("Syntax:\n%s <style file>\n", argv[0]);
exit(1);
}
path = defaultsPathForDomain("WindowMaker");
prop = PLGetProplistWithPath(path);
if (!prop) {
printf("%s:could not load WindowMaker configuration file \"%s\".\n",
ProgName, path);
exit(1);
}
style = PLGetProplistWithPath(argv[1]);
if (!style) {
printf("%s:could not load style file \"%s\".\n", ProgName, argv[1]);
exit(1);
}
PLMergeDictionaries(prop, style);
PLSave(prop, YES);
exit(0);
}

122
util/wdwrite.c Normal file
View File

@@ -0,0 +1,122 @@
/* wdwrite.c - write key/value to defaults database
*
* WindowMaker window manager
*
* Copyright (c) 1997, 1998 Alfredo K. Kojima
*
* This program 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
/*
* WindowMaker defaults DB writer
*/
#include "../src/wconfig.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <proplist.h>
#include <pwd.h>
char *ProgName;
char*
gethomedir()
{
char *home = getenv("HOME");
struct passwd *user;
if (home)
return home;
user = getpwuid(getuid());
if (!user) {
perror(ProgName);
return "/";
}
if (!user->pw_dir) {
return "/";
} else {
return user->pw_dir;
}
}
void wAbort()
{
exit(0);
}
void help()
{
printf("Syntax:\n%s <domain> <option> <value>\n", ProgName);
exit(1);
}
int main(int argc, char **argv)
{
char path[256];
proplist_t dom, key, value, dict;
char *gsdir;
ProgName = argv[0];
if (argc<4) {
help();
}
dom = PLMakeString(argv[1]);
key = PLMakeString(argv[2]);
value = PLGetProplistWithDescription(argv[3]);
if (!value) {
printf("%s:syntax error in value \"%s\"", ProgName, argv[3]);
exit(1);
}
gsdir = getenv("GNUSTEP_USER_ROOT");
if (gsdir) {
strcpy(path, gsdir);
} else {
strcpy(path, gethomedir());
strcat(path, "/GNUstep");
}
strcat(path, "/");
strcat(path, DEFAULTS_DIR);
strcat(path, "/");
strcat(path, argv[1]);
dict = PLGetProplistWithPath(path);
if (!dict) {
dict = PLMakeDictionaryFromEntries(key, value, NULL);
PLSetFilename(dict, PLMakeString(path));
} else {
PLRemoveDictionaryEntry(dict, key);
PLInsertDictionaryEntry(dict, key, value);
}
PLSave(dict, YES);
return 0;
}

235
util/wmaker.inst.in Normal file
View File

@@ -0,0 +1,235 @@
#!/bin/sh
#
# Install WindowMaker for the current user
#
# directory where system wide configuration is stored
GLOBALDIR="#pkgdatadir#"
USERDIR=$HOME
VERSION="#version#"
BINDIR="#bindir#"
make_script() {
ISCRIPT=$1
echo '#!/bin/sh' >> $ISCRIPT
echo '# WindowMaker Default .xinitrc' >> $ISCRIPT
echo "exec $BINDIR/wmaker" >> $ISCRIPT
}
#
# Copy files considering special cases
#
copy() {
source=$1
target=$2
file=`basename $source`
rm -f $target
if [ "$file" = "WMRootMenu" ]; then
echo \"$GSDIR/Library/WindowMaker/menu\" > \
$target
elif [ "$file" = "WindowMaker" ]; then
sed -e "s|~/GNUstep|$GSDIR|g" $source > $target
else
if test "x$GNUSTEP_USER_ROOT" = "x"; then
cp $source $target
else
sed -e "s|~/GNUstep|$GSDIR|g" $source > $target
fi
fi
}
echo "Installing WindowMaker $VERSION for current user..."
if [ ! -d $GLOBALDIR ]; then
echo "Could not find global configurations files"
echo "Make sure you've installed WindowMaker correctly"
exit 1
fi
if [ ! -d "$USERDIR" ]; then
echo "Could not find user directory $USERDIR"
exit 1
fi
if test "x$GNUSTEP_USER_ROOT" = "x"; then
cd $USERDIR
GSDIR=$USERDIR/GNUstep
if [ ! -d $GSDIR ]; then
echo "Creating $GSDIR user directory"
mkdir $GSDIR
fi
else
GSDIR=$GNUSTEP_USER_ROOT
if [ ! -d $GSDIR ]; then
echo "Directory specified in GNUSTEP_USER_ROOT environment variable does not exist"
exit 1
fi
cd $GSDIR
cd ..
fi
if [ ! -d "$GSDIR/.AppInfo" ]; then
mkdir $GSDIR/.AppInfo
fi
if [ ! -d "$GSDIR/Defaults" ]; then
mkdir $GSDIR/Defaults
fi
echo "Copying defaults database..."
FILES=`(cd $GLOBALDIR/Defaults;ls *)`
all=""
for i in $FILES; do
if [ -f $GSDIR/Defaults/$i ]; then
echo "The configuration file \"$i\" already exists in your defaults database."
echo "Do you wish to replace it? <y/n/a> [n] $all"
if [ "$all" != "a" ]; then
read foo
if [ "$foo" = "a" -o "$foo" = "A" ]; then
all="a"
fi
fi
if [ "$foo" = "y" -o "$foo" = "Y" -o "$all" = "a" ]; then
copy $GLOBALDIR/Defaults/$i $GSDIR/Defaults/$i
fi
else
copy $GLOBALDIR/Defaults/$i $GSDIR/Defaults/$i
fi
done
if [ ! -d "$GSDIR/Library/Icons/" ]; then
echo "Creating icon library directory $GSDIR/Library/Icons"
if [ ! -d $GSDIR/Library ]; then
mkdir $GSDIR/Library
fi
mkdir $GSDIR/Library/Icons
fi
if [ ! -d "$GSDIR/Library/WindowMaker/" ]; then
echo "Creating WindowMaker data library directory $GSDIR/Library/WindowMaker"
if [ ! -d $GSDIR/Library ]; then
mkdir $GSDIR/Library
fi
mkdir $GSDIR/Library/WindowMaker
fi
if [ ! -d "$GSDIR/Library/WindowMaker/Styles" ]; then
echo "Creating style library $GSDIR/Library/WindowMaker/Styles"
mkdir $GSDIR/Library/WindowMaker/Styles
else
echo "Styles directory already exists. Skipping..."
fi
if [ ! -d "$GSDIR/Library/WindowMaker/Themes" ]; then
echo "Creating theme library $GSDIR/Library/WindowMaker/Themes"
mkdir $GSDIR/Library/WindowMaker/Themes
else
echo "Themes directory already exists. Skipping..."
fi
if [ ! -d "$GSDIR/Library/WindowMaker/Backgrounds" ]; then
echo "Creating bg image library $GSDIR/Library/WindowMaker/Backgrounds"
mkdir $GSDIR/Library/WindowMaker/Backgrounds
else
echo "Default Backgrounds directory already exists. Skipping..."
fi
if [ ! -d "$GSDIR/Library/WindowMaker/IconSets" ]; then
echo "Creating icon setup library $GSDIR/Library/WindowMaker/IconSets"
mkdir $GSDIR/Library/WindowMaker/IconSets
else
echo "Default IconSets directory already exists. Skipping..."
fi
if [ ! -d "$GSDIR/Library/WindowMaker/Pixmaps" ]; then
echo "Creating pixmap library $GSDIR/Library/WindowMaker/Pixmaps"
mkdir $GSDIR/Library/WindowMaker/Pixmaps
else
echo "Default Pixmaps directory already exists. Skipping..."
fi
if [ ! -d "$GSDIR/Library/WindowMaker/Sounds" ]; then
echo "Creating sound library $GSDIR/Library/WindowMaker/Sounds"
mkdir $GSDIR/Library/WindowMaker/Sounds
else
echo "Default Sounds directory already exists. Skipping..."
fi
echo "Copying default menu configuration files..."
FILES=`(cd $GLOBALDIR;ls -1 menu* plmenu wmmacros)`
all=""
for i in $FILES; do
if [ -f "$GSDIR/Library/WindowMaker/$i" ]; then
echo "The file \"$i\" already exists in $GSDIR/Library/WindowMaker"
echo "Do you wish to replace it? <y/n/a> [n] $all"
if [ "$all" != "a" ]; then
read foo
if [ "$foo" = "a" -o "$foo" = "A" ]; then
all="a"
fi
fi
if [ "$foo" = "y" -o "$foo" = "Y" -o "$foo" = "a" ]; then
copy $GLOBALDIR/$i $GSDIR/Library/WindowMaker/$i
fi
else
copy $GLOBALDIR/$i $GSDIR/Library/WindowMaker/$i
fi
done
cp $GLOBALDIR/README $GSDIR/Library/WindowMaker
cp -i $GLOBALDIR/autostart.sh $GSDIR/Library/WindowMaker/autostart
chmod +rx $GSDIR/Library/WindowMaker/autostart
#
#######################
DATE=`date +%m%d%H%M`
echo
echo "Now the .xinitrc, .Xclients or .xsession script must be updated so that"
echo "it calls wmaker when you start an X session."
echo "Type the name of the file that must be changed (normally .xinitrc)."
echo "If the file already exists, it will be backed up with a .old.$DATE extension"
read file
if test "x$file" = "x"; then
echo "Using .xinitrc as a default value"
file=.xinitrc
fi
if [ -f $USERDIR/$file ]; then
mv $USERDIR/$file $USERDIR/$file.old.$DATE
fi
make_script $USERDIR/$file
echo "Installation Finished"
echo
echo "There are menus in 2 different file formats. The plain text format and"
echo "the property list format. The plain text format is more flexible, but"
echo "the menu in the property list format can be edited graphically. The"
echo "menu that will be used by default is the plain text. Read"
echo "$GSDIR/Library/WindowMaker/README for information on how to change it."

492
util/wmsetbg.c Normal file
View File

@@ -0,0 +1,492 @@
/* wmsetbg.c- sets root window background image
*
* WindowMaker window manager
*
* Copyright (c) 1998 Dan Pascu
* Copyright (c) 1998 Alfredo K. Kojima
*
* This program 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <string.h>
#include <wraster.h>
#include <pwd.h>
#include <sys/types.h>
#include "../src/wconfig.h"
#include <proplist.h>
#ifdef DEBUG
#include <sys/time.h>
#include <time.h>
#endif
#define WTP_TILE 1
#define WTP_SCALE 2
#define WTP_CENTER 3
char *ProgName;
/* Alfredo please take a look at this function. I don't like the way
* it sends the XKillClient. Should it interfere this way with the rest?
* This was added by the patch to allow the transparent background for Eterm.
* Also for this purpose Eterm have a program named Esetroot.
* People wanting that feature can use that instead of wmsetbg. Why do we
* need to patch wmsetbg to do this?
* In case you want to keep it, please also check the way it does
* the PropModeAppend. -Dan */
static void
setPixmapProperty(Pixmap pixmap, Display *dpy, Window root)
{
Atom prop, type;
int format;
unsigned long length, after;
unsigned char *data;
/* This will locate the property, creating it if it doesn't exist */
prop = XInternAtom(dpy, "_XROOTPMAP_ID", False);
if (prop == None)
return;
/* Clear out the old pixmap */
XGetWindowProperty(dpy, root, prop, 0L, 1L, True, AnyPropertyType,
&type, &format, &length, &after, &data);
if ((type == XA_PIXMAP) && (format == 32) && (length == 1)) {
XKillClient(dpy, *((Pixmap *)data));
}
XDeleteProperty(dpy, root, prop);
prop = XInternAtom(dpy, "_XROOTPMAP_ID", True);
if (prop == None)
return;
/* Now add the new one. We use PropModeAppend because PropModeReplace
doesn't seem to work if there isn't already a property there. */
XChangeProperty(dpy, root, prop, XA_PIXMAP, 32, PropModeAppend,
(unsigned char *) &pixmap, 1);
XFlush(dpy);
XSetCloseDownMode(dpy, RetainPermanent);
XFlush(dpy);
}
void*
wmalloc(size_t size)
{
void *ptr;
ptr = malloc(size);
if (!ptr) {
perror(ProgName);
exit(1);
}
return ptr;
}
char*
gethomedir()
{
char *home = getenv("HOME");
struct passwd *user;
if (home)
return home;
user = getpwuid(getuid());
if (!user) {
perror(ProgName);
return "/";
}
if (!user->pw_dir) {
return "/";
} else {
return user->pw_dir;
}
}
void wAbort()
{
exit(1);
}
void
print_help()
{
printf("usage: %s [-options] image\n", ProgName);
puts("options:");
puts(" -d dither image");
puts(" -m match colors");
puts(" -b <color> background color");
puts(" -t tile image");
puts(" -e center image");
puts(" -s scale image (default)");
puts(" -u update WindowMaker domain database");
puts(" -D <domain> update <domain> database");
puts(" -c <cpc> colors per channel to use");
}
char*
defaultsPathForDomain(char *domain)
{
char path[1024];
char *gspath, *tmp;
gspath = getenv("GNUSTEP_USER_ROOT");
if (gspath) {
strcpy(path, gspath);
strcat(path, "/");
} else {
strcpy(path, gethomedir());
strcat(path, "/GNUstep/");
}
strcat(path, DEFAULTS_DIR);
strcat(path, "/");
strcat(path, domain);
tmp = wmalloc(strlen(path)+2);
strcpy(tmp, path);
return tmp;
}
char *wstrdup(char *str)
{
return strcpy(wmalloc(strlen(str)+1), str);
}
/* Returns an array of pointers to the pixmap paths, doing ~ expansion */
static char**
getPixmapPath(char *domain)
{
char **ret;
char *path;
proplist_t prop, pixmap_path, key, value;
int count, i;
path = defaultsPathForDomain(domain);
if (!path)
return NULL;
prop = PLGetProplistWithPath(path);
if (!prop || !PLIsDictionary(prop))
return NULL;
key = PLMakeString("PixmapPath");
pixmap_path = PLGetDictionaryEntry(prop, key);
PLRelease(key);
if (!pixmap_path || !PLIsArray(pixmap_path))
return NULL;
count = PLGetNumberOfElements(pixmap_path);
if (count < 1)
return NULL;
ret = wmalloc(sizeof(char*)*(count+1));
for (i=0; i<count; i++) {
value = PLGetArrayElement(pixmap_path, i);
if (!value || !PLIsString(value))
break;
ret[i] = wstrdup(PLGetString(value));
if (ret[i][0]=='~' && ret[i][1]=='/') {
/* home is statically allocated. Don't free it */
char *fullpath, *home=gethomedir();
fullpath = wmalloc(strlen(home)+strlen(ret[i]));
strcpy(fullpath, home);
strcat(fullpath, &ret[i][1]);
free(ret[i]);
ret[i] = fullpath;
}
}
ret[i] = NULL;
return ret;
}
int
main(int argc, char **argv)
{
Display *dpy;
Window root_win;
RContextAttributes rattr;
int screen_number, default_depth, i, style = WTP_SCALE;
int scr_width, scr_height;
RContext *rcontext;
RImage *image, *tmp;
Pixmap secretBuffer = None;
Pixmap pixmap;
XColor xcolor;
char *back_color = "black";
char *image_name = NULL;
char *domain = "WindowMaker";
char *program = "wdwrite";
int update=0, cpc=4, render_mode=RM_MATCH, obey_user=0;
#ifdef DEBUG
double t1, t2, total, t;
struct timeval timev;
#endif
ProgName = strrchr(argv[0],'/');
if (!ProgName)
ProgName = argv[0];
else
ProgName++;
if (argc>1) {
for (i=1; i<argc; i++) {
if (strcmp(argv[i], "-s")==0) {
style = WTP_SCALE;
} else if (strcmp(argv[i], "-t")==0) {
style = WTP_TILE;
} else if (strcmp(argv[i], "-e")==0) {
style = WTP_CENTER;
} else if (strcmp(argv[i], "-d")==0) {
render_mode = RM_DITHER;
obey_user++;
} else if (strcmp(argv[i], "-m")==0) {
render_mode = RM_MATCH;
obey_user++;
} else if (strcmp(argv[i], "-u")==0) {
update++;
} else if (strcmp(argv[i], "-D")==0) {
update++;
i++;
if (i>=argc) {
fprintf(stderr, "too few arguments for %s\n", argv[i-1]);
exit(0);
}
domain = wstrdup(argv[i]);
} else if (strcmp(argv[i], "-c")==0) {
i++;
if (i>=argc) {
fprintf(stderr, "too few arguments for %s\n", argv[i-1]);
exit(0);
}
if (sscanf(argv[i], "%i", &cpc)!=1) {
fprintf(stderr, "bad value for colors per channel: \"%s\"\n", argv[i]);
exit(0);
}
} else if (strcmp(argv[i], "-b")==0) {
i++;
if (i>=argc) {
fprintf(stderr, "too few arguments for %s\n", argv[i-1]);
exit(0);
}
back_color = argv[i];
} else if (strcmp(argv[i], "-x")==0) {
/* secret option:renders the pixmap in the supplied drawable */
i++;
if (i>=argc ||
sscanf(argv[i], "%x", (unsigned*)&secretBuffer)!=1) {
print_help();
exit(1);
}
} else if (argv[i][0] != '-') {
image_name = argv[i];
} else {
print_help();
exit(1);
}
}
}
if (image_name == NULL) {
print_help();
exit(1);
}
if (update) {
char *value = wmalloc(sizeof(image_name) + 30);
char *tmp=image_name, **paths;
int i;
/* should we read PixmapPath from the same file as we write into ? */
paths = getPixmapPath("WindowMaker");
if (paths) {
for(i=0; paths[i]!=NULL; i++) {
if ((tmp = strstr(image_name, paths[i])) != NULL &&
tmp == image_name) {
tmp += strlen(paths[i]);
while(*tmp=='/') tmp++;
break;
}
}
}
if (!tmp)
tmp = image_name;
if (style == WTP_TILE)
strcpy(value, "(tpixmap, \"");
else if (style == WTP_SCALE)
strcpy(value, "(spixmap, \"");
else
strcpy(value, "(cpixmap, \"");
strcat(value, tmp);
strcat(value, "\", \"");
strcat(value, back_color);
strcat(value, "\")");
execlp(program, program, domain, "WorkspaceBack", value, NULL);
printf("%s: warning could not run \"%s\"\n", ProgName, program);
/* Do not exit. At least try to put the image in the background */
/* Won't this waste CPU for nothing? We're going to be called again,
* anyways. -Alfredo */
/* If it fails to update the WindowMaker domain with "wdwrite" we
* won't be called again, because Window Maker will not notice any
* change. If it reaches this point, this means it failed.
* On success it will never get here. -Dan */
/*exit(0);*/
}
dpy = XOpenDisplay("");
if (!dpy) {
puts("Could not open display!");
exit(1);
}
#ifdef DEBUG
XSynchronize(dpy, True);
#endif
screen_number = DefaultScreen(dpy);
root_win = RootWindow(dpy, screen_number);
default_depth = DefaultDepth(dpy, screen_number);
scr_width = WidthOfScreen(ScreenOfDisplay(dpy, screen_number));
scr_height = HeightOfScreen(ScreenOfDisplay(dpy, screen_number));
if (!XParseColor(dpy, DefaultColormap(dpy, screen_number), back_color,
&xcolor)) {
printf("invalid color %s\n", back_color);
exit(1);
}
if (!obey_user && default_depth <= 8)
render_mode = RM_DITHER;
rattr.flags = RC_RenderMode | RC_ColorsPerChannel | RC_DefaultVisual;
rattr.render_mode = render_mode;
rattr.colors_per_channel = cpc;
rcontext = RCreateContext(dpy, screen_number, &rattr);
if (!rcontext) {
printf("could not initialize graphics library context: %s\n",
RErrorString);
exit(1);
}
#ifdef DEBUG
gettimeofday(&timev, NULL);
t1 = (double)timev.tv_sec + (((double)timev.tv_usec)/1000000);
t = t1;
#endif
image = RLoadImage(rcontext, image_name, 0);
#ifdef DEBUG
gettimeofday(&timev, NULL);
t2 = (double)timev.tv_sec + (((double)timev.tv_usec)/1000000);
total = t2 - t1;
printf("load image in %f sec\n", total);
#endif
if (!image) {
printf("could not load image %s:%s\n", image_name, RErrorString);
exit(1);
}
#ifdef DEBUG
gettimeofday(&timev, NULL);
t1 = (double)timev.tv_sec + (((double)timev.tv_usec)/1000000);
#endif
if (style == WTP_SCALE) {
tmp = RScaleImage(image, scr_width, scr_height);
if (!tmp) {
printf("could not scale image: %s\n", image_name);
exit(1);
}
RDestroyImage(image);
image = tmp;
} else if (style==WTP_CENTER && (image->width!=scr_width
|| image->height!=scr_height)) {
RColor color;
color.red = xcolor.red>>8;
color.green = xcolor.green>>8;
color.blue = xcolor.blue>>8;
color.alpha = 255;
tmp = RMakeCenteredImage(image, scr_width, scr_height, &color);
if (!tmp) {
printf("could not create centered image: %s\n", image_name);
exit(1);
}
RDestroyImage(image);
image = tmp;
}
#ifdef DEBUG
gettimeofday(&timev, NULL);
t2 = (double)timev.tv_sec + (((double)timev.tv_usec)/1000000);
total = t2 - t1;
printf("scale image in %f sec\n", total);
gettimeofday(&timev, NULL);
t1 = (double)timev.tv_sec + (((double)timev.tv_usec)/1000000);
#endif
RConvertImage(rcontext, image, &pixmap);
#ifdef DEBUG
gettimeofday(&timev, NULL);
t2 = (double)timev.tv_sec + (((double)timev.tv_usec)/1000000);
total = t2 - t1;
printf("convert image to pixmap in %f sec\n", total);
total = t2 - t;
printf("total image proccessing in %f sec\n", total);
#endif
RDestroyImage(image);
if (secretBuffer==None) {
setPixmapProperty(pixmap, dpy, root_win);
XSetWindowBackgroundPixmap(dpy, root_win, pixmap);
XClearWindow(dpy, root_win);
} else {
XCopyArea(dpy, pixmap, secretBuffer, DefaultGC(dpy, screen_number),
0, 0, scr_width, scr_height, 0, 0);
}
XSync(dpy, False);
XCloseDisplay(dpy);
#ifdef DEBUG
gettimeofday(&timev, NULL);
t2 = (double)timev.tv_sec + (((double)timev.tv_usec)/1000000);
total = t2 - t;
printf("total proccessing time: %f sec\n", total);
#endif
if (secretBuffer)
exit(123);
else
exit(0);
}

138
util/wxcopy.c Normal file
View File

@@ -0,0 +1,138 @@
/* wxcopy.c- copy stdin or file into cutbuffer
*
* Copyright (c) 1997 Alfredo K. Kojima
*
* This program 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#define LINESIZE (4*1024)
#define MAXDATA (64*1024)
void
help(char *progn)
{
printf("usage: %s [-cutbuffer number] [filename]\n", progn);
}
static int
errorHandler(Display *dpy, XErrorEvent *err)
{
/* ignore all errors */
return 0;
}
int
main(int argc, char **argv)
{
Display *dpy;
int i;
int buffer=-1;
char *filename=NULL;
FILE *file=stdin;
char *buf=NULL;
int l=0;
for (i=1; i<argc; i++) {
if (argv[i][0]=='-') {
if (argv[i][1]=='h') {
help(argv[0]);
exit(0);
} else if (strcmp(argv[i],"-cutbuffer")==0) {
if (i<argc-1) {
i++;
if (sscanf(argv[i],"%i", &buffer)!=1) {
printf("%s: could not convert \"%s\" to int\n",
argv[0], argv[i]);
exit(1);
}
if (buffer<0 || buffer > 7) {
printf("%s: invalid buffer number %i\n", argv[0],
buffer);
exit(1);
}
} else {
help(argv[0]);
exit(1);
}
} else {
help(argv[0]);
exit(1);
}
} else {
filename = argv[i];
}
}
if (filename) {
file = fopen(filename, "r");
if (!file) {
char line[1024];
sprintf(line, "%s: could not open \"%s\"", argv[0], filename);
perror(line);
exit(1);
}
}
dpy = XOpenDisplay("");
XSetErrorHandler(errorHandler);
if (!dpy) {
printf("%s: could not open display\n", argv[0]);
exit(1);
}
if (buffer<0) {
XRotateBuffers(dpy, 1);
buffer=0;
}
while (!feof(file)) {
char *nbuf;
char tmp[LINESIZE+2];
int nl=0;
if (!fgets(tmp, LINESIZE, file)) {
break;
}
nl = strlen(tmp);
if (!buf)
nbuf = malloc(l+nl+1);
else
nbuf = realloc(buf, l+nl+1);
if (!nbuf) {
printf("%s: out of memory\n", argv[0]);
exit(1);
}
buf=nbuf;
if (l==0) {
strcpy(buf,tmp);
} else {
strcat(buf, tmp);
}
l+=nl;
if (l>=MAXDATA) {
printf("%s: too much data in input\n", argv[0]);
exit(1);
}
}
if (buf)
XStoreBuffer(dpy, buf, l, buffer);
XFlush(dpy);
XCloseDisplay(dpy);
exit(1);
}

81
util/wxpaste.c Normal file
View File

@@ -0,0 +1,81 @@
/* wxpaste.c- paste contents of cutbuffer to stdout
*
* Copyright (c) 1997 Alfredo K. Kojima
*
* This program 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#define LINESIZE (4*1024)
void
help(char *progn)
{
printf("usage: %s [-cutbuffer number]\n", progn);
}
int
main(int argc, char **argv)
{
Display *dpy;
int i, l;
int buffer=0;
char *buf;
for (i=1; i<argc; i++) {
if (argv[i][0]=='-') {
if (argv[i][1]=='h') {
help(argv[0]);
exit(0);
} else if (strcmp(argv[i],"-cutbuffer")==0) {
if (i<argc-1) {
i++;
if (sscanf(argv[i],"%i", &buffer)!=1) {
printf("%s: could not convert \"%s\" to int\n",
argv[0], argv[i]);
exit(1);
}
if (buffer<0 || buffer > 7) {
printf("%s: invalid buffer number %i\n", argv[0],
buffer);
exit(1);
}
} else {
help(argv[0]);
exit(1);
}
}
} else {
help(argv[0]);
exit(1);
}
}
dpy = XOpenDisplay("");
if (!dpy) {
printf("%s: could not open display\n", argv[0]);
exit(1);
}
buf=XFetchBuffer(dpy, &l, buffer);
if (buf)
printf("%s", buf);
XCloseDisplay(dpy);
exit(1);
}