キーの入れ替え
setxkbmap -option altwin:swap_alt_win
オプション一覧は次のコマンドの出力の !option
以下で確認できる.
less /usr/share/X11/xkb/rules/base.lst
Ubuntu起動時に自動的に実行
再起動後,先ほどのコマンドが自動的に実行されるように設定.
mkdir ~/auto_shell
cd ~/auto_shell
vi swap_alt_win.sh
~/auto_shell/swap_alt_win.sh
setxkbmap -option altwin:swap_alt_win
chmod +x swap_alt_win.sh
vi ~/.config/systemd/user/swap_alt_win.service
<User Name>
は自身のユーザー名に置き換える.
~/.config/systemd/user/swap_alt_win.service
[Unit]
Description=swap alt keys with the windows key
After=graphical.target
[Service]
ExecStart=/home/<User Name>/auto_shell/swap_alt_win.sh
Restart=on-failure
RestartSec=10
StartLimitIntervalSec=300
StartLimitBurst=3
[Install]
WantedBy=default.target
systemctl --user daemon-reload
systemctl --user enable swap_alt_win.service
systemctl --user start swap_alt_win.service