-
Notifications
You must be signed in to change notification settings - Fork 113
安装Labwc
Labwc是一个堆叠式(stacking)窗口管理器,同时支持四角平铺和工作区切换,足以对付大多数使用场景,并且完全符合windows的布局逻辑。
Labwc功能齐全的同时做到了极度轻量,堆叠式意味着它没有自动平铺的性能消耗,所以它比sway、river、dwl等一众轻量的平铺式窗口管理器都要轻量,是老电脑的最佳选择。
为了轻量,配置的时候会尽量避免持久运行的程序,尽量使用TUI,尽量使用内存和CPU占用低的程序。
sudo pacman -S labwc foot fuzzel
foot fuzzel 可以换成你喜欢的终端和启动器
mkdir -p ~/.config/labwc
# 环境变量配置文件
touch ~/.config/labwc/environment
# labwc配置文件(快捷键、布局等)
touch ~/.config/labwc/rc.xml
# 自动启动配置文件
touch ~/.config/labwc/autostart
每一次修改以上文件都要labwc --reconfigure应用更改。修改了autostart environment的话要重启labwc。
-
临时修改
临时调整的话有一个很方便的gui叫
wdisplays,它没法持久生效。sudo pacman -S wdisplays -
持久保存
使用
wlr-randr,在autostart里配置开启labwc时自动调整分辨率的命令就可以做到持久保存。sudo pacman -S wlr-randr运行
wlr-randr找到自己需要的显示器接口名称和mode,然后用以下命令调整分辨率:wlr-randr --output 【显示器接口名称】 --mode 宽x高@刷新率示例:
wlr-randr --output eDP-1 --mode 2560x1440@165
使用的脚本位于~/.config/labwc/autostart
示例:
waybar &
wl-paste --watch cliphist store &
每条自动启动后面一定要加&让那条命令在后台运行。
sudo pacman -S xdg-user-dirs
强制生成英文的常用目录:
LANG=en_US.UTF-8 xdg-user-dirs-update --force
编辑environment文件
vim ~/.config/labwc/environment
LANGUAGE=zh_CN.UTF-8
LANG=zh_CN.UTF-8
需要重启labwc
以下是一个rc.xml文件的示例。<keyboard></keyboard>中间设置快捷键绑定。
<?xml version="1.0" ?>
<labwc_config>
<keyboard>
<default />
<!-- The W- prefix refers to the Super key -->
<keybind key="W-b">
<action name="Execute" command="firefox" />
</keybind>
<keybind key="W-z">
<action name="Execute" command="fuzzel" />
</keybind>
</keyboard>
</labwc_config>
推荐wl-clipboard配cliphist,gui用cliphist-tui-git
yay -S wl-clipboard cliphist cliphist-tui-git
在autostart里写
wl-paste --watch cliphist store &
然后设置一个打开剪贴板的快捷键
<keybind key="W-A-v">
<action name="Execute" command="foot cliphist-tui" />
</keybind>
使用mako
-
安装
sudo pacman -S mako -
自动启动
在
autostart里新建一行写上mako &。 -
配置
示例配置:
border-size=2 icons=1 anchor=top-right default-timeout=8000 margin=10 padding=10 font=adwaita sans regular 11 history=1 max-visible=20 max-history=100
使用waybar
sudo pacman -S waybar
autostart里写waybar &
NetworkManager使用nmtui,iwd用impala。无需额外程序。蓝牙使用bluetui。想要系统托盘的话安装network-manager-applet 和blueman,在autostart里设置nm-applet和blueman-applet自动启动。
使用grim slurp,用satty编辑。
-
安装
sudo pacman -S grim slurp satty -
修改satty配置
位于
~/.config/satty/config.toml示例:
[general] copy-command = "wl-copy" focus-toggles-toolbars= true initial-tool = "brush" zoom-factor=1.1 [font] family = "Roboto" style = "Regular" fallback = [ "Noto Sans CJK SC", "Noto Sans CJK JP", "Noto Sans CJK TC", "Noto Sans CJK KR" ] -
创建截图脚本
xml里直接写命令不太方便,可以在
~/.config/labwc/scripts里创建脚本。mkdir -p ~/.config/labwc/scripts vim ~/.config/labwc/scripts/screenshot写入:
#!/bin/bash case "$1" in select) # 框选截图 -> 复制到剪贴板 grim -g "$(slurp)" - | wl-copy ;; edit) # 框选截图 -> 打开 satty 编辑器 (可以在编辑器里保存或复制) grim -g "$(slurp)" - | satty -f - ;; esac给执行权限
chmod +x ~/.config/labwc/scripts/screenshot -
设置快捷键
<keybind key="W-A-a"> <action name="Execute" command="~/.config/labwc/scripts/screenshot select" /> </keybind> <keybind key="W-S-s"> <action name="Execute" command="~/.config/labwc/scripts/screenshot edit" /> </keybind>
使用thunar
sudo pacman -S --needed xdg-desktop-portal-gtk thunar tumbler ffmpegthumbnailer poppler-glib gvfs-smb file-roller thunar-archive-plugin gnome-keyring thunar-volman gvfs-mtp gvfs-gphoto2 webp-pixbuf-loader icoextract
xdg-desktop-portal-gtk是gtk的xdg桌面门户
tumbler提供图片预览功能
ffmpegthumbnailer视频预览
poppler-glibpdf预览
gvfs-smb检查可挂载的外部设备,访问smb分享等功能
file-roller提供压缩解压缩功能
thunar-archive-plugin在thunar的右键菜单添加压缩解压缩选项
gnome-keyring提供密码保存功能。第一次保存密码会让你设置keyring的密码,可以空着。
thunar-volman自动管理移动硬盘等设备
gvfs-mtp连接手机
gvfs-gphoto2连相机
webp-pixbuf-loaderwebp缩略图
icoextractexe缩略图
-
右键从此处打开
左上角编辑配置自定动作,把open terminal here的命令改成
foot(你的终端)。 -
默认终端
yay -S xdg-terminal-exec echo "foot.desktop" >> ~/.config/xdg-terminals.list这里的
foot.desktop应是你实际的终端的.desktop文件。
录屏推荐使用wf-recorder和wl-screenrec
obs录屏需要配置门户
sudo pacman -S xdg-desktop-portal-wlr
vim ~/.config/labwc/environment
XDG_CURRENT_DESKTOP=labwc:wlroots
重启labwc之后就可以在obs看到屏幕采集选项了。
推荐breeze-cursors
sudo pacman -S breeze-cursors
在environment里写上
XCURSOR_THEME=breeze_cursors
XCURSOR_SIZE=30
-
安装
-
配置
在
environment里写上XMODIFIERS=@im=fcitx LC_CTYPE=en_US.UTF-8
推荐使用swaybg,gui使用waypaper
sudo pacman -S swaybg waypaper
然后在autostart写上
waypaper --restore
之后用waypaper切换壁纸就行了