19fcd changing keyboard layout - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > General

General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Reply
 
Thread Tools Display Modes
  #1  
Old December 1st, 2010, 22:43
bbzz bbzz is offline
Member
 
Join Date: Nov 2010
Location: random
Posts: 826
Thanks: 77
Thanked 119 Times in 79 Posts
Default changing keyboard layout

Greetings,

Can anyone help with this; I need to change my standard US layout to support Serbian (Latin only would suffice) letters. Does anyone know how can i do that, and how to switch back and forth between the two without restarting the system.
Much obliged.
Reply With Quote
  #2  
Old December 1st, 2010, 22:48
graudeejs's Avatar
graudeejs graudeejs is offline
Style(9) Addict
 
Join Date: Nov 2008
Location: Riga, Latvia
Posts: 4,525
Thanks: 422
Thanked 607 Times in 475 Posts
Default

I use: setxkbmap(1) Comes with Xorg.
To switch to my native lang I run
$ setxkbmap lv
Be aware, that If you switch to lang, that doesn't have latin characters, then you won't be able to type setxkbmap again to switch back...

I eliminated this problem by making custom fvwm menu for language switching. Also to switch languages faster, I assigned fvwm key bindings to switch between latvian and russian languages
Reply With Quote
  #3  
Old December 2nd, 2010, 05:24
jotawski's Avatar
jotawski jotawski is offline
Member
 
Join Date: Nov 2008
Location: park kred/nontabury/thai
Posts: 198
Thanks: 208
Thanked 3 Times in 3 Posts
Default

Hi,

Just for your informations, I used to ask here about thai keyboard layout switching too. But I forgot where it is now. Please have a look at hal and fdi for keywords.

Another way is using xorg.conf. Also I got suggestion from this forum. I have attched my xorg.conf for switching from thai to english with this post too.

Sorry, I can not attach file but here it is

Code:
Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	Screen      1  "Screen1" RightOf "Screen0"
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/local/lib/xorg/modules"
	FontPath     "/usr/local/lib/X11/fonts/misc/"
	FontPath     "/usr/local/lib/X11/fonts/TTF/"
	FontPath     "/usr/local/lib/X11/fonts/OTF"
	FontPath     "/usr/local/lib/X11/fonts/Thai/"
	FontPath     "/usr/local/lib/X11/fonts/local/"
	FontPath     "/usr/local/lib/X11/fonts/util/"
	FontPath     "/usr/local/lib/X11/fonts/bitstream-vera/"
	FontPath     "/usr/local/lib/X11/fonts/texcm-ttf/"
	FontPath     "/usr/local/lib/X11/fonts/Type1/"
	FontPath     "/usr/local/lib/X11/fonts/100dpi/"
	FontPath     "/usr/local/lib/X11/fonts/75dpi/"
	FontPath     "/usr/local/lib/X11/fonts/TrueType/"
	FontPath     "/usr/local/lib/X11/fonts/webfonts/"
	FontPath     "/usr/local/lib/X11/fonts/urwfonts-ttf/"
	FontPath     "/usr/local/lib/X11/fonts/URW/"
	FontPath     "/usr/local/share/fonts/amspsfont/type1/"
	FontPath     "/usr/local/share/fonts/cmpsfont/type1/"
	FontPath     "unix/:7101"
EndSection

Section "Module"
	Load  "extmod"
	Load  "record"
	Load  "dbe"
	Load  "glx"
	Load  "dri"
	Load  "dri2"
	Load  "freetype"
	Load  "type1"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
