惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
T
The Blog of Author Tim Ferriss
U
Unit 42
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
Vercel News
Vercel News
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
Blog — PlanetScale
Blog — PlanetScale
I
InfoQ
Y
Y Combinator Blog
F
Full Disclosure
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
S
SegmentFault 最新的问题
腾讯CDC
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
Apple Machine Learning Research
Apple Machine Learning Research
人人都是产品经理
人人都是产品经理
Recent Commits to openclaw:main
Recent Commits to openclaw:main
The Register - Security
The Register - Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
F
Fortinet All Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
T
Threatpost
GbyAI
GbyAI
G
GRAHAM CLULEY
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
L
LangChain Blog
T
Tenable Blog
C
Cisco Blogs
T
Threat Research - Cisco Blogs
Google Online Security Blog
Google Online Security Blog

mephisto.cc

修复rime-ice无法弹出候选框的问题 开机滚动字体显示优化 个人网站安全防护 树莓派上部署Vaultwarden 使用goaccess实时分析Caddy日志 个人网站监控 Hugo全站AVIF记 Linux下尝试使用Godot开发小游戏 Arch linux dae 透明代理 Airflow接管galler-dl下载任务 如何使用gallery-dl批量下载图像 Arch核显下如何愉快玩Dota2和CS2 Arch/labwc 环境网络相关设置 Rime添加dota2词库 Arch 重装记录 Supertuxkart iOS版终于发布了 打造自己的流媒体音乐服务 剪切板管理工具clipcat推荐 MangoHud性能监控 微信小程序开发记 Rofi试用 解决Arch下VSCode无法输入中文的问题 独立窗口管理器下无法录屏问题处理 上海市二手房成交数据监控 OpenLDAP监控 Arch linux如何顺畅连接蓝牙设备 使用Git和Ansible管理配置文件 Arch Linux SSL VPN 客户端配置 简单获取celery任务实时结果 Arch linux下iNode客户端的安装和使用方法 券商费率调整记 迷你主机组装记 Labwc更换定制皮肤 树莓派跑分流代理 实用自动代理配置示例 九年老鼠标复活记 Openvpn示例 Mac下如何旋转webp图片 如何隐藏Vscode中Markdown PDF插件的头部内容 解决Linux下网络配置无法变更保存的问题 labwc环境启用wlogout Ubuntu下新官方微信尝鲜 简单检测用户是否开启广告屏蔽 Atuin ZFS下卡顿问题解决 Wine安装64位微信 Fish 和 Atuin使用记 Fastapi简单实现临时下载链接 Fastapi微信公众号开发简要 Hugo根据语种展示不同内容 如何修复Waybar微信图标错误 信封加密简要 Linux环境下维护公众号记录 快速隐藏和呼出终端 Wayland环境自动切换壁纸 SuperTuxKart 试玩 简单抓取雪球股票快讯 为什么你的kill命令不能列出信号表 Wine安装微信保姆教程 Hysteria科学上网简要 Ubuntu 23.10 钉钉无法启动解决方法 网站导航栏防止插入Adsense自动广告 Linux环境按键检测 Hugo文末添加最后修改时间 Wayland环境ksnip无法复制问题解决 我眼中的股票市场 Caddy简单图片防盗链 greetd和regreet使用教程 Wayland环境下截图加后期修改 Wayland 环境下gif录屏 Firefox的一些有趣功能 Ubuntu 切换系统语言 Firefox 标题栏高度调整 网站添加回到顶部功能 Hugo自定义字体 Wofi使用教程 窗口管理器labwc使用记 文件共享软件Dufs推荐 Hugo静态站点接入Adsense广告 Fcitx5配置详解 Ubuntu安装chrome的方法总结 一种Xterm.js的全屏方案 Google网址收录api Python示例 手机听离线音乐 Snipe it资产导入 应用启动器yofi使用配置 Snipe it资产管理系统安装使用 Ubuntu开机启动加速 Vue3 vite TypeScript跨域等相关设置 Ubuntu手动升级Libreoffice Ubuntu设置alacritty为默认终端 简体文章批量转换为繁体 使用Inkscape调整svg图片大小 实用命令 使用mitmproxy给手机app抓包 Python中rstrip方法细解 Github同主机多仓库部署deploy key问题处理 Linux安装最新版本Python KeePassXC使用教程 Ubuntu 22.10连接蓝牙耳机报错br-connection-profile-unavailable解决方法 Caddy日志配置轮转和格式化
Labwc 便捷配置
2023-06-14 · via mephisto.cc

