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

推荐订阅源

量子位
云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Hacker News
The Hacker News
Martin Fowler
Martin Fowler
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
F
Full Disclosure
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recorded Future
Recorded Future
Security Archives - TechRepublic
Security Archives - TechRepublic
阮一峰的网络日志
阮一峰的网络日志
T
Threatpost
P
Privacy International News Feed
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
I
Intezer
Recent Announcements
Recent Announcements
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Privacy & Cybersecurity Law Blog
A
Arctic Wolf
博客园 - 聂微东
博客园 - 叶小钗
Cisco Talos Blog
Cisco Talos Blog
H
Help Net Security
S
Schneier on Security
Y
Y Combinator Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
The Exploit Database - CXSecurity.com
T
Tor Project blog
月光博客
月光博客
NISL@THU
NISL@THU
A
About on SuperTechFans
Spread Privacy
Spread Privacy
Blog — PlanetScale
Blog — PlanetScale
D
DataBreaches.Net
雷峰网
雷峰网
C
CXSECURITY Database RSS Feed - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
G
Google Developers Blog
W
WeLiveSecurity
P
Palo Alto Networks Blog
The Last Watchdog
The Last Watchdog
K
Kaspersky official blog
博客园 - 司徒正美
L
LINUX DO - 热门话题
小众软件
小众软件

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下网络配置无法变更保存的问题 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自定义字体 Labwc 便捷配置 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环境启用wlogout
2024-03-13 · via mephisto.cc

自从弃用 Gnome 后,一直都在使用 labwc 这个窗口管理器,加上一些其它桌面核心组件,算是自己打造了一个桌面环境。好处是什么都可以自己控制,坏处是什么都必须自己打造。这个过程有点类似抖音上面自己手搓汽车的视频,算是自得其乐,同时能加深理解什么是桌面环境。

老实说,如今 Linux 打造自己的桌面环境,比 10 年前好很多了,也没什么难度,个人觉得比直接使用 Gnome、KDE、Xfce 等要有意思。

如何为 labwc 核心的桌面环境,我写过系列文章,有兴趣的读者可以前往查看。

本文为登出界面的一个补充,也很简单直接,因为中文世界信息还不多,简单记录方便后来者。

所谓登出界面(logout menu),就是你退出桌面环境时,弹出的一个选择菜单,进入不同功能模式,比如关机、锁屏、登出等。

默认的 labwc 配置是没有给出这样的菜单选择,当你不小心点到 exit 时,直接就退出系统回到登录界面了,可以说非常暴力。

所以,经过一段时间的使用后,个人觉得必须给装上本文的主角 wlogout

1. 安装 wlogout

直接包管理安装,这种东西功能更新不频繁。

1sudo apt install wlogout

安装好后,命令即就绪。

1➜  ~ which wlogout
2/usr/bin/wlogout
3➜  ~ wlogout -v
41.1.1

要测试效果,可以直接运行 wlogut 命令,弹出的界面如下所示。

wlogout

2. 更改 labwc 的菜单配置

为了真正使用 wlogout,得把它嵌入到 labwc 的 menu 中。

相比默认配置的变动如下:

wlogout-labwc-menu

简单解释就是用 wlogout 命令接管 退出关机 命令,当你在系统的右键菜单中选择 Exit 或者 Poweroff 时,即弹出 wlogout 的菜单。

这样的好处是,误点的时候不会立即退出桌面环境,毕竟多了一层选择,出错的概率下降一个挡位。

3. wlogout 美化

请看相关配置

  1➜  ~ tree .config/wlogout/
  2.config/wlogout/
  3├── icons
  4│   ├── hibernate.svg
  5│   ├── lock.svg
  6│   ├── logout.svg
  7│   ├── reboot.svg
  8│   ├── shutdown.svg
  9│   └── suspend.svg
 10├── layout
 11└── style.css
 12
 132 directories, 8 files
 14➜  ~ cat .config/wlogout/layout
 15{
 16    "label" : "lock",
 17    "action" : "swaylock",
 18    "text" : "Lock",
 19    "keybind" : "l"
 20}
 21{
 22    "label" : "hibernate",
 23    "action" : "systemctl hibernate",
 24    "text" : "Hibernate",
 25    "keybind" : "h"
 26}
 27{
 28    "label" : "logout",
 29    "action" : "loginctl terminate-user $USER",
 30    "text" : "Logout",
 31    "keybind" : "e"
 32}
 33{
 34    "label" : "shutdown",
 35    "action" : "systemctl poweroff",
 36    "text" : "Shutdown",
 37    "keybind" : "s"
 38}
 39{
 40    "label" : "suspend",
 41    "action" : "systemctl suspend",
 42    "text" : "Suspend",
 43    "keybind" : "u"
 44}
 45{
 46    "label" : "reboot",
 47    "action" : "systemctl reboot",
 48    "text" : "Reboot",
 49    "keybind" : "r"
 50}
 51➜  ~ cat .config/wlogout/style.css
 52* {
 53  background-image: none;
 54}
 55window {
 56  background-color: rgba(0, 0, 0, 0.4);
 57}
 58button {
 59  color: #ffffff;
 60  background-color: #1e222a;
 61  border-style: solid;
 62  border-color: #33ccfe;
 63  border-width: 2px;
 64  border-radius: 3%;
 65  background-repeat: no-repeat;
 66  background-position: center;
 67  background-size: 25%;
 68  margin: 50px;
 69}
 70
 71button:focus,
 72button:active {
 73  background-color: #06b6d4;
 74  outline-style: none;
 75}
 76
 77button:hover {
 78  background-color: #353c4a;
 79}
 80
 81#lock {
 82  background-image: image(
 83    url("./icons/lock.svg"),
 84    url("/usr/share/wlogout/icons/lock.png"),
 85    url("/usr/local/share/wlogout/icons/lock.png")
 86  );
 87}
 88
 89#logout {
 90  background-image: image(
 91    url("./icons/logout.svg"),
 92    url("/usr/share/wlogout/icons/logout.png"),
 93    url("/usr/local/share/wlogout/icons/logout.png")
 94  );
 95}
 96
 97#suspend {
 98  background-image: image(
 99    url("./icons/suspend.svg"),
100    url("/usr/share/wlogout/icons/suspend.png"),
101    url("/usr/local/share/wlogout/icons/suspend.png")
102  );
103}
104
105#hibernate {
106  background-image: image(
107    url("./icons/hibernate.svg"),
108    url("/usr/share/wlogout/icons/hibernate.png"),
109    url("/usr/local/share/wlogout/icons/hibernate.png")
110  );
111}
112
113#shutdown {
114  background-image: image(
115    url("./icons/shutdown.svg"),
116    url("/usr/share/wlogout/icons/shutdown.png"),
117    url("/usr/local/share/wlogout/icons/shutdown.png")
118  );
119}
120
121#reboot {
122  background-image: image(
123    url("./icons/reboot.svg"),
124    url("/usr/share/wlogout/icons/reboot.png"),
125    url("/usr/local/share/wlogout/icons/reboot.png")
126  );
127}

上述配置文件都相当直白,分别控制图标、功能块相关、各种样式,基本上想怎么调整都可以。

通常这种定制漂亮界面的活,我都是去 github 搜索 xx theme 关键字解决,万一对方是个设计师呢?

写这个文章时,搜索 wlogout theme 只返回 2 个结果,第二个不错: https://github.com/DreamMaoMao/wlogout-theme

按照对方的配置,替换后效果如下:

wlogout-custom

我机器上面操作后真实效果不好,text 文章位置不对,懒得截图,估计要调整 style.css 文件,css 高手可以尽情发挥。