Thunar command line options

Thunar & command line

Like you, I could not find any direct command to open a new window in either treeview or shortcuts (left) pane. I doubt if they are available.

There is however a workaround, but I don't know if you want it to be "pure", or if your goal is mainly to make it functional via command line, so that you can make a starter. If the last is the case, there is a pretty straightforward solution in xdotool.

Using xdotool to create a command

The side pane view in Thunar is set by key combinations. You can simulate these key combinations with xdotool in a command. xdotool is not installed by default, so you have to install it first:

sudo apt-get install xdotool

To generate a working command which you can use in a starter, you need to know that the key combinations to set the tree/shortcut view are:

ctrl+e
ctrl+b

The command to open a new Thunar window in tree view:

thunar; xdotool key ctrl+b; xdotool key ctrl+e

enter image description here

or shortcut view:

thunar; xdotool key ctrl+e; xdotool key ctrl+b

enter image description here

To make a double xdotool command seems odd, but that is necessary to prevent Thunar from cycling through the options, and hide the side pane.

if you want the window to open in a specific directory; add the directory to the command:

thunar /path; xdotool key ctrl+e; xdotool key ctrl+b

Other Thunar options

No need to say that you can use other options in Thunar in a similar way, just look at the key combination(s) after the menu options.


xfce save thunar setting in

~/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml

For example, to change an attribute of the window, as the width of the sidebar, type:

xfconf-query --channel thunar --property /last-separator-position --set 400

you can create a shell script that changes the values ​​first and then run thunar.
ie, create a file thunar.sh as:

#!/bin/bash

xfconf-query --channel thunar --property /last-side-pane --set ThunarTreePane
xfconf-query --channel thunar --property /last-separator-position --set 200
thunar &

and run it by typing:

sh thunar.sh

With a little modification you can select the type of left pane by passing the argument "tree" to the script:

#!/bin/bash
PANE="ThunarShortcutsPane"
if [ $# -eq 1 ] && [ "$1" = "tree" ]; then
   PANE="ThunarTreePane"
fi
xfconf-query --channel thunar --property /last-side-pane --set "$PANE"
thunar &

so, for open thunar with treeview pane, type:

sh thunar.sh tree

or, for shortcut pane:

sh thunar.sh

refer to xfce thunar doc page for more setting and help.