Open5
UbuntuでHyprland
Ubuntu 24.04 で使っているノートPCで Hyprland を使えるようにしたのでメモを残していきたい。
まずHyprland は PPA で導入することができる。
活発に更新されていてとても助かります。
Hyprlandをインストールすると、セッションでHyprlandが選択可能になる。
日本語入力は fcitx-mozc
を用いる。
入力ウィンドウの初期表示位置がおかしいので直したい。
~/.config/hypr/hyprland.conf
exec-once = fcitx5 -d --replace
env = QT_IM_MODULE, fcitx
env = XMODIFIERS, @im=fcitx
#env = GTK_IM_MODULE, fcitx # see https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland
env = SDL_IM_MODULE, fcitx
env = GLFW_IM_MODULE, ibus
env = INPUT_METHOD, fcitx
waybar で用いるフォントについて。
Web で見かけた良さげな設定をコピーして使おうとしても、フォントにない絵文字を使っていて化けてしまうことがある。
Ubuntu のフォントを入れても全ては対応していないようなので、結局本家から JetBrainsMono Nerd Font をダウンロードして .fonts
に入れた。
~/.config/waybar/style.css
/* -- Global rules -- */
* {
border: none;
font-family: "JetbrainsMono Nerd Font";
font-size: 15px;
min-height: 10px;
}
いわゆる夜間モードは hyprsunset
で実現する。ただし注意点がある。
Wiki では profile で時刻に対して色温度やガンマを設定するようになっているが hyprsunset はサスペンドを想定したロジックになっていないため、ノートPCでは期待通りの動作にならない。
ワークアラウンドは上の issue にも書いたが systemd をユーザーモードで用いることである。
例えば次のようなタイマーとサービスを設定する。
~/.config/systemd/user/hyprsunset-evening.timer
[Unit]
Description="Run hyprsunset-evening"
[Timer]
OnCalendar=*-*-* 17:00:00
Unit=hyprsunset-evening
[Install]
WantedBy=timers.target
.config/systemd/user/hyprsunset-evening.service
[Unit]
Description="Hyprsunset evening"
[Service]
Type=oneshot
ExecStart=hyprctl hyprsunset temperature 4500 gamma 0.8
[Install]
WantedBy=default.target
Bluetooth の状態を表示する。
blueman をインストールし blueman-applet を起動するよう設定する。
sudo apt install blueman
~/.config/hypr/hyprland.conf
exec-once = blueman-applet
.config/waybar/config.jsonc
"bluetooth": {
"on-click": "~/.config/waybar/rofi-bluetooth &",
"format": " {status}"
},
クリックした際に起動する rofi-bluetooth はこちらのスクリプトを使わせていただいております。