答案1
暂停后恢复时禁用蓝牙
在文件中创建禁用蓝牙的脚本
/path/to/file/disable-bluetooth.sh
#!/usr/bin/env bash rfkill block bluetooth
使其可执行
$ chmod +x /path/to/file/disable-bluetooth.sh
创建文件
/etc/systemd/system/disable-bluetooth.service
[Unit] Description=Disables Bluetooth Before=sleep.target StopWhenUnneeded=yes [Service] Type=oneshot RemainAfterExit=yes ExecStop=/path/to/file/disable-bluetooth.sh [Install] WantedBy=sleep.target
启用服务
$ sudo systemctl enable disable-bluetooth.service
在启动时禁用蓝牙
创建文件~/.config/autostart/disable-bluetooth.desktop
[Desktop Entry]
Type=Application
Exec=/path/to/file/disable-bluetooth.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=Disable Bluetooth on startup
Name=Disable Bluetooth on startup
Comment[en_US]=
Comment=