Linux关闭笔记本盖不休眠

systemd 处理某些电源相关的 ACPI事件,可以通过从 /etc/systemd/logind.conf以下选项进行配置:

grep -r HandleLidSwitch /etc/systemd/logind.conf

HandlePowerKey按下电源键后的行为,默认power off

HandleSleepKey 按下挂起键后的行为,默认suspend

HandleHibernateKey 按下休眠键后的行为,默认hibernate

HandleLidSwitch 合上笔记本盖后的行为,默认suspend

触发的行为可以有

ignore、power off、reboot、halt、suspend、hibernate、hybrid-sleep、lock 或 exec。

如果要合盖不休眠只需要把HandleLidSwitch选项设置为如下即可:

HandleLidSwitch=lock

echo HandleLidSwitch=lock >> /etc/systemd/logind.conf

重启服务使之生效。

systemctl restart systemd-logind

原文链接:https://blog.csdn.net/sinat_34439107/article/details/70214289

让vi支持中文显示

在用户目录下创建.vimrc文件

cat << EOF > ~/.vimrc
set fileencodings=utf-8,gb2312,gbk,gb18030
set termencoding=utf-8
set fileformats=unix
set encoding=prc
EOF

debian没有此文件,直接添加即可。

Debian10修改时区和源

修改时区:

rm -f /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ls -l /etc/localtime
date

修改源:

cat << EOF > /etc/apt/sources.list
deb http://mirrors.163.com/debian/ buster main non-free contrib
deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
deb-src http://mirrors.163.com/debian/ buster main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
EOF

apt update