Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Compose and hal/fdi
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
milomak
Apprentice
Apprentice


Joined: 10 Apr 2008
Posts: 287

PostPosted: Sun Apr 19, 2009 6:50 pm    Post subject: [Solved] Compose and hal/fdi Reply with quote

I am having issues enabling compose to work on my laptop. The compose file I want to use is - /usr/share/X11/locale/en_US.UTF-8/Compose

10-x11-input.fdi
Code:
                 
root ~ # cat /etc/hal/fdi/policy/10-x11-input.fdi

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">           
<device>                             
    <!-- Mouse configuration -->     
    <match key="info.capabilities" contains="input.mouse">
      <merge key="input.x11_driver" type="string">evdev</merge>
    </match>                                                   

    <!-- Keyboard configuration -->
    <match key="info.capabilities" contains="input.keymap">
      <append key="info.callouts.add" type="strlist">hal-setup-keymap</append>
    </match>
    <match key="info.capabilities" contains="input.keys">
      <merge key="input.xkb.model" type="string">evdev</merge>
      <merge key="input.x11_driver" type="string">evdev</merge>
      <merge key="input.xkb.layout" type="string">us_intl</merge>
      <merge key="input.x11_options.XkbModel" type="string">pc104</merge>
      <append key="input.xkb.options" type="string">compose:lwin</append>
    </match>
  </device>
</deviceinfo>



Xorg seems not to take up the compose option
Code:

root ~ # cat /var/log/Xorg.0.log | grep xkb
(**) Option "xkb_rules" "evdev"
(**) Option "xkb_model" "evdev"
(**) Option "xkb_layout" "us"
root ~ # cat /var/log/Xorg.0.log | grep Xkb
root ~ #


My xorg looked like this
Code:

#Section "InputDevice"
#        Identifier  "Keyboard0"
#        Driver      "kbd"
#        Option      "XkbModel" "pc104"
#        Option      "XkbLayout" "us+inet"
#        Option      "XkbOptions" "compose:ralt"
#EndSection


What am I doing wrong? I even tried changing the compose section to look like
Code:

<merge key="input.x11_options.XkbOptions" type="string">compose:lwin</merge>


Last edited by milomak on Mon Apr 20, 2009 7:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
jackhole
n00b
n00b


Joined: 23 Feb 2009
Posts: 55

PostPosted: Sun Apr 19, 2009 7:56 pm    Post subject: Reply with quote

All you need is:

Code:
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->

<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.keys">
      <merge key="input.x11_options.XkbOptions" type="string">compose:ralt</merge>
    </match>
  </device>
</deviceinfo>
Back to top
View user's profile Send private message
milomak
Apprentice
Apprentice


Joined: 10 Apr 2008
Posts: 287

PostPosted: Sun Apr 19, 2009 8:39 pm    Post subject: Reply with quote

I made that change.

stopped xdm, restarted hald and the started xdm.

This what /var/log/Xorg.0.log reports

Code:

(II) config/hal: Adding input device AT Translated Set 2 keyboard                                 
(II) LoadModule: "evdev"                                                                           

(II) Loading /usr/lib/xorg/modules/input//evdev_drv.so
(II) Module evdev: vendor="X.Org Foundation"         
        compiled for 1.5.3, module version = 2.2.1   
        Module class: X.Org XInput Driver             
        ABI class: X.Org XInput driver, version 2.1   
(**) AT Translated Set 2 keyboard: always reports core events
(**) AT Translated Set 2 keyboard: Device: "/dev/input/event3"
(II) AT Translated Set 2 keyboard: Found keys                 
(II) AT Translated Set 2 keyboard: Configuring as keyboard   
(II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD)
(**) Option "xkb_rules" "evdev"                                                         
(**) Option "xkb_model" "evdev"                                                         
(**) Option "xkb_layout" "us"
Back to top
View user's profile Send private message
jackhole
n00b
n00b


Joined: 23 Feb 2009
Posts: 55

PostPosted: Sun Apr 19, 2009 9:05 pm    Post subject: Reply with quote

Well shit.

Try switching to compose:lwin again and see if that works.

