User Tools

Site Tools


docs:tips_n_tricks:thunar.html

Thunar

Open disk image files read-write

loop-device

Thunar seems to open disk images read-only by default. This makes sense for ISO-images and probably a bunch of other use cases, but not for image files created to be used with LUKS for additional security1)

The workaround is to configure a custom action in Thunar containing the command

udisksctl loop-setup -f %f

References:

man udisksctl

Use ssh-agent to mount sftp targets

systemddbusgiogvfs

dbus-update-activation-environment SSH_AUTH_SOCK=$SSH_AUTH_SOCK
systemctl --user stop gvfs-daemon
gio mount sftp://ftp.example.com

This doesn't look like a Thunar topic, but it seems to affect Thunar as well, so I put it here

References:

Build Thunar deb package with default password save set to "never"

This was done with success with thunar-1.8.14 on Linux Mint 20 Ulyana

apt-get source thunar
cd thunar-*.*.*
export DEBEMAIL="${DEBEMAIL:-<your e-mail address here>}"
export DEBFULLNAME="${DEBFULLNAME:-<your name here>}"
cat >> debian/patches/02_set_default_password_save_never.patch <<EOF
--- a/thunar/thunar-gtk-extensions.c    2024-08-31 14:49:58.042852434 +0200
+++ b/thunar/thunar-gtk-extensions.c    2024-08-31 14:47:57.468107395 +0200
@@ -307,7 +307,7 @@
   screen = thunar_util_parse_parent (parent, &window);
 
   operation = gtk_mount_operation_new (window);
-  g_mount_operation_set_password_save (G_MOUNT_OPERATION (operation), G_PASSWORD_SAVE_FOR_SESSION);
+  g_mount_operation_set_password_save (G_MOUNT_OPERATION (operation), G_PASSWORD_SAVE_NEVER);
   if (window == NULL && screen != NULL)
     gtk_mount_operation_set_screen (GTK_MOUNT_OPERATION (operation), screen);
 
EOF
echo 02_set_default_password_save_never.patch >> debian/patches/series
# <codename> is your Debian (derivate) release codename as "bookworm" or "ulyana".
# You might want to replace "local" by something specific to you or your organisation
dch -l .local~<codename> -D <codename> # Enter line "* Set G_PASSWORD_SAVE_NEVER for default password save option"
 
dpkg-buildpackage -rfakeroot --no-sign
 
# # If it fails due to missing dependencies, install them by
# sudo apt install --no-install-recommends <packages>
# # and redo
# dpkg-buildpackage -rfakeroot --no-sign
 
sudo apt install ../thunar-data_*_all.deb ../thunar_*_amd64.deb
# # If you want to clean up your system, you might want to remove packages installed just for compiling:
# sudo apt purge <packages>

Extend desktop background context menu

Thunar allows the user to add custom items on file and directory context menus called custom actions. (look for them in the Edit menu) You can specifiy a pattern where the custom items … sorry: actions - appear. By setting this to “Desktop”, the item will appear on the context menu of any folders named “Desktop” - which ist most of the times just the one Desktop.

Example values to launch the Xfce4 display settings would be:

Name Display
Description Configure screen settings and layout
Command xfce4-display-settings
1)
In my case, the image file is on a encrypted home partition, but still encrypted (second) as it contains keys etc. I don't want to expose to the system all the time while my home partion is mounted.
docs/tips_n_tricks/thunar.html.txt · Last modified: 25.04.2026 00:47 CEST by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki