Compare commits

..
Author SHA1 Message Date
Giacomo Catenazzi 2b7a313c05 Import Debian changes 1.9.0-wip.20070910-3
g15daemon (1.9.0-wip.20070910-3) unstable; urgency=low

  * first try to make a debian/rules full working for
    svn and released version
  * fix directory fixes (closes: #442296)
2007-09-14 20:59:27 +02:00
Giacomo Catenazzi 8337c95069 Import Debian changes 1.9.0-wip.20070910-2
g15daemon (1.9.0-wip.20070910-2) unstable; urgency=low

  * pause() instead of busy loop.
2007-09-11 06:12:01 +02:00
Giacomo Catenazzi 0301e1151b Import Debian changes 1.9.0-wip.20070910-1
g15daemon (1.9.0-wip.20070910-1) unstable; urgency=low

  * New upstream release (from svn)
  * Don't install plugin in /usr/share (Closes: #441619)
2007-09-10 23:02:14 +02:00
Giacomo Catenazzi 6c7461ac31 Import Debian changes 1.9.0-2
g15daemon (1.9.0-2) unstable; urgency=low

  * Updates: better init.d scripts (with support for L1 key)
  * install also the sample plugin (clock, net, uinput)
2007-08-30 23:31:18 +02:00
Giacomo Catenazzi 70c4e045b2 Import Debian changes 1.9.0-1
g15daemon (1.9.0-1) unstable; urgency=low

  * New upstream release

g15daemon (1.2.7-1) unstable; urgency=low

  * Initial release
2007-08-28 20:09:54 +02:00
30 changed files with 365 additions and 128 deletions

No files matched your search

+3 -24
View File
@@ -17,7 +17,7 @@
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006 Mike Lampard, Philip Lawatsch, and others
$Revision: 343 $ - $Date: 2007-12-18 06:26:28 +0100 (Tue, 18 Dec 2007) $ $Author: mlampard $ $Revision: 295 $ - $Date: 2007-09-09 06:37:50 +0200 (Sun, 09 Sep 2007) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -84,7 +84,7 @@ allow clients use of all 'L' keys.
1.2.5svn -> current 1.2.5svn -> current
- Add compiletime check for uinput version, should resolve compilation problems on some distro's - Add compiletime check for uinput version, should resolve compilation problems on some distro's
- Security improved - the daemon now sets its effective uid to nobody as soon as possible. - Security improved - the daemon now sets its effective uid to nobody as soon as possible.
1.9.0 1.9.0SVN
- Add plugin API - Add plugin API
- partially rewritten event core - partially rewritten event core
- updated g15daemon_xmms_spectrum plugin with new features, available in trunk/g15daemon_audio_plugins (SVN) - updated g15daemon_xmms_spectrum plugin with new features, available in trunk/g15daemon_audio_plugins (SVN)
@@ -93,26 +93,5 @@ allow clients use of all 'L' keys.
- g15daemon is now dependant on libg15render. - g15daemon is now dependant on libg15render.
- Clock now includes analog clock thanks to Rasta Freak <igor.jusic@zg.t-com.hr> - Clock now includes analog clock thanks to Rasta Freak <igor.jusic@zg.t-com.hr>
- Moved g15daemon_xmms_spectrum plugin to separate package - Moved g15daemon_xmms_spectrum plugin to separate package
1.9.1 - Plugins are now installed in ${PREFIX}/lib/g15daemon/${VERSION}/plugins
- Plugins are now installed in ${PREFIX}/{${LIBDIR}/g15daemon/${VERSION}/plugins
- OS-X support thanks to Fabrizio Sestito. - OS-X support thanks to Fabrizio Sestito.
- Bugfix: libg15daemon_client: keypresses were being corrupted.
- Bugfix: libg15daemon_client: use g15_recv rather than recv.
- Bugfix: use default scheduling for all threads.
- Optimisation: minor optimisation of lcd_cycle() code.
- Security: repair some potential security holes.
- Bugfix: Backlight status was being mis-applied when cycling screens.
- Bugfix: Language bindings were not being distributed.
1.9.1->SVN
- Add exitfunc to net plugin for exit notification.
- Use pause() instead of sleeping
- create leaving var as volatile.
- Add NAME section to g15daemon_client manpages
- Tweak delay between successive keyboard reads. This reduces cpu load by
50% on my system.
- Bugfix: Ensure that all plugin exit functions are called on leaving.
- Bugfix: if keypress event is received (very early in the startup process,
the daemon would crash. Check that expected pointers are valid.
- Bugfix: Dont attempt compilation of uinput plugin if headers are
unavailable.
- Bugfix: Write a blank buffer to the LCD before exiting.
+1 -1
View File
@@ -23,7 +23,7 @@ dist-hook:
rm -rf `find $(distdir)/debian -name .svn` rm -rf `find $(distdir)/debian -name .svn`
rm -rf `find $(distdir)/contrib -name .svn` rm -rf `find $(distdir)/contrib -name .svn`
rm -rf `find $(distdir)/Documentation -name .svn` rm -rf `find $(distdir)/Documentation -name .svn`
rm -rf `find $(distdir)/lang-bindings -name .svn` rm -rf `find $(distdir)/lang_bindings -name .svn`
rm -rf `find $(distdir)/patches -name .svn` rm -rf `find $(distdir)/patches -name .svn`
rm -rf `find $(distdir)/rpm -name .svn` rm -rf `find $(distdir)/rpm -name .svn`
rm -rf `find $(distdir)/plugins -name .svn` rm -rf `find $(distdir)/plugins -name .svn`
+2 -6
View File
@@ -1,10 +1,10 @@
# -*- Autoconf -*- # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
# $Revision: 334 $ - $Date: 2007-12-07 15:08:03 +0100 (Fri, 07 Dec 2007) $ $Author: mlampard $ # $Revision: 295 $ - $Date: 2007-09-09 06:37:50 +0200 (Sun, 09 Sep 2007) $ $Author: mlampard $
AC_PREREQ(2.59) AC_PREREQ(2.59)
AC_INIT(g15daemon, [1.9.1], [mlampard@users.sf.net]) AC_INIT(g15daemon, [1.9pre], [mlampard@users.sf.net])
AC_PREFIX_DEFAULT(/usr) AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_AUX_DIR(config) AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_TARGET() AC_CANONICAL_TARGET()
@@ -32,7 +32,6 @@ AC_CHECK_HEADERS([ linux/uinput.h arpa/inet.h fcntl.h stdlib.h string.h sys/sock
#include <linux/input.h> #include <linux/input.h>
#endif #endif
]) ])
#if HAVE_LINUX_UINPUT_H #if HAVE_LINUX_UINPUT_H
dnl check for uinput.h version 2.4 or 2.6 ? dnl check for uinput.h version 2.4 or 2.6 ?
AC_CHECK_MEMBER([struct uinput_user_dev.id], AC_CHECK_MEMBER([struct uinput_user_dev.id],
@@ -43,12 +42,9 @@ AC_CHECK_HEADERS([ linux/uinput.h arpa/inet.h fcntl.h stdlib.h string.h sys/sock
#include <linux/uinput.h> #include <linux/uinput.h>
] ]
) )
uinput=true
dnl end of uinput version checks dnl end of uinput version checks
#endif #endif
AM_CONDITIONAL(UINPUT_INTERFACE_PLUGIN, [test x$uinput = xtrue])
case $host_os in case $host_os in
*linux*) *linux*)
AC_DEFINE([OSTYPE_LINUX], [1],[Target OS is Linux]) AC_DEFINE([OSTYPE_LINUX], [1],[Target OS is Linux])
+35
View File
@@ -0,0 +1,35 @@
g15daemon for Debian
--------------------
Debian 'xkeyboard-config' package already have support for g15
keyboards, so you don't need to exec 'xmodmap' as described on
original documentations. Anywaym you should configure your
xorg.conf file, so that xorg will understand the extra keys.
To have the full support of the extra keys, you should edit the
xorg configuration file /etc/X11/xorg.conf . The 'XkbModel' should
be "logitech_g15".
I.e. on my machine:
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "logitech_g15"
Option "XkbLayout" "us"
EndSection
Also in KDE and gnome you should set the g15daemon keyboard.
In KDE you find the configuration in:
Control Center
Regional & Accessibility
Keyboard Layout
On the right at the top "Keyboard model" select:
"Logitech G15 extra keys via G15daemon"
-- Giacomo Catenazzi <cate@debian.org> Mon, 30 Aug 2007 08:04:22 +0200
+40
View File
@@ -0,0 +1,40 @@
g15daemon (1.9.0-wip.20070910-3) unstable; urgency=low
* first try to make a debian/rules full working for
svn and released version
* fix directory fixes (closes: #442296)
-- Giacomo Catenazzi <cate@debian.org> Fri, 14 Sep 2007 20:59:27 +0200
g15daemon (1.9.0-wip.20070910-2) unstable; urgency=low
* pause() instead of busy loop.
-- Giacomo Catenazzi <cate@debian.org> Tue, 11 Sep 2007 06:12:01 +0200
g15daemon (1.9.0-wip.20070910-1) unstable; urgency=low
* New upstream release (from svn)
* Don't install plugin in /usr/share (Closes: #441619)
-- Giacomo Catenazzi <cate@debian.org> Mon, 10 Sep 2007 23:02:14 +0200
g15daemon (1.9.0-2) unstable; urgency=low
* Updates: better init.d scripts (with support for L1 key)
* install also the sample plugin (clock, net, uinput)
-- Giacomo Catenazzi <cate@debian.org> Thu, 30 Aug 2007 23:31:18 +0200
g15daemon (1.9.0-1) unstable; urgency=low
* New upstream release
-- Giacomo Catenazzi <cate@debian.org> Tue, 28 Aug 2007 20:09:54 +0200
g15daemon (1.2.7-1) unstable; urgency=low
* Initial release
-- Giacomo Catenazzi <cate@debian.org> Mon, 27 Aug 2007 20:00:20 +0200
+1
View File
@@ -0,0 +1 @@
5
+33
View File
@@ -0,0 +1,33 @@
Source: g15daemon
Section: utils
Priority: optional
Maintainer: Giacomo Catenazzi <cate@debian.org>
Build-Depends: cdbs, debhelper (>= 5), autotools-dev, automake1.9, libtool, libg15-dev, libg15render-dev, libusb-dev
Standards-Version: 3.7.2
Package: g15daemon
Section: utils
Architecture: any
Depends: ${shlibs:Depends}, libg15daemon-client1 (=${binary:Version})
Recommends: xkeyboard-config ( >= 0.9+cvs.20070428-1)
Description: Screen multiplexer for Logitech G15 Keyboard
G15daemon provides multiple virtual screens for the LCD on the Logitech
G11 and G15 keyboards.
.
This package contain the daemon and a generic client to talk to the
daemon.
Package: libg15daemon-client1
Section: libs
Architecture: any
Depends: ${shlibs:Depends}
Description: Development packages for libg15daemon-client
Includes the files needed for developing g15daemon clients
Package: libg15daemon-client-dev
Section: libdevel
Architecture: any
Depends: libg15daemon-client1 (= ${binary:Version})
Description: Development packages for libg15daemon-client
Includes the files needed for developing g15daemon clients
+28
View File
@@ -0,0 +1,28 @@
This package was debianized by Giacomo A. Catenazzi <cate@debian.org> on
Mon, 27 Aug 2007 20:00:20 +0200.
It was downloaded from http://g15daemon.sourceforge.net/
Upstream Authors:
Mike Lampard <mlampard@users.sf.net>
Sven Ludwig
James Green
Philip Lawatsch <philip@lawatsch.at>
Copyright:
Copyright (c) 2006 Mike Lampard, Philip Lawatsch, and others
License:
g15tools 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.
License can be found in the file `/usr/share/common-licenses/GPL-2'.
The Debian packaging is (C) 2007, Giacomo Catenazzi <cate@debian.org> and
is licensed under the GPL v2 (or later), see `/usr/share/common-licenses/GPL-2'.
Vendored
+2
View File
@@ -0,0 +1,2 @@
usr/bin
usr/sbin
Vendored
+4
View File
@@ -0,0 +1,4 @@
FAQ
NEWS
README
TODO
+12
View File
@@ -0,0 +1,12 @@
# Defaults for g15daemon initscript
# SWITCH_KEY selects the key used to switch between client screens
#
# SWITCH_KEY="MR" to use the MR key (on top left) (default)
# SWITCH_KEY="L1 to use the L1 key: the small round key below the LCD
SWITCH_KEY="MR"
# Additional options that are passed to the Daemon.
DAEMON_OPTS=""
+89
View File
@@ -0,0 +1,89 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: g15daemon
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Should-Start: $remote_fs
# Should-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: load deamon for Logitech G15 keyboard lcd display
# Description: load deamon for Logitech G15 keyboard lcd display
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/g15daemon
NAME=g15daemon
DESC=g15daemon
test -x $DAEMON || exit 0
# Include g15daemon defaults if available
if [ -f /etc/default/g15daemon ] ; then
. /etc/default/g15daemon
fi
if [ "$SWITCH_KEY" = "L1" ]; then
DAEMON_OPTS="-s $DAEMON_OPTS"
fi
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
$DAEMON -k
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON
echo "$NAME."
;;
#reload)
#
# If the daemon can reload its config files on the fly
# for example by sending it SIGHUP, do it here.
#
# If the daemon responds to changes in its config file
# directly anyway, make this a do-nothing entry.
#
# echo "Reloading $DESC configuration files."
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
# /var/run/$NAME.pid --exec $DAEMON
#;;
force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart" except that it does nothing if the
# daemon isn't already running.
# check wether $DAEMON is running. If so, restart
start-stop-daemon --stop --test --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON \
&& $0 restart \
|| exit 0
;;
restart)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
+6
View File
@@ -0,0 +1,6 @@
debian/tmp/usr/sbin/g15daemon usr/sbin
debian/tmp/usr/lib/g15daemon/1.9pre/plugins/g15plugin_uinput.so usr/lib/g15daemon/1.9pre/plugins/
debian/tmp/usr/lib/g15daemon/1.9pre/plugins/g15plugin_tcpserver.so usr/lib/g15daemon/1.9pre/plugins/
debian/tmp/usr/lib/g15daemon/1.9pre/plugins/g15plugin_clock.so usr/lib/g15daemon/1.9pre/plugins/
debian/tmp/usr/share/g15daemon/splash/g15logo2.wbmp usr/share/g15daemon/splash/
+1
View File
@@ -0,0 +1 @@
Documentation/g15daemon.1
+5
View File
@@ -0,0 +1,5 @@
debian/tmp/usr/include/* usr/include/
debian/tmp/usr/lib/lib*.a usr/lib/
debian/tmp/usr/lib/lib*.so usr/lib/
debian/tmp/usr/lib/*.la usr/lib/
+1
View File
@@ -0,0 +1 @@
usr/lib/lib*.so.*
+1
View File
@@ -0,0 +1 @@
debian/tmp/usr/lib/lib*.so.* usr/lib/
+1
View File
@@ -0,0 +1 @@
Documentation/g15daemon_client_devel.3
Vendored Executable
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/make -f
AUTOMAKE_REMOVE := Makefile Makefile.in */Makefile */Makefile.in configure aclocal.m4
AUTOMAKE_REMOVE += *.lo *.o *.la */*.lo */*.o */*.la
AUTOMAKE_REMOVE += g15daemon/g15daemon g15daemon/g15daemontest
AUTOMAKE_REMOVE += config.status config.log config.h config.h.in config/* libtool stamp-h1
AUTOMAKE_REMOVE += */.libs/
clean::
-rm -Rf $(AUTOMAKE_REMOVE)
makebuilddir:: Makefile
Makefile:: Makefile.am autogen.sh
[ -d config ] || mkdir config
aclocal -I config
libtoolize --automake --force --copy
autoheader
automake --add-missing --copy
autoconf
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
+7
View File
@@ -0,0 +1,7 @@
# See uscan(1) for format
# Compulsory line, this is a version 3 file
version=3
http://sf.net/g15daemon/g15daemon-([1-9].*)\.tar\.bz2
+2 -2
View File
@@ -17,7 +17,7 @@
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006 Mike Lampard, Philip Lawatsch, and others
$Revision: 333 $ - $Date: 2007-12-02 04:50:57 +0100 (Sun, 02 Dec 2007) $ $Author: mlampard $ $Revision: 179 $ - $Date: 2006-11-19 09:33:12 +0100 (Sun, 19 Nov 2006) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -129,7 +129,7 @@ void run_advanced_client(plugin_t *plugin_args)
g15daemon_msleep(info->update_msecs); g15daemon_msleep(info->update_msecs);
} }
}else{ }else{
while(!leaving){ while(1){
g15daemon_msleep(500); g15daemon_msleep(500);
} }
} }
+12 -12
View File
@@ -17,7 +17,7 @@
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006 Mike Lampard, Philip Lawatsch, and others
$Revision: 324 $ - $Date: 2007-11-29 02:45:27 +0100 (Thu, 29 Nov 2007) $ $Author: mlampard $ $Revision: 300 $ - $Date: 2007-09-10 09:52:01 +0200 (Mon, 10 Sep 2007) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
// keystate = g15_send_cmd (g15screen_fd, G15DAEMON_GET_KEYSTATE, foo); // keystate = g15_send_cmd (g15screen_fd, G15DAEMON_GET_KEYSTATE, foo);
//while(1){ //while(1){
recv(g15screen_fd, &keystate, 4, 0); //recv(g15screen_fd, &keystate, 4, 0);
if(keystate) if(keystate)
printf("keystate = %i\n",keystate); printf("keystate = %i\n",keystate);
//} //}
@@ -79,19 +79,19 @@ recv(g15screen_fd, &keystate, 4, 0);
// break; // break;
/* G2,G3 & G4 change LCD backlight */ /* G2,G3 & G4 change LCD backlight */
if(keystate & G15_KEY_G2){ // if(keystate & G15_KEY_G2){
retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_DARK); // retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_DARK);
} // }
if(keystate & G15_KEY_G3){ // if(keystate & G15_KEY_G3){
retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_MEDIUM); // retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_MEDIUM);
unsigned char packet[2]; unsigned char packet[2];
packet[0] = G15DAEMON_BACKLIGHT|G15_BRIGHTNESS_MEDIUM; packet[0] = G15DAEMON_BACKLIGHT|G15_BRIGHTNESS_MEDIUM;
printf("sent %i bytes\n",send(g15screen_fd, packet, 1, MSG_OOB )); printf("sent %i bytes\n",send(g15screen_fd, packet, 1, MSG_OOB ));
} // }
if(keystate & G15_KEY_G4){ // if(keystate & G15_KEY_G4){
retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_BRIGHT); // retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_BRIGHT);
} // }
/* /*
retval = g15_send_cmd (g15screen_fd, G15DAEMON_IS_FOREGROUND, foo); retval = g15_send_cmd (g15screen_fd, G15DAEMON_IS_FOREGROUND, foo);
@@ -115,7 +115,7 @@ recv(g15screen_fd, &keystate, 4, 0);
// } // }
*/ */
// sleep(2); sleep(2);
#ifdef TEST_KEYHANDLER #ifdef TEST_KEYHANDLER
/* ok.. request that all G&M keys are passed to us.. */ /* ok.. request that all G&M keys are passed to us.. */
retval = g15_send_cmd (g15screen_fd, G15DAEMON_KEY_HANDLER, foo); retval = g15_send_cmd (g15screen_fd, G15DAEMON_KEY_HANDLER, foo);
+6 -6
View File
@@ -17,7 +17,7 @@
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006 Mike Lampard, Philip Lawatsch, and others
$Revision: 321 $ - $Date: 2007-11-29 01:00:29 +0100 (Thu, 29 Nov 2007) $ $Author: mlampard $ $Revision: 177 $ - $Date: 2006-11-18 14:46:03 +0100 (Sat, 18 Nov 2006) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -119,7 +119,6 @@ void g15daemon_lcdnode_cycle(g15daemon_t *masterlist)
lcdnode_t *current_screen = masterlist->current; lcdnode_t *current_screen = masterlist->current;
g15daemon_send_event(current_screen->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_HIDDEN); g15daemon_send_event(current_screen->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_HIDDEN);
do do
{ {
pthread_mutex_lock(&lcdlist_mutex); pthread_mutex_lock(&lcdlist_mutex);
@@ -133,18 +132,19 @@ void g15daemon_lcdnode_cycle(g15daemon_t *masterlist)
pthread_mutex_unlock(&lcdlist_mutex); pthread_mutex_unlock(&lcdlist_mutex);
} }
while (current_screen != masterlist->current); while (current_screen != masterlist->current);
pthread_mutex_lock(&lcdlist_mutex); pthread_mutex_lock(&lcdlist_mutex);
if(masterlist->tail == masterlist->current) { if(masterlist->tail == masterlist->current) {
masterlist->current = masterlist->head; masterlist->current = masterlist->head;
} else { } else {
masterlist->current = masterlist->current->prev; masterlist->current = masterlist->current->prev;
} }
pthread_mutex_unlock(&lcdlist_mutex);
g15daemon_send_event(masterlist->current->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_VISIBLE);
g15daemon_send_event(current_screen->lcd, G15_EVENT_USER_FOREGROUND, 1);
pthread_mutex_lock(&lcdlist_mutex);
masterlist->current->lcd->state_changed = 1;
masterlist->current->last_priority = masterlist->current; masterlist->current->last_priority = masterlist->current;
pthread_mutex_unlock(&lcdlist_mutex); pthread_mutex_unlock(&lcdlist_mutex);
g15daemon_send_event(current_screen->lcd, G15_EVENT_USER_FOREGROUND, 1);
g15daemon_send_event(masterlist->current->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_VISIBLE);
} }
void g15daemon_lcdnode_remove (lcdnode_t *oldnode) { void g15daemon_lcdnode_remove (lcdnode_t *oldnode) {
+19 -38
View File
@@ -17,7 +17,7 @@
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006 Mike Lampard, Philip Lawatsch, and others
$Revision: 346 $ - $Date: 2007-12-18 06:44:36 +0100 (Tue, 18 Dec 2007) $ $Author: mlampard $ $Revision: 302 $ - $Date: 2007-09-10 09:57:53 +0200 (Mon, 10 Sep 2007) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -64,10 +64,6 @@ int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
static unsigned long lastkeys; static unsigned long lastkeys;
if(!(value & cycle_key) && !(lastkeys & cycle_key)){ if(!(value & cycle_key) && !(lastkeys & cycle_key)){
lcd_t *lcd = (lcd_t*)caller; lcd_t *lcd = (lcd_t*)caller;
if(!lcd->g15plugin->info)
break;
int *(*plugin_listener)(plugin_event_t *newevent) = (void*)lcd->g15plugin->info->event_handler; int *(*plugin_listener)(plugin_event_t *newevent) = (void*)lcd->g15plugin->info->event_handler;
plugin_event_t *newevent=g15daemon_xmalloc(sizeof(plugin_event_t)); plugin_event_t *newevent=g15daemon_xmalloc(sizeof(plugin_event_t));
newevent->event = event; newevent->event = event;
@@ -86,12 +82,9 @@ int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
g15daemon_log(LOG_WARNING,"Error in send: %s\n",strerror(errno)); g15daemon_log(LOG_WARNING,"Error in send: %s\n",strerror(errno));
} }
if(value & G15_KEY_LIGHT){ // the backlight key was pressed - maintain user-selected state if(value & G15_KEY_LIGHT){ // the backlight key was pressed - maintain user-selected state
lcd_t *displaying = lcd->masterlist->tail->lcd;
lcd->masterlist->kb_backlight_state++; lcd->masterlist->kb_backlight_state++;
if(lcd->masterlist->kb_backlight_state>2) if(lcd->masterlist->kb_backlight_state>2)
lcd->masterlist->kb_backlight_state=0; lcd->masterlist->kb_backlight_state=0;
displaying->backlight_state++;
displaying->backlight_state %= 3; // limit to 0-2 inclusive
} }
free(newevent); free(newevent);
}else{ }else{
@@ -175,38 +168,33 @@ static void *keyboard_watch_thread(void *lcdlist){
unsigned int keypresses = 0; unsigned int keypresses = 0;
int retval = 0; int retval = 0;
static int lastkeys = 0;
while (!leaving) { while (!leaving) {
pthread_mutex_lock(&g15lib_mutex); pthread_mutex_lock(&g15lib_mutex);
retval = getPressedKeys(&keypresses, 2); retval = getPressedKeys(&keypresses, 40);
pthread_mutex_unlock(&g15lib_mutex); pthread_mutex_unlock(&g15lib_mutex);
/* every 2nd packet contains the codes we want.. immediately try again */ /* every 2nd packet contains the codes we want.. immediately try again */
while (retval == G15_ERROR_TRY_AGAIN){ while (retval == G15_ERROR_TRY_AGAIN){
pthread_mutex_lock(&g15lib_mutex); pthread_mutex_lock(&g15lib_mutex);
retval = getPressedKeys(&keypresses, 2); retval = getPressedKeys(&keypresses, 40);
pthread_mutex_unlock(&g15lib_mutex); pthread_mutex_unlock(&g15lib_mutex);
} }
if(retval == G15_NO_ERROR && lastkeys != keypresses) { if(retval == G15_NO_ERROR){
g15daemon_send_event(masterlist->current->lcd, g15daemon_send_event(masterlist->current->lcd,
G15_EVENT_KEYPRESS, keypresses); G15_EVENT_KEYPRESS, keypresses);
lastkeys = keypresses; }
if(retval == -ENODEV && LIBG15_VERSION>=1200) {
}else if(retval == -ENODEV && LIBG15_VERSION>=1200) {
pthread_mutex_lock(&g15lib_mutex); pthread_mutex_lock(&g15lib_mutex);
while((retval=re_initLibG15() != G15_NO_ERROR) && !leaving){ while((retval=re_initLibG15() != G15_NO_ERROR) && !leaving){
sleep(1); sleep(1);
} }
if(!leaving) { if(!leaving) { masterlist->current->lcd->state_changed=1; masterlist->current->lcd->ident=random();}
masterlist->current->lcd->state_changed=1;
masterlist->current->lcd->ident=random();
}
pthread_mutex_unlock(&g15lib_mutex); pthread_mutex_unlock(&g15lib_mutex);
} }
g15daemon_msleep(40); g15daemon_msleep(10);
} }
return NULL; return NULL;
@@ -269,7 +257,6 @@ void g15daemon_sighandler(int sig) {
case SIGUSR1: case SIGUSR1:
keyboard_backlight_off_onexit = 1; keyboard_backlight_off_onexit = 1;
case SIGINT: case SIGINT:
case SIGTERM:
case SIGQUIT: case SIGQUIT:
leaving = 1; leaving = 1;
break; break;
@@ -288,7 +275,6 @@ int main (int argc, char *argv[])
struct sigaction new_action; struct sigaction new_action;
cycle_key = G15_KEY_L1; cycle_key = G15_KEY_L1;
unsigned char user[256]; unsigned char user[256];
unsigned int lcdlevel = 1;
pthread_t keyboard_thread; pthread_t keyboard_thread;
pthread_t lcd_thread; pthread_t lcd_thread;
@@ -323,13 +309,13 @@ int main (int argc, char *argv[])
if (!strncmp(daemonargs, "-h",2) || !strncmp(daemonargs, "--help",6)) { if (!strncmp(daemonargs, "-h",2) || !strncmp(daemonargs, "--help",6)) {
printf("G15Daemon version %s - %s\n",VERSION,uf_return_running() >= 0 ?"Loaded & Running":"Not Running"); printf("G15Daemon version %s - %s\n",VERSION,uf_return_running() >= 0 ?"Loaded & Running":"Not Running");
printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) [level] or -v (--version) or -l (--lcdlevel) [0-2] \n\n -k will kill a previous incarnation",argv[0]); printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) or -v (--version)\n\n -k will kill a previous incarnation",argv[0]);
#ifdef LIBG15_VERSION #ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200 #if LIBG15_VERSION >= 1200
printf(", if uppercase -K or -KILL turn off the keyboard backlight on the way out."); printf(", if uppercase -K or -KILL turn off the keyboard backlight on the way out.");
#endif #endif
#endif #endif
printf("\n -h shows this help\n -s changes the screen-switch key from MR to L1\n -d debug mode - stay in foreground and output all debug messages to STDERR\n -v show version\n -l set default LCD backlight level\n"); printf("\n -h shows this help\n -s changes the screen-switch key from MR to L1\n -d debug mode - stay in foreground and output all debug messages to STDERR\n -v show version\n");
exit(0); exit(0);
} }
@@ -354,13 +340,6 @@ int main (int argc, char *argv[])
} }
} }
if (!strncmp(daemonargs, "-l",2) || !strncmp(daemonargs, "--lcdlevel",7)) {
if((argv[i+1])!=NULL)
if(isdigit(argv[i+1][0])){
lcdlevel = atoi(argv[i+1]);
}
}
} }
if(uf_return_running()>=0) { if(uf_return_running()>=0) {
g15daemon_log(LOG_ERR,"G15Daemon already running.. Exiting"); g15daemon_log(LOG_ERR,"G15Daemon already running.. Exiting");
@@ -422,8 +401,7 @@ int main (int argc, char *argv[])
setLCDContrast(1); setLCDContrast(1);
setLEDs(0); setLEDs(0);
lcdlist->kb_backlight_state=1; lcdlist->kb_backlight_state=1;
lcdlist->current->lcd->backlight_state=lcdlevel; setLCDBrightness(lcdlist->kb_backlight_state);
setLCDBrightness(lcdlevel);
#ifdef LIBG15_VERSION #ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200 #if LIBG15_VERSION >= 1200
@@ -444,12 +422,19 @@ int main (int argc, char *argv[])
pthread_mutex_init(&g15lib_mutex, NULL); pthread_mutex_init(&g15lib_mutex, NULL);
pthread_attr_init(&attr); pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr,512*1024); /* set stack to 512k - dont need 8Mb !! */ pthread_attr_setstacksize(&attr,512*1024); /* set stack to 512k - dont need 8Mb !! */
pthread_attr_setscope(&attr,PTHREAD_SCOPE_SYSTEM);
int thread_policy=SCHED_RR;
pthread_attr_setschedpolicy(&attr,thread_policy);
if (pthread_create(&keyboard_thread, &attr, keyboard_watch_thread, lcdlist) != 0) { if (pthread_create(&keyboard_thread, &attr, keyboard_watch_thread, lcdlist) != 0) {
g15daemon_log(LOG_ERR,"Unable to create keyboard listener thread. Exiting"); g15daemon_log(LOG_ERR,"Unable to create keyboard listener thread. Exiting");
goto exitnow; goto exitnow;
} }
pthread_attr_setstacksize(&attr,128*1024); pthread_attr_setstacksize(&attr,128*1024);
/* all other threads have a lower priority... maybe */
pthread_attr_setscope(&attr,PTHREAD_SCOPE_PROCESS);
thread_policy=SCHED_OTHER;
pthread_attr_setschedpolicy(&attr,thread_policy);
if (pthread_create(&lcd_thread, &attr, lcd_draw_thread, lcdlist) != 0) { if (pthread_create(&lcd_thread, &attr, lcd_draw_thread, lcdlist) != 0) {
g15daemon_log(LOG_ERR,"Unable to create display thread. Exiting"); g15daemon_log(LOG_ERR,"Unable to create display thread. Exiting");
@@ -476,11 +461,11 @@ int main (int argc, char *argv[])
new_action.sa_flags = 0; new_action.sa_flags = 0;
sigaction(SIGINT, &new_action, NULL); sigaction(SIGINT, &new_action, NULL);
sigaction(SIGQUIT, &new_action, NULL); sigaction(SIGQUIT, &new_action, NULL);
sigaction(SIGTERM, &new_action, NULL);
sigaction(SIGUSR1, &new_action, NULL); sigaction(SIGUSR1, &new_action, NULL);
do { do {
pause(); pause();
} while( leaving == 0); } while( leaving == 0);
g15daemon_log(LOG_INFO,"Leaving by request"); g15daemon_log(LOG_INFO,"Leaving by request");
@@ -488,10 +473,6 @@ int main (int argc, char *argv[])
pthread_join(lcd_thread,NULL); pthread_join(lcd_thread,NULL);
pthread_join(keyboard_thread,NULL); pthread_join(keyboard_thread,NULL);
/* switch off the lcd backlight */ /* switch off the lcd backlight */
char *blank=malloc(G15_BUFFER_LEN);
memset(blank,0,G15_BUFFER_LEN);
writePixmapToLCD((unsigned char*)blank);
free(blank);
setLCDBrightness(0); setLCDBrightness(0);
#ifdef LIBG15_VERSION #ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200 #if LIBG15_VERSION >= 1200
+10 -15
View File
@@ -17,7 +17,7 @@
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006 Mike Lampard, Philip Lawatsch, and others
$Revision: 339 $ - $Date: 2007-12-15 07:10:26 +0100 (Sat, 15 Dec 2007) $ $Author: mlampard $ $Revision: 190 $ - $Date: 2006-11-21 17:31:03 +0100 (Tue, 21 Nov 2006) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -195,23 +195,17 @@ void g15daemon_sleep(int seconds) {
pthread_mutex_destroy(&dummy_mutex); pthread_mutex_destroy(&dummy_mutex);
} }
/* microsecond sleep routine. */
int g15daemon_usleep(int useconds) {
struct timeval timeout;
if(useconds < 10000)
useconds = 10000;
timeout.tv_sec = useconds / 1000000;
timeout.tv_usec = useconds % 1000000;
return select (0,0,0,0,&timeout);
}
/* millisecond sleep routine. */ /* millisecond sleep routine. */
int g15daemon_msleep(int milliseconds) { int g15daemon_msleep(int milliseconds) {
return g15daemon_usleep(milliseconds*1000); struct timespec timeout;
} if(milliseconds>999)
milliseconds=999;
timeout.tv_sec = 0;
timeout.tv_nsec = milliseconds*1000000;
return nanosleep (&timeout, NULL);
}
unsigned int g15daemon_gettime_ms(){ unsigned int g15daemon_gettime_ms(){
struct timeval tv; struct timeval tv;
@@ -373,6 +367,7 @@ char * uf_remove_whitespace(char *str){
int g15daemon_cfg_write_string(config_section_t *section, char *key, char *val){ int g15daemon_cfg_write_string(config_section_t *section, char *key, char *val){
config_items_t *new = NULL; config_items_t *new = NULL;
const char empty[]=" ";
if(section==NULL) if(section==NULL)
return -1; return -1;
@@ -524,7 +519,7 @@ int uf_conf_open(g15daemon_t *list, char *filename) {
int config_fd=-1; int config_fd=-1;
char *sect; char *sect;
char *start; char *start;
char *bar = NULL; char *bar;
int i; int i;
struct stat stats; struct stat stats;
+2 -2
View File
@@ -17,7 +17,7 @@
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006 Mike Lampard, Philip Lawatsch, and others
$Revision: 322 $ - $Date: 2007-11-29 01:04:29 +0100 (Thu, 29 Nov 2007) $ $Author: mlampard $ $Revision: 301 $ - $Date: 2007-09-10 09:55:15 +0200 (Mon, 10 Sep 2007) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -67,7 +67,7 @@ int g15_send(int sock, char *buf, unsigned int len);
int g15_recv(int sock, char *buf, unsigned int len); int g15_recv(int sock, char *buf, unsigned int len);
/* send a command (defined above) to the daemon. any replies from the daemon are returned */ /* send a command (defined above) to the daemon. any replies from the daemon are returned */
unsigned long g15_send_cmd (int sock, unsigned char command, unsigned char value); int g15_send_cmd (int sock, unsigned char command, unsigned char value);
/* receive an oob byte from the daemon, used internally by g15_send_cmd, but useful elsewhere */ /* receive an oob byte from the daemon, used internally by g15_send_cmd, but useful elsewhere */
#define G15_FOREGROUND_SENT_OOB 1 #define G15_FOREGROUND_SENT_OOB 1
int g15_recv_oob_answer(int sock); int g15_recv_oob_answer(int sock);
+5 -5
View File
@@ -17,7 +17,7 @@
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006 Mike Lampard, Philip Lawatsch, and others
$Revision: 322 $ - $Date: 2007-11-29 01:04:29 +0100 (Thu, 29 Nov 2007) $ $Author: mlampard $ $Revision: 301 $ - $Date: 2007-09-10 09:55:15 +0200 (Mon, 10 Sep 2007) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -177,7 +177,7 @@ int g15_recv_oob_answer(int sock) {
return packet[0]; return packet[0];
} }
unsigned long g15_send_cmd (int sock, unsigned char command, unsigned char value) int g15_send_cmd (int sock, unsigned char command, unsigned char value)
{ {
int retval; int retval;
unsigned char packet[2]; unsigned char packet[2];
@@ -219,9 +219,9 @@ unsigned long g15_send_cmd (int sock, unsigned char command, unsigned char value
break; break;
case G15DAEMON_GET_KEYSTATE:{ case G15DAEMON_GET_KEYSTATE:{
retval = 0; retval = 0;
unsigned long keystate = 0; packet[0] = (unsigned char)command;
g15_recv(sock, (char*)&keystate, sizeof(keystate)); send( sock, packet, 1, MSG_OOB );
return keystate; g15_recv(sock, (char*)&retval, sizeof(retval));
break; break;
} }
case G15DAEMON_IS_FOREGROUND:{ case G15DAEMON_IS_FOREGROUND:{
+3 -6
View File
@@ -3,14 +3,11 @@ METASOURCES = AUTO
libdir = @G15DAEMON_PLUGIN_DIR@ libdir = @G15DAEMON_PLUGIN_DIR@
AM_CFLAGS = -Wall AM_CFLAGS = -Wall
if UINPUT_INTERFACE_PLUGIN lib_LTLIBRARIES =g15plugin_uinput.la g15plugin_tcpserver.la g15plugin_clock.la
INCLUDES = -I$(top_builddir)/libg15daemon_client/ -I$(top_builddir)/g15daemon
g15plugin_uinput_la_SOURCES = g15_plugin_uinput.c g15plugin_uinput_la_SOURCES = g15_plugin_uinput.c
g15plugin_uinput_la_LDFLAGS = -avoid-version -module g15plugin_uinput_la_LDFLAGS = -avoid-version -module
input_la = g15plugin_uinput.la
endif
lib_LTLIBRARIES = ${input_la} g15plugin_tcpserver.la g15plugin_clock.la
INCLUDES = -I$(top_builddir)/libg15daemon_client/ -I$(top_builddir)/g15daemon
g15plugin_tcpserver_la_SOURCES = g15_plugin_net.c g15plugin_tcpserver_la_SOURCES = g15_plugin_net.c
g15plugin_tcpserver_la_LDFLAGS = -avoid-version -module g15plugin_tcpserver_la_LDFLAGS = -avoid-version -module
+4 -9
View File
@@ -17,7 +17,7 @@
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006 Mike Lampard, Philip Lawatsch, and others
$Revision: 329 $ - $Date: 2007-11-30 06:15:06 +0100 (Fri, 30 Nov 2007) $ $Author: mlampard $ $Revision: 299 $ - $Date: 2007-09-09 19:19:52 +0200 (Sun, 09 Sep 2007) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -40,7 +40,7 @@
#include <libg15.h> #include <libg15.h>
#include <g15daemon.h> #include <g15daemon.h>
static int leaving = 0; static int leaving;
int server_events(plugin_event_t *myevent); int server_events(plugin_event_t *myevent);
#ifndef SO_PRIORITY #ifndef SO_PRIORITY
@@ -108,8 +108,7 @@ static void process_client_cmds(lcdnode_t *lcdnode, int sock, unsigned int *msgb
} }
else if (msgbuf[0] & CLIENT_CMD_BACKLIGHT) else if (msgbuf[0] & CLIENT_CMD_BACKLIGHT)
{ {
unsigned char retval = lcdnode->lcd->backlight_state; send(sock,&lcdnode->lcd->backlight_state,1,MSG_OOB);
send(sock,&retval,1,MSG_OOB);
lcdnode->lcd->backlight_state = msgbuf[0]-0x80; lcdnode->lcd->backlight_state = msgbuf[0]-0x80;
lcdnode->lcd->state_changed = 1; lcdnode->lcd->state_changed = 1;
} }
@@ -427,14 +426,10 @@ int server_events(plugin_event_t *event) {
return G15_PLUGIN_OK; return G15_PLUGIN_OK;
} }
static void g15plugin_net_exit() {
leaving = 1;
}
/* if no exitfunc or eventhandler, member should be NULL */ /* if no exitfunc or eventhandler, member should be NULL */
plugin_info_t g15plugin_info[] = { plugin_info_t g15plugin_info[] = {
/* TYPE, name, initfunc, updatefreq, exitfunc, eventhandler, initfunc */ /* TYPE, name, initfunc, updatefreq, exitfunc, eventhandler, initfunc */
{G15_PLUGIN_LCD_SERVER, "LCDServer" , (void*)lcdserver_thread, 500, g15plugin_net_exit, (void*)server_events, NULL}, {G15_PLUGIN_LCD_SERVER, "LCDServer" , (void*)lcdserver_thread, 500, NULL, (void*)server_events, NULL},
{G15_PLUGIN_NONE, "" , NULL, 0, NULL, NULL, NULL} {G15_PLUGIN_NONE, "" , NULL, 0, NULL, NULL, NULL}
}; };
+4 -2
View File
@@ -3,16 +3,18 @@
%define prefix /usr %define prefix /usr
Summary: Daemon to control logitech G15 keyboards Summary: Daemon to control logitech G15 keyboards
Name: g15daemon Name: g15daemon
Version: 1.9.1 Version: 1.2.5
Release: 1 Release: 1
Copyright: GPL Copyright: GPL
Group: Applications/System Group: Applications/System
Source: ftp://prdownloads.sf.net/g15daemon-1.9.1.tar.bz2 Source: ftp://prdownloads.sf.net/g15daemon-1.2.5.tar.bz2
URL: http://g15daemon.sf.net URL: http://g15daemon.sf.net
Distribution: Linux Distribution: Linux
Vendor: NONE Vendor: NONE
Packager: Mike Lampard <mlampard@users.sourceforge.net> Packager: Mike Lampard <mlampard@users.sourceforge.net>
Buildroot: /var/tmp/g15daemon-%{PACKAGE_VERSION}-root Buildroot: /var/tmp/g15daemon-%{PACKAGE_VERSION}-root
BuildRequires: daemon-devel
Requires: daemon
Requires: libg15 Requires: libg15
Provides: g15daemon Provides: g15daemon