Preview Text File

Tags: thunar custom action, zenity, text
November 11, 2015

To learn how to use Thunar Custom Actions click here.

This command will preview a text file in a Zenity pop-up box. Decrease or increase 300 in the command to change the amount of text that is previewed. Zenity must be installed.

head -n 300 %f | zenity --text-info --width=450 --height=400 --title="Text Preview"

Under Appears if selection contains make sure Text Files is checked.