See if you get your keyboard with the command 'hal-find-by-capability --capability input.keys' and if you do, post the ouput of 'hal-find-by-capability --capability input.keys | xargs hal-device'
Back to top
View user's profile Send private message
milomak
Apprentice
Apprentice


Joined: 10 Apr 2008
Posts: 287

PostPosted: Sun Apr 19, 2009 10:06 pm    Post subject: Reply with quote

Here we go

Code:

root ~ # hal-find-by-capability --capability input.keys | xargs hal-device
udi = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port_logicaldev_input'
  linux.subsystem = 'input'  (string)
  info.callouts.add = { 'hal-setup-keymap' } (string list)
  input.device = '/dev/input/event3'  (string)
  input.xkb.rules = 'base'  (string)
  info.capabilities = { 'input', 'input.keyboard', 'input.keypad', 'input.keys', 'input.keymap', 'button' } (string list)
  input.product = 'AT Translated Set 2 keyboard'  (string)
  info.subsystem = 'input'  (string)
  input.xkb.model = 'evdev'  (string)
  info.category = 'input'  (string)
  info.product = 'AT Translated Set 2 keyboard'  (string)
  input.xkb.layout = 'us'  (string)
  info.udi = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port_logicaldev_input'  (string)
  input.xkb.variant = ''  (string)
  info.addons.singleton = { 'hald-addon-input' } (string list)
  input.x11_driver = 'evdev'  (string)
  linux.sysfs_path = '/sys/devices/platform/i8042/serio0/input/input3/event3'  (string)
  linux.device_file = '/dev/input/event3'  (string)
  info.parent = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port'  (string)
  input.originating_device = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  input.keymap.data = { 'e001:fn_esc', 'e009:battery', 'e00a:screenlock', 'e00b:camera', 'e00c:media', 'e00e:dvd', 'e031:help', 'e033:f21', 'e057:wlan' } (string list)


EDIT: changed the compose setting to ralt and lalt and it still didn't work
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Sun Apr 19, 2009 11:33 pm    Post subject: Reply with quote

As you may see, your file is not applied.
Either you put it in the wrong place, didn't restart hal
or the file is malformed.
Oh, and 'us+intl' looks bit invalid for a layout value.
Back to top
View user's profile Send private message
jackhole
n00b
n00b


Joined: 23 Feb 2009
Posts: 55

PostPosted: Sun Apr 19, 2009 11:35 pm    Post subject: Reply with quote

milomak wrote:
changed the compose setting to ralt and lalt and it still didn't work


Well, half of that is because compose:lalt is not a valid option. Run 'cat /usr/share/X11/xkb/rules/xorg.lst | grep compose' to see what is.

Since the defaults don't seem to be working, try this:

Code:
<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">           
<device>                             
    <match key="info.capabilities" contains="input.keys">
      <merge key="input.x11_options.XkbModel" type="string">pc104</merge>
      <merge key="input.x11_options.XkbVariant" type="string">alt-intl</merge>
      <merge key="input.x11_options.XkbOptions" type="string">compose:ralt</merge>
    </match>
  </device>
</deviceinfo>


Then post your 'hal-find-by-capability --capability input.keys | xargs hal-device'.
Back to top
View user's profile Send private message
milomak
Apprentice
Apprentice


Joined: 10 Apr 2008
Posts: 287

PostPosted: Mon Apr 20, 2009 5:18 pm    Post subject: Reply with quote

It the fdi file now looks like this:
Code:

root ~ # cat /etc/hal/fdi/policy/10-x11-input.fdi

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
    <!-- Mouse configuration -->
    <match key="info.capabilities" contains="input.mouse">
      <merge key="input.x11_driver" type="string">evdev</merge>
    </match>

    <!-- Keyboard configuration -->
    <match key="info.capabilities" contains="input.keys">
      <match key="info.capabilities" contains="input.keys">
      <merge key="input.x11_options.XkbModel" type="string">pc104</merge>
      <merge key="input.x11_options.XkbVariant" type="string">alt-intl</merge>
      <merge key="input.x11_options.XkbOptions" type="string">compose:ralt</merge>
    </match>
  </device>
