Skip to content

Commit 9159fd3

Browse files
committed
Initial import with numlockx 1.2 code
0 parents  commit 9159fd3

File tree

19 files changed

+11098
-0
lines changed

19 files changed

+11098
-0
lines changed

AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Lubos Lunak <l.lunak@kde.org>
2+
XKB stuff by Oswald Buddenhagen <ossi@kde.org>

ChangeLog

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2010-03-13 L.Lunak <l.lunak@kde.org>
2+
* 1.2
3+
* autotools upgrade
4+
2005-10-03 L.Lunak <l.lunak@kde.org>
5+
* 1.1
6+
* toggle option from Chris Vanden Berghe <Chris@vandenberghe.org>
7+
* autotools upgrade from Martin-Eric Racine <q-funk@iki.fi>
8+
2001-04-30 L.Lunak <l.lunak@kde.org>
9+
* 1.0
10+
* added XKB way of doing things from Oswald Buddenhagen <ossi@kde.org>
11+
* removed distro specific portions
12+
2000-11-14 L.Lunak <l.lunak@email.cz>
13+
* 0.3
14+
2000-08-30 L.Lunak <l.lunak@email.cz>
15+
* added more X11 cfg. paths
16+
* finally found out how to detect NumLock state without using XKB,
17+
i.e. replaced the test from KLeds by my own test
18+
2000-06-28 L.Lunak <l.lunak@email.cz>
19+
* added /usr/X11R6/lib/X11/xdm/Xsetup_0 and
20+
/usr/X11R6/lib/X11/xinit/xinitrc as possible paths for X init files
21+
* added 'make user_xinitrc'
22+
2000-06-14 L.Lunak <l.lunak@email.cz>
23+
* 0.2 - added another ugly hack, so it's now possible to detect
24+
NumLock state ( "borrowed" from KLeds
25+
by Hans Matzen <hans@tm.informatik.uni-frankfurt.de> )
26+
* added configure & Co.
27+
2000-02-18 ( or so ) L.Lunak <l.lunak@email.cz>
28+
* 0.1 - first version, ugly hack to change NumLock state in X

