desktop/wmxss: New maintainer, minor fixes.

This commit is contained in:
B. Watson 2016-08-16 03:43:04 -04:00 committed by Willy Sudiarto Raharjo
parent 9ea8ca2f3e
commit 787c93b8a8
No known key found for this signature in database
GPG key ID: 887B8374D7333381
4 changed files with 89 additions and 20 deletions

View file

@ -1,3 +1,8 @@
A simple dockapp frontend for XScreenSaver that can also display XSS screensavers. Execute like so,
A simple dockapp frontend for XScreenSaver that can also display XSS
screensavers. Execute like so:
wmxss -e /usr/libexec/xscreensaver/<screensaverhere>
wmxss -e xflame
"xflame" in the example can be replaced by any of the screensavers in
/usr/libexec/xscreensaver, or any screensaver on the filesystem if an
absolute path is given.

View file

@ -0,0 +1,59 @@
diff -Naur wmxss-0.1.orig/Src/wmxss.c wmxss-0.1/Src/wmxss.c
--- wmxss-0.1.orig/Src/wmxss.c 1999-08-11 17:29:02.000000000 -0400
+++ wmxss-0.1/Src/wmxss.c 2016-08-16 03:37:20.306233811 -0400
@@ -43,6 +43,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <limits.h>
#include <X11/X.h>
#include <X11/xpm.h>
#include "xutils.h"
@@ -71,7 +72,8 @@
int GotFirstClick3, GotDoubleClick3;
int DblClkDelay;
int HasExecute;
-char ExecuteCommand[1024];
+char ExecuteCommand[PATH_MAX];
+char env_path[PATH_MAX];
@@ -93,8 +95,16 @@
XEvent event;
int n;
- char Command[512];
+ char Command[PATH_MAX];
+ char *env_path, new_path[PATH_MAX];
+ /* 20160816 bkw: export PATH=/usr/libexec/xscreensaver:$PATH */
+ if( !(env_path = getenv("PATH")) )
+ strcpy(new_path, "PATH=/usr/libexec/xscreensaver");
+ else
+ snprintf(new_path, PATH_MAX - 1, "PATH=/usr/libexec/xscreensaver:%s", env_path);
+
+ putenv(new_path);
/*
* Parse any command line arguments.
@@ -113,7 +123,7 @@
if (HasExecute){
- sprintf(Command, "%s -window-id 0x%x &", ExecuteCommand, (int)iconwin);
+ snprintf(Command, PATH_MAX - 1, "%s -window-id 0x%x &", ExecuteCommand, (int)iconwin);
system(Command);
}
@@ -245,8 +255,8 @@
print_usage();
exit(-1);
}
- strcpy(ExecuteCommand, argv[++i]);
- HasExecute = 1;
+ strcpy(ExecuteCommand, argv[++i]);
+ HasExecute = 1;
} else {

View file

@ -2,7 +2,7 @@
# Slackware build script for wmxss
#
# Copyright 2015 Gethyn ThomasQuail <gethyn@bloodbathsoftworks.com>
# Copyright 2015 Gethyn ThomasQuail <email removed>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@ -22,14 +22,23 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Now maintained by B. Watson <yalhcru@gmail.com>
# 20160816 bkw:
# - BUILD=2
# - took over as maintainer
# - actually build with SLKCFLAGS
# - add /usr/libexec/xscreensaver to $PATH before executing the -e
# command, to allow the example (from "wmxss --help") to actually work.
PRGNAM=wmxss
VERSION=${VERSION:-0.1}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@ -40,8 +49,8 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@ -69,19 +78,15 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
cd Src
# lazy typist patch: search in /usr/libexec/xscreensaver first.
patch -p1 < $CWD/libexecpath.diff
# This archive is very dirty!
make clean
# This archive is very dirty:
rm -f Src/$PRGNAM Src/*.o
# Let's compile!
make
# Copies over compiled binary
install -D -m 0755 wmxss $PKG/usr/bin/wmxss
# Need to do this for the license file
cd ../
make -C Src all CFLAGS="$SLKCFLAGS"
mkdir -p $PKG/usr/bin
install -s -m 0755 Src/wmxss $PKG/usr/bin/wmxss
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING $PKG/usr/doc/$PRGNAM-$VERSION

View file

@ -6,5 +6,5 @@ MD5SUM="26d4f00c3a3d1b2306ba4924a9fbb0fa"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Gethyn ThomasQuail"
EMAIL="gethyn@bloodbathsoftworks.com"
MAINTAINER="B. Watson"
EMAIL="yalhcru@gmail.com"