最近使用 labwc 工作,逐步发现一些小问题,这里记录下,方便后来人。

目前中国大陆使用的微信、钉钉、腾讯会议等都是无法在纯粹的 wayland 下工作的,包括 chrome 在纯 wayland 下,Fcitx5 的候选框会跑偏,所以编译 labwc 的时候一定要开启 xwayland 支持。

下面针对一些常见问题给出个人解决方案:

1. 任务栏

taskbar 放在什么位置?双屏的话,在哪个屏幕显示?显示图标还是名称,以及点击后执行什么动作?

  • 放在什么位置

    1"modules-center": [
    2    "wlr/taskbar"
    3    //"river/tags"
    4],
    

    wlr/taskbar 放到 "modules-center" 中,就是放到状态栏中间

  • 单屏还是双屏输出

    1// swaymsg -t get_outputs (sway)
    2// wlr-randr (others)
    3"output": "eDP-1",
    

    output 的值可 sway 可从 swaymsg -t get_outputs 获得,其它的安装 wlr-randr 后运行 wlr-randr 命令后获得,多个逗号分隔(typeof: string|array),星号所有,默认就是所有。

    我选择输出到副屏,主屏一般不放状态栏,只显示核心窗口,副屏放到一遍,需要看 taskbar 等辅助信息的时候,眼睛斜瞄一眼即可。

  • taskbar 配置

    1"wlr/taskbar": {
    2  "all-outputs": true,
    3    "format": "{icon}",
    4    "on-click": "minimize-raise",
    5},
    

    all-outputs 表示所有显示器窗口的软件都收集展示,不然只显示本显示器的窗口,多少有点不方便,看喜好设置。

    format {icon}就是显示软件图标,也可设置为显示软件名等,可以查看对应文档设置。

    on-click minimize-raise 点一下展示,再点一下缩回去。

