Thunar 命令行选项

Sea*_*ean 3 xfce xubuntu

是否有任何命令行选项可以为该实例启动具有不同显示选项的 Thunar?

我有时希望 Thunar 使用目录树侧栏视图而不是通常的快捷方式视图。有没有我可以使用的选项,以便我可以为每个视图创建一个启动器?

man thunar并且thunar --help在这方面没有帮助。

Jac*_*ijm 6

Thunar 和命令行

像您一样,我在树视图或快捷方式(左)窗格中找不到任何直接打开新窗口的命令。我怀疑它们是否可用。

然而,有一种解决方法,但我不知道您是否希望它是“纯”的,或者您的目标是否主要是通过命令行使其发挥作用,以便您可以制作一个初学者。如果是最后一种情况,在xdotool.

使用 xdotool 创建命令

Thunar 中的侧窗格视图由组合键设置。您可以在命令中使用 xdotool 模拟这些组合键。xdotool 默认没有安装,所以你必须先安装它:

sudo apt-get install xdotool
Run Code Online (Sandbox Code Playgroud)

要生成可以在 starter 中使用的工作命令,您需要知道设置树/快捷方式视图的组合键是:

ctrl+e
ctrl+b
Run Code Online (Sandbox Code Playgroud)

在树视图中打开一个新的 Thunar 窗口的命令:

thunar; xdotool key ctrl+b; xdotool key ctrl+e
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

或快捷方式视图:

thunar; xdotool key ctrl+e; xdotool key ctrl+b
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

制作双 xdotool 命令似乎很奇怪,但这对于防止 Thunar 循环浏览选项和隐藏侧窗格是必要的。

如果您希望窗口在特定目录中打开;将目录添加到命令中:

thunar /path; xdotool key ctrl+e; xdotool key ctrl+b
Run Code Online (Sandbox Code Playgroud)

其他 Thunar 选项

无需说您可以以类似的方式在 Thunar 中使用其他选项,只需查看菜单选项后的组合键即可。


gir*_*ngo 5

xfce 将 thunar 设置保存在

\n\n
~/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml\n
Run Code Online (Sandbox Code Playgroud)\n\n

例如,要更改窗口的属性(如侧边栏的宽度),请键入:

\n\n
xfconf-query --channel thunar --property /last-separator-position --set 400\n
Run Code Online (Sandbox Code Playgroud)\n\n

您可以创建一个 shell 脚本,首先更改值 \xe2\x80\x8b\xe2\x80\x8b,然后运行 ​​thunar。
\nie,创建一个文件thunar.sh

\n\n
#!/bin/bash\n\nxfconf-query --channel thunar --property /last-side-pane --set ThunarTreePane\nxfconf-query --channel thunar --property /last-separator-position --set 200\nthunar &\n
Run Code Online (Sandbox Code Playgroud)\n\n

并通过键入以下内容来运行它:

\n\n
sh thunar.sh\n
Run Code Online (Sandbox Code Playgroud)\n\n

经过一些修改,您可以通过将参数“tree”传递给脚本来选择左窗格的类型:

\n\n
#!/bin/bash\nPANE="ThunarShortcutsPane"\nif [ $# -eq 1 ] && [ "$1" = "tree" ]; then\n   PANE="ThunarTreePane"\nfi\nxfconf-query --channel thunar --property /last-side-pane --set "$PANE"\nthunar &\n
Run Code Online (Sandbox Code Playgroud)\n\n

因此,要使用树视图窗格打开 thunar,请输入:

\n\n
sh thunar.sh tree\n
Run Code Online (Sandbox Code Playgroud)\n\n

或者,对于快捷方式窗格:

\n\n
sh thunar.sh\n
Run Code Online (Sandbox Code Playgroud)\n\n

请参阅xfce thunar 文档页面以获取更多设置和帮助。

\n