Page 1 of 2

Permanent and systematic loading of the canadian Keyboard

Posted: 19 Jul 2011, 13:03
by francois
I would like to have the permanent and systematic loading of the canadian Keyboard at each bootup. Even though I set the canadian keyboard for a session, it does not remain from one session to the other. Although I have a save change folder. How do I set this option?

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 19 Jul 2011, 13:51
by Hamza
Hi,

Please post more informations.
4. Include logs and tell us what commands were executed. What we want the most are: /var/log/dmesg and /var/log/messages. Use pastebin.com for long and multiple files. Jayflood's 'Porteus System Info' tool can be also very helpful - you can launch it from Kmenu/Lxde menu and receive a lot of useful info about your system straight on the desktop. Remember: nobody can help you if they don't know what's wrong, or what you did to get the error you received. Providing this information will greatly aid others in assisting you, and will allow us to diagnose your problem easier and sooner.

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 20 Jul 2011, 03:21
by brokenman
have you used the 'Language Selection Tool?'

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 20 Jul 2011, 15:33
by BlackRider
I think Porteus lacks of automatic keyboard settings at startup.

The solution adopted by Knoppix should be applied in Porteus if posible. When you start Knoppix, you have the option of adding "lang=es" as a cheatcode. Doing so grants that the keyboard will load itself in and behave well even when Xorg is up.

If the approach taken by Knoppix was adopted, then configuring the keyboard would be as easy as adding a cheatcode in the bootloader's config file.

When you are used to boot in Always Fresh mode, it is really annoying to reconfigure the keyboard with setxkbmap once, and again, and again...

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 20 Jul 2011, 19:51
by francois
There was not such a problem with slax. Once you would change the keyboard setting in one session, given that you would use the save change option, it would remember it.

So what was the trick?

Posted after 2 hours 27 minutes:
brokenman wrote:have you used the 'Language Selection Tool?'
Thanks brokenman. I will try that.

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 20 Jul 2011, 19:53
by fanthom
@francois
i have checked it and seems that switching kbd layout settings with left mouse click on the flag in tray and "alt+shift" shortcuts works only temporarily (nothing is saved in changes folder).
to sort out this issue you must call kdb settings applet in kde, set your kdm layout and click "Apply" button. you can launch it from console with "kcmshell4 kcm_keyboard" (kde4) or "kcmshell keyboard_layout" (kde3) command.
for LXDE you have to edit ~/.config/autostart/xkb.desktop manually.

other solution mentioned by brokenman is to use "Language Selection Tool".

@BlackRider
"I think Porteus lacks of automatic keyboard settings at startup."
LST is the solution - pls try it.

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 20 Jul 2011, 21:29
by BlackRider
LST is the solution - pls try it.
Are you refering to Low Stress Training :D ??

Yeah, Language selection tool could be of some help in USB drives (not tried yet). But what about CDs?

In any other Live distribution I have tried, you could choose your keyboard settings by appending the lang=xx cheatcode and kmap=xx, or at least you had a similar option. Porteus will boot with an unfriendly keyboard anyway . Worse yet, the menu displayed in the bar does not include my language, so I am supposed to know the setxkbmap trick! No many newcomers would know that trick.

Yes, I could use LST, but LST displays a message about downloading stuff. A bad thing, because it asumes:

1 – That you have Linux compatible networking hardware and you have managed to set it up and running. Not true in some cases (my modem is not recognized by default without some tweaking).

2 – That your network is able to download that stuff. True in most cases. Not in mine :wall: . Have you got an idea of how much time it took to load this forum from my house?

LST is nice, but i think the capability of selecting a keyboard from the start prompt is a MUST.

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 20 Jul 2011, 23:22
by fanthom
@BlackRider
no problem. in Porteus 1.1 i will introduce new cheatcode: "kmap=" which gonna operate in /opt/porteus-scripts/paths (this script sets some variables for GUI).

here is the code:

Code: Select all

KMAP=`egrep -o " kmap=[^[:space:]]+" /proc/cmdline | cut -d= -f2`
[ "$KMAP" = "" ] || setxkbmap $KMAP
(you can try it even now)
btw: LST is still recommended as most complex and efficient solution. some lang files are exported from Porteus ISO and can be downloaded back only by using LST.

@Ahau
pls add description to the new cheatcode in /boot/cheatcodes.txt. here is my draft:
"kmap=
this cheatcode lets you set preferred keyboard layout for KDE/LXDE/other desktop. Full list of supported layouts can be found in /etc/X11/xkb/symbols folder.
Example: 'kmap=ara' parameter will set arabic keyboard layout on start."

