You are not logged in.

#1 2005-03-21 22:26:07

dcbdbis
Member
From: Aurora, Colorado
Registered: 2004-09-10
Posts: 247

Num Lock and XFCE4

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

#2 2005-03-21 23:29:17

holskoiff
Member
From: São Paulo
Registered: 2005-03-16
Posts: 38

Re: Num Lock and XFCE4

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

#3 2005-03-22 03:49:33

dcbdbis
Member
From: Aurora, Colorado
Registered: 2004-09-10
Posts: 247

Re: Num Lock and XFCE4

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

#4 2005-03-22 10:25:08

AceTheFace
Member
From: Ulm/Germany
Registered: 2005-03-21
Posts: 14

Re: Num Lock and XFCE4

pacman -S numlockx

and add it to your autostart would do the job, too smile

Greets,
Ace[/code]

Offline

#5 2005-03-23 00:23:08

holskoiff
Member
From: São Paulo
Registered: 2005-03-16
Posts: 38

Re: Num Lock and XFCE4

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

#6 2005-06-30 20:50:33

rdoggsv
Member
From: /home
Registered: 2005-06-24
Posts: 79
Website

Re: Num Lock and XFCE4

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

#7 2005-06-30 21:15:35

droog
Member
Registered: 2004-11-18
Posts: 877

Re: Num Lock and XFCE4

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

#8 2005-07-01 01:25:58

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Num Lock and XFCE4

holskoiff wrote:

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

#9 2005-07-01 02:29:03

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: Num Lock and XFCE4

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

#10 2005-08-22 10:10:02

andrewski
Member
Registered: 2005-06-08
Posts: 21

Re: Num Lock and XFCE4

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

#11 2005-11-01 20:27:42

makz
Member
Registered: 2004-12-07
Posts: 27

Re: Num Lock and XFCE4

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

Board footer

Powered by FluxBB