相关疑难解决方法(0)

抓住盖子关闭和打开事件

我试着写一个这样的建议的脚本:

当我合上盖子时,如何将屏幕设置为锁定?

我创建了一个目录和一个新的脚本文件:

mkdir /etc/acpi/local
gksudo gedit /etc/acpi/local/lid.sh.post
Run Code Online (Sandbox Code Playgroud)

/etc/acpi/local/lid.sh.post包含以下代码的文件:

#!/bin/sh

#########################################################################
## Script written by Ruben Barkow                                      ##
## https://gist.githubusercontent.com/rubo77/1a3320fda5a47fdebde7/raw/87cde3f0554467a132aba3cda7ad3c5e7187571f/lid.sh.post
## Description: This script reacts if laptop lid is opened or          ##
## closed in Ubuntu 11.10 (Oneiric Ocelot).                            ##
##                                                                     ##
## This script can be freely redistributed, modified and used.         ##
## Any redistribution must include the information of authors.         ##
##                                                                     ##
## THIS SCRIPT HAS NO WARRANTY!                                        ##
#########################################################################

grep -q close /proc/acpi/button/lid/*/state
if [ …
Run Code Online (Sandbox Code Playgroud)

acpi lid events touchscreen 14.04

9
推荐指数
1
解决办法
1万
查看次数

关闭笔记本电脑盖时执行 shell 脚本

现在我有两个脚本,我想在关闭笔记本电脑的唇缘并打开它时分别执行它们。我怎样才能做到这一点?

scripts laptop 12.04

8
推荐指数
1
解决办法
3615
查看次数

在哪里可以更改自动锁定屏幕首选项?

我在虚拟机中使用 ubuntu,所以,我不时让它闲置。当我回去时显然屏幕被锁定,但我想将空闲时间配置为大约 10 分钟。我在哪里可以这样做?

lock-screen

7
推荐指数
1
解决办法
1万
查看次数

在 Ubuntu 14.04 中合上盖子时笔记本电脑不休眠

好的,我知道已经有几个与此相关的问题。我尝试了很多解决方案都无济于事。我将在这里详细说明我做了什么以及我的配置文件如何,希望好心人能指出我遗漏了什么。

一些初步信息:

  • 我从 14.01 .iso 安装了 Ubuntu 14,它变成了 14.04,因为我猜是因为我在安装过程中选中了自动更新的选项。
  • 我有一个外接显示器。这在某些情况下似乎是相关的。
  • 正如这里所解释的,在 Ubuntu 14 的电源设置中没有让 PC 休眠的选项。只能挂起,什么也不做。
  • pm-hibernate 工作正常。
  • 我的交换区比我的 RAM 稍大

1. 我有一个 Mint(如果我没记错的话是 14 个),在我添加一些脚本之前,关闭盖子不会休眠。在 Ubuntu 14 中/etc/acpi/lid.sh,我无法像在 Mint 中那样进行编辑。我试图用以下内容创建一个:

echo 'ok' > ok
grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]
then
    su - gabriel -c 'dconf read /org/gnome/settings-daemon/plugins/power/lid-close-ac-action' | grep hibernate
    if [ $? = 0 ]
    then
        pm-hibernate
    fi
fi
Run Code Online (Sandbox Code Playgroud)

ok当我合上盖子时不会创建该文件,这意味着该脚本从未被调用。

我试图将lid.sh 移动到events/.

作为建议在这里 …

lid 14.04

5
推荐指数
1
解决办法
6358
查看次数

标签 统计

14.04 ×2

lid ×2

12.04 ×1

acpi ×1

events ×1

laptop ×1

lock-screen ×1

scripts ×1

touchscreen ×1