Bak*_*ku9 6 startup keyboard scripts 14.04
全新安装 14.04,酷冷至尊风暴键盘。我完全不关心能够切换/关闭 LED,我只是希望 LED在登录前打开,即在查看登录屏幕时,LED 应该已经亮起。
我已经设置了一个键盘快捷键来运行xset led 3,但这并不理想,因为我必须登录才能使用该快捷键。我希望这会自动发生。
我对 Linux 和脚本编写都很陌生,所以请 ELI5/带我完成它。我知道你可以按照这个在启动时运行脚本,但我不明白如何实际编写脚本或如何“放入” /etc/rc.local。难道我只是火起来的gedit和类型xset led 3直接进入rc.local下面的#comments,但上面的exit 0?我是否在其他地方制作另一个脚本并链接到它rc.local?我是不是想多了(可能)?
简而言之,我想更详细地解释米奇在链接中所说的内容。谢谢你的时间。
打开终端,输入sudo -s以获取 root 访问权限。现在输入nano /etc/rc.local,编辑文件,使其看起来像这样:
!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
xset led 3
exit 0
Run Code Online (Sandbox Code Playgroud)
现在使用Ctrl + O保存,按Enter 键,然后按Ctrl + X退出。
让我们使用以下方法设置适当的权限:
sudo chown root /etc/rc.local
sudo chmod 755 /etc/rc.local
Run Code Online (Sandbox Code Playgroud)
使用以下命令确保一切正常:
sudo /etc/init.d/rc.local start
Run Code Online (Sandbox Code Playgroud)
现在重新启动。