misc/cwiid: Updated for version 0.6.00+svn201.

Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
This commit is contained in:
B. Watson 2013-06-26 19:54:07 -03:00 committed by Niels Horn
parent 4451a38cd8
commit f4fc936b4d
12 changed files with 1227 additions and 23 deletions

View file

@ -1,3 +1,12 @@
CWiid is a collection of Linux tools written in C for interfacing to the
Nintendo Wiimote, including an event-based API, an event/mouse/joystick
driver, and GUI/control panel.
To start cwiid's wminput daemon on boot, edit /etc/rc.d/rc.cwiid.conf
if needed (only needed if you have multiple wiimotes), then
"chmod 755 /etc/rc.d/rc.cwiid", and add the following code to
e.g. /etc/rc.d/rc.local:
if [ -x /etc/rc.d/rc.cwiid ]; then
/etc/rc.d/rc.cwiid start
fi

View file

@ -0,0 +1,394 @@
Index: cwiid-0.6.00+svn184.orig/wminput/plugins/Makefile.in
===================================================================
--- cwiid-0.6.00+svn184.orig.orig/wminput/plugins/Makefile.in 2008-06-24 21:43:05.000000000 +0200
+++ cwiid-0.6.00+svn184.orig/wminput/plugins/Makefile.in 2009-03-27 13:15:50.000000000 +0100
@@ -2,7 +2,7 @@
include @top_builddir@/defs.mak
-PLUGINS = ir_ptr acc nunchuk_acc led nunchuk_stick2btn
+PLUGINS = ir_ptr ir_fps acc nunchuk_acc led nunchuk_stick2btn nunchuk_kb
all install clean distclean uninstall: TARGET += $(MAKECMDGOALS)
Index: cwiid-0.6.00+svn184.orig/wminput/plugins/ir_fps/Makefile.in
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ cwiid-0.6.00+svn184.orig/wminput/plugins/ir_fps/Makefile.in 2009-03-27 13:15:50.000000000 +0100
@@ -0,0 +1,15 @@
+#Copyright (C) 2007 L. Donnie Smith
+
+include @top_builddir@/defs.mak
+
+PLUGIN_NAME = ir_fps
+SOURCES = ir_fps.c
+CFLAGS += -I@top_builddir@/wminput -I@top_builddir@/libcwiid
+INST_DIR = $(CWIID_PLUGINS_DIR)
+
+include $(COMMON)/include/plugin.mak
+
+distclean: clean
+ rm Makefile
+
+.PHONY: distclean
Index: cwiid-0.6.00+svn184.orig/wminput/plugins/ir_fps/ir_fps.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ cwiid-0.6.00+svn184.orig/wminput/plugins/ir_fps/ir_fps.c 2009-03-27 13:15:50.000000000 +0100
@@ -0,0 +1,162 @@
+/* Copyright (C) 2007 L. Donnie Smith <cwiidabstrakraft.org>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "wmplugin.h"
+
+#define DEBOUNCE_THRESHOLD 50
+
+//deadzone is a circle of diameter a 10th of the screen
+#define DEADZONE (CWIID_IR_X_MAX*CWIID_IR_X_MAX+CWIID_IR_Y_MAX*CWIID_IR_Y_MAX)/100
+
+//speed is here
+#define XSPEED 10/(CWIID_IR_X_MAX/2)
+#define YSPEED 10/(CWIID_IR_Y_MAX/2)
+
+cwiid_wiimote_t *wiimote;
+
+static struct wmplugin_info info;
+static struct wmplugin_data data;
+
+wmplugin_info_t wmplugin_info;
+wmplugin_init_t wmplugin_init;
+wmplugin_exec_t wmplugin_exec;
+
+struct wmplugin_info *wmplugin_info() {
+ static unsigned char info_init = 0;
+
+ if (!info_init) {
+ info.button_count = 0;
+ info.axis_count = 2;
+ info.axis_info[0].name = "X";
+ info.axis_info[0].type = WMPLUGIN_REL;
+ info.axis_info[0].max = CWIID_IR_X_MAX;
+ info.axis_info[0].min = 0;
+ info.axis_info[0].fuzz = 0;
+ info.axis_info[0].flat = 0;
+ info.axis_info[1].name = "Y";
+ info.axis_info[1].type = WMPLUGIN_REL;
+ info.axis_info[1].max = CWIID_IR_Y_MAX;
+ info.axis_info[1].min = 0;
+ info.axis_info[1].fuzz = 0;
+ info.axis_info[1].flat = 0;
+ info.param_count = 0;
+ info_init = 1;
+ }
+ return &info;
+}
+
+int wmplugin_init(int id, cwiid_wiimote_t *arg_wiimote)
+{
+ wiimote = arg_wiimote;
+
+ data.buttons = 0;
+
+ if (wmplugin_set_rpt_mode(id, CWIID_RPT_IR)) {
+ return -1;
+ }
+
+ return 0;
+}
+
+struct wmplugin_data *wmplugin_exec(int mesg_count, union cwiid_mesg mesg[])
+{
+ static int src_index = -1;
+ static int debounce = 0;
+ static uint8_t old_flag;
+
+ int i;
+ uint8_t flag;
+ struct cwiid_ir_mesg *ir_mesg;
+ int dx, dy;
+
+ ir_mesg = NULL;
+ for (i=0; i < mesg_count; i++) {
+ if (mesg[i].type == CWIID_MESG_IR) {
+ ir_mesg = &mesg[i].ir_mesg;
+ }
+ }
+
+ if (!ir_mesg) {
+ return NULL;
+ }
+
+ /* invalidate src index if source is no longer present */
+ if ((src_index != -1) && !ir_mesg->src[src_index].valid) {
+ if (debounce > DEBOUNCE_THRESHOLD) {
+ src_index = -1;
+ }
+ else {
+ debounce++;
+ }
+ }
+ else {
+ debounce = 0;
+ }
+
+ /* of not set, pick largest available source */
+ if (src_index == -1) {
+ for (i=0; i < CWIID_IR_SRC_COUNT; i++) {
+ if (ir_mesg->src[i].valid) {
+ if ((src_index == -1) ||
+ (ir_mesg->src[i].size > ir_mesg->src[src_index].size)) {
+ src_index = i;
+ }
+ }
+ }
+ }
+
+ /* LEDs */
+ switch (src_index) {
+ case 0:
+ flag = CWIID_LED1_ON;
+ break;
+ case 1:
+ flag = CWIID_LED2_ON;
+ break;
+ case 2:
+ flag = CWIID_LED3_ON;
+ break;
+ case 3:
+ flag = CWIID_LED4_ON;
+ break;
+ default:
+ flag = 0;
+ break;
+ }
+ if (flag != old_flag) {
+ cwiid_set_led(wiimote, flag);
+ old_flag = flag;
+ }
+
+ if ((src_index == -1) || !ir_mesg->src[src_index].valid) {
+ data.axes[0].valid = data.axes[1].valid = 0;
+ }
+ else {
+ data.axes[0].valid = data.axes[1].valid = 1;
+ dx = CWIID_IR_X_MAX/2 - ir_mesg->src[src_index].pos[CWIID_X];
+ dy = ir_mesg->src[src_index].pos[CWIID_Y] - CWIID_IR_Y_MAX/2;
+ if (dx*dx+dy*dy > DEADZONE){
+ data.axes[0].value = dx*XSPEED;
+ data.axes[1].value = dy*YSPEED;
+ }else {
+ data.axes[0].value = 0;
+ data.axes[1].value = 0;
+ }
+ }
+ return &data;
+}
Index: cwiid-0.6.00+svn184.orig/wminput/plugins/nunchuk_kb/Makefile.in
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ cwiid-0.6.00+svn184.orig/wminput/plugins/nunchuk_kb/Makefile.in 2009-03-27 13:15:50.000000000 +0100
@@ -0,0 +1,16 @@
+#Copyright (C) 2007 L. Donnie Smith
+
+include @top_builddir@/defs.mak
+
+PLUGIN_NAME = nunchuk_kb
+SOURCES = nunchuk_kb.c
+CFLAGS += -I@top_builddir@/wminput -I@top_builddir@/libcwiid
+LDLIBS += -lm
+INST_DIR = $(CWIID_PLUGINS_DIR)
+
+include $(COMMON)/include/plugin.mak
+
+distclean: clean
+ rm Makefile
+
+.PHONY: distclean
Index: cwiid-0.6.00+svn184.orig/wminput/plugins/nunchuk_kb/nunchuk_kb.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ cwiid-0.6.00+svn184.orig/wminput/plugins/nunchuk_kb/nunchuk_kb.c 2009-03-27 13:15:50.000000000 +0100
@@ -0,0 +1,116 @@
+/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <math.h>
+
+#include "wmplugin.h"
+
+/* Button flags */
+#define STICK_KEY_UP 0x0001
+#define STICK_KEY_DOWN 0x0002
+#define STICK_KEY_RIGHT 0x0004
+#define STICK_KEY_LEFT 0x0008
+#define STICK_MID_VAL 128
+#define STICK_NEUTRAL 20
+
+static unsigned char info_init = 0;
+static struct wmplugin_info info;
+static struct wmplugin_data data;
+
+static cwiid_wiimote_t *wiimote;
+
+static struct acc_cal acc_cal;
+static int plugin_id;
+
+wmplugin_info_t wmplugin_info;
+wmplugin_init_t wmplugin_init;
+wmplugin_exec_t wmplugin_exec;
+static void process_nunchuk(struct cwiid_nunchuk_mesg *mesg);
+
+static float Roll_Scale = 1.0;
+static float Pitch_Scale = 1.0;
+static float X_Scale = 1.0;
+static float Y_Scale = 1.0;
+
+struct wmplugin_info *wmplugin_info() {
+ if (!info_init) {
+ info.button_count = 4;
+ info.button_info[0].name = "Up";
+ info.button_info[1].name = "Down";
+ info.button_info[2].name = "Right";
+ info.button_info[3].name = "Left";
+ info.axis_count = 0;
+ info_init = 1;
+ }
+ return &info;
+}
+
+int wmplugin_init(int id, cwiid_wiimote_t *arg_wiimote)
+{
+ plugin_id = id;
+ wiimote = arg_wiimote;
+ data.buttons = 0;
+ data.axes[0].valid = 1;
+ data.axes[1].valid = 1;
+ if (wmplugin_set_rpt_mode(id, CWIID_RPT_STATUS | CWIID_RPT_NUNCHUK)) {
+ return -1;
+ }
+
+ return 0;
+}
+
+struct wmplugin_data *wmplugin_exec(int mesg_count, union cwiid_mesg mesg[])
+{
+ int i;
+ enum cwiid_ext_type ext_type = CWIID_EXT_NONE;
+ struct wmplugin_data *ret = NULL;
+
+ for (i=0; i < mesg_count; i++) {
+ switch (mesg[i].type) {
+ case CWIID_MESG_STATUS:
+ if ((mesg[i].status_mesg.ext_type == CWIID_EXT_NUNCHUK) &&
+ (ext_type != CWIID_EXT_NUNCHUK)) {
+ if (cwiid_get_acc_cal(wiimote, CWIID_EXT_NUNCHUK, &acc_cal)) {
+ wmplugin_err(plugin_id, "calibration error");
+ }
+ }
+ ext_type = mesg[i].status_mesg.ext_type;
+ break;
+ case CWIID_MESG_NUNCHUK:
+ process_nunchuk(&mesg[i].nunchuk_mesg);
+ ret = &data;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return ret;
+}
+
+static void process_nunchuk(struct cwiid_nunchuk_mesg *mesg)
+{
+ double stx=(double)mesg->stick[CWIID_X];
+ double sty=(double)mesg->stick[CWIID_Y];
+ data.buttons=0;
+ if (sty > STICK_MID_VAL+STICK_NEUTRAL) data.buttons |= STICK_KEY_UP;
+ if (sty < STICK_MID_VAL-STICK_NEUTRAL) data.buttons |= STICK_KEY_DOWN;
+ if (stx > STICK_MID_VAL+STICK_NEUTRAL) data.buttons |= STICK_KEY_RIGHT;
+ if (stx < STICK_MID_VAL-STICK_NEUTRAL) data.buttons |= STICK_KEY_LEFT;
+}
+
Index: cwiid-0.6.00+svn184.orig/wminput/configs/fps_config
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ cwiid-0.6.00+svn184.orig/wminput/configs/fps_config 2009-03-27 13:15:50.000000000 +0100
@@ -0,0 +1,32 @@
+# Fps config for wminput by kyrlian
+# needs plugins ir_fps and nunchuk_kb
+# available from http://kyrlian.free.fr/binaries/cwiid/latest/
+# wminput source and info at http://abstrakraft.org/cwiid/
+
+# IR for mouse REL - fps style
+Plugin.ir_fps.X = REL_X
+Plugin.ir_fps.Y = REL_Y
+
+#custom buttons
+Wiimote.A = BTN_LEFT
+Wiimote.B = BTN_RIGHT
+Wiimote.Up = KEY_UP
+Wiimote.Down = KEY_DOWN
+Wiimote.Left = KEY_LEFT
+Wiimote.Right = KEY_RIGHT
+Wiimote.Minus = KEY_PAGEDOWN
+Wiimote.Plus = KEY_PAGEUP
+Wiimote.Home = KEY_ESC
+
+Wiimote.1 = KEY_TAB
+Wiimote.2 = KEY_ESC
+
+Nunchuk.C = KEY_C
+Nunchuk.Z = KEY_SPACE
+
+#plugin for nunchuk stick
+Plugin.nunchuk_kb.Up = KEY_W
+Plugin.nunchuk_kb.Down = KEY_S
+Plugin.nunchuk_kb.Left = KEY_A
+Plugin.nunchuk_kb.Right = KEY_D
+
Index: cwiid-0.6.00+svn184.orig/configure.ac
===================================================================
--- cwiid-0.6.00+svn184.orig.orig/configure.ac 2008-06-24 21:43:05.000000000 +0200
+++ cwiid-0.6.00+svn184.orig/configure.ac 2009-03-27 13:15:50.000000000 +0100
@@ -142,8 +142,10 @@
[wminput/Makefile]
[wminput/plugins/Makefile]
[wminput/plugins/ir_ptr/Makefile]
+ [wminput/plugins/ir_fps/Makefile]
[wminput/plugins/acc/Makefile]
[wminput/plugins/nunchuk_acc/Makefile]
+ [wminput/plugins/nunchuk_kb/Makefile]
[wminput/plugins/led/Makefile]
[wminput/plugins/nunchuk_stick2btn/Makefile]
[lswm/Makefile]

View file

@ -1,11 +0,0 @@
--- cwiid-0.6.00.orig/libcwiid/bluetooth.c.old 2008-09-30 16:52:55.000000000 -0500
+++ cwiid-0.6.00.orig/libcwiid/bluetooth.c 2008-09-30 16:53:19.000000000 -0500
@@ -122,7 +122,7 @@
}
/* timeout (10000) in milliseconds */
- if (hci_remote_name(sock, &dev_list[i].bdaddr, BT_NAME_LEN,
+ if (hci_read_remote_name(sock, &dev_list[i].bdaddr, BT_NAME_LEN,
(*bdinfo)[bdinfo_count].name, 10000)) {
cwiid_err(NULL, "Bluetooth name read error");
err = 1;

View file

@ -1,13 +1,22 @@
#!/bin/sh
#!/bin/bash
# Slackware build script for cwiid
# Written by B. Watson (yalhcru@gmail.com)
# Licensed under the WTFPL. See http://sam.zoy.org/wtfpl/ for details.
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20130318 bkw:
# - Upgraded from 0.6.00 to 0.6.00+svn201
# - Added init script
# - Added lswm man page
# - Added .desktop and icon
# - Removed bluez4 API patch (no longer needed)
# - Fixed permissions of config files and header
# - Added ir_fps and nunchuk_kb plugins
PRGNAM=cwiid
VERSION=${VERSION:-0.6.00}
VERSION=${VERSION:-0.6.00+svn201}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
@ -44,7 +53,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG/usr $PKG/etc $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tgz
tar xvf $CWD/${PRGNAM}_$VERSION.orig.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find . \
@ -53,10 +62,17 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
# Patch against newer bluez
patch -p1 < $CWD/bluez_4_api_changes.patch
# Underlinking fix (add -lbluetooth)
patch -p1 < $CWD/bluetooth-linker.patch
# Add ir_fps and nunchuk_kb plugins (patch comes from Debian)
patch -p1 < $CWD/"add_other_plugins_#487498.patch"
autoreconf -if
# ./configure --help documents this option, but it's not actually recognized:
# --disable-ldconfig
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
@ -65,14 +81,17 @@ CXXFLAGS="$SLKCFLAGS" \
--sysconfdir=/etc \
--localstatedir=/var \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--disable-ldconfig \
--mandir=/usr/man \
--build=$ARCH-slackware-linux
make
make install DESTDIR=$PKG
# Remove static library.
# Config and include files get installed +x, fix
find $PKG/etc/cwiid/wminput/ -maxdepth 1 -a -type f | xargs chmod 644
chmod 644 $PKG/usr/include/*.h
# Remove static library, configure doesn't accept --disable-static
rm -f $PKG/usr/lib$LIBDIRSUFFIX/libcwiid.a
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
@ -80,12 +99,29 @@ find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
find $PKG/usr/man -type f -exec gzip -9 {} \;
# lswm man page borrowed from Debian
gzip -9c $CWD/lswm.1 > $PKG/usr/man/man1/lswm.1.gz
# icon borrowed from Debian
mkdir -p $PKG/usr/share/pixmaps
cat $CWD/wmgui.xpm > $PKG/usr/share/pixmaps/wmgui.xpm
# .desktop borrowed from Debian and fixed so it validates
mkdir -p $PKG/usr/share/applications
cat $CWD/wmgui.desktop > $PKG/usr/share/applications/wmgui.desktop
# init script written for this build
mkdir -p $PKG/etc/rc.d/
cat $CWD/rc.cwiid.new > $PKG/etc/rc.d/rc.cwiid.new
cat $CWD/rc.cwiid.conf.new > $PKG/etc/rc.d/rc.cwiid.conf.new
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS COPYING ChangeLog NEWS README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

View file

@ -1,8 +1,8 @@
PRGNAM="cwiid"
VERSION="0.6.00"
VERSION="0.6.00+svn201"
HOMEPAGE="http://abstrakraft.org/cwiid/"
DOWNLOAD="http://abstrakraft.org/cwiid/downloads/cwiid-0.6.00.tgz"
MD5SUM="8d574afdeedc5e5309c87a72d744316a"
DOWNLOAD="http://ftp.debian.org/debian/pool/main/c/cwiid/cwiid_0.6.00+svn201.orig.tar.gz"
MD5SUM="a57605bba039dd2d4460574574f950e7"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""

31
misc/cwiid/doinst.sh Normal file
View file

@ -0,0 +1,31 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
preserve_perms() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ -e $OLD ]; then
cp -a $OLD ${NEW}.incoming
cat $NEW > ${NEW}.incoming
mv ${NEW}.incoming $NEW
fi
config $NEW
}
preserve_perms etc/rc.d/rc.cwiid.new
config etc/rc.d/rc.cwiid.conf.new
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi

54
misc/cwiid/lswm.1 Normal file
View file

@ -0,0 +1,54 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH LSWM 1 "janvier 18, 2007"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
lswm \- discover new wiimotes
.SH SYNOPSIS
.B lswm
.RI [ options ]
.br
.SH DESCRIPTION
This manual page documents briefly the
.B lswm
command.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
.SH OPTIONS
.TP
.B \-h
Show summary of options.
.TP
.B \-a
List all bluetooth devices (not just wiimotes)
.TP
.B \-l
Long format (device details)
.TP
.B \-q
Quiet mode
.SH SEE ALSO
.BR wminput (1),
.BR wmgui (1),
.br
.SH AUTHOR
wmgui was written by L. Donnie Smith <cwiid@abstrakraft.org>
.PP
This manual page was written by Romain Beauxis <toots@rastageeks.org>,
for the Debian project (but may be used by others).

View file

@ -0,0 +1,39 @@
# rc.cwiid.conf - config file for rc.cwiid (part of cwiid package)
# This file is similar to rc.inet1.conf: you define your wiimotes here,
# and rc.cwiid reads this file and starts wminput daemons as needed.
# Each wiimote section looks like this:
# WIIMOTE[0]="[bluetooth address or 'auto']"
# WIIMOTE_CONF[0]="[config file or 'default']"
# the WIIMOTE_CONF files are found in /etc/cwiid/wminput
# If you only have one wiimote, you can just say WIIMOTE[0]="auto"
# and it should work fine. However, if you have more than one, you'll
# have to specify the Bluetooth device addresses for all of them.
# If this file is missing, the default config looks like:
# WIIMOTE[0]="auto"
# WIIMOTE_CONF[0]="default"
# If this file is present, but contains no WIIMOTE[] definitions, no
# wminput daemons will be started.
# Configuration begins here - uncomment and edit as needed:
WIIMOTE[0]="auto"
WIIMOTE_CONF[0]="default"
# WIIMOTE[1]="some-bluetooth-addr"
# WIIMOTE_CONF[1]="default"
# WIIMOTE[2]="some-bluetooth-addr"
# WIIMOTE_CONF[2]="default"
# WIIMOTE[3]="some-bluetooth-addr"
# WIIMOTE_CONF[3]="default"
# (you can add up to WIIMOTE[9], below)

89
misc/cwiid/rc.cwiid.new Normal file
View file

@ -0,0 +1,89 @@
#!/bin/sh
# RC script for cwiid's wminput daemon, part of the SBo cwiid package.
# Where's the config file for this script? This is the only variable that can't
# be overridden in the config file.
RC_CONF=/etc/rc.d/rc.cwiid.conf
####
# Override this stuff in $RC_CONF if you see a need to:
# Default config file for wminput instances
WMINPUT_DEFAULT_CONF=default
# full path to wminput binary:
WMINPUT_BIN=/usr/bin/wminput
# probably nobody will ever need to increase this:
MAX_WIIMOTES=9
####
start_cwiid() {
local cwiid_conf
local cwiid_addr
local cmd
local daemons
echo "Starting cwiid wminput daemon(s)..."
# Guarantee the uinput module gets loaded, don't complain if not
# (it may not be modular in the running kernel)
/sbin/modprobe uinput &>/dev/null
# WIIMOTE is a bash array, will be populated by config file or default conf
unset WIIMOTE
if [ -r "$RC_CONF" ]; then
source $RC_CONF
else
echo -e "$RC_CONF missing, using defaults:\\n\\tWIIMOTE[0]='auto'\\n\\tWIIMOTE_CONF[0]='$WMINPUT_DEFAULT_CONF'" 1>&2
WIIMOTE[0]=auto
fi
i=0
daemons=0
while [ $i -le $MAX_WIIMOTES ]; do
if [ -n "${WIIMOTE[$i]}" ]; then
cwiid_conf="${WIIMOTE_CONF[$i]:-$WMINPUT_DEFAULT_CONF}"
cwiid_addr=${WIIMOTE[$i]}
if [ "$cwiid_addr" = "auto" ]; then
cwiid_addr=""
fi
cmd="$WMINPUT_BIN -d -c $cwiid_conf $cwiid_addr"
echo " Starting daemon: $cmd"
$cmd &
daemons=$((daemons+1))
fi
i=$((i+1))
done
echo "cwiid startup done, $daemons daemons started"
}
stop_cwiid() {
echo -n "Stopping cwiid wminput daemon(s)..."
killall wminput &>/dev/null
sleep 2
killall -9 wminput &>/dev/null
echo "done"
}
case "$1" in
start) start_cwiid ;;
stop) stop_cwiid ;;
restart)
stop_cwiid
sleep 1
start_cwiid
;;
*)
echo "Usage: $0 start|stop|restart" 1>&2
exit 1
;;
esac
exit 0

View file

@ -6,7 +6,7 @@
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
cwiid: CWiid (Tools for the Nintendo Wii Remote)
cwiid: cwiid (tools for the Nintendo Wii remote)
cwiid:
cwiid: CWiid is a collection of Linux tools written in C for
cwiid: interfacing to the Nintendo Wiimote, including an event

11
misc/cwiid/wmgui.desktop Normal file
View file

@ -0,0 +1,11 @@
[Desktop Entry]
Name=Wmgui
GenericName=Graphical user interface to the wiimote
GenericName[fr]=Interface graphique pour la wiimote
Comment=Simple GTK gui to the wiimote to test and display the wiimote data.
Comment[fr]=Simple interface graphique pour la wiimote pour tester et afficher les informations de la wiimote.
Exec=wmgui
Icon=wmgui
Terminal=false
Type=Application
Categories=Utility;HardwareSettings;Settings;

552
misc/cwiid/wmgui.xpm Normal file
View file

@ -0,0 +1,552 @@
/* XPM */
static char * wmgui_xpm[] = {
"39 45 504 2",
" c None",
". c #010C2D",
"+ c #000B2B",
"@ c #000C2B",
"# c #000B2A",
"$ c #000C2A",
"% c #000B29",
"& c #000A29",
"* c #000C30",
"= c #000B2E",
"- c #000A2D",
"; c #000A2B",
"> c #000A2A",
", c #000B2D",
"' c #000D2F",
") c #000F35",
"! c #000D33",
"~ c #000C31",
"{ c #000B30",
"] c #000C2E",
"^ c #000C2D",
"/ c #000B2C",
"( c #000D32",
"_ c #010F35",
": c #00153C",
"< c #001139",
"[ c #001037",
"} c #000E35",
"| c #000E34",
"1 c #000D31",
"2 c #000C2C",
"3 c #000C2F",
"4 c #000D34",
"5 c #001138",
"6 c #001840",
"7 c #00153E",
"8 c #00133C",
"9 c #00123A",
"0 c #001038",
"a c #000F37",
"b c #030F31",
"c c #71737A",
"d c #B0B0B1",
"e c #B8B8B8",
"f c #BCBCBC",
"g c #BDBDBD",
"h c #BEBEBE",
"i c #BFBFBF",
"j c #A4A5A7",
"k c #2A3145",
"l c #000F36",
"m c #00143C",
"n c #001C45",
"o c #001943",
"p c #001741",
"q c #00163F",
"r c #00143D",
"s c #00123C",
"t c #646872",
"u c #E5E5E6",
"v c #E5DDDF",
"w c #DBD8D9",
"x c #F5F5F5",
"y c #F6F6F6",
"z c #F8F8F8",
"A c #F9F9F9",
"B c #FAFAFA",
"C c #DCDCDC",
"D c #081432",
"E c #00123B",
"F c #001841",
"G c #01214B",
"H c #001D48",
"I c #001B46",
"J c #001A44",
"K c #001842",
"L c #001742",
"M c #001640",
"N c #A1A1A1",
"O c #E8E8E8",
"P c #DBD4D5",
"Q c #DCD7D8",
"R c #F7F7F7",
"S c #F4F4F4",
"T c #293449",
"U c #001C46",
"V c #00214C",
"W c #00204B",
"X c #001F49",
"Y c #001E48",
"Z c #001D47",
"` c #001C47",
" . c #9D9D9D",
".. c #EFEFEF",
"+. c #EBEBEB",
"@. c #EDEDED",
"#. c #D7D7D7",
"$. c #D1D1D1",
"%. c #2A374D",
"&. c #001A46",
"*. c #001B45",
"=. c #001E49",
"-. c #00244E",
";. c #00234E",
">. c #00224D",
",. c #00214D",
"'. c #00214E",
"). c #00204D",
"!. c #F2F2F2",
"~. c #F1F1F1",
"{. c #B9B9B9",
"]. c #2A3A50",
"^. c #00204C",
"/. c #01254F",
"(. c #00244F",
"_. c #002550",
":. c #002551",
"<. c #002652",
"[. c #002653",
"}. c #002753",
"|. c #002754",
"1. c #002755",
"2. c #002654",
"3. c #D6D6D6",
"4. c #C1C1C1",
"5. c #E2E2E2",
"6. c #D0D0D0",
"7. c #2A3D54",
"8. c #002552",
"9. c #002450",
"0. c #00224C",
"a. c #002956",
"b. c #002B58",
"c. c #002C5A",
"d. c #002D5B",
"e. c #002D5C",
"f. c #002D5E",
"g. c #002C5C",
"h. c #D9D9D9",
"i. c #CBCBCB",
"j. c #E1E1E1",
"k. c #E4E4E4",
"l. c #D4D4D4",
"m. c #2A4058",
"n. c #002C5B",
"o. c #002B59",
"p. c #002A58",
"q. c #002854",
"r. c #00204A",
"s. c #002F5E",
"t. c #003261",
"u. c #003363",
"v. c #003465",
"w. c #003466",
"x. c #003364",
"y. c #F3F3F3",
"z. c #CACACA",
"A. c #2A435C",
"B. c #003365",
"C. c #003263",
"D. c #003262",
"E. c #00305F",
"F. c #002E5C",
"G. c #002855",
"H. c #003463",
"I. c #003868",
"J. c #003A6C",
"K. c #003C6E",
"L. c #003C6F",
"M. c #003B6D",
"N. c #DFDFDF",
"O. c #2A4760",
"P. c #003A6D",
"Q. c #00396A",
"R. c #003666",
"S. c #003362",
"T. c #002957",
"U. c #003160",
"V. c #003767",
"W. c #004173",
"X. c #004376",
"Y. c #004478",
"Z. c #CDCDCD",
"`. c #D3D3D3",
" + c #2A4B65",
".+ c #004174",
"++ c #003F71",
"@+ c #003B6C",
"#+ c #004578",
"$+ c #004A7D",
"%+ c #004D81",
"&+ c #004D7F",
"*+ c #C9C9C9",
"=+ c #D2D2D2",
"-+ c #2A506A",
";+ c #004B7F",
">+ c #00487C",
",+ c #003E70",
"'+ c #003769",
")+ c #003161",
"!+ c #001944",
"~+ c #001C48",
"{+ c #00214F",
"]+ c #002D5D",
"^+ c #00396C",
"/+ c #004F82",
"(+ c #005588",
"_+ c #005888",
":+ c #2A556E",
"<+ c #005386",
"[+ c #00467A",
"}+ c #003F72",
"|+ c #00386A",
"1+ c #003162",
"2+ c #002B5B",
"3+ c #002554",
"4+ c #001B47",
"5+ c #011943",
"6+ c #001641",
"7+ c #001844",
"8+ c #001C49",
"9+ c #002150",
"0+ c #002757",
"a+ c #004175",
"b+ c #004A7E",
"c+ c #005C8D",
"d+ c #006290",
"e+ c #CFCFCF",
"f+ c #F0F0F0",
"g+ c #2A5A71",
"h+ c #005A8C",
"i+ c #005184",
"j+ c #004073",
"k+ c #00386B",
"l+ c #003163",
"m+ c #002B5C",
"n+ c #002655",
"o+ c #00204E",
"p+ c #001B48",
"q+ c #001843",
"r+ c #001541",
"s+ c #001845",
"t+ c #001C4A",
"u+ c #002151",
"v+ c #002758",
"w+ c #002D5F",
"x+ c #003366",
"y+ c #003A6E",
"z+ c #004276",
"A+ c #005688",
"B+ c #006291",
"C+ c #006B95",
"D+ c #2A5E74",
"E+ c #005F8F",
"F+ c #005486",
"G+ c #00497D",
"H+ c #004074",
"I+ c #00386C",
"J+ c #003164",
"K+ c #002B5D",
"L+ c #002556",
"M+ c #00204F",
"N+ c #001B49",
"O+ c #001744",
"P+ c #011843",
"Q+ c #001642",
"R+ c #001C4B",
"S+ c #002152",
"T+ c #002659",
"U+ c #002C60",
"V+ c #003267",
"W+ c #003A6F",
"X+ c #004377",
"Y+ c #004D80",
"Z+ c #005989",
"`+ c #006693",
" @ c #007198",
".@ c #2A6075",
"+@ c #006390",
"@@ c #005687",
"#@ c #004B7E",
"$@ c #004075",
"%@ c #00386D",
"&@ c #003165",
"*@ c #002B5E",
"=@ c #002557",
"-@ c #002050",
";@ c #011B45",
">@ c #001643",
",@ c #001846",
"'@ c #001B4C",
")@ c #002053",
"!@ c #002559",
"~@ c #002B60",
"{@ c #003268",
"]@ c #003A70",
"^@ c #004F81",
"/@ c #005C8A",
"(@ c #006994",
"_@ c #007499",
":@ c #D8D8D8",
"<@ c #1D5468",
"[@ c #006691",
"}@ c #005887",
"|@ c #004C7E",
"1@ c #003065",
"2@ c #002A5E",
"3@ c #002457",
"4@ c #001F51",
"5@ c #001A4A",
"6@ c #001745",
"7@ c #001847",
"8@ c #001B4D",
"9@ c #001F53",
"0@ c #002459",
"a@ c #002B61",
"b@ c #003B70",
"c@ c #005181",
"d@ c #005D8A",
"e@ c #006B94",
"f@ c #00769A",
"g@ c #DADADA",
"h@ c #C2C2C2",
"i@ c #BBC2C7",
"j@ c #AABAC6",
"k@ c #ACACAC",
"l@ c #C5C5C5",
"m@ c #C3C3C3",
"n@ c #195164",
"o@ c #006792",
"p@ c #005A88",
"q@ c #004E7F",
"r@ c #00386E",
"s@ c #003066",
"t@ c #00295E",
"u@ c #002357",
"v@ c #001E51",
"w@ c #001A4B",
"x@ c #00245A",
"y@ c #004679",
"z@ c #005281",
"A@ c #005E8B",
"B@ c #00779A",
"C@ c #E5E5E5",
"D@ c #C7C7C7",
"E@ c #D5D5D5",
"F@ c #CBCED0",
"G@ c #B4BDC4",
"H@ c #DDDDDD",
"I@ c #00396E",
"J@ c #00285F",
"K@ c #002258",
"L@ c #001D51",
"M@ c #001743",
"N@ c #001945",
"O@ c #003269",
"P@ c #005282",
"Q@ c #00779B",
"R@ c #ECECEC",
"S@ c #011B46",
"T@ c #00255A",
"U@ c #003368",
"V@ c #005D8B",
"W@ c #006A94",
"X@ c #EEEEEE",
"Y@ c #E4E5E8",
"Z@ c #E1E3E6",
"`@ c #EAEBEC",
" # c #195064",
".# c #005988",
"+# c #004D7E",
"@# c #001C4C",
"## c #002153",
"$# c #005B8A",
"%# c #006894",
"&# c #007399",
"*# c #E9E9EB",
"=# c #D6D7DB",
"-# c #C9CACE",
";# c #E6E7EA",
"># c #194F64",
",# c #006591",
"'# c #001F50",
")# c #002759",
"!# c #002D60",
"~# c #003367",
"{# c #003B6F",
"]# c #005889",
"^# c #006592",
"/# c #006D96",
"(# c #E9E9EA",
"_# c #DBDCDF",
":# c #D0D1D4",
"<# c #E5E6E9",
"[# c #194D63",
"}# c #00618F",
"|# c #005586",
"1# c #001A49",
"2# c #001D4B",
"3# c #002251",
"4# c #002858",
"5# c #002E5F",
"6# c #003467",
"7# c #004277",
"8# c #005587",
"9# c #9B9B9B",
"0# c #DBDCE0",
"a# c #D1D2D6",
"b# c #194A61",
"c# c #005D8D",
"d# c #005285",
"e# c #001D4A",
"f# c #002250",
"g# c #002857",
"h# c #002E5E",
"i# c #004275",
"j# c #005084",
"k# c #005789",
"l# c #005A89",
"m# c #999999",
"n# c #E8E9EB",
"o# c #19455E",
"p# c #004E82",
"q# c #00477B",
"r# c #003F73",
"s# c #002555",
"t# c #001A45",
"u# c #001D49",
"v# c #00224F",
"w# c #002856",
"x# c #002E5D",
"y# c #003464",
"z# c #004E80",
"A# c #19405A",
"B# c #003E71",
"C# c #00376A",
"D# c #00224E",
"E# c #003869",
"F# c #003E6F",
"G# c #004579",
"H# c #004477",
"I# c #193B55",
"J# c #003768",
"K# c #003565",
"L# c #003969",
"M# c #003C70",
"N# c #003B6E",
"O# c #E9E9E9",
"P# c #193751",
"Q# c #003D71",
"R# c #003D70",
"S# c #002A57",
"T# c #003567",
"U# c #EAEAEA",
"V# c #19334C",
"W# c #003668",
"X# c #003566",
"Y# c #00234F",
"Z# c #002C5D",
"`# c #E3E3E3",
" $ c #192F48",
".$ c #002F60",
"+$ c #00214B",
"@$ c #002756",
"#$ c #E7E7E7",
"$$ c #B7B7B7",
"%$ c #192C44",
"&$ c #002451",
"*$ c #192940",
"=$ c #01244F",
"-$ c #989898",
";$ c #E4EAED",
">$ c #EAECEC",
",$ c #19263D",
"'$ c #001F4A",
")$ c #011F49",
"!$ c #898989",
"~$ c #E6E6E6",
"{$ c #B6B6B6",
"]$ c #131F36",
"^$ c #001B44",
"/$ c #353A45",
"($ c #E0E0E0",
"_$ c #717171",
":$ c #011032",
"<$ c #001740",
"[$ c #00173F",
"}$ c #00133B",
"|$ c #000F33",
"1$ c #242A38",
"2$ c #56575B",
"3$ c #5E6062",
"4$ c #5F6063",
"5$ c #5D5E61",
"6$ c #43454C",
"7$ c #09132D",
"8$ c #00143B",
"9$ c #000E33",
"0$ c #000E36",
"a$ c #000B2F",
"b$ c #000C32",
"c$ c #011137",
"d$ c #000A2C",
"e$ c #010B2D",
" ",
" . + @ @ # $ $ % & ",
" * = - ; > > & & & & > ; , ' ",
" ) ! ~ { ] ^ ^ , , / / , , , = * ( _ ",
" : < [ } | ! ( 1 ^ ^ ^ ^ 2 2 3 1 1 ( 4 ) 5 ",
" 6 7 8 9 < 0 a b c d e f g h i j k ) l a 0 9 m ",
" n o p q 7 r 8 s t u v w x y z A B C D E E 8 r q F ",
" G H I J o K L p M N O P Q x y R A B S T M M p p K J U ",
" V W X Y Z ` ` ` I ...+.@.#.$.R A B S %.&.*.*.I U Z =.W ",
" -.;.;.>.>.,.,.,.'.). ...!.~.$.{.S z B S ].).^.W W W W V >./. ",
" -.(._.:.<.<.[.}.|.1.2. ...3.4.5.@.i 6.B S 7.2.[.8.:._.9.(.(.-. ",
" 0.;.:.|.a.b.c.d.e.f.g. ...h.i.j.k.l.l.B S m.g.n.o.p.a.q.<.9.;.>. ",
" X r.>.:.a.c.s.t.u.v.w.x. ...!.y.z.g !.A B S A.B.C.D.E.F.o.G.9.>.W ",
" Z =.,.8.p.s.H.I.J.K.L.M. ...!.y.5.N.R A B S O.P.J.Q.R.S.F.T.:.V =.Y ",
" *.H ,.[.o.U.V.K.W.X.Y.X. ...!.!.Z.`.y A B S +X..+++@+R.E.p.8.^.H I ",
" K J H '.2.n.S.Q.++#+$+%+&+ ...!.z.*+`.=+A B S -+;+>+X.,+'+)+o.8.^.` J ",
" p !+~+{+1.]+x.^+.+>+/+(+_+ ...!.i.6.6.6.A B S :+<+%+[+}+|+1+2+3+).4+o 5+ ",
" 6+7+8+9+0+f.B.P.a+b+<+c+d+ ...!.+.$.e+f+A B S g+h+i+>+j+k+l+m+n+o+p+q+6+ ",
" r+s+t+u+v+w+x+y+z+;+A+B+C+ ...!.y.x y R A B S D+E+F+G+H+I+J+K+L+M+N+O+6+ ",
" P+Q+s+R+S+T+U+V+W+X+Y+Z+`+ @ ...!.y.x y R A B S .@+@@@#@$@%@&@*@=@-@N+O+Q+ ",
" ;@>@,@'@)@!@~@{@]@Y.^@/@(@_@ ...+.!.!.f+R ~.z :@<@[@}@|@a+%@1@2@3@4@5@6@7+ ",
" !+>@7@8@9@0@a@{@b@#+c@d@e@f@ .g@h@z.i@j@3.k@l@m@n@o@p@q@z+r@s@t@u@v@w@6@O+` ",
" q+>@7@8@9@x@a@{@b@y@z@A@e@B@ .C@D@E@F@G@H@{.=+m@n@o@p@q@X.I@s@J@K@L@w@6@M@N@",
" J >@7@8@9@x@a@O@b@y@P@A@C+Q@ ...!.y.f+R@R@R@R@m@n@o@p@q@X.I@s@J@K@L@w@6@O+` ",
" S@>@,@8@)@T@a@U@b@#+c@V@W@f@ ...!.X@Y@Z@`@R@R@m@ #[@.#+#z+%@s@t@u@v@5@6@7+ ",
" o >@,@@###T+U+U@b@Y.^@$#%#&# ...X@*#=#-#;#R@R@m@>#,#}@|@a+%@1@2@3@'#5@6@M@ ",
" Q+,@@#S+)#!#~#{#X+Y+]#^#/# .@.R@(#_#:#<#R@R@m@[#}#|#$+$@%@&@*@=@'#1#6@Q+ ",
" 6+s+2#3#4#5#6#{#7#;+8#E+,#9#+.R@*#0#a#;#R@R@m@b#c#d#>+H+I+J+K+L+M+N+O+Q+ ",
" L N@e#f#g#h#w.y+i#G+j#k#l#m#+.R@R@*#n#+.R@R@m@o#A+p#q#r#k+l+m+s#o+p+7+P+ ",
" K t#u#v#w#x#y#J.j+[+b+p#z#m#+.R@R@e+*+O R@R@m@A#p#b+#+B#C#1+2+3+).~+!+ ",
" I =.D#1.d.u.E#F#.+X+G#H#m#+.R@j.6.C@*+R@R@m@I#[+H#.+K.J#)+o.8.^.` t# ",
" Z =.D#|.c.U.K#L#@+K.M#N#m#+.R@O#h l@E@R@R@m@P#Q#R#M.Q.y#s.p.:.^.H Z ",
" X W D#<.S#e.E.S.y#w.T#B.m#+.R@R@e+h@U#R@R@m@V#W#T#X#u.U.d.a.9.V =. ",
" V Y#:.|.a.b.c.e.]+h#Z#m#+.R@`#$.3.i.R@R@m@ $.$5#x#e.c.S#}.9.>.+$ ",
" -.Y#9.9.:.<.[.|.1.@$n+m#+.R@#$$$=+=+R@R@m@%$4#g#G.|.}.<.&$Y#;. ",
" ;.>.,.V V V ,.'.{+o+m#+.R@R@5.#.R@R@R@m@*$f#v#D#D#>.>.D#;.=$ ",
" W =.H Z ` ` ` ~+4+-$+.;$>$#$U#+.O R@m@,$8+H H H H =.'$V ",
" )$U J o K F p p 6+!$~$R@R@R@R@R@R@+.{$]$K K K o J *.H ",
" ^$F q 7 r m 8 8 /${$C j.j.j.j.($Z._$:$r r 7 q <$o ",
" [$m }$< 5 [ [ |$1$2$3$4$4$4$5$6$7$0 0 < 9 m 7 ",
" 8$5 l } | ! ! ! ! 9$9$9$9$9$9$9$9$| 0$[ 9 ",
" ) ! ~ { a$] ] ] ] ] ] ] ] a$* b$4 c$ ",
" * = d$; ; > > > > ; ; - = 1 ",
" e$; @ @ # $ @ # ; ",
" "};