#screen #action #desktop-environment #exit #down #logging #lock

nightly app desk-exit-screen

桌面环境退出GUI(注销,关机)

4 个版本

0.2.2 2021年1月22日
0.2.1 2020年7月27日
0.2.0 2020年7月27日
0.1.0 2020年6月6日

#12 in #桌面环境

MIT/Apache

79KB
2K SLoC

桌面环境支持套件

Desk 是一套用于使用轻量级窗口管理器执行桌面环境类似功能的工具集。目前有两个,一个是屏幕锁定助手,一个是退出屏幕。

desk-locker

desk-locker 是一个与 xss-lock 类似的屏幕锁定工具。它监听 X 屏幕保护程序事件、系统休眠和会话锁定/解锁事件,并运行类似于 xsecurelocki3lock 的锁定程序。与 xss-lock 不同,它使用 XDG_SESSION_ID 环境变量来确定要锁定哪个会话,因此可以从 systemd 用户单元运行。

用法

# Basic usage: run xsecurelock whenever the screen should be locked
$ desk-locker xsecurelock

# Pass a logind inhibitor lock to xsecurelock. This prevents the system from sleeping until xsecurelock reports that
# it's ready. `--pass-inhibitor-lock` should work with any screen locker that supports xss-lock's `--transfer-sleep-lock` flag.
$ desk-locker --pass-inhibitor-lock xsecurelock

# Additionally, update the session's idle hint. Logind can be configured to do something (ex. put the system to sleep)
# after all sessions have been idle for a certain amount of time. If you don't already have something that updates the
# idle hint, setting it whenever the screen locker is active is a reasonable default.
$ desk-locker --set-idle-hint --pass-inhibitor-lock xsecurelock

desk-exit-screen

desk-exit-screen 显示了一个用于退出您的窗口管理器(关机、重启、注销等)的 GUI。

它支持使用 ~/.config/desk/exit-screen.toml 中的配置文件自定义操作。

# Add an action for quitting / logging out, by running the given shell command
# For example, i3-msg exit
quit_command = "<window-manager-specific quit command>"

# Customize the order actions are shown in. This must be set to display any custom actions.
# By default, the order is
# [ "lock", "quit", "suspend", "hibernate", "reboot", "shutdown" ]
order = ["act1", "act2", "..."]

# Use more [actions.<action name>] sections to define additional actions
[actions.mycustomaction]
key = "u" # Keyboard shortcut for this action
icon = "system-upgrade" # GTK+ icon name to use for the button
description = "Upgrade the system" # Text description of the action
command = "yay" # Command to run

desk-logind

这是一个用于使用 logind D-Bus API 的 Rust 库。

依赖项

~24–34MB
~644K SLoC