You are not logged in.

#1 2010-09-11 19:30:26

wolfspaw
Member
Registered: 2010-08-28
Posts: 15

[Solved]switch my keyboard layout (also, how to unify clipboard?)

ok, i want to switch between us and us intl layout. After reading the Xorg page in the great Arch Wiki i maded
a file called "11-switchkb.conf" in my xorg folder and writed into it:

Section "InputClass"
       Identifier                         "Keyboard Defaults"
       MatchIsKeyboard            "yes"
       Option                             "XkbLayout" "us, us intl"
       Option                             "XkbOptions" "grp:caps_toggle"
EndSection

and i happyli restared my X and... My keyboard stopped working ( i had to brute shutdown my notebook holding power button)

I also tried 10-switchkb.conf and didnt worked.  What im doing wrong?
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
My second question i dont know how to explain it right... Im confused about copy and paste in linux, and it's seems weird for me,
sometimes it works sometimes it doesnt...

like when i highlight something in uzbl i can paste with shift+insert but
only while its highlighted. Sometimes i highlight what i want in vim and, even while its still highlighted, when i do shift+insert
in some other app it doesnt paste anything. and when i highlight in vim and paste in the same vim whith shift+insert it pastes
with a crazy indentation, but when i yank and paste it with 'p' it pastes correctly.

Is there a way to "unify" clipboard, in such a way i can copy-paste without trouble from any app to any other app?

Last edited by wolfspaw (2010-09-13 16:03:28)

Offline

#2 2010-09-11 20:25:38

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved]switch my keyboard layout (also, how to unify clipboard?)

Post your Xorg.0.log.

Offline

#3 2010-09-11 20:28:14

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [Solved]switch my keyboard layout (also, how to unify clipboard?)

wolfspaw wrote:

Is there a way to "unify" clipboard, in such a way i can copy-paste without trouble from any app to any other app?

Use a clipboard like parcellite? Optionally it can synchronize the selection and clipboard.

Offline

#4 2010-09-11 20:29:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved]switch my keyboard layout (also, how to unify clipboard?)

Vim has many paste options, some might result in "crazy" indentation.

Offline

#5 2010-09-12 12:04:11

quigybo
Member
Registered: 2009-01-15
Posts: 223

Re: [Solved]switch my keyboard layout (also, how to unify clipboard?)

anonymous_user wrote:
wolfspaw wrote:

Is there a way to "unify" clipboard, in such a way i can copy-paste without trouble from any app to any other app?

Use a clipboard like parcellite? Optionally it can synchronize the selection and clipboard.

Parcellite is great for having more control over your clipboards (with a nice tray icon etc.), but if all you want is to synchronise them and forget about it, autocutsel may be another solution.

wolfspaw wrote:

...when i highlight in vim and paste in the same vim whith shift+insert it pastes with a crazy indentation, but when i yank and paste it with 'p' it pastes correctly.

If you just paste in vim it will interpret it as keystrokes, autoindenting as if you are typing it in. To copy and paste you want to use the * and + buffers in vim for selection and clipboard respectively. For example to copy text from vim to the clipboard you can select it then type "+y and to paste text in "+p.

There are plenty of docs about on the web explaining clipboards in X if you are still unsure about the differences between the two. And I would recommend reading the docs in vim on buffers, you can do some neat stuff with named buffers - saving several blocks of text to different buffers, appending text to an existing buffer, and reclaiming previous deleted text with numbered buffers.

Last edited by quigybo (2010-09-12 12:07:08)

Offline

#6 2010-09-12 12:37:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved]switch my keyboard layout (also, how to unify clipboard?)

If you paste from e.g. browser

:set paste    # to disable autoindenting
:set nopaste  # to re-enable

may be what you need to get

  class Product
    def initialize( code, name, desc, cost )
      @code = code
      @name = name
      @desc = desc
      @cost = cost

instead of

  class Product
              def initialize( code, name, desc, cost )
                            @code = code
                                  @name = name
                                        @desc = desc
                                              @cost = cost

IIRC you can also change the mouse mode with 'set mouse='.

Last edited by karol (2010-09-12 12:38:59)

Offline

#7 2010-09-12 13:42:22

steve___
Member
Registered: 2008-02-24
Posts: 452

Re: [Solved]switch my keyboard layout (also, how to unify clipboard?)

To unify the clipboard I used this in my $HOME/.xinitrc file:

autocutsel -fork
autocutsel -selection PRIMARY -fork

Offline

#8 2010-09-12 16:00:01

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: [Solved]switch my keyboard layout (also, how to unify clipboard?)

