我正在尝试制作一个脚本文件。一切都运行得很好,但它只能从终端开始。
我已经使用chmod +x filename.sh
使其可执行,但它无法运行。
我看到了一个解决方案:
xfconf-query --channel thunar --property /misc-exec-shell-scripts-by-default \
--create --type bool --set true '
但即使如此也不起作用。
我正在尝试制作一个脚本文件。一切都运行得很好,但它只能从终端开始。
我已经使用chmod +x filename.sh
使其可执行,但它无法运行。
我看到了一个解决方案:
xfconf-query --channel thunar --property /misc-exec-shell-scripts-by-default \
--create --type bool --set true '
但即使如此也不起作用。
#!/bin/bash/
shebang。xfconf-query --channel thunar --property /misc-exec-shell-scripts-by-default --create --type bool --set true
/misc-exec-shell-scripts-by-default
。
无论哪种方式,请确保您没有打开文件管理器/Thunar窗口
如果您想了解有关Thunar中这些“隐藏设置”的更多信息,请查看文档!
https://docs.xfce.org/xfce/thunar/hidden-settings
你需要在你的脚本中添加一个shebang。第一行应该是这样的:
#!/bin/bash
这就是我需要做的,让脚本能够像你提到的那样通过Thunar双击运行。
#!/bin/bash notify-send foo
对我来说可行(Thunar 1.8.6)。是的,这里启用了misc-exec-shell-scripts-by-default
。尝试从终端运行 Thunar(首先使用thunar -q
结束守护进程),并观察错误消息。 - AndreLDM