Thanks guys.

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 21 Jul 2011, 01:09
by francois
@BlackRider and Fanthom:
appending the lang=xx cheatcode and kmap=xx ... in menu.lst
is an excellent and widely adopted solution.

I am on kde. I will try one or the other of the propositions.

Thanks.

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 21 Jul 2011, 09:47
by Hamza
What is your version? arch?

I will write a small script to make a module of keyboard configuration.

Re: Permanent and systematic loading canadian Keyboard

Posted: 21 Jul 2011, 14:43
by francois
Porteus v 1.0 32-bit. To my knowledge there is no such keyboard issue on 64-bit.

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 21 Jul 2011, 15:35
by Hamza
My script,

Tested and Approved by Me ;)

This tool is compatible with Porteus V1.0 32-bit ONLY

Code: Select all

#!/bin/bash

if [ "`whoami`" = "root" ]; then
ME=/root
else
ME=/home/guest
fi

CFG=$ME/.kde/share/config/kxkbrc

dialog --title "Welcome" --infobox 'Welcome to Porteus Keymap Saver\nHere, you will be able to save your keymap configuration.This tool is compatible with Porteus V1.0 32bit ONLY\n\nBefore to run this script, you must have set your keyboard layouts!! ' 10 70
read
if [ "`uname -m`" == "x86_64" ]; then
dialog --title "Error" --infobox "This tool is compatible with Porteus V1.0 32bit ONLY" 10 70
exit 1
fi

if [ ! -e "$CFG" ]; then
dialog --title "Error" --infobox 'The Keyboard config file does not exist' 5 70
exit 1
fi


TMP=/tmp/pkmap
[ -d "$TMP" ] && rm -Rf $TMP
mkdir $TMP
mkdir $TMP/`whoami`/
mkdir $TMP/`whoami`/.kde/
mkdir $TMP/`whoami`/.kde/share/
mkdir $TMP/`whoami`/.kde/share/config/


if [ "`whoami`" = "root" ]; then
PTH=/tmp/pkmap/root/.kde/share/config/
else
PTH=/tmp/pkmap/home/guest/.kde/share/config/
fi

cp -R $CFG $PTH
dir2xzm /tmp/pkmap $ME/Desktop/my-keyboard-settings.xzm
The module with your keyboard configuration will be saved in your current desktop.

Enjoy!

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 29 Jul 2011, 19:09
by Ahau
@fanthom,

I'll bet you thought I forgot about this :)

Here's a draft for the cheatcodes.txt doc for V1.1:

Code: Select all

kmap=keyboardmap

   ... Specifies the preferred keyboard layout for KDE/LXDE or other
       desktop.  A full list of supported layouts can be found in the
       /etc/X11/xkb/symbols folder.

       Example: 'kmap=ara' will set the arabic keyboard layout at 
       startup.
If this works, I'll put it into the cheatcodes.txt file from V1.0, then submit it as a patch in this thread:

http://porteus.org/forum/viewtopic.php? ... +patch+1.1

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 31 Jul 2011, 02:54
by francois
@hamza: thanks for your kindness. You are always there with a solution.

@ahau: you are fast as lightning with your pen or I rather say with your us keyboard. Next bootup of my machine under frugal install save changes will come up to an answer to your suggestion. :twisted: As soon as we get v 1.1 on hands. :roll:

Posted after 1 hour 7 minutes 45 seconds:
fanthom wrote:@francois
...
"kcmshell4 kcm_keyboard" (kde4) or "kcmshell keyboard_layout" (kde3) command.
for LXDE you have to edit ~/.config/autostart/xkb.desktop manually.
...

.
@fanthom: Thanks, this solution of yours, is my preferred one. This olution works quite fine on kde3

I would add, why can't we just adjust it as in the previous versions of porteus? That is thru thru the gui on the keyboard layout.

Re: Permanent and systematic loading of the canadian Keyboar

Posted: 31 Jul 2011, 09:08
by fanthom
why can't we just adjust it as in the previous versions of porteus? That is thru thru the gui on the keyboard layout.
i think i have answered this question already:
"switching kbd layout settings with left mouse click on the flag in tray and "alt+shift" shortcuts works only temporarily (nothing is saved in changes folder). to sort out this issue you must call kdb settings applet in kde, set your kbd layout and click "Apply" button."

i'm pretty convinced that it works the same way in kde-3.5.10 :wink:

cheers