Collecting filenames with Thunar

Sat 17 June 2017 by Stig Inge Lea Bjørnsen

On my Linux desktop, I combine its graphical user interface (GUI) and command line interface (CLI).

The shell script is on my path and used for collecting filenames.

It can be used from the command line:

$ add /home/user/IMG_4453.JPG /home/user/IMG_4455.JPG

But, using the XFCE desktop environment with its Thunar file manager, I have added this script as a custom action.

By selecting files and choosing "Collect filenames" in the context menu I can preview files before I choose to collect them:

Thunar context menu with a custom action

Using Thunar I can navigate into many folders and collect the files I need. When done, I can se what was collected:

$ list

With this output, I can do anything with the collected filenames by using command line tools.

If I wanted to share copies of the collected files with other users, I would use the following one-liner:

$ list | while read filename; do cp -v "$filename" /home/user/Public/; done

If you are interested, the script is available for download. Store it in $HOME/bin or any other folder on your $PATH. When added as a Thunar custom action its command line should be add %F.

Share on: Hacker NewsProggitTwitter