#author("2024-12-13T00:20:44+09:00","default:nobuoki","nobuoki")
#author("2024-12-13T00:26:50+09:00","default:nobuoki","nobuoki")
* はじめに [#h8b664cf]

MacBook Air で Ubuntuベースのディストリビューションを使う場合を想定しています

- 2024/12/13 追記 fn key behaviour (fnmode)
- 2021/03/02 修正 fn key behaviour
- 2020/11/13 更新

** Ubuntu 24.04 修正点 [#q7a1b732]

fnmodeを司るモジュールが変わっています

- 参考:[[Ubuntu 22.10 on MacBook Proでファンクションキーの入れ替え – lunablanca>https://lunablanca.net/mac-ubuntu-function-key/]]

#prism(bash){{{
# toggle fn key (永続化)
sudo tee /etc/modprobe.d/applespi.conf <<'...'
options applespi fnmode=2
...

# fn key behaviour (テンポラリ)
#  0 : disabled (fn + F8 = only F8 = F8)
#  1 : fn + F8 = F8,      only F8 = special
#  2 : fn + F8 = special, only F8 = F8
echo 2 | sudo tee /sys/module/applespi/parameters/fnmode
}}}

** fnmode 旧版 [#w0d78aef]

#prism(bash){{{
# NOPASSWD
echo $USER ALL=NOPASSWD: ALL | sudo tee /etc/sudoers.d/$USER

# hardware keyboard [Apple Aluminium (JIS)]
# MacBook AirでUbuntuキーボードレイアウトを設定する - 考えるエンジニア https://takacity.blog.fc2.com/blog-entry-252.html
sudo dpkg-reconfigure keyboard-configuration

# toggle fn key (永続化)
sudo tee /etc/modprobe.d/hid_apple.conf <<'...'
options hid_apple fnmode=2
...
sudo update-initramfs -u -k all

# fn key behaviour (テンポラリ)
#  0 : disabled (fn + F8 = only F8 = F8)
#  1 : fn + F8 = F8,      only F8 = special
#  2 : fn + F8 = special, only F8 = F8
echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode

# disable auto update
sudo dpkg-reconfigure -p low unattended-upgrades

# change directory name in English
LANG=C xdg-user-dirs-gtk-update

# Disables window maximization when the application starts
gsettings set org.gnome.mutter auto-maximize false

# Disable window maximization when moving the window to the top of the screen
gsettings set org.gnome.mutter edge-tiling false
}}}

* ブート時のエラーを無くす [#o35da569]

[[boot - Ubuntu 20.04 Failed to Set MokListRT: Invallid Parameter - Ask Ubuntu>https://askubuntu.com/questions/1279602/ubuntu-20-04-failed-to-set-moklistrt-invallid-parameter]]

#prism(bash){{{
sudo sh -x <<'...'
cd /boot/efi/EFI/ubuntu
cp grubx64.efi shimx64.efi
reboot
...
}}}

* タッチパッド操作の変更 [#e024a914]

事前にパッケージ類のインストールを済ませておくこと
- [[【Linux】トラックパッドでジェスチャーを可能にする | Oh My Enter!>https://ohmyenter.com/trackpad-gestures-with-libinput-on-linux/]]

3本指スワイプの左右を入れ替えるconfigを作成する例

#prism(bash){{{
# libinput-gestures
mkdir ~/.config || true
tee ~/.config/libinput-gestures.conf <<'...'
gesture swipe left  3 xdotool key alt+Left
gesture swipe right 3 xdotool key alt+Right
...
libinput-gestures-setup restart
}}}

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS