下面是我的整个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.
cd ~/xcape && ./xcape -e 'Control_L=Escape'
exit 0在Ubuntu中,我需要在xcape目录中运行./xcape -e 'Control_L=Escape‘,这样才能让我的大写锁定在按下时像esc键一样工作,并在按下时进行控制。
我每次启动计算机时都需要运行此命令,这很烦人,所以我通读了在启动时自动运行此命令的内容,以及在0号出口上执行命令的来源,并具有绝对路径。当我关闭电脑并打开它时,它不工作,我的caps lock键起到了控制作用,但并没有像它应该的那样逃脱。这就是为什么我要得出结论,我的命令没有运行。我该怎么办?
发布于 2015-05-06 01:28:07
有点过时了,但以防万一,请尝试在命令中添加完整路径,因为~不会扩展,因此./将不起作用。就像这样
#!/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.
/home/<USER>/xcape -e 'Control_L=Escape'
exit 0其中是您的用户名。还要检查/etc/rc.local是可执行的chmod +x /etc/rc.local
https://stackoverflow.com/questions/26620396
复制相似问题