#始めに
この文章ではFedora等のGNOME3, Wayland環境でよく設定変更したいところ(MouseやKeyboard等)についての方法を備忘録程度に書いたものです。
上に書いているように筆者はFedoraでの経験を書いていますがGNOME3, Waylandの環境の人だったら同じように設定できると思います。
KeyboardのCtrl/CapsLockの入れ替え
gnome-tweak-tool
をインストールすることでGUIから設定変更が可能です。
ちなみにターミナルから設定変更したい方は以下を参考にして下さい。
shell
# CapsLockをCtrlにする
gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:nocaps']"
# または
dconf write /org/gnome/desktop/input-sources/xkb-options "['ctrl:nocaps']"
# CapsLockとCtrlを入れ替える
gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:swapcaps']"
# または
dconf write /org/gnome/desktop/input-sources/xkb-options "['ctrl:swapcaps']"
yubikeyを使いたい
udevで間違えて認識しないようにruleを記述します。
/etc/udev/rules.d/70-u2f.rules
ACTION!="add|change", GOTO="u2f_end"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1050", TAG+="uaccess"
LABEL="u2f_end"
Mouseのボタンの設定を入れ替える
Waylandの場合Mouseのボタンの設定変更はxinputで可能です。
xinputを使って設定を変更する
基本は arch linux - マウスのアクセラレーションや xinputでマウスボタンのマッピングを変更すると同じなのですが、設定を永続的にする方法がなかなか難しかったりします。理想としてはユーザでログインするそのタイミングなので、以下の方法で可能です。
ログイン時に設定を有効にする
以下の2つのファイルを作成することで、ユーザのログイン時に設定を変更させることが可能です。
/usr/libexec/libinput-mouse
#!/bin/sh
#xinputを使って設定したいものを書く。
#ここではKensingtonのSlimbladeの上の2ボタンを通常から反転させる設定を追加 (右上が中ボタンになる)
xinput set-button-map 7 1 8 3 4 5 6 7 2 9 10
/etc/xdg/autostart/libinput-mouse.desktop
[Desktop Entry]
Type=Application
Name=xinput for mouse
Exec=/usr/libexec/libinput-mouse.sh
X-GNOME-Autostart-Phase=Desktop
X-GNOME-Autostart-Notify=false
X-GNOME-Autostart-enabled=true
OnlyShowIn=GNOME;
起動時にroot権限で何かスクリプトを動かす
systemdを使うことも可能ですが/etc/rc.d/rc.local
に記述することでも可能です。起動後に監視する必要がない場合にはこっちの方が簡単かもしれません。
タイトルバーの幅を狭くする
GNOME 3 のタイトルバーを細くするやReduce title bar height in gnome 3 / gtk+ 3を参考に僕は以下のようにしています。
~/.config/gtk-3.0/gtk.css
/* shrink headerbars (don't forget semicolons after each property) */
headerbar {
min-height: 0px;
padding-left: 2px; /* same as childrens vertical margins for nicer proportions */
padding-right: 2px;
background-color: #2d2d2d;
}
headerbar entry,
headerbar spinbutton,
headerbar button,
headerbar separator {
margin-top: 0px; /* same as headerbar side padding for nicer proportions */
margin-bottom: 0px;
}
/* shrink ssd titlebars */
.default-decoration {
min-height: 0; /* let the entry and button drive the titlebar size */
padding: 0px;
background-color: #2d2d2d;
}
.default-decoration .titlebutton {
min-height: 0px; /* tweak these two props to reduce button size */
min-width: 0px;
}
window.ssd headerbar.titlebar {
padding-top: 3px;
padding-bottom: 3px;
min-height: 0;
}
window.ssd headerbar.titlebar button.titlebutton {
padding-top: 3px;
padding-bottom:3px;
min-height: 0;
}