Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: DanielH on March 10, 2021, 09:30:24 PM

Title: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 10, 2021, 09:30:24 PM
Dear "TinyCorers":

I'm "coming back to the future", the last TCL I've used was 4.0.7 (IIRC).
I habitually use Arch Linux + LXQt in my two laptops (i7-2620 8GB RAM for work, Core 2 Duo 2 GB RAM connected to my 42" LCD TV for fun)...

Now, I have installed TCL 12 in a 8 GB pendrive, with persistent tce, opt and home.
I will use this pendrive as a "portable system" to run some free software for Windows under wine (LDmicro, Tiny Multi Bootloader+, Kmap Minimizer, QElectrotech) in other computers.
Of course, I've installed some FLTK apps: fluff, flaxpdf, flviewer, flburn, flit; and a lot of non FLTK apps: Firefox (latest), LibreOffice, VLC, Xarchiver, Transmission, RecordMyDesktop, Pulseaudio, VLC, etc.

 I live in Argentina, the most common keyboards are es (desktops) and latam (laptops), but I need us configuration, too (LDmicro has hardware fixed shortcuts).
Thus, I've installed Xorg7.7 and its dependencies as OnBoot apps, and following TCL wiki I've created /etc/X11/xorg.conf and added it to .filetool, to properly configure my laptop keyboard (86 keys, non numeric keys).

Code: [Select]
tc@box:~$ less /etc/X11/xorg.conf
Section "InputDevice"
    Identifier "Keyboard0"
    Driver "kbd"
    Option "XkbLayout" "latam,es,us"
    Option "XkbModel" "pc86"
    Option "XkbVariant" "deadtilde,deadtilde,"
    Option "XkbOptions" "grp:shifts_toggle"
EndSection

But TCL refuses to load this configuration file at startup, and finally I have a partially not working keyboard: my cursor keys (up, down, left, right) an other auxiliary keys (Delete, Home, Page Up, Page Down, End) doesn't work.

TCL "running" keyboard:
Code: [Select]
tc@box:~$ setxkbmap -print -verbose 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/xorg...
Trying to load rules file /usr/local/share/X11/xkb/rules/xorg...
Success.
Applied rules from xorg:
rules:      xorg
model:      -layout
layout:     latam,es,us
options:    grp:shifts_toggle
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+latam+es:2+us:3+group(shifts_toggle)
geometry:   pc(pc104)
xkb_keymap {
        xkb_keycodes  { include "xfree86+aliases(qwerty)"       };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+latam+es:2+us:3+group(shifts_toggle)"};
        xkb_geometry  { include "pc(pc104)"     };
};

I've tryed using Option "XkbModel" "pc105" in my xorg.conf, without success. BTW: this options works very well under Arch Linux in my two laptops.
I've tryed using Option "XkbModel" "pc104" as setxkmap reports: xkb_geometry  { include "pc(pc104)"     }; no success, again...

I would appreciate your suggestions and thoughts on how to configure my keyboard in TCL.

Best regards,
DanielH

    [EDIT]: Added code tags.  Rich
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Juanito on March 10, 2021, 09:39:54 PM
I've created /etc/X11/xorg.conf and added it to .filetool, to properly configure my laptop keyboard (86 keys, non numeric keys).

Do things work if you put an xorg config snippet in /usr/local/share/X11/xorg.conf.d?

Have you used the getlocale extension to create mylocale and set an appropriate boot code?
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 10, 2021, 10:20:06 PM
@Juanito:

Thanks you for your quickly reply!

I've not used getlocale extension nor generated mylocale. I need to learn about this.

My extlinux.conf:

Code: [Select]
DEFAULT core
LABEL core
KERNEL /boot/vmlinuz
INITRD /boot/core.gz
APPEND waitusb=5 tce=UUID=a5757f2c-b960-4804-8200-7a7d77232d16 opt=UUID=a5757f2c-b960-4804-8200-7a7d77232d16 restore=UUID=a5757f2c-b960-4804-8200-7a7d77232d16 home=UUID=a5757f2c-b960-4804-8200-7a7d77232d16 multivt showapps settime tz=GMT+3

Tomorrow I'll try to put a xorg config snippet in /usr/local/share/X11/xorg.conf.d, as you suggest, and will report if it works.
Here is too late (3:15 A.M.), I need to sleep...

Best regards,
DanielH

    [EDIT]: Added code tags.  Rich
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Juanito on March 10, 2021, 10:39:41 PM
You could also look at the kmaps extension and kmap boot code
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: curaga on March 10, 2021, 11:14:40 PM
kmaps only affects the console and Xvesa, not Xorg.
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 11, 2021, 05:05:41 AM
@Juanito, @curaga:

I agree with curaga, kmap=la-latin1 boot code has no effect on my Xorg OnBoot system.

I've installed kmaps extension and included this boot code in the past, when I configure TCL to boot with Xvesa; it worked fine, all keys in my latam keyboard was full functional.

But now I prefer to boot with Xorg, to allow better screen resolution, size and color configuration, and "automagically" adapt TCL to run in various desktops and laptops. At last, wine (the main program that I will use) has Xorg as dependency. So configuring Xorg as OnBoot has big advantages for me.

The pendrive that I'm trying to use with TCL and the apps I've previously listed will be cloned (or perhaps remastered, but I have to learn about remastering procedures). Them will be used in short courses "Introduction to Automation with micro PLC" that I will dictate in person in a near future, when Covid-19 vaccine has a more spread in my country.

Today I will try to implement Juanito's suggestion: to put a xorg config snippet in /usr/local/share/X11/xorg.conf.d

Thanks for your kindly support!
Best regards,
DanielH
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Rich on March 11, 2021, 05:06:18 AM
Hi DanielH
Please use  Code Tags  when posting commands and responses seen in a terminal. To use  Code Tags  click on the  #  icon
above the reply box and paste your text between the  Code Tags  as shown in this example:

Quote
[code][   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517[/code]

It will appear like this in your post:
Code: [Select]
[   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517

Code Tags  serve as visual markers between what you are trying to say and the information you are posting. They also preserve
spacing so column aligned data displays properly. Code tags also automatically add horizontal and or vertical scrollbars
to accommodate long lines and listings.
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Rich on March 11, 2021, 05:10:57 AM
Hi DanielH
Just a heads up. You do not need this in your  extlinux.conf  file:
Code: [Select]
restore=UUID=a5757f2c-b960-4804-8200-7a7d77232d16It is the same location as your  tce  directory which is the default location for your backup anyway.
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 11, 2021, 05:34:29 AM
@Rich:

1.
Quote
Please use  Code Tags  when posting commands and responses seen in a terminal.
OK, I will do.
I've not visited TCL Forums for a long time...
My apologies: I have forgotten to use the formatting options that are available in the forum interface.  :P

2.
Quote
Just a heads up. You do not need this in your  extlinux.conf  file:
Thanks very much! I did not understand that tce is the default directory to save the backup...

I coming back to TCL after seven or more years, I forgotten how it works, functionalities, configs.
Please, consider me as a "re-newbie" for a while.

In the past, I used TCL for demos and friendly distro wars in certain editions of FLISoL (Latin American Linux Installation Festival).

My Linux way: Kubuntu > Debian stable with XFCE > Debian testing with XFCE > LMDE  with XFCE > ArchBan with OpenBox > Arch Linux with LXQt = stop).

3.
I'm argentinian and only speak spanish, I apologize if my english is not good enough.

Best regards,
DanielH
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Rich on March 11, 2021, 05:53:30 AM
Hi DanielH
No worries, it's all good. :)
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 12, 2021, 06:30:39 PM
@Juanito:

1.
Quote
Do things work if you put an xorg config snippet in /usr/local/share/X11/xorg.conf.d?

No, thigs doesn't work.
My /usr/local/share/X11/xorg.conf.d/01-xorg.conf, listed for backup in /opt/.filetool.lst:
Code: [Select]
Section "InputDevice"
    Identifier "Keyboard0"
    Driver "kbd"
    Option "XkbLayout" "latam,es,us"
    Option "XkbModel" "pc86"
    Option "XkbVariant" "deadtilde,deadtilde,"
    Option "XkbOptions" "grp:shifts_toggle"
EndSection

I've tryed with Option "XkbModel" "pc104" and Option "XkbModel" "pc105", nothing works.
Of course, I've previously deleted /etc/X11/xorg.conf and its entry in /opt/.filetool.lst.

Other keys or combinations that doesn't work:
Alt Gr (right Alt) + Q key, latam = at symbol.
Alt Gr (right Alt) + 2 key, es = at symbol.
Alt Gr alone produces a carriage return and new line in Editor, Firefox, but isn't recognized in Terminal (of course, right alt is not a valid character for vt).

Worst:
a. sometimes Option "XkbOptions" "grp:shifts_toggle" (both Shifts keys together) works, sometimes not (not at this moment, when I'm posting from Firefox in TCL).
b. sometimes cursor and Home, End, Page Up and Page Down keys  works, sometimes not (yes at this moment, when I'm posting from Firefox in TCL).
My keyboard is now freezed at en-US layout...

2.
Quote
Have you used the getlocale extension to create mylocale and set an appropriate boot code?

I've tryed, but mylocale.tcz and extlinux.conf code lang=es_AR.UTF-8 has no effect.
So I've deleted both...

3.
As a collateral issue: sometimes Wallpaper with a background image works, sometimes not.

 :(

Any idea?
Best regards,
DanielH


Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Juanito on March 12, 2021, 09:44:03 PM
If you add your /usr/local/share/X11/xorg.conf.d/01-xorg.conf, exit to the console prompt and "startx", do you see any messages about loading the keyboard in /var/log/Xorg.0.log?
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Juanito on March 12, 2021, 09:47:52 PM
I've tryed, but mylocale.tcz and extlinux.conf code lang=es_AR.UTF-8 has no effect.
So I've deleted both...

After reboot (with mylocale set "onboot" and lang=es_AR.UTF-8), what does the command "locale" give?
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 18, 2021, 11:38:13 AM
@Juanito:

I apologize for my delayed reply, I was very busy these last days...

Title: Re: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 18, 2021, 11:43:39 AM
@Juanito:

Quote
If you add your /usr/local/share/X11/xorg.conf.d/01-xorg.conf, exit to the console prompt and "startx", do you see any messages about loading the keyboard in /var/log/Xorg.0.log?

I send my /var/log/Xorg.0.log in an .txt attached file, I can't post it directly in forum (500 Internal Server Error when I try to post or preview).

I don't see any code about keyboard layout configuration...
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 20, 2021, 06:02:33 PM
Knock knock!!!
Anybody here?

I've tryed and tryed, but issue (persistent keyboard configuration on Xorg not working) insists on staying...
I've followed Juanito's suggestions and tips, nothing works.
I quit :(

Now I've deleted Xorg-7.7.tcz from /mnt/sdxn/tce/onboot.lst, restored kmaps.tcz on it, and added kmap=qwerty/la-latin1 code to my APPEND line in extlinux.conf.

My keyboard works well again, but I've have NOT Xorg at the graphical desktop, nor its automatic resolutions to my (various) displays :'(

I have an issue using some free windozers programs under wine (phisical keyboard isn't recognized), but I will post this and a partial solution using virtual keyboard xvkbd.

I will be waiting for new tips or recommendations on this problem using Xorg, but in the meantime I will try to use my own (and precarious) solution.

Kind regards,
DanielH
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Juanito on March 21, 2021, 01:45:54 AM
Are you missing the line "MatchIsKeyboard "on"" from your xorg.conf snippet?

i.e.
Code: [Select]
Section "InputDevice"
    Identifier "Keyboard0"
    MatchIsKeyboard "on"
    Driver "kbd"
    Option "XkbLayout" "latam,es,us"
...

You could also try:
Code: [Select]
$ setxkbmap [-model xkb_model] [-layout xkb_layout] [-variant xkb_variant] [-option xkb_options]
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 21, 2021, 07:45:00 PM
@Juanito:

Quote
Are you missing the line "MatchIsKeyboard "on"" from your xorg.conf snippet?

Yes, I've missed that code.
So, I've added  "MatchIsKeyboard "on"" and I've ended on a high resolution console with a warning:
Code: [Select]
failed in waitforX
startx in this console brings
Code: [Select]
failed in waitforX , again...

/var/log/Xorg.0.log complains: ""MatchIsKeyboard" is not a valid keyword in this section."
See attached Xorg.0.log.txt

But IIRC "MatchIsKeyboard" is a valid code for keyboard configuration...
As confirmation: see https://wiki.archlinux.org/index.php/Xorg/Keyboard_configuration (I use Arch Linux as my main distro).

So what?
I've deleted this offending code and reboot: Xorg works well again and now I'm posting from Firefox in TCL... but keyboard layout is en_US, and it's impossible to change this layout to latam or es using both Shifts simultaneously.

The issue has come back...
 >:(
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Juanito on March 21, 2021, 10:16:21 PM
Did you try the setxkbmap command?
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Rich on March 22, 2021, 04:51:46 AM
Hi DanielH
What happens if you replace:
Code: [Select]
Driver "kbd"with:
Code: [Select]
MatchIsKeyboard "on"
This line:
Code: [Select]
Option "XkbVariant" "deadtilde,deadtilde,"appears to have an extra  comma  after  deadtilde.

Make sure there is a carriage return after this line:
Code: [Select]
EndSection
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Rich on March 22, 2021, 05:12:53 AM
Hi DanielH
One more thing. Based on what I read here:
http://forum.tinycorelinux.net/index.php/topic,24864.msg158216.html#msg158216

It's possible this line:
Code: [Select]
Section "InputDevice"
Should look like this:
Code: [Select]
Section "InputClass"
That might explain this error:
... /var/log/Xorg.0.log complains: ""MatchIsKeyboard" is not a valid keyword in this section." ...
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 22, 2021, 08:14:32 AM
@Juanito:
Quote
Did you try the setxkbmap command?

Yes, and it works!
setxkbmap -model pc105 -layout latam -variant deadtilde
All is alright!

@Rich:

Today, I will try your suggestions and inform about results.

Quote
This line:
Code: [Select]
Option "XkbVariant" "deadtilde,deadtilde,"
appears to have an extra  comma  after  deadtilde.

I've defined three layouts in this order: latam, es, en.
latam and es layouts has deadtilde variants, en has not. So, I set this extra comma to expicitly confiure variants for each layout... I suposse that a null string after comma correspond to en layout.

BTW: I've discovered that correct layout for english US is us, NOT en.
I will modify my /usr/local/share/X11/xorg.conf.d/01-xorg.conf before try your tips.

Thanks you, TCL developers and maintainers, for your kindly support!


Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Rich on March 22, 2021, 08:40:31 AM
Hi DanielH
According to the man page:

https://www.systutorials.com/docs/linux/man/5-xorg.conf/#lbAI
MatchIsKeyboard  is not listed as an option for  InputDevice.

https://www.systutorials.com/docs/linux/man/5-xorg.conf/#lbAK
MatchIsKeyboard  is listed as an option for  InputClass.

That's why you got this error:
... /var/log/Xorg.0.log complains: ""MatchIsKeyboard" is not a valid keyword in this section." ...
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 23, 2021, 06:44:21 AM
@Rich:

You're right!
Section "InputClass" is the clue for partially solve this issue.
Attached in 01-xorg.cong.txt file, my new and working /usr/local/share/X11/xorg.conf.d/01-xorg.conf :

BTW:
Option "XkbOptions" "grp:shifts_toggle" doesn't works at all :-( , I don't know why...
Any idea?

@Juanito:

Code: [Select]
setxkbmap -model pc105 -layout latam -variant deadtilde

Code: [Select]
setxkbmap -model pc105 -layout es -variant deadtilde

Code: [Select]
setxkbmap -model pc105 -layout us

All these codes works well.

Thanks very much to juanito, Rich and all tinycorers that helped me to solve the initial issue!!!
Best regrads,
DanielH
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Rich on March 23, 2021, 07:28:21 AM
Hi DanielH
I don't see  XkbOptions  even showing up in the  xorg.conf  man page I linked to:
https://www.systutorials.com/docs/linux/man/5-xorg.conf

I did come across this:
https://medium.com/@damko/a-simple-humble-but-comprehensive-guide-to-xkb-for-linux-6f1ad5e13450

He states (emphasis mine):
Quote
There is no xorg.conf and no trace, in the whole X11 directory, of any XKB option. This is because most of the recent distributions don't use it anymore.

He suggests some alternatives to using xorg.conf. It might be worth a read. Be aware, you may have to adjust some
paths, such as  /usr/local/share/  instead of  /usr/share/.
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 23, 2021, 09:27:46 AM
@Rich
Quote
I did come across this:
https://medium.com/@damko/a-simple-humble-but-comprehensive-guide-to-xkb-for-linux-6f1ad5e13450

He states (emphasis mine):
Quote
There is no xorg.conf and no trace, in the whole X11 directory, of any XKB option. This is because most of the recent distributions don't use it anymore.

He suggests some alternatives to using xorg.conf. It might be worth a read. Be aware, you may have to adjust some
paths, such as  /usr/local/share/  instead of  /usr/share/.

Well, I think that article is not completely correct.

My keyboard configuration in Arch Linux:
Code: [Select]
[daniel@hardwork ~]$ setxkbmap -print -verbose 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     latam,us
variant:    deadtilde,
options:    grp:alts_toggle,grp:ctrls_toggle
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+latam(deadtilde)+us:2+inet(evdev)+level3(ralt_switch_for_alts_toggle):1+level3(ralt_switch_for_alts_toggle):2+group(ctrls_toggle)+group(alts_toggle)
geometry:   pc(pc105)
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+latam(deadtilde)+us:2+inet(evdev)+level3(ralt_switch_for_alts_toggle):1+level3(ralt_switch_for_alts_toggle):2+group(ctrls_toggle)+group(alts_toggle)"      };
        xkb_geometry  { include "pc(pc105)"     };
};

As can you see, it has options:    grp:alts_toggle,grp:ctrls_toggle
alts_toggle doesn't work in my system (perhaps because latam and es keyboards uses Alt right as Alt graphics, allowing input extra characters).
"ctrls_toggle" option works well.

I will try with "grp:ctrls_toggle" in my 01-xorg.conf, replacing "grp:shifts_toggle", and report my results.

Thanks you, again...
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: DanielH on March 25, 2021, 05:58:19 PM
@Rich and @Juanito:

"grp:ctrls_toggle" in my 01-xorg.conf, replacing "grp:shifts_toggle" neither allows change keyboard layout :-(
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: rullolex on April 13, 2021, 10:31:33 AM
Hi Daniel,

have you solved? I have the same problem  :(
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: rullolex on May 01, 2021, 12:11:59 AM
solved
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: Rich on May 01, 2021, 06:16:06 AM
Hi rullolex
Maybe you could share how you solved it in case someone else has the same problem?
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: rullolex on May 01, 2021, 08:12:47 AM
After a long research in che web and in the forum I have found this old post where gutmensch says to write inside the ./home/tc/xsession file the line:

Code: [Select]
[ -e /usr/local/bin/setxkbmap ] && setxkbmap -layout "de" -variant "nodeadkeys"
I changed "de" with "it" and works


http://forum.tinycorelinux.net/index.php?topic=6682.msg35017
Title: Re: Persistent keyboard configuration on Xorg not working
Post by: rullolex on May 01, 2021, 08:25:19 AM
Hi Rich

Hi rullolex
Maybe you could share how you solved it in case someone else has the same problem?


I think that one post fixed on top (like the translation one) with the solution of this kind of issues will be great.

I.e persistent keyboard layout with xvesa, with xorg, and other configuration things to make easy for future users