INSTALL

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
2+
--------------------------------------------------------------
3+
Please see README for package specific installation details.
4+
--------------------------------------------------------------
5+
6+
Basic Installation
7+
==================
8+
9+
These are generic installation instructions.
10+
11+
The `configure' shell script attempts to guess correct values for
12+
various system-dependent variables used during compilation. It uses
13+
those values to create a `Makefile' in each directory of the package.
14+
It may also create one or more `.h' files containing system-dependent
15+
definitions. Finally, it creates a shell script `config.status' that
16+
you can run in the future to recreate the current configuration, a file
17+
`config.cache' that saves the results of its tests to speed up
18+
reconfiguring, and a file `config.log' containing compiler output
19+
(useful mainly for debugging `configure').
20+
21+
If you need to do unusual things to compile the package, please try
22+
to figure out how `configure' could check whether to do them, and mail
23+
diffs or instructions to the address given in the `README' so they can
24+
be considered for the next release. If at some point `config.cache'
25+
contains results you don't want to keep, you may remove or edit it.
26+
27+
The file `configure.in' is used to create `configure' by a program
28+
called `autoconf'. You only need `configure.in' if you want to change
29+
it or regenerate `configure' using a newer version of `autoconf'.
30+
31+
The simplest way to compile this package is:
32+
33+
1. `cd' to the directory containing the package's source code and type
34+
`./configure' to configure the package for your system. If you're
35+
using `csh' on an old version of System V, you might need to type
36+
`sh ./configure' instead to prevent `csh' from trying to execute
37+
`configure' itself.
38+
39+
Running `configure' takes a while. While running, it prints some
40+
messages telling which features it is checking for.
41+
42+
2. Type `make' to compile the package.
43+
44+
3. Type `make install' to install the programs and any data files and
45+
documentation.
46+
47+
4. You can remove the program binaries and object files from the
48+
source code directory by typing `make clean'.
49+
50+
Compilers and Options
51+
=====================
52+
53+
Some systems require unusual options for compilation or linking that
54+
the `configure' script does not know about. You can give `configure'
55+
initial values for variables by setting them in the environment. Using
56+
a Bourne-compatible shell, you can do that on the command line like
57+
this:
58+
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
59+
60+
Or on systems that have the `env' program, you can do it like this:
61+
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
62+
63+
Compiling For Multiple Architectures
64+
====================================
65+
66+
You can compile the package for more than one kind of computer at the
67+
same time, by placing the object files for each architecture in their
68+
own directory. To do this, you must use a version of `make' that
69+
supports the `VPATH' variable, such as GNU `make'. `cd' to the
70+
directory where you want the object files and executables to go and run
71+
the `configure' script. `configure' automatically checks for the
72+
source code in the directory that `configure' is in and in `..'.
73+
74+
If you have to use a `make' that does not supports the `VPATH'
75+
variable, you have to compile the package for one architecture at a time
76+
in the source code directory. After you have installed the package for
77+
one architecture, use `make distclean' before reconfiguring for another
78+
architecture.
79+
80+
Installation Names
81+
==================
82+
83+
By default, `make install' will install the package's files in
84+
`/usr/local/bin', `/usr/local/man', etc. You can specify an
85+
installation prefix other than `/usr/local' by giving `configure' the
86+
option `--prefix=PATH'.
87+
88+
You can specify separate installation prefixes for
89+
architecture-specific files and architecture-independent files. If you
90+
give `configure' the option `--exec-prefix=PATH', the package will use
91+
PATH as the prefix for installing programs and libraries.
92+
Documentation and other data files will still use the regular prefix.
93+
94+
If the package supports it, you can cause programs to be installed
95+
with an extra prefix or suffix on their names by giving `configure' the
96+
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
97+
98+
Optional Features
99+
=================
100+
101+
Some packages pay attention to `--enable-FEATURE' options to
102+
`configure', where FEATURE indicates an optional part of the package.
103+
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
104+
is something like `gnu-as' or `x' (for the X Window System). The
105+
`README' should mention any `--enable-' and `--with-' options that the
106+
package recognizes.
107+
108+
For packages that use the X Window System, `configure' can usually
109+
find the X include and library files automatically, but if it doesn't,
110+
you can use the `configure' options `--x-includes=DIR' and
111+
`--x-libraries=DIR' to specify their locations.
112+
113+
Specifying the System Type
114+
==========================
115+
116+
There may be some features `configure' can not figure out
117+
automatically, but needs to determine by the type of host the package
118+
will run on. Usually `configure' can figure that out, but if it prints
119+
a message saying it can not guess the host type, give it the
120+
`--host=TYPE' option. TYPE can either be a short name for the system
121+
type, such as `sun4', or a canonical name with three fields:
122+
CPU-COMPANY-SYSTEM
123+
124+
See the file `config.sub' for the possible values of each field. If
125+
`config.sub' isn't included in this package, then this package doesn't
126+
need to know the host type.
127+
128+
If you are building compiler tools for cross-compiling, you can also
129+
use the `--target=TYPE' option to select the type of system they will
130+
produce code for and the `--build=TYPE' option to select the type of
131+
system on which you are compiling the package.
132+
133+
Sharing Defaults
134+
================
135+
136+
If you want to set default values for `configure' scripts to share,
137+
you can create a site shell script called `config.site' that gives
138+
default values for variables like `CC', `cache_file', and `prefix'.
139+
`configure' looks for `PREFIX/share/config.site' if it exists, then
140+
`PREFIX/etc/config.site' if it exists. Or, you can set the
141+
`CONFIG_SITE' environment variable to the location of the site script.
142+
A warning: not all `configure' scripts look for a site script.
143+
144+
Operation Controls
145+
==================
146+
147+
`configure' recognizes the following options to control how it
148+
operates.
149+
150+
`--cache-file=FILE'
151+
Use and save the results of the tests in FILE instead of
152+
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
153+
debugging `configure'.
154+
155+
`--help'
156+
Print a summary of the options to `configure', and exit.
157+
158+
`--quiet'
159+
`--silent'
160+
`-q'
161+
Do not print messages saying which checks are being made.
162+
163+
`--srcdir=DIR'
164+
Look for the package's source code in directory DIR. Usually
165+
`configure' can determine that directory automatically.
166+
167+
`--version'
168+
Print the version of Autoconf used to generate the `configure'
169+
script, and exit.
170+
171+
`configure' also accepts some other, not widely useful, options.
172+

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (C) 2000-2001 Lubos Lunak <l.lunak@kde.org>
2+
Copyright (C) 2001 Oswald Buddenhagen <ossi@kde.org>
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a
5+
copy of this software and associated documentation files (the "Software"),
6+
to deal in the Software without restriction, including without limitation
7+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
and/or sell copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in
12+
all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20+
DEALINGS IN THE SOFTWARE.

Makefile.am

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# $Id: Makefile.am,v 1.8 2001/04/30 19:34:10 seli Exp $
2+
3+
bin_PROGRAMS = numlockx
4+
5+
numlockx_SOURCES = main.c
6+
numlockx_LDADD = @XTESTLIB@ -lXext -lX11 @X_PRE_LIBS@
7+
numlockx_LDFLAGS = @X_LDFLAGS@
8+
INCLUDES = @X_INCLUDES@
9+
10+
CFLAGS = @CFLAGS@ -Wall -pedantic
11+
12+
EXTRA_DIST = AUTHORS LICENSE ChangeLog INSTALL README TODO
13+
14+
AUTOMAKE_OPTIONS = foreign
15+
16+
xsetup:
17+
@if test -n "@xsetup@"; then \
18+
echo "Modifying @xsetup@"; \
19+
rm -f @xsetup@.tmp ;\
20+
cat @xsetup@ | grep -v "numlockx" > @xsetup@.tmp ;\
21+
echo "# Turn NumLock on ( numlockx ) ---------------" >> @xsetup@.tmp ;\
22+
echo "${bindir}/numlockx " >> @xsetup@.tmp ;\
23+
echo "# numlockx -----------------------------------" >> @xsetup@.tmp ;\
24+
cp -f @xsetup@ ${srcdir}/xsetup.sav ;\
25+
cat @xsetup@.tmp > @xsetup@ ;\
26+
rm -f @xsetup@.tmp; \
27+
else \
28+
echo "Xsetup not found! - nothing to update";\
29+
fi
30+
31+
xsetup_uninstall:
32+
@if test -n "@xsetup@"; then \
33+
echo "Restoring @xsetup@"; \
34+
rm -f @xsetup@.tmp ;\
35+
cat @xsetup@ | grep -v "numlockx" > @xsetup@.tmp ;\
36+
cat @xsetup@.tmp > @xsetup@ ;\
37+
rm -f @xsetup@.tmp; \
38+
else \
39+
echo "Xsetup not found! - nothing to restore";\
40+
fi
41+
42+
xinitrc:
43+
@if test -n "@xinitrc@"; then \
44+
echo "Modifying @xinitrc@"; \
45+
rm -f @xinitrc@.tmp ;\
46+
cat @xinitrc@ | grep -v "numlockx" \
47+
| ( was_mod= ; \
48+
ifs_sav=$IFS ;\
49+
IFS= ;\
50+
while read ln; do \
51+
if test -n "$$ln"; then \
52+
if test "$${ln#\#}" = "$$ln" ; then \
53+
if test -z "$$was_mod"; then \
54+
was_mod=1 ;\
55+
echo "# Turn NumLock on ( numlockx ) ---------------";\
56+
echo "${bindir}/numlockx ";\
57+
echo "# numlockx -----------------------------------" ;\
58+
fi \
59+
fi \
60+
fi; \
61+
echo "$$ln" ;\
62+
done; \
63+
IFS=$$ifs_sav ;\
64+
if test -z "$$was_mod"; then \
65+
was_mod=1 ;\
66+
echo "# Turn NumLock on ( numlockx ) ---------------";\
67+
echo "${bindir}/numlockx ";\
68+
echo "# numlockx -----------------------------------" ;\
69+
fi \
70+
) \
71+
> @xinitrc@.tmp ;\
72+
cp -f @xinitrc@ ${srcdir}/xinitrc.sav ;\
73+
cat @xinitrc@.tmp > @xinitrc@ ;\
74+
rm -f @xinitrc@.tmp ;\
75+
else \
76+
echo "xinitrc not found! - nothing to update";\
77+
fi
78+
79+
xinitrc_uninstall:
80+
@if test -n "@xinitrc@"; then \
81+
echo "Restoring @xinitrc@"; \
82+
rm -f @xinitrc@.tmp ;\
83+
cat @xinitrc@ | grep -v "numlockx" > @xinitrc@.tmp ;\
84+
cat @xinitrc@.tmp > @xinitrc@ ;\
85+
rm -f @xinitrc@.tmp ;\
86+
else \
87+
echo "xinitrc not found! - nothing to restore";\
88+
fi
89+
90+
user_xinitrc:
91+
@if test -f ~/.xinitrc; then \
92+
echo "Modifying ~/.xinitrc"; \
93+
rm -f xinitrc.tmp ;\
94+
cat ~/.xinitrc | grep -v "numlockx" \
95+
| ( was_mod= ; \
96+
ifs_sav=$IFS ;\
97+
IFS= ;\
98+
while read ln; do \
99+
if test -n "$$ln"; then \
100+
if test "$${ln#\#}" = "$$ln" ; then \
101+
if test -z "$$was_mod"; then \
102+
was_mod=1 ;\
103+
echo "# Turn NumLock on ( numlockx ) ---------------";\
104+
echo "${bindir}/numlockx ";\
105+
echo "# numlockx -----------------------------------" ;\
106+
fi \
107+
fi \
108+
fi; \
109+
echo "$$ln" ;\
110+
done; \
111+
IFS=$$ifs_sav ;\
112+
if test -z "$$was_mod"; then \
113+
was_mod=1 ;\
114+
echo "# Turn NumLock on ( numlockx ) ---------------";\
115+
echo "${bindir}/numlockx ";\
116+
echo "# numlockx -----------------------------------" ;\
117+
fi \
118+
) \
119+
> xinitrc.tmp ;\
120+
cp -f ~/.xinitrc ${srcdir}/xinitrc.sav ;\
121+
cat xinitrc.tmp > ~/.xinitrc ;\
122+
rm -f xinitrc.tmp ;\
123+
else \
124+
echo "# Turn NumLock on ( numlockx ) ---------------" >> ~/.xinitrc; \
125+
echo "${bindir}/numlockx " >> ~/.xinitrc;\
126+
echo "# numlockx -----------------------------------" >> ~/.xinitrc;\
127+
chmod 700 ~/.xinitrc ; \
128+
fi

0 commit comments

Comments
 (0)