debian/0000755000000000000000000000000012142161270007162 5ustar debian/55numlockx0000644000000000000000000000122412012645650011123 0ustar # X session startup script: /etc/X11/Xsession.d/55numlockx # Initial settings NUMLOCK=auto # Load configuration cf=/etc/default/numlockx [ ! -r $cf ] || . $cf # Toggle numlock if we're not removed nlx=/usr/bin/numlockx [ ! -x $nlx ] || { case $NUMLOCK in # 'keep' is an undocumented state (see `man 1 numlockx'), though # /etc/default/numlockx mentions it; do nothing keep) return 0 ;; off|on|toggle) ;; *) NUMLOCK=on ltd=/usr/sbin/laptop-detect [ ! -x $ltd ] || ! $ltd || NUMLOCK=off ;; esac $nlx $NUMLOCK || : } # EOF debian/manpages0000644000000000000000000000002211475466716010717 0ustar debian/numlockx.1 debian/changelog0000644000000000000000000002021412142161256011037 0ustar numlockx (1.2-5) unstable; urgency=low * X session script improvements (Closes: #684601). * Switch to dh 9. -- Michal Čihař Tue, 07 May 2013 13:17:01 +0200 numlockx (1.2-4) unstable; urgency=low * Fix typo in X session script (Closes: #672974, #666981). -- Michal Čihař Tue, 15 May 2012 08:33:21 +0200 numlockx (1.2-3) unstable; urgency=low * Provide configuration file for controlling numlockx behaviour in X session (Closes: #648013). * Default to disabling numlock for laptops (Closes: #666981). * Bump standards to 3.9.3. * Update upstream homepage URL. * Rewrite debian/changelog to machine-readable format. * Improve --help output (Closes: #617736). * Add option to get numlock status (Closes: #617737). -- Michal Čihař Mon, 14 May 2012 11:41:24 +0200 numlockx (1.2-2) unstable; urgency=low * New maintainer (Closes: #479157). * Move packaging to collab-maint git. * Convert package to dh 7. -- Michal Čihař Wed, 01 Dec 2010 16:50:20 +0100 numlockx (1.2-1) unstable; urgency=low * QA upload. * New upstream release * Bump Standard Versions to 3.9.1 * Added source format 3.0 (quilt) -- Lorenzo De Liso Wed, 15 Sep 2010 18:15:57 +0200 numlockx (1.1-10) unstable; urgency=low * QA upload. + Set maintainer to Debian QA Group . * Move Homepage from package description to source stanza. * Bump Standards Version to 3.8.1. (No changes needed). -- Barry deFreese Thu, 21 May 2009 16:43:16 -0400 numlockx (1.1-9) unstable; urgency=low * Added missing CC=gcc macro in debian/rules. -- Martin-Éric Racine Sun, 22 Jun 2008 17:17:25 +0300 numlockx (1.1-8) unstable; urgency=low * Upgraded Build-Depends to match current X.org packages. -- Martin-Éric Racine Fri, 20 Jun 2008 20:04:30 +0300 numlockx (1.1-7) unstable; urgency=low * Retooled using autoconf 2.61, automake 1.10, libtool 1.5.22. -- Martin-Éric Racine Sat, 7 Jul 2007 00:58:10 +0300 numlockx (1.1-6) unstable; urgency=low * Made the startup script always succeed (Fixes: Malone 116528). * Upgraded to Standards-Version 3.7.2; no change required. -- Martin-Éric Racine Thu, 24 May 2007 14:14:55 +0300 numlockx (1.1-5) unstable; urgency=low * Bumped all Build-Depends based on manual @cdbs@ answers. -- Martin-Éric Racine Sun, 4 Jun 2006 23:06:39 +0300 numlockx (1.1-4) unstable; urgency=low * Retooled libraries for X11R7 transition (Closes: #367833). * Tightened up Build-Depends to match X11R7 versions. * Upgraded Build-Depends on debhelper to version 5. -- Martin-Éric Racine Sun, 4 Jun 2006 15:24:45 +0300 numlockx (1.1-3) unstable; urgency=low * Added missing call to list-missing target of utils.mk CDBS include. * Added missing ${misc:Depends} to binary in debian/control. -- Martin-Éric Racine Mon, 19 Dec 2005 21:24:46 +0200 numlockx (1.1-2) unstable; urgency=low * The "debian/rules overhaul" release: - Swapped order of debhelper.mk and autotools.mk CDBS includes. - Added utils.mk CDBS include. - Changed all := into +=. -- Martin-Éric Racine Thu, 24 Nov 2005 02:00:03 +0200 numlockx (1.1-1) unstable; urgency=low * New upstream release: - Added 'toggle' option to 'on' and 'off' options (Closes: #311044). - Reran autotools to automake 1.9 and autoconf 2.50 compliance. -- Martin-Éric Racine Mon, 3 Oct 2005 20:02:12 +0300 numlockx (1.0-18) unstable; urgency=low * Reverted to static debian/control file. -- Martin-Éric Racine Mon, 15 Aug 2005 08:57:47 +0300 numlockx (1.0-17) unstable; urgency=low * Converted debian/control to debian/control.in for CDBS auto-updating. * Upgraded to Debian Policy 3.6.2 standards; no change required. -- Martin-Éric Racine Sun, 19 Jun 2005 12:18:03 +0300 numlockx (1.0-16) unstable; urgency=low * Reduced Build-Depends according to 'dpkg-depcheck -m' output. This also happens to provide correct modularized XFree86 dependencies, as opposed to the deprecated xlibs-dev metapackage we previously used. * Sponsored by Kenshi Muto. -- Martin-Éric Racine Thu, 12 May 2005 13:15:59 +0300 numlockx (1.0-15) unstable; urgency=low * Final debian/rules cleanup before the Sarge release. -- Martin-Éric Racine Wed, 4 May 2005 04:04:23 +0300 numlockx (1.0-14) unstable; urgency=medium * [debian/control]: - Added missing texinfo to build dependencies. * [debian/rules]: - Deflated dependencies via ld's --as-needed option. * Sponsored by Kenshi Muto. -- Martin-Éric Racine Sat, 19 Mar 2005 18:53:33 +0200 numlockx (1.0-13) unstable; urgency=medium * Removed outdated Debconf info from the manual page (Closes: #296892). * Sponsored by Kenshi Muto. -- Martin-Éric Racine Fri, 25 Feb 2005 15:42:53 +0200 numlockx (1.0-12) unstable; urgency=low * Updated the upstream URL in debian/copyright and debian/control. * Added watch file to monitor the upstream tarball. * Sponsored by Kenshi Muto. -- Martin-Éric Racine Thu, 23 Dec 2004 02:46:41 +0200 numlockx (1.0-11) unstable; urgency=low * Added missing automake1.4 to build dependencies. * Sponsored by Kenshi Muto. -- Martin-Éric Racine Mon, 20 Dec 2004 02:23:28 +0200 numlockx (1.0-10) unstable; urgency=low * Changed path in 55numlockx to match Debian Policy 11.8.7, paragraph 1. * Sponsored by Kenshi Muto. -- Martin-Éric Racine Mon, 20 Dec 2004 00:56:49 +0200 numlockx (1.0-9) unstable; urgency=low * Upgraded to CDBS. * Removed pointless Debconf question and corresponding README.Debian too. Someone that does NOT want NumLock to be enabled by X11 initialization scripts does NOT need this package (Closes: #202045, #202046). * Sponsored by Kenshi Muto. -- Martin-Éric Racine Mon, 20 Dec 2004 00:02:19 +0200 numlockx (1.0-8) unstable; urgency=low * Adopted orphan package (Bug: #274287). Thanks to Chris Jones for previously maintaining it. * Removed pointless menu entry (Closes: #197552). * Fixed the source of all Lintian errors. * Sponsored by Kenshi Muto. -- Martin-Éric Racine Sun, 19 Dec 2004 18:18:45 +0200 numlockx (1.0-7) unstable; urgency=low * Fix path for numlockx, closes: #160911 * Fix path in 55numlockx script, closes: #160910 * add AM_MAINTAINER_MODE closes: #160111 * update/remove /etc/X11/Xsession.d/55numlockx when upgrading/purging * update man page and readme, closes: #176703 * Fix path for numlockx in menu file * Patch numlockx source to display usage if display is unopenable mostly closes: #176704 * Some of the above fixes supplied by: Ariel Shkedi -- Chris Jones Sat, 14 Sep 2002 23:40:12 +0100 numlockx (1.0-6) unstable; urgency=low * Added debconf helper script for the Xsession.d helper script (fixes #153448) -- Chris Jones Fri, 30 Aug 2002 14:20:58 +0100 numlockx (1.0-5) unstable; urgency=low * Fixed #158827, numlockx binary now goes into the correct location -- Chris Jones Fri, 30 Aug 2002 10:57:05 +0100 numlockx (1.0-4) unstable; urgency=low * Corrected Build-Depends, fixes #152355 * Corrected typo in README.Debian, fixes #153810 and #153448 (partially) -- Chris Jones Fri, 30 Aug 2002 10:56:47 +0100 numlockx (1.0-3) unstable; urgency=low * Added note about Xsession.d script to the manpage * Corrected a missing linebreak in the man page -- Chris Jones Wed, 3 Jul 2002 12:37:25 +0100 numlockx (1.0-2) unstable; urgency=low * Added Xsession.d script from Ariel Shkedi * Added README.Debian -- Chris Jones Mon, 24 Jun 2002 23:24:28 +0100 numlockx (1.0-1) unstable; urgency=low * Initial Release. -- Chris Jones Sun, 26 May 2002 02:47:06 +0100 debian/numlockx.default0000644000000000000000000000044312012646233012374 0ustar # Configuration file for numlockx # State of numlog on start of X session # Accepts following options: # auto - turns numlock on unless ran on laptop # on - turns numlock on # off - turns numlock off # keep - does not change numlock state # toggle - toggles numlock state NUMLOCK=auto debian/patches/0000755000000000000000000000000011754152062010620 5ustar debian/patches/series0000644000000000000000000000004311754151004012025 0ustar improve-help.patch get-state.patch debian/patches/improve-help.patch0000644000000000000000000000077311754150652014262 0ustar Subject: Improve help output From: Alkis Georgopoulos --- a/main.c +++ b/main.c @@ -54,7 +54,7 @@ printf( "NumLockX " VERSION "\n" "(C) 2000-2001 Lubos Lunak \n" "(C) 2001 Oswald Buddenhagen \n\n" - "Usage : %s [on|off]\n" + "Usage: %s [on|off|toggle]\n" "on - turns NumLock on in X ( default )\n" "off - turns NumLock off in X\n" "toggle - toggles the NumLock on and off in X\n" debian/patches/get-state.patch0000644000000000000000000000365411754152062013546 0ustar Subject: Add status command to numlockx From: Michal Čihař --- a/main.c +++ b/main.c @@ -54,10 +54,11 @@ printf( "NumLockX " VERSION "\n" "(C) 2000-2001 Lubos Lunak \n" "(C) 2001 Oswald Buddenhagen \n\n" - "Usage: %s [on|off|toggle]\n" + "Usage: %s [on|off|toggle|status]\n" "on - turns NumLock on in X ( default )\n" "off - turns NumLock off in X\n" "toggle - toggles the NumLock on and off in X\n" + "status - gets the NumLock status\n" "\n" , argv0 ); } @@ -150,7 +151,25 @@ XkbLockModifiers ( dpy, XkbUseCoreKbd, mask, mask); return 1; } - + +int xkb_status() + { + unsigned int mask; + unsigned int numlockState; + XkbStateRec xkbState; + if( !xkb_init()) + return 0; + mask = xkb_numlock_mask(); + if( mask == 0 ) + return 0; + XkbGetState( dpy, XkbUseCoreKbd, &xkbState); + numlockState = xkbState.locked_mods & mask; + if (numlockState) + printf("Numlock is on\n"); + else + printf("Numlock is off\n"); + return 1; + } #endif #ifdef HAVE_XTEST @@ -200,6 +219,14 @@ { xtest_change_numlock(); } + +void xtest_status() + { + if( xtest_get_numlock_state()) + printf("Numlock is on\n"); + else + printf("Numlock is off\n"); + } #endif void numlock_set_on() @@ -235,6 +262,17 @@ #endif } +void numlock_status() + { +#ifdef HAVE_XKB + if( xkb_status()) + return; +#endif +#ifdef HAVE_XTEST + xtest_status(); +#endif + } + int main( int argc, char* argv[] ) { if( argc > 2 ) @@ -256,6 +294,8 @@ numlock_set_off(); else if( strcmp( argv[ 1 ], "toggle" ) == 0 ) numlock_toggle(); + else if( strcmp( argv[ 1 ], "status" ) == 0 ) + numlock_status(); else { usage( argv[ 0 ] ); debian/numlockx.10000644000000000000000000000236311754152062011117 0ustar .\" 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 NUMLOCKX 1 "March 01, 2003" "X Version 11" .\" 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 insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME numlockx \- Control the state of NumLock .SH SYNOPSIS .B numlockx .RI [ on | off | toggle | status] .SH DESCRIPTION .BR numlockx is a program to control the NumLock key inside X11 session scripts. .SH OPTIONS .TP .B on Turn NumLock on .TP .B off Turn NumLock off .TP .B toggle Toggle NumLock to opposite status .TP .B status Gets the NumLock status .TP .B --help Display help .SH AUTHOR This manual page was written by Chris Jones and Michal Cihar for the Debian GNU/Linux system (but may be used by others). debian/copyright0000644000000000000000000000270011754150401011116 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: numlockx Source: http://home.kde.org/~seli/numlockx/ Files: * Copyright: (C) 2000-2010, Lubos Lunak (C) 2001, Oswald Buddenhagen License: BSD-3-clause Files: debian/* Copyright: 2010-2012 Michal Čihař License: BSD-3-clause License: BSD-3-clause Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/gbp.conf0000644000000000000000000000014611475473373010624 0ustar # Configuration file for git-buildpackage and friends [DEFAULT] sign-tags = True pristine-tar = True debian/control0000644000000000000000000000155212142161164010572 0ustar Source: numlockx Section: x11 Priority: optional Maintainer: Michal Čihař Build-Depends: autotools-dev, debhelper (>= 9), dpkg-dev (>= 1.13.19), libice-dev (>= 1:1.0.0), libx11-dev, libxtst-dev (>= 1:1.0.0), x11proto-xext-dev, xutils-dev Standards-Version: 3.9.4 Homepage: http://home.kde.org/~seli/numlockx/ Vcs-Browser: http://git.debian.org/?p=collab-maint/numlockx.git Vcs-Git: git://git.debian.org/git/collab-maint/numlockx.git Package: numlockx Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Suggests: x-display-manager Enhances: gdm, kdm, wdm, xdm Description: enable NumLock in X11 sessions Utilities to enable the keyboard's Numeric Lock during X11 session initialization or using command line utility. . The package automatically installs session script to enable numlock on session start. debian/dirs0000644000000000000000000000005611475466716010074 0ustar etc/X11/Xsession.d usr/bin usr/share/man/man1 debian/watch0000644000000000000000000000010411754147672010230 0ustar version=3 http://home.kde.org/~seli/numlockx/numlockx-(.*)\.tar\.gz debian/compat0000644000000000000000000000000212142161150010355 0ustar 9 debian/install0000644000000000000000000000004511475466716010577 0ustar debian/55numlockx etc/X11/Xsession.d debian/rules0000755000000000000000000000003611475467270010262 0ustar #!/usr/bin/make -f %: dh $@ debian/source/0000755000000000000000000000000011475466716010507 5ustar debian/source/format0000644000000000000000000000001411475466716011715 0ustar 3.0 (quilt)