在Linux上禁用Ctrl + Alt + Backspace重启X Windows

If you’ve used Linux for any amount of time, you’re already familiar with the Ctrl+Alt+Backspace shortcut key combination that restarts X Windows immediately… but have you ever wondered if there is a way to disable that behavior?

如果您使用Linux已有一段时间,那么您已经熟悉Ctrl + Alt + Backspace快捷键组合,该组合键可以立即重新启动X Windows……但是您是否想知道是否有办法禁用该行为?

Turns out it’s extremely simple to do, although I’m not necessarily recommending that you do this… it’s more for informational purposes. (while Linux might be rock-solid, I’ve had more than my share of crashing in Gnome, so the shortcut key is useful)

事实证明,这样做非常简单,尽管我不一定建议您这样做……它更多是为了提供信息。 (尽管Linux可能固若金汤,但我在Gnome中遇到的崩溃更多,所以快捷键很有用)

Disable Ctrl+Alt+Backspace

禁用Ctrl + Alt + Backspace

The first thing you’d probably want to do is make a backup of the xorg.conf file, which you can do with this command:

您可能要做的第一件事是对xorg.conf文件进行备份,您可以使用以下命令进行备份:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.orig

须藤cp /etc/X11/xorg.conf /etc/X11/xorg.conf.orig

Then you can edit the xorg.conf file by using Alt+F2 to open up the Run dialog and using the following command:

然后,您可以使用Alt + F2打开“运行”对话框并使用以下命令来编辑xorg.conf文件:

gksu gedit /etc/X11/xorg.conf

gksu gedit /etc/X11/xorg.conf

image

Now go to the bottom of the file and look for a section called “ServerFlags”, which might not exist. If the section does not exist, add this to the bottom of the file:

现在,转到文件底部,查找可能不存在的名为“ ServerFlags”的部分。 如果该部分不存在,请将其添加到文件的底部:

Section "ServerFlags"
Option "DontZap"  "yes"
EndSection

Section "ServerFlags"
Option "DontZap" "yes"
EndSection

If that section does exist, then just add in the option line:

如果该部分确实存在,则只需添加选项行:

Option "DontZap"  "yes"

Option "DontZap" "yes"

You’ll have to restart X again, the easiest way is ironically by using Ctrl+Alt+Backspace… but at that point the shortcut key won’t be active anymore.

您将不得不再次重新启动X,最简单的方法是使用Ctrl + Alt + Backspace…具有讽刺意味的是,但是此时快捷键将不再有效。

If you somehow managed to totally screw up your system by making this change, you can copy the xorg.conf.orig file back to xorg.conf to switch back to the original configuration.

如果通过某种方式设法完全破坏了系统,则可以将xorg.conf.orig文件复制回xorg.conf,以切换回原始配置。

翻译自: https://www.howtogeek.com/howto/linux/disable-ctrlaltbackspace-from-restarting-x-windows-on-linux/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值