You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
769 B

#!/bin/bash
###
# @Author: Zhang Yueqian zhangyueqian@antiy.cn
# @Date: 2022-11-01 10:24:40
# @LastEditors: Zhang Yueqian zhangyueqian@antiy.cn
# @LastEditTime: 2022-11-02 15:09:16
# @FilePath: /screensaver/backend/medr-lightdm-dpms-disable
# @Description: 在lightdm(greeter)登陆之后禁用屏幕休眠功能
#
# 本程序需安装在 /usr/local/bin/ 目录下, 配置到 /etc/lightdm/50-medr-dpms.conf 文件中
###
# 是否锁屏判断文件
LOCK_FILE=/var/run/medr-lightdm-lock
# 入口函数, 调用xset
function main() {
# 通知其他进程已解锁
echo '' >$LOCK_FILE
# 等待X启动(大概?)
while true; do
xset q 2>&1 >/dev/null && break
done
sleep 10
# 将超时配置设为0(禁用)
xset dpms 0 0 0
}
main &