</deviceinfo>


This was done in a console. I then stopped xdm, restarted hald and then started xdm again

Code:

root ~ # hal-find-by-capability --capability input.keys | xargs hal-device
udi = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port_logicaldev_input'
  linux.subsystem = 'input'  (string)                                             
  info.callouts.add = { 'hal-setup-keymap' } (string list)                         
  input.device = '/dev/input/event3'  (string)                                     
  input.xkb.rules = 'base'  (string)                                               
  info.capabilities = { 'input', 'input.keyboard', 'input.keypad', 'input.keys', 'input.keymap', 'button' } (string list)
  input.product = 'AT Translated Set 2 keyboard'  (string)                                                               
  info.subsystem = 'input'  (string)                                                                                     
  input.xkb.model = 'evdev'  (string)
  info.category = 'input'  (string)
  info.product = 'AT Translated Set 2 keyboard'  (string)
  input.xkb.layout = 'us'  (string)
  info.udi = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port_logicaldev_input'  (string)
  input.xkb.variant = ''  (string)
  info.addons.singleton = { 'hald-addon-input' } (string list)
  input.x11_driver = 'evdev'  (string)
  linux.sysfs_path = '/sys/devices/platform/i8042/serio0/input/input3/event3'  (string)
  linux.device_file = '/dev/input/event3'  (string)
  info.parent = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port'  (string)
  input.originating_device = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  input.keymap.data = { 'e001:fn_esc', 'e009:battery', 'e00a:screenlock', 'e00b:camera', 'e00c:media', 'e00e:dvd', 'e031:help', 'e033:f21', 'e057:wlan' } (string list)


Xorg.0.log
Code:

(II) intel(0): Setting screen physical size to 331 x 207                                           
(II) config/hal: Adding input device AT Translated Set 2 keyboard                                 
(II) LoadModule: "evdev"                                                                           

(II) Loading /usr/lib/xorg/modules/input//evdev_drv.so
(II) Module evdev: vendor="X.Org Foundation"         
        compiled for 1.5.3, module version = 2.2.1   
        Module class: X.Org XInput Driver             
        ABI class: X.Org XInput driver, version 2.1   
(**) AT Translated Set 2 keyboard: always reports core events
(**) AT Translated Set 2 keyboard: Device: "/dev/input/event3"
(II) AT Translated Set 2 keyboard: Found keys                 
(II) AT Translated Set 2 keyboard: Configuring as keyboard   
(II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD)
(**) Option "xkb_rules" "evdev"                                                         
(**) Option "xkb_model" "evdev"                                                         
(**) Option "xkb_layout" "us"                                                           
(II) config/hal: Adding input device SynPS/2 Synaptics TouchPad
Back to top
View user's profile Send private message
jackhole
n00b
n00b


Joined: 23 Feb 2009
Posts: 55

PostPosted: Mon Apr 20, 2009 6:22 pm    Post subject: Reply with quote

milomak wrote:
It the fdi file now looks like this:
Code:

root ~ # cat /etc/hal/fdi/policy/10-x11-input.fdi

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
    <!-- Mouse configuration -->
    <match key="info.capabilities" contains="input.mouse">
      <merge key="input.x11_driver" type="string">evdev</merge>
    </match>

    <!-- Keyboard configuration -->
    <match key="info.capabilities" contains="input.keys">
      <match key="info.capabilities" contains="input.keys">
      <merge key="input.x11_options.XkbModel" type="string">pc104</merge>
      <merge key="input.x11_options.XkbVariant" type="string">alt-intl</merge>
      <merge key="input.x11_options.XkbOptions" type="string">compose:ralt</merge>
    </match>
  </device>
</deviceinfo>


You don't see the problem with this? You've doubled up the "<match key="info.capabilities" contains="input.keys">" at the start of the keyboard configuration, leaving one of the match keys unclosed. Your XML file is therefore invalid and nothing in it is being applied.

When I said "all you need is <the following code>" in post #2 I meant exactly that: I apologize for being unclear. Try replacing your entire /etc/hal/fdi/policy/10-x11-input.fdi with the first config I posted:

