解决wayland无法运行某些X应用的问题

先放出报错内容

1
2
3
localuser:root being added to access control list
Error executing command as another user: No authentication agent found.
localuser:root being removed from access control list

然后我询问了ChatGPT,和我的预料差不多,是因为Wayland和x11不同的底层设计导致的(基本上是因为在Wayland上,默认是不允许以root运行应用的,这也是为什么说Wayland更安全)
但是总不能不用啊……所以解决方案就是暂时放开权限

1
2
xhost +si:localuser:root                                                                                                                                                                        
sudo (运行你需要的应用,当然从启动器打开也是OK的 xhost -si:localuser:root

别忘了为了安全性关闭授权