在 Thunar 中远程创建自定义操作

Remote creation of Custom actions in Thunar

我使用 Thunar 作为 linux 网络的文件浏览器,该网络由 100 台 CentOS 7.2 机器组成。我们正在使用 PXE 服务器和 SaltStack 安装来管理这些工作站的安装。 我需要在安装期间创建这些自定义操作。

目前,Thunar 安装在每个工作站上,脚本在共享中可用,但我需要在每台机器上创建自定义操作。打开 Thunar,编辑 > 创建自定义操作,它会在 xterm 中为所选文件夹启动我的脚本:

xterm -e "/path/to/my/script.sh %f"

有没有办法从命令行或通过编辑文件创建 Thunar 的自定义操作,以便我能够通过 Salt cmd.run 启动它们?

感谢您的帮助。

我发现这些自定义操作存储在这个文件中:

cat ~/.config/Thunar/uca.xml 

这是一个语法示例:

<?xml encoding="UTF-8" version="1.0"?>
<actions>
<action>
    <icon>script.png</icon>
    <name>My custom action</name>
    <unique-id>1479309009025049-2</unique-id>
    <command>xterm -e &quot;/path/to/my/script.sh %f&quot;</command>
    <patterns>*</patterns>
    <startup-notify/>
    <directories/>
    <audio-files/>
    <image-files/>
    <other-files/>
    <text-files/>
    <video-files/>
</action>
</actions>

这样,我就可以创建这个模板文件并将其复制到用户文件夹中。