Code:
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->

<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.keys">
      <merge key="input.x11_options.XkbOptions" type="string">compose:ralt</merge>
    </match>
  </device>
</deviceinfo>


That should get your compose key working, which is apparently the only thing not working for you with hal's defaults.

If you find some other keys don't work, try using the 2nd fdi file I posted, which is a replica of your old, possibly obsolete, config.
Back to top
View user's profile Send private message
milomak
Apprentice
Apprentice


Joined: 10 Apr 2008
Posts: 287

PostPosted: Mon Apr 20, 2009 7:13 pm    Post subject: Reply with quote

Ah foolishness on my part. Thanks.
Back to top
View user's profile Send private message
jackhole
n00b
n00b


Joined: 23 Feb 2009
Posts: 55

PostPosted: Mon Apr 20, 2009 7:23 pm    Post subject: Reply with quote

milomak wrote:
Ah foolishness on my part. Thanks.


So everything works now?
Back to top
View user's profile Send private message
milomak
Apprentice
Apprentice


Joined: 10 Apr 2008
Posts: 287

PostPosted: Mon Apr 20, 2009 7:50 pm    Post subject: Reply with quote

Yep

Code:

root ~ $ cat /var/log/Xorg.0.log | grep xkb
(**) Option "xkb_rules" "evdev"
(**) Option "xkb_model" "evdev"
(**) Option "xkb_layout" "us"
(**) Option "xkb_options" "compose:ralt"
Back to top
View user's profile Send private message
milomak
Apprentice
Apprentice


Joined: 10 Apr 2008
Posts: 287

PostPosted: Wed Jun 17, 2009 10:28 pm    Post subject: Reply with quote

For my desktop I have
Code:

# cat /etc/hal/fdi/policy/10-x11-input.fdi

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
    <!-- Mouse configuration -->
    <match key="info.capabilities" contains="input.mouse">
      <merge key="input.x11_driver" type="string">evdev</merge>
    </match>

    <!-- Keyboard configuration -->
    <match key="info.capabilities" contains="input.keys">
        <merge key="input.x11_options.XkbOptions" type="string">compose:ralt</merge>
    </match>
  </device>
</deviceinfo>


And this is what Xorg.0.log shows after boot
Code:

# cat /var/log/Xorg.0.log | grep xkb
(**) Option "xkb_rules" "evdev"
(**) Option "xkb_model" "evdev"
(**) Option "xkb_layout" "us"
(**) Option "xkb_rules" "evdev"
(**) Option "xkb_model" "evdev"
(**) Option "xkb_layout" "us"
(**) Option "xkb_rules" "evdev"
(**) Option "xkb_model" "evdev"
(**) Option "xkb_layout" "us"


Is there a compose package I am meant to install? Am I missing something here?
_________________
Desktop - Windows 10, Debian Sid, Gentoo Unstable, Arch Linux, Solus

Laptop - Windows 10, Debian Sid, Solus
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Thu Jun 18, 2009 1:10 am    Post subject: Reply with quote

Standard steps
- see, if the file gets applied (by looking at hal settings)
- see it fdi file gets validated by xmllint
Back to top
View user's profile Send private message
milomak
Apprentice
Apprentice


Joined: 10 Apr 2008
Posts: 287

PostPosted: Thu Jun 18, 2009 9:08 pm    Post subject: Reply with quote

xmllint returns

Code:

# xmllint /etc/hal/fdi/policy/10-x11-input.fdi
/etc/hal/fdi/policy/10-x11-input.fdi:2: parser error : XML declaration allowed only at the start of the document
<?xml version="1.0" encoding="UTF-8"?>
     ^


but that is something i copied and paste from here and which worked on my laptop configuration.

How do I go about checking how the file gets applied?
_________________
Desktop - Windows 10, Debian Sid, Gentoo Unstable, Arch Linux, Solus

Laptop - Windows 10, Debian Sid, Solus
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Thu Jun 18, 2009 9:14 pm    Post subject: Reply with quote