Re your first question about keymap switching, I can't help you with xorg config, but what I did is bind this small script to the <Super>-k combo in XFCE:

params="-t 1000 -i /usr/share/icons/Tango/48x48/devices/keyboard.png"
( setxkbmap -print | grep azerty > /dev/null ) && ( setxkbmap us && notify-send $params QWERTY ) || ( setxkbmap fr latin9 && notify-send $params AZERTY )

If you want to try this you'll have to replace "azerty" with "intl" or something, as well as "fr latin9" with "us intl".

Last edited by stqn (2010-09-12 16:01:19)

Offline

#9 2010-09-12 18:31:11

wolfspaw
Member
Registered: 2010-08-28
Posts: 15

Re: [Solved]switch my keyboard layout (also, how to unify clipboard?)

Thanks for the help guys!

Great answers, that was exactly what i wanted for my clipboard and Vim! (I'll read about buffers).

stqn : Nice script, i'll try to bind it to xMonad.

Karol: I can solve the issue with sqn script but im curious to why my X
does not detect my keyboard when i use the Xorg Arch Wiki way of
Layout Switch:

Here is my Xorg.0.log after trying the swi(the last third of it.):
(my touchpad is detected as a mouse, but it works great) :


[ 29619.012] (II) Initializing built-in extension Generic Event Extension
[ 29619.012] (II) Initializing built-in extension SHAPE
[ 29619.012] (II) Initializing built-in extension MIT-SHM
[ 29619.012] (II) Initializing built-in extension XInputExtension
[ 29619.012] (II) Initializing built-in extension XTEST
[ 29619.012] (II) Initializing built-in extension BIG-REQUESTS
[ 29619.012] (II) Initializing built-in extension SYNC
[ 29619.012] (II) Initializing built-in extension XKEYBOARD
[ 29619.012] (II) Initializing built-in extension XC-MISC
[ 29619.012] (II) Initializing built-in extension SECURITY
[ 29619.012] (II) Initializing built-in extension XINERAMA
[ 29619.012] (II) Initializing built-in extension XFIXES
[ 29619.012] (II) Initializing built-in extension RENDER
[ 29619.012] (II) Initializing built-in extension RANDR
[ 29619.012] (II) Initializing built-in extension COMPOSITE
[ 29619.012] (II) Initializing built-in extension DAMAGE
[ 29619.023] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[ 29619.023] (II) AIGLX: enabled GLX_INTEL_swap_event
[ 29619.023] (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
[ 29619.023] (II) AIGLX: enabled GLX_SGI_make_current_read
[ 29619.023] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
[ 29619.023] (II) AIGLX: Loaded and initialized /usr/lib/xorg/modules/dri/i965_dri.so
[ 29619.023] (II) GLX: Initialized DRI2 GL provider for screen 0
[ 29619.024] (II) intel(0): Setting screen physical size to 361 x 203
[ 29619.211] (II) config/udev: Adding input device Power Button (/dev/input/event5)
[ 29619.211] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[ 29619.211] (**) Power Button: Applying InputClass "Keyboard Defaults"
[ 29619.211] (II) LoadModule: "evdev"
[ 29619.211] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[ 29619.212] (II) Module evdev: vendor="X.Org Foundation"
[ 29619.212]     compiled for 1.8.1.902, module version = 2.4.0
[ 29619.212]     Module class: X.Org XInput Driver
[ 29619.212]     ABI class: X.Org XInput driver, version 9.0
[ 29619.212] (**) Power Button: always reports core events
[ 29619.212] (**) Power Button: Device: "/dev/input/event5"
[ 29619.220] (II) Power Button: Found keys
[ 29619.220] (II) Power Button: Configuring as keyboard
[ 29619.220] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
[ 29619.220] (**) Option "xkb_rules" "evdev"
[ 29619.220] (**) Option "xkb_model" "evdev"
[ 29619.220] (**) Option "xkb_layout" "us, us intl"
[ 29619.220] (**) Option "xkb_options" "grp:caps_toggle"
[ 29619.259] (II) config/udev: Adding input device Video Bus (/dev/input/event8)
[ 29619.259] (**) Video Bus: Applying InputClass "evdev keyboard catchall"
[ 29619.259] (**) Video Bus: Applying InputClass "Keyboard Defaults"
[ 29619.259] (**) Video Bus: always reports core events
[ 29619.259] (**) Video Bus: Device: "/dev/input/event8"
[ 29619.267] (II) Video Bus: Found keys
[ 29619.267] (II) Video Bus: Configuring as keyboard
[ 29619.267] (II) XINPUT: Adding extended input device "Video Bus" (type: KEYBOARD)
[ 29619.267] (**) Option "xkb_rules" "evdev"
[ 29619.267] (**) Option "xkb_model" "evdev"
[ 29619.267] (**) Option "xkb_layout" "us, us intl"
[ 29619.267] (**) Option "xkb_options" "grp:caps_toggle"
[ 29619.271] (II) config/udev: Adding input device Lid Switch (/dev/input/event4)
[ 29619.271] (II) No input driver/identifier specified (ignoring)
[ 29619.271] (II) config/udev: Adding input device Sleep Button (/dev/input/event3)
[ 29619.271] (**) Sleep Button: Applying InputClass "evdev keyboard catchall"
[ 29619.271] (**) Sleep Button: Applying InputClass "Keyboard Defaults"
[ 29619.271] (**) Sleep Button: always reports core events
[ 29619.271] (**) Sleep Button: Device: "/dev/input/event3"
[ 29619.280] (II) Sleep Button: Found keys
[ 29619.280] (II) Sleep Button: Configuring as keyboard
[ 29619.280] (II) XINPUT: Adding extended input device "Sleep Button" (type: KEYBOARD)
[ 29619.280] (**) Option "xkb_rules" "evdev"
[ 29619.280] (**) Option "xkb_model" "evdev"
[ 29619.280] (**) Option "xkb_layout" "us, us intl"
[ 29619.280] (**) Option "xkb_options" "grp:caps_toggle"
[ 29619.283] (II) config/udev: Adding input device USB2.0 0.3M UVC WebCam (/dev/input/event7)
[ 29619.283] (**) USB2.0 0.3M UVC WebCam: Applying InputClass "evdev keyboard catchall"
[ 29619.283] (**) USB2.0 0.3M UVC WebCam: Applying InputClass "Keyboard Defaults"
[ 29619.283] (**) USB2.0 0.3M UVC WebCam: always reports core events
[ 29619.283] (**) USB2.0 0.3M UVC WebCam: Device: "/dev/input/event7"
[ 29619.290] (II) USB2.0 0.3M UVC WebCam: Found keys
[ 29619.290] (II) USB2.0 0.3M UVC WebCam: Configuring as keyboard
[ 29619.290] (II) XINPUT: Adding extended input device "USB2.0 0.3M UVC WebCam" (type: KEYBOARD)
[ 29619.290] (**) Option "xkb_rules" "evdev"
[ 29619.290] (**) Option "xkb_model" "evdev"
[ 29619.290] (**) Option "xkb_layout" "us, us intl"
[ 29619.290] (**) Option "xkb_options" "grp:caps_toggle"
[ 29619.296] (II) config/udev: Adding input device Asus Laptop extra buttons (/dev/input/event6)
[ 29619.296] (**) Asus Laptop extra buttons: Applying InputClass "evdev keyboard catchall"
[ 29619.296] (**) Asus Laptop extra buttons: Applying InputClass "Keyboard Defaults"
[ 29619.296] (**) Asus Laptop extra buttons: always reports core events
[ 29619.296] (**) Asus Laptop extra buttons: Device: "/dev/input/event6"
[ 29619.310] (II) Asus Laptop extra buttons: Found keys
[ 29619.310] (II) Asus Laptop extra buttons: Configuring as keyboard
[ 29619.310] (II) XINPUT: Adding extended input device "Asus Laptop extra buttons" (type: KEYBOARD)
[ 29619.310] (**) Option "xkb_rules" "evdev"
[ 29619.310] (**) Option "xkb_model" "evdev"
[ 29619.310] (**) Option "xkb_layout" "us, us intl"
[ 29619.310] (**) Option "xkb_options" "grp:caps_toggle"
[ 29619.311] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event0)
[ 29619.311] (**) AT Translated Set 2 keyboard: Applying InputClass "evdev keyboard catchall"
[ 29619.311] (**) AT Translated Set 2 keyboard: Applying InputClass "Keyboard Defaults"
[ 29619.311] (**) AT Translated Set 2 keyboard: always reports core events
[ 29619.311] (**) AT Translated Set 2 keyboard: Device: "/dev/input/event0"
[ 29619.323] (II) AT Translated Set 2 keyboard: Found keys
[ 29619.324] (II) AT Translated Set 2 keyboard: Configuring as keyboard
[ 29619.324] (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD)
[ 29619.324] (**) Option "xkb_rules" "evdev"
[ 29619.324] (**) Option "xkb_model" "evdev"
[ 29619.324] (**) Option "xkb_layout" "us, us intl"
[ 29619.324] (**) Option "xkb_options" "grp:caps_toggle"
[ 29619.324] (II) config/udev: Adding input device ETPS/2 Elantech Touchpad (/dev/input/event2)
[ 29619.324] (**) ETPS/2 Elantech Touchpad: Applying InputClass "evdev touchpad catchall"
[ 29619.324] (**) ETPS/2 Elantech Touchpad: Applying InputClass "touchpad catchall"
[ 29619.324] (II) LoadModule: "synaptics"
[ 29619.325] (II) Loading /usr/lib/xorg/modules/input/synaptics_drv.so
[ 29619.325] (II) Module synaptics: vendor="X.Org Foundation"
[ 29619.325]     compiled for 1.8.0.902, module version = 1.2.2
[ 29619.325]     Module class: X.Org XInput Driver
[ 29619.325]     ABI class: X.Org XInput driver, version 9.0
[ 29619.325] (II) Synaptics touchpad driver version 1.2.2
[ 29619.325] (**) Option "Device" "/dev/input/event2"
[ 29619.363] (II) ETPS/2 Elantech Touchpad: x-axis range 8 - 1144
[ 29619.364] (II) ETPS/2 Elantech Touchpad: y-axis range 8 - 760
[ 29619.364] (II) ETPS/2 Elantech Touchpad: device does not report pressure, will use touch data.
[ 29619.364] (II) ETPS/2 Elantech Touchpad: finger width range 0 - 0
[ 29619.364] (II) ETPS/2 Elantech Touchpad: buttons: left right double triple
[ 29619.364] (**) Option "TapButton1" "1"
[ 29619.364] (**) Option "TapButton2" "2"
[ 29619.364] (**) Option "TapButton3" "3"
[ 29619.390] (--) ETPS/2 Elantech Touchpad: touchpad found
[ 29619.390] (**) ETPS/2 Elantech Touchpad: always reports core events
[ 29619.403] (II) XINPUT: Adding extended input device "ETPS/2 Elantech Touchpad" (type: TOUCHPAD)
[ 29619.404] (**) ETPS/2 Elantech Touchpad: (accel) keeping acceleration scheme 1
[ 29619.404] (**) ETPS/2 Elantech Touchpad: (accel) acceleration profile 0
[ 29619.404] (**) ETPS/2 Elantech Touchpad: (accel) acceleration factor: 2.000
[ 29619.404] (**) ETPS/2 Elantech Touchpad: (accel) acceleration threshold: 4
[ 29619.430] (--) ETPS/2 Elantech Touchpad: touchpad found
[ 29619.431] (II) config/udev: Adding input device ETPS/2 Elantech Touchpad (/dev/input/mouse0)
[ 29619.431] (**) ETPS/2 Elantech Touchpad: Applying InputClass "touchpad catchall"
[ 29619.431] (II) Synaptics touchpad driver version 1.2.2
[ 29619.837] ETPS/2 Elantech Touchpad no synaptics event device found
[ 29619.837] (**) Option "Device" "/dev/input/mouse0"
[ 29619.850] (**) Option "TapButton1" "1"
[ 29619.850] (**) Option "TapButton2" "2"
[ 29619.850] (**) Option "TapButton3" "3"
[ 29619.871] Query no Synaptics: 6003C8
[ 29619.871] (--) ETPS/2 Elantech Touchpad: no supported touchpad found
[ 29619.871] (EE) ETPS/2 Elantech Touchpad Unable to query/initialize Synaptics hardware.
[ 29619.910] (EE) PreInit failed for input device "ETPS/2 Elantech Touchpad"
[ 29619.910] (II) UnloadModule: "synaptics"
[ 29619.911] (II) config/udev: Adding input device PC Speaker (/dev/input/event1)
[ 29619.911] (II) No input driver/identifier specified (ignoring)
[ 29672.057] (II) Power Button: Close
[ 29672.057] (II) UnloadModule: "evdev"
[ 29672.077] (II) Video Bus: Close
[ 29672.077] (II) UnloadModule: "evdev"
[ 29672.097] (II) Sleep Button: Close
[ 29672.097] (II) UnloadModule: "evdev"
[ 29672.117] (II) USB2.0 0.3M UVC WebCam: Close
[ 29672.117] (II) UnloadModule: "evdev"
[ 29672.137] (II) Asus Laptop extra buttons: Close
[ 29672.137] (II) UnloadModule: "evdev"
[ 29672.157] (II) AT Translated Set 2 keyboard: Close
[ 29672.157] (II) UnloadModule: "evdev"
[ 29672.190] (II) UnloadModule: "synaptics"

Offline

Board footer

Powered by FluxBB