diff options
-rw-r--r-- | misc/g15daemon/51g15hook.sh | 38 | ||||
-rw-r--r-- | misc/g15daemon/README | 5 | ||||
-rw-r--r-- | misc/g15daemon/README.SLACKWARE | 3 | ||||
-rw-r--r-- | misc/g15daemon/doinst.sh | 19 | ||||
-rw-r--r-- | misc/g15daemon/g15daemon-1.9.5.3-uinput.patch | 35 | ||||
-rw-r--r-- | misc/g15daemon/g15daemon.SlackBuild | 27 | ||||
-rw-r--r-- | misc/g15daemon/g15daemon.info | 2 | ||||
-rw-r--r-- | misc/g15daemon/rc.g15daemon | 22 | ||||
-rw-r--r-- | misc/g15daemon/rc.g15daemon.conf | 9 | ||||
-rw-r--r-- | misc/g15daemon/slack-desc | 8 |
10 files changed, 138 insertions, 30 deletions
diff --git a/misc/g15daemon/51g15hook.sh b/misc/g15daemon/51g15hook.sh new file mode 100644 index 000000000000..a46a74237050 --- /dev/null +++ b/misc/g15daemon/51g15hook.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# g15daemon hook script for pm-utils. +# If you use g15daemon in conjunction with pm-utils, this hook script +# stops g15daemon when suspending/hinernating and restarts it when +# resuming/thawing. +# Copyright (c) 2011 Alan Alberghini <414N@slacky.it> +# All rights reserved. +# +# Permission to use, copy, modify, and distribute this software for +# any purpose with or without fee is hereby granted, provided that +# the above copyright notice and this permission notice appear in all +# copies. +# +# THIS SOFTWARE IS PROVIDED AS IS'' AND ANY EXPRESSED OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + + +if [ -x /etc/rc.d/rc.g15daemon ] +then + case $1 in + resume|thaw) + /etc/rc.d/rc.g15daemon restart + ;; + hibernate) + /etc/rc.d/rc.g15daemon stop + ;; + esac +fi diff --git a/misc/g15daemon/README b/misc/g15daemon/README index 8603c2dd9b79..a7a8e605f5d6 100644 --- a/misc/g15daemon/README +++ b/misc/g15daemon/README @@ -1,8 +1,9 @@ -The G15daemon is a userspace driver/multiplexer for the keyboard and its LCD, +The G15daemon is a userspace driver/multiplexer for the keyboard and its LCD, using libg15 for low-level keyboard control. Some features of g15daemon are: 1. Allows all extra G15 keys to be used in applications. 2. It allows for multiple simultaneous LCD clients. -3. Virtualises the LCD, the user can select which application is displayed with a simple keypress. +3. Virtualises the LCD, the user can select which application is displayed + with a simple keypress. 4. Clients talk to the daemon via a simple protocol. 5. Client applications have full control over LCD backlight and contrast. diff --git a/misc/g15daemon/README.SLACKWARE b/misc/g15daemon/README.SLACKWARE index 1cf39a2e83b6..ae098570e23e 100644 --- a/misc/g15daemon/README.SLACKWARE +++ b/misc/g15daemon/README.SLACKWARE @@ -14,3 +14,6 @@ You will also need to add the following to /etc/rc.d/rc.local_shutdown: /etc/rc.d/rc.g15daemon stop fi +If you want to automatically start/stop some plugins/applets along g15daemon +(e.g. g15stats), fill the /etc/rc.d/rc.g15daemon.conf file with the relevant +information. diff --git a/misc/g15daemon/doinst.sh b/misc/g15daemon/doinst.sh index ec1722b4b51e..de2d05871554 100644 --- a/misc/g15daemon/doinst.sh +++ b/misc/g15daemon/doinst.sh @@ -11,12 +11,17 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -# Keep same perms on rc.g15daemon.new: -if [ -e etc/rc.d/rc.g15daemon ]; then - cp -a etc/rc.d/rc.g15daemon etc/rc.d/rc.g15daemon.new.incoming - cat etc/rc.d/rc.g15daemon.new > etc/rc.d/rc.g15daemon.new.incoming - mv etc/rc.d/rc.g15daemon.new.incoming etc/rc.d/rc.g15daemon.new -fi +perms(){ -config etc/rc.d/rc.g15daemon.new + # Keep same perms on $1.new: + if [ -e "$1" ]; then + cp -a "$1" "$1".new.incoming + cat "$1".new > "$1".new.incoming + mv "$1".new.incoming "$1".new + fi + + config "$1".new +} +perms etc/rc.d/rc.g15daemon +perms etc/rc.d/rc.g15daemon.conf diff --git a/misc/g15daemon/g15daemon-1.9.5.3-uinput.patch b/misc/g15daemon/g15daemon-1.9.5.3-uinput.patch new file mode 100644 index 000000000000..f91843281cd4 --- /dev/null +++ b/misc/g15daemon/g15daemon-1.9.5.3-uinput.patch @@ -0,0 +1,35 @@ +Index: g15daemon-1.9.5.3/g15daemon/g15_plugin_uinput.c +=================================================================== +--- g15daemon-1.9.5.3/plugins/g15_plugin_uinput.c ++++ g15daemon-1.9.5.3/plugins/g15_plugin_uinput.c +@@ -125,6 +125,14 @@ + event.value = G15KEY_DOWN; + + write (uinp_fd, &event, sizeof(event)); ++ ++ /* Need to write sync event */ ++ memset(&event, 0, sizeof(event)); ++ event.type = EV_SYN; ++ event.code = SYN_REPORT; ++ event.value = 0; ++ write(uinp_fd, &event, sizeof(event)); ++ + } + + static void g15_uinput_keyup(unsigned char code) +@@ -137,6 +145,14 @@ + event.value = G15KEY_UP; + + write (uinp_fd, &event, sizeof(event)); ++ ++ /* Need to write sync event */ ++ memset(&event, 0, sizeof(event)); ++ event.type = EV_SYN; ++ event.code = SYN_REPORT; ++ event.value = 0; ++ write(uinp_fd, &event, sizeof(event)); ++ + } + + void (*keyup)(unsigned char code) = &g15_uinput_keyup; + diff --git a/misc/g15daemon/g15daemon.SlackBuild b/misc/g15daemon/g15daemon.SlackBuild index 74eac4150b68..52075439c6d9 100644 --- a/misc/g15daemon/g15daemon.SlackBuild +++ b/misc/g15daemon/g15daemon.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for g15daemon -# Copyright (c) 2009 Alan Alberghini <414N@slacky.it> +# Copyright (c) 2011 Alan Alberghini <414N@slacky.it> # All rights reserved. # # Permission to use, copy, modify, and distribute this software for @@ -23,18 +23,15 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. - PRGNAM=g15daemon VERSION=${VERSION:-1.9.5.3} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} -# Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; - # Unless $ARCH is already set, use uname -m for all other archs: *) ARCH=$( uname -m ) ;; esac fi @@ -52,7 +49,7 @@ elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" + SLKCFLAGS="-O2" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" @@ -74,6 +71,10 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +# Patch for uinput to make the Gn keys work under X +# Thanks to Gentoo bugzilla people! +patch -p1 < "$CWD/g15daemon-1.9.5.3-uinput.patch" + CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ @@ -88,18 +89,22 @@ CXXFLAGS="$SLKCFLAGS" \ make install-strip docdir=/usr/doc/$PRGNAM-$VERSION DESTDIR=$PKG -# Install init script +# Install init and configuration script mkdir -p $PKG/etc/rc.d cat $CWD/rc.$PRGNAM > $PKG/etc/rc.d/rc.$PRGNAM.new +cat $CWD/rc.$PRGNAM.conf > $PKG/etc/rc.d/rc.$PRGNAM.conf.new chmod 0755 $PKG/etc/rc.d/rc.$PRGNAM.new +# Install pm-utils hook +mkdir -p $PKG/etc/pm/sleep.d +cat $CWD/51g15hook.sh > $PKG/usr/lib${LIBDIRSUFFIX}/pm-utils/sleep.d/51g15hook +chmod 0755 $PKG/usr/lib${LIBDIRSUFFIX}/pm-utils/sleep.d/51g15hook + cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE -( cd $PKG/usr/man - find . -type f -exec gzip -9 {} \; - for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done -) +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/misc/g15daemon/g15daemon.info b/misc/g15daemon/g15daemon.info index bc586d559c69..1f243c54d321 100644 --- a/misc/g15daemon/g15daemon.info +++ b/misc/g15daemon/g15daemon.info @@ -7,4 +7,4 @@ DOWNLOAD_x86_64="" MD5SUM_x86_64="" MAINTAINER="Alan Alberghini" EMAIL="414N@slacky.it" -APPROVED="rworkman" +APPROVED="dsomero" diff --git a/misc/g15daemon/rc.g15daemon b/misc/g15daemon/rc.g15daemon index 9bf247b83135..b86efa03d476 100644 --- a/misc/g15daemon/rc.g15daemon +++ b/misc/g15daemon/rc.g15daemon @@ -2,7 +2,7 @@ # rc script to start/stop g15daemon. -# Copyright 2009 Alan Alberghini <414N@slacky.it> +# Copyright 2011 Alan Alberghini <414N@slacky.it> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,10 +22,23 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +G15DAEMON_PATH=/usr/sbin/g15daemon +. /etc/rc.d/rc.g15daemon.conf +NUM_PLUGINS=${#PLUGINS[*]} + function start() { echo -n "Starting g15daemon..." - /usr/sbin/g15daemon + "$G15DAEMON_PATH" + if [ $NUM_PLUGINS -gt 0 ] + then + ( sleep 2 # Need a little time for g15daemon to settle + for I in $(seq 0 $NUM_PLUGINS) + do + ${PLUGINS[$I]} ${PLUGIN_PARAMS[$I]} &>/dev/null & + done ) & + fi + echo -ne "Done!\n" } function stop() @@ -34,10 +47,9 @@ function stop() if [ $(pidof g15daemon) ] then /usr/sbin/g15daemon -k - return 0 + echo -ne "Done!\n" else - echo "Failed! g15daemon not running!" - return 1 + echo -ne "Failed! g15daemon not running!\n" fi } diff --git a/misc/g15daemon/rc.g15daemon.conf b/misc/g15daemon/rc.g15daemon.conf new file mode 100644 index 000000000000..e5ca515fb7fc --- /dev/null +++ b/misc/g15daemon/rc.g15daemon.conf @@ -0,0 +1,9 @@ +#!/bin/sh +# Plugin configuration file read by rc.15daemon. +# Put the path to the plugin executable in PLUGINS[n] and command-line parameters in PLUGIN_PARAMS[n]. +# Sample plugin entry for g15stats: +# PLUGINS[0]="/usr/bin/g15stats" +# PLUGIN_PARAMS[0]="-i eth0 -d" + +PLUGINS[0]="" +PLUGIN_PARAMS[0]="" diff --git a/misc/g15daemon/slack-desc b/misc/g15daemon/slack-desc index b1a26e3aa832..67ef5254493b 100644 --- a/misc/g15daemon/slack-desc +++ b/misc/g15daemon/slack-desc @@ -5,13 +5,13 @@ # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. - |----handy-ruler--------------------------------------------------------| + |----handy-ruler--------------------------------------------------------| g15daemon: G15Daemon (G15 keyboard driver) g15daemon: -g15daemon: The G15daemon is a userspace driver/multiplexer for the keyboard -g15daemon: and its LCD, using libg15 for low-level keyboard control. +g15daemon: The G15daemon is a userspace driver/multiplexer for the keyboard and +g15daemon: its LCD, using libg15 for low-level keyboard control. g15daemon: -g15daemon: http://www.g15tools.com +g15daemon: Homepage: http://www.g15tools.com g15daemon: g15daemon: g15daemon: |