If the file doesn't validate, it's not applied - it's that simple.
xml is either valid or not, nothing between.

And I meant something bit longer, i.e.:
Code:

xmllint -dtdvalid /usr/share/hal/fdi/fdi.dtd /etc/hal/fdi/policy/10-x11-input.fdi


'<?xml' must be the very first chars of the file, no line breaks, no spaces,
no unprintable char before them. See, if your editor isn't doing something silly,
like inserting BOMs at the start.
Back to top
View user's profile Send private message
milomak
Apprentice
Apprentice


Joined: 10 Apr 2008
Posts: 287

PostPosted: Thu Jun 18, 2009 10:17 pm    Post subject: Reply with quote

perhaps post yours as a reference if you use compose?

what is strange is that using something pasted here (from someone with whom it works), creates a file that does not work. thinking about it now it may be a 32-bit config file to a 64-bit config-file
_________________
Desktop - Windows 10, Debian Sid, Gentoo Unstable, Arch Linux, Solus

Laptop - Windows 10, Debian Sid, Solus
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Fri Jun 19, 2009 1:28 am    Post subject: Reply with quote

32 vs 64 should not matter in this case,
xml is just structured pure text with enconing stated in the header
and a few restrictions on used chars (those that have to be given as entities).
As I said, that error suggests that the file doesn't start with '<?xml ' as it should.
When I said '...very first chars' I literally meant "'<' is the first byte" and your output says
it's the second line.
Back to top
View user's profile Send private message
milomak
Apprentice
Apprentice


Joined: 10 Apr 2008
Posts: 287

PostPosted: Mon Jun 22, 2009 8:00 pm    Post subject: Reply with quote

ah i get you. will make the change.
_________________
Desktop - Windows 10, Debian Sid, Gentoo Unstable, Arch Linux, Solus

Laptop - Windows 10, Debian Sid, Solus
Back to top
View user's profile Send private message
milomak
Apprentice
Apprentice


Joined: 10 Apr 2008
Posts: 287

PostPosted: Wed Jun 24, 2009 9:11 pm    Post subject: Reply with quote

Code:

<Multi_key> <L> <minus>                 : "£"   sterling # POUND SIGN
<Multi_key> <minus> <L>                 : "£"   sterling # POUND SIGN
<Multi_key> <l> <minus>                 : "£"   sterling # POUND SIGN
<Multi_key> <minus> <l>                 : "£"   sterling # POUND SIGN


I think part of the problem is here. Do you see a capital A with a ^ above it before the £ sign? I do but when I view the same file from Debian I do not see the A with ^.

Strangely the pound still works but Euro is no go on my desktop. This is what cat /usr/share/X11/locale/en_US.UTF-8/Compose | grep EURO looks like.
_________________
Desktop - Windows 10, Debian Sid, Gentoo Unstable, Arch Linux, Solus

Laptop - Windows 10, Debian Sid, Solus
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Wed Jun 24, 2009 9:20 pm    Post subject: Reply with quote

What's your locale ?
And I'm not asking "what do you think your locale is ?",
but "what is the output of 'locale' ?".
Back to top
View user's profile Send private message
milomak
Apprentice
Apprentice


Joined: 10 Apr 2008
Posts: 287

PostPosted: Wed Jun 24, 2009 9:55 pm    Post subject: Reply with quote

Code:
# locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=


This is only my second Gentoo install. But I now remember having this issue the first time I installed some 6 or so months ago. Solved by

Code:

# nano /etc/env.d/02locale

LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANGUAGE=en_US.UTF-8


Then
Code:

# env-update
>>> Regenerating /etc/ld.so.cache...
# source /etc/profile
# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8


Thanks for the heads up.

EDIT: That solved it all
_________________
Desktop - Windows 10, Debian Sid, Gentoo Unstable, Arch Linux, Solus

Laptop - Windows 10, Debian Sid, Solus
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Wed Jun 24, 2009 11:25 pm    Post subject: Reply with quote

Personally, I only set LANG, LC_ALL is not needed in that case
and LANGUAGE has a different purpose (and, IIRC, it accepts just language,
not locale values).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum