1
0
hugo/content/blog/2022-02-13-sway.md

85 lines
2.0 KiB
Markdown
Raw Normal View History

2024-04-23 13:21:26 +00:00
+++
date = "2022-02-13"
tags = ["arch"]
title = "archのwmをi3からswayに移行してみた"
slug = "sway"
+++
移行自体はwm(window manager)のi3を使っていたこともあり簡単でした。
基本的には、dm(display manager)をwayland対応のものにすることと、swayを呼び出すことくらいです。slimから呼び出すと問題が発生します。
今回はdmをlightdmにしました。
```sh
$ sudo pacman -S sway xorg-xwayland qt5-wayland
$ sudo pacman -S lightdm lightdm-gtk-greeter
$ sudo systemctl disable slim
$ sudo systemctl enable lightdm
$ cp -rf ~/.config/i3 ~/.config/sway
$ cp -rf ~/.xinitr ~/.xprofile
# groupadd -r autologin
# gpasswd -a USERNAME autologin
```
> /etc/lightdm/lightdm.conf
```
[Seat:*]
autologin-user=syui
autologin-user-timeout=0
autologin-session=sway
```
> ~/.xprofile
```sh
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
```
> ~/.config/sway/config
```sh
exec fcitx5 &
```
### status bar
```sh
$ sudo pacman -S waybar
$ cat .config/sway/config
bar {
swaybar_command waybar
}
```
今回は、こちらをもとに設定しました。
https://github.com/201dreamers/sway-config
`blueman-applet`や`nm-applet`, `pavucontrol`などを表示、クリックできます。
![](https://raw.githubusercontent.com/syui/img/master/other/arch_sway_20220213_0001.png)
あと、rofi-greenclipを入れて、keybindとiconを設定したりしました。
```json
"custom/clipboard": {
"format": "{} ",
"on-click": "rofi -modi 'clipboard:greenclip print' -show clipboard -run-command '{cmd}'"
}
bindsym $mod+Shift+x exec rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}'
```
x11vncが使えなくなったのがつらかったけど、それ以外は今のところ問題ありませんでした。そのうち、keybindあたり不満が出てきそうだけど...。
wayvncを試してみたけど、今使ってるclientが対応してないっぽい。