Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: meo on July 22, 2023, 12:26:34 PM

Title: [Solved] Swedish keyboard layout
Post by: meo on July 22, 2023, 12:26:34 PM
Yesterday a managed to overwrite my old TC sd card. Naturally I had a lot of backups on it to. Like photos etc. Well enough about that mishap (the story of my life). How can I change my keyboard layout to the swedish one and make it permanent so I don't have to load it all the time. Sorry I can't find the question mark. Will be very grateful for any help. Actually I found how to do it but I don't remember what it's called.
Title: Re: Swedish keyboard layout
Post by: CardealRusso on July 22, 2023, 04:00:12 PM
If you are using Xorg you can just add
[ -e /usr/local/bin/setxkbmap ] && setxkbmap -layout se -option ctrl:nocaps
in .xsession

For Xvesa:
https://www.youtube.com/watch?v=dOpHMqNeA6I
For Xorg:
https://www.youtube.com/watch?v=YwCs-Huoax4
Title: Re: Swedish keyboard layout
Post by: patrikg on July 22, 2023, 11:48:25 PM
Hej
Här har du en länk som jag skrev inte så länge sedan hur man ändrar till engelsk tangentbord, som du säkert enkelt kan ändra på till svenskt. Bara att ersätta uk till se. osv...

Title: Re: Swedish keyboard layout
Post by: patrikg on July 23, 2023, 12:32:32 AM
Förlåt jag glömde länken...här kommer den.

http://forum.tinycorelinux.net/index.php/topic,25863.msg165846.html#msg165846
Title: Re: Swedish keyboard layout
Post by: meo on July 23, 2023, 02:47:35 AM
Hej Patrik!

Have some problems resolving this keymap issue. Haven't used TC with a GUI for years. I use this command to set up the GUI

$tce-load -i TC
$startx

Which graphic interface does that give me? xvesa or Xorg? Thanks for your effort to help me out. I haven't used TC regularly for many years. I was there from the beginning after DSL but now I've forgotten a lot. So what would be the appropriate way to solve this? Thanks beforehand!

Greetings,
meo
Title: Re: Swedish keyboard layout
Post by: meo on July 23, 2023, 04:00:55 AM
Hej patrikg!

I changed your script and tried to run it but it didn't solve the problem. Perhaps I made a mistake when running it. I renamed it se_keymap.sh and ran it (at least I think I did). Any thoughts about it? How should I run the script? Maybe I did it the wrong way.

Kind greetings,
meo
Title: Re: Swedish keyboard layout
Post by: Rich on July 23, 2023, 07:15:14 AM
Hi meo
... Which graphic interface does that give me? xvesa or Xorg? ...
It gives you Xorg. Xvesa is only for x86 (32 bit). TC.tcz is
a piCore extension.
Title: Re: Swedish keyboard layout
Post by: patrikg on July 23, 2023, 10:25:52 AM
Yes you have to change the file content to your specific language.
Not just the file name.
If you can see this line you have to change it from uk to se.
Code: (bash) [Select]
\"XkbLayout\" \"uk\""
And another lines with uk you can also change it to se.


Title: Re: Swedish keyboard layout
Post by: meo on July 23, 2023, 10:55:47 AM
I have changed all the instances of uk to se but I still can't make it t]o work. I've been away from TC so long that I feel like a noob again. So how do I run the script? That's what I'm unsure of. Sorry for making such a fuzz about this but yesterday was the first day I could make GUI work on the piCore. Several things have changed in those years that I've been gone so to speak. So, how do I run the script? Thanks for putting up with me!

Kind Greetings,
meo
Title: Re: Swedish keyboard layout
Post by: meo on July 23, 2023, 11:37:26 AM
The only kmap I can find is in /usr/share/kmap and it is us.kmap. Am I missing the kmaps or are they located elsewhere?
Title: Re: Swedish keyboard layout
Post by: patrikg on July 23, 2023, 12:24:44 PM
kmaps is only for console like framebuffer.

So just past this lines into some terminal I think it will be fine.. And of course restart the system so x11 will read your new created file. This lines create the file se_keyboard.conf in the directory /etc/X11/xorg.conf.d/ you can check after you paste the lines with just the cat command that the file exist.

Code: (bash) [Select]
cat /etc/X11/xorg.conf.d/se_keyboard.conf