完整配置文件(https://github.com/kmephistoh/dotfiles/tree/main/.config/waybar/config):

  1{
  2  "layer": "top",
  3  "position": "bottom",
  4  // swaymsg -t get_outputs (sway)
  5  // wlr-randr (others)
  6  "output": "eDP-1",
  7  "modules-left": [
  8    //"wlr/taskbar",
  9    "custom/launcher",
 10    "cpu",
 11    "memory",
 12    "custom/media",
 13    "tray"
 14  ],
 15  "modules-center": [
 16    "wlr/taskbar"
 17    //"river/tags"
 18  ],
 19  "modules-right": [
 20    "custom/updates",
 21    "custom/wallpaper",
 22    "backlight",
 23    "pulseaudio",
 24    "clock",
 25    "battery",
 26    "custom/power"
 27  ],
 28  "pulseaudio": {
 29    "tooltip": false,
 30    "scroll-step": 5,
 31    "format": "{icon} {volume}%",
 32    "format-muted": "{icon} {volume}%",
 33    "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
 34    "format-icons": {
 35      "default": ["", "", ""]
 36    }
 37  },
 38  "river/tags": {
 39    "num-tags": 6
 40  },
 41  "network": {
 42    "tooltip": false,
 43    "format-wifi": "  {essid}",
 44    "format-ethernet": ""
 45  },
 46  "backlight": {
 47    "tooltip": false,
 48    "format": " {}%",
 49    "interval": 1,
 50    "on-scroll-up": "light -A 5",
 51    "on-scroll-down": "light -U 5"
 52  },
 53  "battery": {
 54    "states": {
 55      "good": 95,
 56      "warning": 30,
 57      "critical": 20
 58    },
 59    "format": "{icon}  {capacity}%",
 60    "format-charging": " {capacity}%",
 61    "format-plugged": " {capacity}%",
 62    "format-alt": "{time} {icon}",
 63    "format-icons": ["", "", "", "", ""]
 64  },
 65  "tray": {
 66    "icon-size": 18,
 67    "spacing": 10
 68  },
 69  "clock": {
 70    "format": "{: %H:%M  %d/%m/%Y}"
 71  },
 72  "cpu": {
 73    "interval": 15,
 74    "format": " {}%",
 75    "max-length": 10
 76  },
 77  "memory": {
 78    "interval": 30,
 79    "format": " {}%",
 80    "max-length": 10
 81  },
 82  "custom/media": {
 83    "interval": 30,
 84    "format": "{icon} {}",
 85    "return-type": "json",
 86    "max-length": 60,
 87    "format-icons": {
 88      "spotify": " ",
 89      "default": " "
 90    },
 91    "escape": true,
 92    "exec": "$HOME/.config/system_scripts/mediaplayer.py 2> /dev/null",
 93    "on-click": "playerctl play-pause"
 94  },
 95  "custom/launcher": {
 96    "format": " ",
 97    "on-click": "wofi -show drun",
 98    "on-click-right": "killall wofi"
 99  },
100  "custom/power": {
101    "format": " ",
102    "on-click": "bash ~/.config/rofi/leave/leave.sh"
103  },
104  "custom/updates": {
105    "format": "{} Update(s)",
106    "exec": "checkupdates | wc -l",
107    "exec-if": "[[ $(checkupdates | wc -l) != 0 ]]",
108    "interval": 15,
109    "on-click": "alacritty -e paru -Syu && notify-send 'The system has been updated' "
110  },
111  "custom/wallpaper": {
112    "format": " ",
113    "on-click": "bash ~/.config/system_scripts/pkill_bc"
114  },
115  "wlr/taskbar": {
116    "all-outputs": true,
117    "format": "{icon}",
118    "on-click": "minimize-raise"
119  }
120}

2. 截屏

flameshot 在 labwc 下截屏有点问题,画选范围的时候反应异常延迟,不过从状态栏点击启动的时候没有问题,很诡异,状态不稳定,必须找个替换组合。

1    <keybind key="F9">
2      <action>
3        <name>Execute</name>
4        <command>sh -c 'grim -g "`slurp`" - | swappy -f -'</command>
5      </action>
6    </keybind>

推荐组合为 grim + slurp + swappy ,安装好后按照上述配置快捷键,按 F9 即可选择范围截屏。请注意上面 action 的写法,直接 <action name="Execute" command='grim -g "$(slurp)" - | wl-copy' /> 是无法工作的,我帮读者踩过坑了。缘由参考官方tips 部分

grim 截屏,slurp 选择范围,swappy 事后编辑。

swappy

注意,swappy 编辑文字的时候,逻辑是先选择范围,再打字,最后 Enter 确认,且无法输入中文(摊手表情!),也没有 flameshot 的步骤指示功能。所以我两个截屏软件都保留,看情况选择。

3. 工作空间设置

labwc-workspace

很久以前我用过一个发行版,它的终端的软件是可以按 F12 呼出和隐藏的,非常贴心,因为终端在 Linux 环境下是超高频软件,用的时候随时按 F12 呼出,此功能很多桌面环境不是那么容易设置。大部分的逻辑是快捷键直接启动多个实例了,这明显不符合使用需求,大部分人只需要开启一个终端,然后多 tab 切换即可。

在 labwc 下,我通过 workspace 切换的的功能勉强实现类似功能:

  • 先添加 workspace
 1  <desktops>
 2    <!--
 3      popupTime defaults to 1000 so could be left out.
 4      Set to 0 to completely disable the workspace OSD.
 5    -->
 6    <popupTime>1000</popupTime>
 7    <names>
 8      <name>work</name>
 9    </names>
10    <names>
11      <name>term</name>
12    </names>
13  </desktops>

我这里只设置了 2 个工作空间,一个 work,日常工作环境;一个 term,单独的只有终端的环境。接下来的设置快捷键,在两者间灵活切换。

  • 设置快捷键
 1    <keybind key="W-1">
 2      <action name="GoToDesktop" to="term" wrap="yes" />
 3    </keybind>
 4    <keybind key="C-W-1">
 5      <action name="SendToDesktop" to="term" follow="yes" wrap="yes" />
 6    </keybind>
 7    <keybind key="W-2">
 8      <action name="GoToDesktop" to="work" wrap="yes" />
 9    </keybind>
10    <keybind key="C-W-2">
11      <action name="SendToDesktop" to="work" follow="yes" wrap="yes" />
12    </keybind>

上述配置解释:win+1 切换到 term,win+2 切换到 work;ctl+win+1 把当前活动窗口放置到 term,ctl+win+2 把当前活动窗口放置到 work,这样即可实现类似老板键切换的功能,读者可以自行决定设置多少个 workspace,绑定好自己喜欢的快捷键,用起来很方便的。

所谓老板键,就是摸鱼时,一键切换到老板喜欢的工作界面,我想你应该懂的!毕竟大陆生活苦,菩萨也要体谅下。