#	Option	"XkbRules" "xorg"
#	Option	"XkbModel"	"pc105"
#	Option	"XkbLayout"	"us,th"
#	Option	"XkbOptions"	"grp:ctrl_shift_toggle"
###
	Option	"XkbRules" "xorg"
	Option	"XkbModel"	"pc105"
	Option	"XkbLayout"	"us,th"
	Option	"XkbVariant"	"tis"
	Option	"XkbOptions"	"grp:alt_shift_toggle"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/sysmouse"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Monitor"
	Identifier   "Monitor1"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "NoAccel"            	# [<bool>]
        #Option     "SWcursor"           	# [<bool>]
        #Option     "ColorKey"           	# <i>
        #Option     "CacheLines"         	# <i>
        #Option     "Dac6Bit"            	# [<bool>]
        #Option     "DRI"                	# [<bool>]
        #Option     "NoDDC"              	# [<bool>]
        #Option     "ShowCache"          	# [<bool>]
        #Option     "XvMCSurfaces"       	# <i>
        #Option     "PageFlip"           	# [<bool>]
	Identifier  "Card0"
	Driver      "intel"
	VendorName  "Intel Corporation"
	BoardName   "82852/855GM Integrated Graphics Device"
	BusID       "PCI:0:2:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "NoAccel"            	# [<bool>]
        #Option     "SWcursor"           	# [<bool>]
        #Option     "ColorKey"           	# <i>
        #Option     "CacheLines"         	# <i>
        #Option     "Dac6Bit"            	# [<bool>]
        #Option     "DRI"                	# [<bool>]
        #Option     "NoDDC"              	# [<bool>]
        #Option     "ShowCache"          	# [<bool>]
        #Option     "XvMCSurfaces"       	# <i>
        #Option     "PageFlip"           	# [<bool>]
	Identifier  "Card1"
	Driver      "intel"
	VendorName  "Intel Corporation"
	BoardName   "82852/855GM Integrated Graphics Device"
	BusID       "PCI:0:2:1"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

Section "Screen"
	Identifier "Screen1"
	Device     "Card1"
	Monitor    "Monitor1"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection
And here is my /usr/local/etc/hal/fdi/policy/x11-input.fdi for additional informations.

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.keyboard">
<merge key="input.x11_options.XkbModel" type="string">pc105</merge>
<merge key="input.x11_options.XkbLayout" type="string">us,th</merge>
<merge key="input.x11_options.XkbOptions" type="string">grp:alt_shift_toggle</merge>
<!--
<append key="input.x11_options.XkbOptions" type="string">terminate:ctrl_alt_bksp</append>
-->
</match>
</device>
</deviceinfo>
hope this helps.
__________________
best regards,
jotawski

http://makham.blogspot.com FreeBSD for thai

Last edited by jotawski; December 2nd, 2010 at 05:34. Reason: can not attch file and add fdi file
Reply With Quote
  #4  
Old December 7th, 2010, 17:46
bbzz bbzz is offline
Member
 
Join Date: Nov 2010
Location: random
Posts: 826
Thanks: 77
Thanked 119 Times in 79 Posts
Default

I finally got to try this (was stuck on win machine for a few days)...
$ setxkbmap rs

Which gives me ?????? no matter what i type.
After little bit of search i found that i need to do something with sr_YU.ISO8859-2 in order to see those letters. I see those files in /usr/local/share/nls, /usr/local/lib/X11/fonts/..., etc. What do i do with it, and how I do it in most painless way so I can revert back to US keymap without restarting Xorg?

Thanks again
Reply With Quote
  #5  
Old December 7th, 2010, 19:31
Beastie Beastie is offline
Senior Member
 
Join Date: Mar 2009
Location: /dev/earth0
Posts: 1,702
Thanks: 0
Thanked 301 Times in 245 Posts
Default

Quote:
Originally Posted by bbzz View Post
$ setxkbmap rs

Which gives me ?????? no matter what i type.
Where are you trying?
The application must support the fonts. If I open Leafpad, for example, I'm able to type the Serbian alphabet:
Code:
љњертзуиопшђасдфгхјклчћжџцвбнм
Quote:
Originally Posted by bbzz View Post
how I do it in most painless way so I can revert back to US keymap without restarting Xorg?
In the same way, by running
% setxkbmap us
But that would be quite difficult with your current keymap hehe. So, like killasmurf86 already said, you add both to your window manager's root menu.
__________________
May the source be with you!
Reply With Quote
The Following User Says Thank You to Beastie For This Useful Post:
bbzz (December 7th, 2010)
  #6  
Old December 7th, 2010, 19:41
graudeejs's Avatar
graudeejs graudeejs is offline
Style(9) Addict
 
Join Date: Nov 2008
Location: Riga, Latvia
Posts: 4,525
Thanks: 422
Thanked 607 Times in 475 Posts
Default

