web-dev-qa-db-ja.com

Ubuntuがsetxkbmap設定を上書きしないようにするにはどうすればよいですか?

.profileに以下を入れました:

rm -f executed.log
echo ".profile starting" >> executed.log
if [ `whoami` != "root" ] 
    then 
    setxkbmap -v >> executed.log
    setxkbmap -layout "us" -variant "altgr-intl" -option "ctrl:nocaps"
    echo "setxkbmap executed" >> executed.log
    setxkbmap -v >> executed.log
fi

echo ".profile finished" >> executed.log

起動後、次のログが書き込まれます。

[22:02:21][giorgio@Desmond:~]$ cat executed.log 
.profile starting
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us(altgr-intl)+inet(evdev)
geometry:   pc(pc105)
setxkbmap executed
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us(altgr-intl)+inet(evdev)+ctrl(nocaps)
geometry:   pc(pc105)
.profile finished

しかし、グラフィカルなログインの後、次のようになります。

[22:02:23][giorgio@Desmond:~]$ setxkbmap -v
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+inet(evdev)
geometry:   pc(pc105)

Unityが私の設定を上書きしているようです。おそらく、インジケーターキーボードアプレットまたは類似のものを使用しています。 .profile設定を使用できるように無効にするにはどうすればよいですか?

3
giorgiosironi

更新しました

rm -f executed.log
echo ".profile starting" >> executed.log
if [ $(whoami) != "root" ] 
then 
  echo "$(setxkbmap -v)">> executed.log
  echo "$(setxkbmap -layout "us" -variant "altgr-intl" -option "ctrl:nocaps")"
  echo "setxkbmap executed" >> executed.log
  echo "$(setxkbmap -v)">> executed.log
fi

小さな修正を確認します。逆引用符を確認してください。

GUIにログインしたとき。文字列としてsetxkbmapを取ります。これらの文字をコマンドとして扱うには、逆引用符を使用する必要があります。

2
Dishank Jindal