Caps Lock을 사용하여 키보드 레이아웃을 변경하도록 Deepin Desktop Environment(DDE)를 구성하는 방법은 무엇입니까?

Caps Lock을 사용하여 키보드 레이아웃을 변경하도록 Deepin Desktop Environment(DDE)를 구성하는 방법은 무엇입니까?

내 시스템은 Manjaro Linux입니다. 그러나 나는 이것이 중요하지 않다고 생각합니다. 설정 패널에서는 키보드 레이아웃 변경자로
만들 수 없습니다 .CapsLock
도와주세요.

답변1

ibus시스템에 설치하십시오 .

일부 시작 스크립트에서 실행하십시오. ibus-daemon -drx

이제 작은 해킹. Caps_Lock을 바인딩하여 레이아웃을 변경하면 대소문자도 변경됩니다. 이 동작을 방지하려면 지도 대문자 옵션이 필요합니다. 하나의 솔루션: setxkbmap -option 'lv3:caps_switch_latch'

필수 레이아웃과 단축키를 변경하려면 ibus 환경설정으로 이동하세요. 언론의 Caps는 다음과 같이 정의되었습니다 ISO_Level3_Shift. 모든 것이 완료되었습니다!

메모:

/etc/X11/xorg.conf.d/00-keyboard.conf영구 xkb 옵션 편집

Section "InputClass"
         Identifier "system-keyboard"
         MatchIsKeyboard "on"
         Option "XkbOptions"    "lv3:caps_switch_latch"
EndSection

UPD:

시간이 지나서 나는 독립적인 핫키 리스너를 기반으로 하는 두 가지 다른 방법을 찾았습니다. 첫 번째 접근 방식은 xbindkeys와 xdotool을 사용하는데 지연이 있습니다.

; layout
(xbindkey '(release "c:66") "xdotool key Super_L+space")

두 번째로 xdotool 대신 D-Bus를 통해 설명했습니다.여기

#!/bin/sh

LANG=$(dbus-send \
    --type=method_call \
    --print-reply=literal \
        --dest=com.deepin.daemon.InputDevices \
    /com/deepin/daemon/InputDevice/Keyboard \
    org.freedesktop.DBus.Properties.Get \
    string:"com.deepin.daemon.InputDevice.Keyboard" \
    string:"CurrentLayout" | awk '{print $2}')

if [[ $LANG = 'us;' ]]; then
    dbus-send \
        --type=method_call \
        --dest=com.deepin.daemon.InputDevices \
        /com/deepin/daemon/InputDevice/Keyboard \
        org.freedesktop.DBus.Properties.Set \
        string:"com.deepin.daemon.InputDevice.Keyboard" \
        string:"CurrentLayout" \
        variant:string:"ru;"
else
    dbus-send \
        --type=method_call \
        --dest=com.deepin.daemon.InputDevices \
        /com/deepin/daemon/InputDevice/Keyboard \
        org.freedesktop.DBus.Properties.Set \
        string:"com.deepin.daemon.InputDevice.Keyboard" \
        string:"CurrentLayout" \
        variant:string:"us;"
fi

답변2

를 열고 dconf-editor심층적인 스위치 레이아웃 키( 이어야 함 /com/deepin/dde/keybinding/system/switch-layout)로 이동하여 다음으로 설정합니다.['Caps_Lock']

관련 정보