try sr_YU.UTF-8
Everyone and everything should use Unicode by Now... even stupid Windows (Don't know if it actually supports uft-8)
Reply With Quote
The Following User Says Thank You to graudeejs For This Useful Post:
bbzz (December 7th, 2010)
  #7  
Old December 7th, 2010, 19:44
bbzz bbzz is offline
Member
 
Join Date: Nov 2010
Location: random
Posts: 826
Thanks: 77
Thanked 119 Times in 79 Posts
Default

Hi!
See, that's the thing, I probably don't have fonts installed. I see squares instead of those letter you typed i this Opera browser
So how do I go about installing those fonts? Seems that's the culprit of the problem.
Reply With Quote
  #8  
Old December 7th, 2010, 19:48
bbzz bbzz is offline
Member
 
Join Date: Nov 2010
Location: random
Posts: 826
Thanks: 77
Thanked 119 Times in 79 Posts
Default

Quote:
Originally Posted by killasmurf86 View Post
try sr_YU.UTF-8
Everyone and everything should use Unicode by Now... even stupid Windows (Don't know if it actually supports uft-8)
Where do I input that exactly?
Reply With Quote
  #9  
Old December 7th, 2010, 19:54
graudeejs's Avatar
graudeejs graudeejs is offline
Style(9) Addict
 
Join Date: Nov 2008
Location: Riga, Latvia
Posts: 4,525
Thanks: 422
Thanked 607 Times in 475 Posts
Default

Depends on your desktop environment.... for light-width desktop It's easy
add to your ~/.xinitrc
Code:
LANG="lv_LV.UTF-8"
LC_ALL="lv_LV.UTF-8"
LC_COLLATE="lv_LV.UTF-8"
LC_CTYPE="lv_LV.UTF-8"
LC_MESSAGES="lv_LV.UTF-8"
LC_MONETARY="lv_LV.UTF-8"
LC_NUMERIC="lv_LV.UTF-8"
LC_TIME="lv_LV.UTF-8"
export LANG LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME XDG_CONFIG_HOME LC_ALL
For Real desktop environments search forum about "localization", there have been many threads about it, I'm tired searching and posting links regarding this....

About fonts. I install these (pasted part of my desktop metaport)
Code:
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/local/unifont.ttf:${PORTSDIR}/x11-fonts/gnu-unifont-ttf
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/junicode:${PORTSDIR}/x11-fonts/junicode
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/terminus-font:${PORTSDIR}/x11-fonts/terminus-font
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/Droid:${PORTSDIR}/x11-fonts/droid-fonts-ttf
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/ecofont:${PORTSDIR}/x11-fonts/ecofont
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/code2001:${PORTSDIR}/x11-fonts/code2001
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/dejavu:${PORTSDIR}/x11-fonts/dejavu
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/freefont-ttf:${PORTSDIR}/x11-fonts/freefont-ttf
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/gentium:${PORTSDIR}/x11-fonts/gentium
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/Khmer:${PORTSDIR}/x11-fonts/khmeros
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/lfpfonts-fix:${PORTSDIR}/x11-fonts/lfpfonts-fix
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/lfpfonts-var:${PORTSDIR}/x11-fonts/lfpfonts-var
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/mgopen:${PORTSDIR}/x11-fonts/mgopen
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/mozilla:${PORTSDIR}/x11-fonts/mozilla-fonts
# restricted fonts
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/webfonts:${PORTSDIR}/x11-fonts/webfonts
Reply With Quote
  #10  
Old December 7th, 2010, 19:55
bbzz bbzz is offline
Member
 
Join Date: Nov 2010
Location: random
Posts: 826
Thanks: 77
Thanked 119 Times in 79 Posts
Default

Nevermind! Got it.
Still no luck with Latin letters. What Beastie typed are cyrilic.
Reply With Quote
  #11  
Old December 7th, 2010, 19:58
graudeejs's Avatar
graudeejs graudeejs is offline
Style(9) Addict
 
Join Date: Nov 2008
Location: Riga, Latvia
Posts: 4,525
Thanks: 422
Thanked 607 Times in 475 Posts
Default

Probably most important fonts are junicode, webfonts, gnu-unifont-ttf
Reply With Quote
  #12  
Old December 7th, 2010, 19:59
bbzz bbzz is offline
Member
 
Join Date: Nov 2010
Location: random
Posts: 826
Thanks: 77
Thanked 119 Times in 79 Posts
Default

Quote:
Originally Posted by killasmurf86 View Post
Depends on your desktop environment.... for light-width desktop It's easy
add to your ~/.xinitrc
Code:
LANG="lv_LV.UTF-8"
LC_ALL="lv_LV.UTF-8"
LC_COLLATE="lv_LV.UTF-8"
LC_CTYPE="lv_LV.UTF-8"
LC_MESSAGES="lv_LV.UTF-8"
LC_MONETARY="lv_LV.UTF-8"
LC_NUMERIC="lv_LV.UTF-8"
LC_TIME="lv_LV.UTF-8"
export LANG LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME XDG_CONFIG_HOME LC_ALL
For Real desktop environments search forum about "localization", there have been many threads about it, I'm tired searching and posting links regarding this....

About fonts. I install these (pasted part of my desktop metaport)
Code:
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/local/unifont.ttf:${PORTSDIR}/x11-fonts/gnu-unifont-ttf
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/junicode:${PORTSDIR}/x11-fonts/junicode
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/terminus-font:${PORTSDIR}/x11-fonts/terminus-font
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/Droid:${PORTSDIR}/x11-fonts/droid-fonts-ttf
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/ecofont:${PORTSDIR}/x11-fonts/ecofont
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/code2001:${PORTSDIR}/x11-fonts/code2001
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/dejavu:${PORTSDIR}/x11-fonts/dejavu
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/freefont-ttf:${PORTSDIR}/x11-fonts/freefont-ttf
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/gentium:${PORTSDIR}/x11-fonts/gentium
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/Khmer:${PORTSDIR}/x11-fonts/khmeros
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/lfpfonts-fix:${PORTSDIR}/x11-fonts/lfpfonts-fix
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/lfpfonts-var:${PORTSDIR}/x11-fonts/lfpfonts-var
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/mgopen:${PORTSDIR}/x11-fonts/mgopen
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/mozilla:${PORTSDIR}/x11-fonts/mozilla-fonts
# restricted fonts
RUN_DEPENDS+=	${LOCALBASE}/lib/X11/fonts/webfonts:${PORTSDIR}/x11-fonts/webfonts
I will try that! Thanks.

I simply want to be able to type Serbian Latin when I work in, say OpenOffice. When I'm done I want to switch back to US. Don't want to localize my whole system. Sorry, should've been more precise.
Reply With Quote
  #13  
Old December 7th, 2010, 20:23
graudeejs's Avatar
graudeejs graudeejs is offline
Style(9) Addict
 
Join Date: Nov 2008
Location: Riga, Latvia
Posts: 4,525
Thanks: 422
Thanked 607 Times in 475 Posts
Default

You can set environment before starting OOO (you can write small sh wrapper script)


UTF-8 is still a way to go
Reply With Quote
  #14  
Old December 7th, 2010, 22:30
Beastie Beastie is offline
Senior Member
 
Join Date: Mar 2009
Location: /dev/earth0
Posts: 1,702
Thanks: 0
Thanked 301 Times in 245 Posts
Default

Quote:
Originally Posted by bbzz View Post
Still no luck with Latin letters. What Beastie typed are cyrilic.
For the latinica maybe the easiest way is to setup a "compose" key by adding setxkbmap -option compose:rwin (before the WM of course) to ~/.xinitrc. This will set the right "Windows" key as a "compose" key. E.g.:
Code:
rwin > - > D = Đ
rwin > v > z = ž
N.B. none of the three keys are held down.
__________________
May the source be with you!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
usb keyboard stalls on a lock key due to no PS/2 keyboard jims Peripheral Hardware 2 March 17th, 2010 13:43
[Solved] Changing date without changing time. caesius General 6 February 8th, 2010 16:30
[Solved] Keyboard layout indicator copypaiste Other Window Managers 4 January 22nd, 2010 09:16
[Solved] Keyboard layout problem phreud X.Org 3 December 3rd, 2009 00:17
Keyboard layout problems Dinchamion X.Org 6 November 25th, 2009 13:27


All times are GMT +1. The time now is 06:45.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0