Debian12安装Sway

2025/02/13:推荐参考Sway完整桌面配置手册,这是一份完整的sway安装配置使用手册。

选取 debian-11.5.0-amd64-netinst 镜像,安装基础系统(Base)。

升级Debian12#

sudo sed -i -e 's/bullseye/bookworm/g' /etc/apt/sources.list
sudo apt update
sudo apt upgrade 
sudo apt full-upgrade

安装sway#

sudo apt install sway swaybg swayidle swaylock foot wofi seatd waybar xwayland neofetch grim wlogout

设置自动启动sway

编辑 ~/.profile加入以下内容即可:

if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
  exec sway
fi

配置sway#

mkdir -p ~/.config/sway
cp /etc/sway/config ~/.config/sway/

编辑~/.config/sway

配置程序启动器#

注释掉$menu行,改为以下内容:

set $menu wofi --show=drun --lines=6 --prompt=""

设置终端(foot)字体大小

vi /etc/xdg/foot/foot.ini

font=monospace:size=12

设置退出菜单(waylogout)#

~/.config/sway/config加入以下内容

bindsym $mod+p exec wlogout

以下为旧内容,请注意软件版本!!!#

推荐使用Quantum’s sway-utils Repository来安装Sway,项目地址为 https://apt.quantum2.xyz/sway-utils/

安装步骤#

添加key#

curl https://quantum5.ca/apt.key | sudo apt-key add -

添加apt源#

将以下内容添加至/etc/apt/sources.list

Ubuntu安装Sway

Sway on Ubuntu#

Installation guide for the latest sway version on Ubuntu 20.04

Source can be found on github

Introduction#

This guide aims to be an easy to follow and straightforward way to install the master version of Sway and the wlroots dependency.

It will then extend to useful projects you might want installed for a complete desktop experience. Example Sway Setup Example of Customized Sway setup (dotfiles)

Why on Ubuntu ?#

If you want to try out this wonderful window manager and you are used to Ubuntu you don’t have to make the jump directly, you can install sway and changing between Gnome and Sway will be a matter of logging out and selecting which one to boot. Desktop Selector