Code: (bash) [Select]
sudo su
mkdir -p /etc/X11/xorg.conf.d/
echo -e "Section \"InputClass\"" > /etc/X11/xorg.conf.d/se_keyboard.conf
echo -e "\tIdentifier \"keyboard defaults\"" >> /etc/X11/xorg.conf.d/se_keyboard.conf
echo -e "\tMatchIsKeyboard \"on\"" >> /etc/X11/xorg.conf.d/se_keyboard.conf
echo -e "\tOption \"XkbModel\" \"pc105\"" >> /etc/X11/xorg.conf.d/se_keyboard.conf
echo -e "\tOption \"XkbLayout\" \"se\"" >> /etc/X11/xorg.conf.d/se_keyboard.conf
echo -e "\tOption \"XkbVariant\" \"nodeadkeys\"" >> /etc/X11/xorg.conf.d/se_keyboard.conf
echo -e "\tOption \"XkbOptions\" \"terminate:ctrl_alt_bksp\"" >> /etc/X11/xorg.conf.d/se_keyboard.conf
echo -e "EndSection" >> /etc/X11/xorg.conf.d/se_keyboard.conf
echo -e "etc/X11/xorg.conf.d/se_keyboard.conf" >> /opt/.filetool.lst
filetool.sh -b -v
Title: Re: Swedish keyboard layout
Post by: patrikg on July 23, 2023, 12:37:54 PM
If your wish to get working åäö chars in console.. you have to install extension kmaps and change the command line argument to the linux kernel, don't know if you using picore or x86 of tinycore ?

But the syntax of change to the correct kmap and some another this like timezone and correct locale for console will be like this.

Extra commandline args:
Set correct timezone Europe/Stockholm and keymapping and language to Swedish.
Code: (bash) [Select]
showapps tz=CET-1CEST,M3.5.0,M10.5.0/3 kmap=qwerty/sv-latin1 lang=sv_SE
You can also read little more about this in this thread:
https://forum.tinycorelinux.net/index.php/topic,24893.msg164210.html#msg164210
Title: Re: Swedish keyboard layout
Post by: Rich on July 23, 2023, 03:53:11 PM
Hi meo
... So how do I run the script? ...
The commands patrikg lists in reply #10 create a configuration file called
/etc/X11/xorg.conf.d/se_keyboard.conf , not a script. The last 2 commands
he lists back up that file.

When Xorg starts, it reads the /etc/X11/xorg.conf.d/se_keyboard.conf file
and uses it to set up the keyboard.
Title: Re: Swedish keyboard layout
Post by: patrikg on July 23, 2023, 11:27:44 PM
Thank you Rich
For more informative explanation what I want to archive.
Title: Re: Swedish keyboard layout
Post by: meo on July 24, 2023, 03:02:15 AM
Thanks a lot for for your help patrikg and Rich! I truly appreciate it. Now I’ve messed up the micro sd card so I have to start over again. I remember manually changing the characters on the keyboard using DSL. The “Very small Linux” on a business card sized cd rom. I think (not accepting though) that the age is taking it’s toll on me. Thanks again for your time and effort to help me! I think I have to take the mission of getting piCore to run smoothly on my Raspberry Pi 4 B with 8 GB of RAM in a little slower pace but I’ll get there with the help of the eminent TC forums enthusiastic members.

Yours truly,
meo
Title: Re: Swedish keyboard layout
Post by: meo on July 24, 2023, 05:51:55 AM
OK, now I'm up and running again. Using piCore 13.1 now. Will try to fix a swedish keyboard layout on my micro sd harddrive.  ;)
Title: Re: Swedish keyboard layout
Post by: meo on July 26, 2023, 01:53:36 PM
Hi again!

Running piCore 14.0 at present and I can't change the keyboard layout to Swedish. Jag får krupp! Igen ska jag väl säga det var ju några år sedan sist. Har provat att köra ditt skript, patrikg, testat getlocale osv. But nothing works. Rich I added the line you suggested to .xsession but it doesn't work for me. I'm getting crazy! Now I can boot into GUI from the start so at least I figured that one out but still no Swedish keyboard layout. I don't get it. I guess you are all tired of this problem right now but it is like having a pebble in your shoe a real Pain in the rear. What more can I do?

Very thankful,
meo
Title: Re: Swedish keyboard layout
Post by: Rich on July 26, 2023, 02:41:15 PM
Hi meo
... Rich I added the line you suggested to .xsession but it doesn't work for me. ...
Which line did I suggest you add to .xsession? In which post did I make that suggestion?
Title: Re: Swedish keyboard layout
Post by: CardealRusso on July 26, 2023, 03:40:35 PM
Which line did I suggest you add to .xsession? In which post did I make that suggestion?
He must be referring to my suggestion in
If you are using Xorg you can just add...

Which is strange that it didn't work. Assuming you correctly placed this line at the end of the .xsession and it still didn't work, I can only conclude that you are not using Xorg.
Also, initially, i didn't know that you were referring to PiCore, because I don't understand anything about PiCore and I don't even know if it works the same. You should have said it was picore or created the topic in the picore session.

Keep in mind that there are some extensions that reset the keyboard defined by setxkbmap, for example raid-dm (this only happens when the extension is loaded manually, after login)

