You are not logged in.
Pages: 1
OK Folks....
I've read through the wiki's. I've read through the documentation on www.x.org... I've done word searches on this bbs....
I've even read through user linux utils to add to my shell script that fires xfce....
I'm missing something.
How can I have the X server (x.org) turn on my num lock at launch, like KDE used to?
xset doesn't appear to work. "xset led -1" through 20 nothing...
Normal keyboard, normal everything.
Thanks!
Dave......
Offline
The only I found to activate the NumLock when Xfce starts was using this program:
//numlock.c
#include <X11/extensions/XTest.h>
#include <X11/keysym.h>
int main(void) {
Display* disp = XOpenDisplay( NULL );
if( disp == NULL )
return 1;
XTestFakeKeyEvent( disp, XKeysymToKeycode( disp, XK_Num_Lock), True, CurrentTime );
XTestFakeKeyEvent( disp, XKeysymToKeycode( disp, XK_Num_Lock), False, CurrentTime );
XCloseDisplay( disp );
return 0;
}
compile it with
gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o setnumlock numlock.c -lX11 -lXtst
then copy it to /usr/bin and add the line
setnumlock &
to your startxfce4 file
[]'s
Felipe Weckx
Offline
Thanks for the post....
I was driving in that direction mentally speaking.... I simply thought there was a better way than actually writing a program to do it.
I truly thought I was missing someting real obvious....but evidently not...
In my job,....I do C++ all the time, so thanks for the source! I'll use it!
Dave........
Offline
pacman -S numlockx
and add it to your autostart would do the job, too
Greets,
Ace[/code]
Offline
Yeah Dave, I also couldn't find any other solution other than using a program for it... that's a feature they should add to Xfce, since it's really useful.
[]'s
Felipe Weckx
Offline
as i am using kdm (kde login manager) to start my xfce session i dont know why my /home/user/.xinitrc lines did not make any effect on my session start (only makes effect when i do startx).
so i open as root the file /opt/xfce4/etc/xdg/xfce4/xinitrc and on the line after #!/bin/sh i put numlock &, and now when i login to my xfce4 session i have num lock set on ;D and thats it 8)
Offline
I made a pkgbuild awhile ago for that small c numlock program here
http://bbs.archlinux.org/viewtopic.php?p=83894
just copy the text and put in the same directory with the pkgbuild and do makepkg
Offline
Yeah Dave, I also couldn't find any other solution other than using a program for it... that's a feature they should add to Xfce, since it's really useful.
So long as its an optional feature. Mandrake put it in the startup scripts and it is the most annoying thing ever.
I have a laptop, so the number keys are right in the middle of my keyboard. So everytime that stupid numlock button is enabled, I have to turn it off, else im typing in numbers.
iphitus
Offline
Although you have to use the startx command in order for it to work, the easiest way I found was to simply:
# pacman -Sy numlockx
...and then I placed a call to it in my ~/.xinitrc file (before the exec startxfce4 line), like this:
numlockx &
Offline
If you're using a DM, ~/.xinitrc will never be used to start Xfce. Rather, you should make any desired changes to the global xinitrc by copying it to ~/.config/xfce4 and making the changes there.
[img]http://www.archlinux.org/logos/button.png[/img] [img]http://mandrivausers.org/style_emoticons/default/2thumbsup.gif[/img]
Offline
Just install numlockx, then create a file called numlockx.sh (or whatever) and put it in ~/Desktop/Autostart.
numlock.sh should contain the line
/usr/bin/numlockx
make numlock.sh executable using chmod and that's it.
Offline
Pages: 1