Open23
Ubuntu Sway Remix 25.04 環境構築

Ubuntu Sway 24.10 の構築方法から更新する

fcitx5 の設定。fcitx configuration を開いて mozc を追加する
sudo apt install -y fcitx5-mozc
mkdir -p ~/.config/sway/config.d/
echo 'exec fcitx5 -dr' > ~/.config/sway/config.d/fcitx5.conf
reboot

ソフトを入れる
sudo apt install git ripgrep unzip python3 python3-venv build-essential gdb lldb libreadline-dev alacritty libboost-math-dev fd-find yq openscad freecad

neovim
sudo apt remove neovim
mkdir -p ~/.local
mkdir -p ~/.local/bin
cd ~/.local
wget $(gh release view --json assets --jq '.assets[] | select(.name == "nvim-linux-x86_64.tar.gz") | .url' --repo https://github.com/neovim/neovim)
tar xf nvim-linux-x86_64.tar.gz
ln -s $HOME/.local/nvim-linux-x86_64/bin/nvim $HOME/.local/bin/

firefox でタブをスクロールで切り替えできるように変更
-
about:config
をアドレスバーに入力 - toolkit.tabbox.switchByScrolling で検索 -> true にする

dvorak jp に変更

Ubuntu mono nerd font 入れる
mkdir ~/.fonts
unzip UbuntuMono.zip -d ~/.fonts

mkdir -p ~/.config/alacritty
nvim ~/.config/alacritty/alacritty.toml
[font]
normal = {family = "UbuntuMono Nerd Font Mono", style = "Regular"}
size = 10.5
[terminal.shell]
program = "/usr/bin/zsh"
# neovim で ctrl-p が効くようにするための設定
# https://github.com/alacritty/alacritty/issues/7565#issuecomment-1877828701
[[keyboard.bindings]]
chars = "\u001F"
key = "Slash"
mods = "Control"

terminal を foot から alacritty に変更
nvim ~/.config/sway/variables.d/terminal.conf
set $term alacritty
set $term_cwd $term --working-directory "$(/usr/share/sway/scripts/swaycwd.sh 2>/dev/null || echo $HOME)"
keybind 定義している /etc/sway/modes/*.conf
の読み込みよりも前にされるようにしなければならないっぽい

status bar には waybar というのを使用しているらしい
~/.config/waybar/config.jsonc
を編集する
天気は custom/weather
の項目で動かしいる python script に地名渡す
"exec": "/usr/share/sway/scripts/weather.py sapporo",

sway configuration
~/.config/sway/variables.d/user.conf
# Fonts
set $gui-font Ubuntu 11
# Terminal
set $term alacritty
set $term_cwd $term --working-directory "$(/usr/share/sway/scripts/swaycwd.sh 2>/dev/null || echo $HOME)"
~/.config/sway/config.d/default.conf
# Tittle bar font
font pango:Ubuntu 8
# The right button over a titlebar kills the window
bindsym button3 kill
# window border
default_border normal
smart_borders off
smart_gaps off
gaps inner 0
gaps outer 0
smart_gaps off
hide_edge_borders both

go install

go install github.com/asdf-vm/asdf/cmd/asdf@v0.17.0
sudo apt install libyaml-dev zlib1g-dev
asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git
asdf install ruby latest
asdf set -u ruby latest
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
asdf install nodejs 22.16.0
asdf set -u nodejs 22.16.0

docker

~/.config/sway/variables.d/user.conf
autotiling が邪魔なので適当なコマンドに置き換え
set $autotiling echo

rr
sudo apt install rr
echo 1 | sudo tee /proc/sys/kernel/perf_event_paranoid
g++ -g3 ex.cpp
rr record ./a.out

GTK settings でフォントを Noto Sans CJK JP Regular
を指定

sudo apt remove libreoffice-common libreoffice-core
sudo apt autoremove
sudo apt install libreoffice-calc

qmk firmware
sudo apt-get install -y git python3-pip pipx make gcc-avr binutils-avr avr-libc avrdude vim gcc-arm-none-eabi ripgrep wget libc6-i386 libc6-dev-arm64-cross
python3 -m venv venv
source venv/bin/activate
pip install qmk
qmk setup

hugo
CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest

24.10 のときは terminal によって変換候補が出たり出なかったりしたが、25.04 では terminal はどれを使っても変換候補が正しく出るようになった。

句読点の表示位置が上のほうになっているのを修正
~/.config/fontconfig/fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- 日本語用フォントを優先 -->
<match target="pattern">
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans CJK JP</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans CJK JP</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>UbuntuMono Nerd Font</string>
</edit>
</match>
</fontconfig>
fc-cache -fv

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install stylua
cargo install jnv