Could you share the contents of your .xsession and, with Rich's help, be sure you're using Xorg?
Title: Re: Swedish keyboard layout
Post by: Rich on July 26, 2023, 08:13:07 PM
Hi CardealRusso
... and, with Rich's help, be sure you're using Xorg?
He said he was using TC.tcz. That means piCore and Xorg.
If you look at the TC.tcz.dep file you'll see it's for Xorg:
Code: [Select]
Xorg.tcz
flwm_topside.tcz
wbar.tcz
aterm.tcz
http://tinycorelinux.net/13.x/armv7/tcz/TC.tcz.dep
Title: Re: Swedish keyboard layout
Post by: patrikg on July 27, 2023, 12:29:02 AM
Hello Meo

Hej igen, då får vi väl ta det på ett annat vis, det finns sällan en lösning på ett problem.

Can you take(download) this file within this post, and put it in your home directory. That will be /home/tc.


1. First we need to make as root.
Code: (bash) [Select]
sudo su -

2. Next we need have to make the directory like this.
Code: (bash) [Select]
mkdir -p /etc/X11/xorg.conf.d/
3. Next we need to copy the file to that directory, don't know where to file is located now but lets say that the file is in your home directory, that you have download it there.
Code: (bash) [Select]
cp /home/tc/se_keyboard.conf /etc/X11/xorg.conf.d/se_keyboard.conf

4. Next you need to make this file do it's thing every boot(persistent).
    You need to add one line to this ".filetool.lst" file.
    The very easy way of doing that can be done with oneliner is this way.
Code: (bash) [Select]
echo -e "etc/X11/xorg.conf.d/se_keyboard.conf" >> /opt/.filetool.lst

5. Next we have to make the backup of the system, so our new file will be there (copied over) then we start our system next time.
Code: (bash) [Select]
filetool.sh -b -v

6. That's all, now we can test if it works if we boot our system.
Code: (bash) [Select]
reboot
Title: Re: Swedish keyboard layout
Post by: meo on July 27, 2023, 02:11:43 AM
Hi guys!

First of all I want to apologize for being absentminded and making this thread a mess. Naturally it was never my intention. I want to say thanks to everybody that has made an effort to help me. That shows that the TC forum works very well. I should have pointed out that I was using piCore from the beginning. That would have avoided a lot of confusion. Probably I should have started this thread (asking for help) in another location of this forum. Last but not least I want to thank patrikg for putting up with my constant mistakes and finally helping me to get my Swedish keyboard layout. Thanks a lot! I will be more cautious to start threads where they belong in the future. So finally thanks to all of you that has helped and made me learn things about TC that I unfortunately have forgotten! Now I'm all set to explore the world of TC through piCore again.

Thanks to all for putting up with me and trying to help me out! I've learned a lot!  :)

Kind regards,
meo
Title: Re: Swedish keyboard layout
Post by: patrikg on July 27, 2023, 03:43:07 AM
You welcome.
I glad that I can help you.

//Patrik
Title: Re: Swedish keyboard layout
Post by: CardealRusso on July 29, 2023, 07:39:12 AM
Now I’ve messed up the micro sd card so I have to start over again.
It wasn't clear to me if you were able to solve the problem.

You could run the command directly:
setxkbmap -layout se -option ctrl:nocaps
In the terminal and check if it solves?
Title: Re: Swedish keyboard layout
Post by: patrikg on July 29, 2023, 09:13:40 AM
Don't think you need to do this type of workaround, to get the keyboard layout correct in X11.

I think it's better to let the X11 do it's thing with the correct config file that you can provide in correct directory like my solution.

I think Meo now get the correct Swedish keyboard layout.

So some moderator could mark this thread as solved ??
I think also you Meo as thread author, can mark this as solved, just edit the Title to solved.

Or do we need to deep any deeper into this problem Meo ??
Title: Re: Swedish keyboard layout
Post by: CardealRusso on July 29, 2023, 01:10:03 PM
@patrikg
I'm just exposing an alternative, you don't need to feel threatened or think (a lot) that everyone is obliged to do what you see as the only correct option.

And please don't call a native, single-function command a workaround. That's a solution.
Title: Re: Swedish keyboard layout
Post by: jazzbiker on July 29, 2023, 01:43:10 PM
So some moderator could mark this thread as solved ??
I think also you Meo as thread author, can mark this as solved, just edit the Title to solved.

Hi patrikg,

It is not possible to edit the topic title. Meo as the topic starter may ask Rich, our admin, to edit the topic title and mark it as solved.

PS Hi Rich!
Title: Re: [Solved] Swedish keyboard layout
Post by: Rich on July 29, 2023, 01:43:48 PM
Hi patrikg
... So some moderator could mark this thread as solved ?? ...
Agreed. So marked.

Quote
... I think also you Meo as thread author, can mark this as solved, just edit the Title to solved. ...
The original post is the correct place to do that. After 30 minutes you
can no longer edit a post you have made, so you need to ask an
administrator to do it for you.