我想摆脱一年多以来的小烦恼。
我有一台戴尔 XPS 9500 笔记本,上面安装了 Ubuntu 20.04 和 i3wm。
每次我的笔记本从挂起状态唤醒时,它都会粘贴剪贴板的内容。我该如何防止这种情况发生?
问题是我甚至不知道如何开始排除故障;
- 是因为某些东西发送了“ctrl+V”键盘快捷键吗?
- 也许是一些奇怪的
udev
规则?我的系统上有很多udev
规则。我怎么知道哪一个是可疑的(甚至是非标准的?)
更新:
电源管理脚本
内容/etc/pm/sleep.d/10_grub-common
:
# Tell grub that resume was successful
case "$1" in
thaw)
[ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv
mkdir -p /boot/grub
grub-editenv /boot/grub/grubenv unset recordfail
;;
esac
内容/etc/pm/sleep.d/xboxdrv
:
case $1 in
suspend|suspend_hybrid|hibernate)
systemctl stop xboxdrv || :
;;
resume|thaw)
systemctl start xboxdrv || :
;;
esac
内容/etc/pm/sleep.d/10_unattended-upgrades-hibernate
PATH=/sbin:/usr/sbin:/bin:/usr/bin
SHUTDOWN_HELPER=/usr/share/unattended-upgrades/unattended-upgrade-shutdown
if [ -x /usr/bin/python3 ]; then
PYTHON=python3
else
PYTHON=python
fi
if [ ! -x /usr/share/unattended-upgrades/unattended-upgrade-shutdown ]; then
exit 0
fi
case "${1}" in
hibernate)
if [ -e $SHUTDOWN_HELPER ]; then
$PYTHON $SHUTDOWN_HELPER --stop-only
fi
;;
resume|thaw)
# nothing
;;
esac
内容/lib/systemd/system-sleep/hdparm
:
case $1 in
post)
/usr/lib/pm-utils/power.d/95hdparm-apm resume
;;
esac
(该命令sudo /usr/lib/pm-utils/power.d/95hdparm-apm resume
不会导致剪贴板粘贴)
systemd 系统睡眠:
内容/lib/systemd/system-sleep/nvidia
:
case "$1" in
post)
/usr/bin/nvidia-sleep.sh "resume"
;;
esac
(该命令/usr/bin/nvidia-sleep.sh "resume"
不会导致剪贴板粘贴)
内容sudo /lib/systemd/system-sleep/unattended-upgrades
:
set -e
if [ "$2" = "hibernate" ] || [ "$2" = "hybrid-sleep" ]; then
case "$1" in
pre)
/usr/share/unattended-upgrades/unattended-upgrade-shutdown --stop-only
;;
esac
fi
(该命令sudo /usr/share/unattended-upgrades/unattended-upgrade-shutdown --stop-only
不会导致剪贴板粘贴)
内容sudo /lib/systemd/system-sleep/tlp
:
case $1 in
pre) tlp suspend ;;
post) tlp resume ;;
esac
(该命令sudo tlp resume
不会导致剪贴板粘贴)
还有其他system-sleep
目录。它们也符合条件吗?:
$ fd system-sleep
snap/core20/1328/usr/lib/systemd/system-sleep
snap/core20/1361/usr/lib/systemd/system-sleep
snap/core18/2284/lib/systemd/system-sleep
snap/core18/2253/lib/systemd/system-sleep
snap/core/12725/lib/systemd/system-sleep
usr/lib/elogind/system-sleep
usr/lib/systemd/system-sleep