I am running Linux Mint on an Acer Aspire E 5 574G.
The problem I am facing is, I have to press and hold the power button for a bit to trigger the lock screen or suspend or whatever option I have set in the power management section. But if I hold it for even half a second longer, the machine powers down.
Is there a way to make it respond to a tap of the power button and not a hold down?
When I tried to test detecting the power button tap with xev, it couldn't. Holding it did detect the stroke though.
The following is the system details:
thekindlyone@deepthought ~ $ inxi -F
System: Host: deepthought Keel: 4.4.0-28-generic x86_64 (64 bit)
Desktop: Cinnamon 3.0.6 Distro: Linux Mint 18 Sarah
Machine: System: Acer product: Aspire E5-574G v: V3.72
Mobo: Acer model: Zoro_SL v: Type2 - A01 Board Version
Bios: Insyde v: V1.02 date: 08/25/2015
CPU: Dual core Intel Core i5-6200U (-HT-MCP-) cache: 3072 KB
clock speeds: max: 2700 MHz 1: 496 MHz 2: 499 MHz 3: 499 MHz
4: 499 MHz
Graphics: Card-1: Intel Sky Lake Integrated Graphics
Card-2: NVIDIA GK208M [GeForce 920M]
Display Server: X.Org 1.18.3 driver: nvidia
Resolution: [email protected]
GLX Renderer: GeForce 920M/PCIe/SSE2
GLX Version: 4.5.0 NVIDIA 361.42
Audio: Card Intel Sunrise Point-LP HD Audio driver: snd_hda_intel
Sound: Advanced Linux Sound Architecture v: k4.4.0-28-generic
Network: Card-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Etheet Controller
driver: r8169
IF: enp2s0 state: down mac: 2c:60:0c:dd:94:59
Card-2: Qualcomm Atheros Device 0042 driver: ath10k_pci
IF: wlp3s0 state: up speed: N/A duplex: N/A mac: 18:4f:32:44:7e:b5
Drives: HDD Total Size: 1000.2GB (4.1% used)
ID-1: /dev/sda model: ST1000LM024_HN size: 1000.2GB
Partition: ID-1: / size: 909G used: 31G (4%) fs: ext4 dev: /dev/sda2
ID-2: swap-1 size: 8.45GB used: 0.00GB (0%) fs: swap dev: /dev/sda3
RAID: No RAID devices: /proc/mdstat, md_mod keel module present
Sensors: System Temperatures: cpu: 46.0C mobo: N/A gpu: 39C
Fan Speeds (in rpm): cpu: N/A
Info: Processes: 236 Uptime: 4 min Memory: 1540.3/7850.1MB
Client: Shell (bash) inxi: 2.2.35
the following is contents of /etc/acpi/events :
event=button[ /]power
action=/etc/acpi/powerbtn.sh
and this is /etc/acpi/powerbtn.sh :
#!/bin/sh
# /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power putton has been
# pressed.
[ -r /usr/share/acpi-support/power-funcs ] && . /usr/share/acpi-support/power-funcs
# If logind is running, it already handles power button presses; desktop
# environments put inhibitors to logind if they want to handle the key
# themselves.
if pidof systemd-logind >/dev/null; then
exit 0
fi
# getXuser gets the X user belonging to the display in $displaynum.
# If you want the foreground X user, use getXconsole!
getXuser() {
user=`pinky -fw | awk '{ if ($2 == ":'$displaynum'" || $(NF) == ":'$displaynum'" ) { print $1; exit; } }'`
if [ x"$user" = x"" ]; then
startx=`pgrep -n startx`
if [ x"$startx" != x"" ]; then
user=`ps -o user --no-headers $startx`
fi
fi
if [ x"$user" != x"" ]; then
userhome=`getent passwd $user | cut -d: -f6`
export XAUTHORITY=$userhome/.Xauthority
else
export XAUTHORITY=""
fi
export XUSER=$user
}
# Skip if we just in the middle of resuming.
test -f /var/lock/acpisleep && exit 0
# If the current X console user is running a power management daemon that
# handles suspend/resume requests, let them handle policy This is effectively
# the same as 'acpi-support's '/usr/share/acpi-support/policy-funcs' file.
[ -r /usr/share/acpi-support/power-funcs ] && getXconsole
PMS="cinnamon-settings-daemon gnome-settings-daemon kpowersave xfce4-power-manager"
PMS="$PMS guidance-power-manager.py dalston-power-applet"
PMS="$PMS mate-settings-daemon"
PMS="$PMS unity-settings-daemon"
if pidof -x $PMS > /dev/null; then
exit
elif test "$XUSER" != "" && pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop --user $XUSER kded kded loadedModules | grep -q klaptopdaemon; then
exit
elif test "$XUSER" != "" && test -x /usr/bin/qdbus; then
kded4pid=$(pgrep -n -u $XUSER kded4)
if test "$kded4pid" != ""; then
dbusaddr=$(su - $XUSER -c "grep -z DBUS_SESSION_BUS_ADDRESS /proc/$kded4pid/environ")
if test "$dbusaddr" != "" && su - $XUSER -c "export $dbusaddr; qdbus org.kde.kded" | grep -q powerdevil; then
exit
fi
fi
fi
# If all else failed, just initiate a plain shutdown.
/sbin/shutdown -h now "Power button pressed"
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 306
تاريخ: يکشنبه
20 تير
1395 ساعت: 9:44