Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-09-19 02:28:46

Laurentius
Member
Registered: 2016-09-04
Posts: 55

Thunar: shortcut to switch Show Thumbnails Always/Never (done)

Hello-

I would like to make a shortcut for switching between Show Thumnails Always / Never on thunar.

I know Alt+e > e takes me to the Preferences, but looking for something more straightforward, if it was possible.

Any idea?

Thanks a lot.

Last edited by Laurentius (2018-09-19 17:50:52)

Offline

#2 2018-09-19 12:19:46

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Thunar: shortcut to switch Show Thumbnails Always/Never (done)

Try this script and assign it to a shortcut key:

#!/bin//bash

CURRENT=$(xfconf-query -c thunar -p /misc-thumbnail-mode)
echo $CURRENT

case $CURRENT in
	THUNAR_THUMBNAIL_MODE_NEVER)
		NEW=THUNAR_THUMBNAIL_MODE_ALWAYS
		;;
	THUNAR_THUMBNAIL_MODE_ALWAYS)
		NEW=THUNAR_THUMBNAIL_MODE_NEVER
		;;
	THUNAR_THUMBNAIL_MODE_ONLY_LOCAL)
		NEW=THUNAR_THUMBNAIL_MODE_ALWAYS
		;;
	*)	;;
esac

xfconf-query -c thunar -p /misc-thumbnail-mode -s $NEW

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2018-09-19 15:17:05

Laurentius
Member
Registered: 2016-09-04
Posts: 55

Re: Thunar: shortcut to switch Show Thumbnails Always/Never (done)

Thanks Toz!.
It works!

One more question:
Would it be possible to add a line to the script for refreshing thunar, so that the changes are immediately  visible?
Currently, I press F5 to make changes visible on the thunar window i am working on.
But it would be great if I could add that to the end of the script for it to apply automatically.

Thanks again.

Last edited by Laurentius (2018-09-19 15:17:46)

Offline

#4 2018-09-19 16:42:04

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Thunar: shortcut to switch Show Thumbnails Always/Never (done)

Yes.

#!/bin//bash

CURRENT=$(xfconf-query -c thunar -p /misc-thumbnail-mode)
echo $CURRENT

case $CURRENT in
	THUNAR_THUMBNAIL_MODE_NEVER)
		NEW=THUNAR_THUMBNAIL_MODE_ALWAYS
		;;
	THUNAR_THUMBNAIL_MODE_ALWAYS)
		NEW=THUNAR_THUMBNAIL_MODE_NEVER
		;;
	THUNAR_THUMBNAIL_MODE_ONLY_LOCAL)
		NEW=THUNAR_THUMBNAIL_MODE_ALWAYS
		;;
	*)	;;
esac

xfconf-query -c thunar -p /misc-thumbnail-mode -s $NEW
sleep .5 && xdotool key F5

It requires xdotool and the thunar window must be the active window (the xdotool command sends F5 to the active window).


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2018-09-19 17:50:28

Laurentius
Member
Registered: 2016-09-04
Posts: 55

Re: Thunar: shortcut to switch Show Thumbnails Always/Never (done)

Oh yes!
Thank you.

Long life to xfce!

Offline

Board footer

Powered by FluxBB