Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-03-13 21:34:17

DavidB
Member
From: France
Registered: 2021-03-10
Posts: 6
Website

Multiple instances of Thunar each with different side panel shortcuts?

Hi,

A little bit of context: In a single day, I can often switch hats to work on completely different files and folders in my job as a writer, depending the projects I am working on and their priority. That would be unbelievably helpful if I could quickly start a new instance of Thunar, say from a shell script, that would load a completely different list of shortcuts in its side panel, pointing to the folders I need for each project, and only to those (to avoid cluttering the panel with too many shortcuts).

After doing some research, I see that all bookmarks in Thunar are stored in `~/.config/gtk-3.0/bookmarks`, which is a good starting point. Alas, reading Thunar's doc (https://docs.xfce.org/xfce/thunar/start) I don't see any mention of optional parameters that I could use at startup to tell Thunar to load a specific config/bookmarks file.

I am a newbie to GNU/Linux and have no idea if it is even possible to do what I am looking for, but seeing how everything is customizable I want to at least try.

If you have any suggestion, you are more than welcome to share it wink

Thx fo reading.

Last edited by DavidB (2021-03-13 21:35:08)

Offline

#2 2021-03-14 00:44:07

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: Multiple instances of Thunar each with different side panel shortcuts?

Thunar doesn't natively support this, but there is one hacky way of doing this. Not sure if it will meet all of your needs, but it can maintain separate bookmarks.

First off, thunar must not be running in daemon mode. That is when its run via "Thunar --daemon". You need to kill/disable this startup.

Then, you can start each separate instance of thunar by specifying a new, unique XDG_CONFIG_HOME. Like this:
- "thunar" - uses ~/.config
- "XDG_CONFIG_HOME=~/.config2 thunar" - uses ~/.config2
- "XDG_CONFIG_HOME=~/.config3 thunar" - uses ~/.config3

In each config directory, ~/.config2 & ~/.config3, you can use different gtk-3.0/bookmarks file. Not sure though if this will break any other functionality though. You'd need to test it to find out.


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 2021-03-14 10:08:31

DavidB
Member
From: France
Registered: 2021-03-10
Posts: 6
Website

Re: Multiple instances of Thunar each with different side panel shortcuts?

Thx a lot!

It works. Mmm, let's be cautious: it looks like it is working really well but, as you said, some more testing will be needed just to be sure wink

And also more learning on my part is required too as I had no idea what this 'thunar --daemon' is and why it was running, and how to prevent it. It's great.

Last edited by DavidB (2021-03-14 10:10:15)

Offline

#4 2021-03-14 10:24:31

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: Multiple instances of Thunar each with different side panel shortcuts?

DavidB wrote:

And also more learning on my part is required too as I had no idea what this 'thunar --daemon' is and why it was running, and how to prevent it. It's great.

Its basically a stub of the program that sits in the background. Starts newer instances of thunar quicker and listens and responds to automount requests (e.g. a USB stick).


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 2021-03-14 10:39:34

DavidB
Member
From: France
Registered: 2021-03-10
Posts: 6
Website

Re: Multiple instances of Thunar each with different side panel shortcuts?

ToZ wrote:

Its basically a stub of the program that sits in the background. Starts newer instances of thunar quicker and listens and responds to automount requests (e.g. a USB stick).

Ok, thx for the clarification. Deactivating it would then mean not being able (un)mount devices anymore or just that I would have to right click on it to do it?

Following your post, I started doing some more reading, but there is quite a few things that I find confusing. For example, I can't find where/how to turn off the deamon parameter for Thunar after reading these:

https://docs.xfce.org/xfce/xfce4-session/advanced
https://docs.xfce.org/xfce/xfce4-session/preferences
https://bbs.archlinux.org/viewtopic.php?id=158674 (I see no line regarding thunar in the suggested files)

Still, There is a lead to follow and that is so much more than what I had yesterday wink

Edit: to be clear, a killall thunar did killed the daemon thingy, but I am looking for a way to make sure I can decide when to run it this daemon parameter or not.

Last edited by DavidB (2021-03-14 10:43:55)

Offline

#6 2021-03-14 18:09:58

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: Multiple instances of Thunar each with different side panel shortcuts?

I think it's started automatically via dbus. The easiest way to deal with it is to create a Startup command (Settings Manager > Session and Startup > Application Startup) to run "thunar -q".


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

#7 2021-03-15 10:20:08

DavidB
Member
From: France
Registered: 2021-03-10
Posts: 6
Website

Re: Multiple instances of Thunar each with different side panel shortcuts?

ToZ wrote:

I think it's started automatically via dbus. The easiest way to deal with it is to create a Startup command (Settings Manager > Session and Startup > Application Startup) to run "thunar -q".

It seens to be working. Once again: thx a lot for your help smile

If anyone else is interested, here is how I managed to get thunar to reload with a different set of shortcuts in the sidebar (and to use a different theme and icons too, just because).

As ToZ suggested. I added a Startup command to prevent Thunar from starting in daemon mode. And I have created a copy of the follwing script (made executable) for each project I want to have custom settings. Each script is then associated with a custom keyboard shortcut in the Settings>Keyboard>Application Shortcuts, to quickly be able to switch from one to the other. Add to that the possibility to have a different Taskbar for each workspace, and it makes a really cool way to create an on-the-spot different workspace for every project you are working on, without having to use different user accounts.

Here is one of such scripts.

  • It kills thunar and then relaunch it after changing the relevant settings and  define a new theme and icons. In the first two lines, I had to add this thunar/Thunar thingy in order for the script to be able to kill Thunar, as it could appear either way in the process list, no idea why (running Manjaro).

  • The .configMyOtherProject folder contains the settings files Thunar needs to be able to have custom settings. For the sidebar shortcuts, the required file is /home/david/.configMyOtherProject/gtk-3.0/bookmarks.

  • Note that using this XDG_CONFIG_Home option, some apps will revert back to their default settings. I have not done much testing, but it happened with Gimp. My solution is either to duplicate their configuration from my default ~/.config or create a new one.

  • Edit: to use different icons and/or theme, you must have them already installed in ~/.icons and ~/.themes respectively.

#!/bin/bash
if pgrep Thunar; then killall Thunar; fi
if pgrep thunar; then killall thunar; fi
xfconf-query -c xsettings -p /Net/IconThemeName -s "Name of the icon pack"
xfconf-query -c xsettings -p /Net/ThemeName -s "Name of the theme"
XDG_CONFIG_HOME=/home/david/.configMyOtherProject thunar

As the script certainly shows, I am not a coder, sorry for that. Every time, I need to switch workspace and then manually run whatever keyboard shortcut to change sidebar shortcuts/theme/icons, no doubt there are ways to automate this. As there must be a way to use a single script, no matter how many projects/custom settings one is willing to have. Also, I could not find a way to have my script not to open a new shell window each time I open Thunar through one of my scripts. But, hey, at least it works wink

I reckon for most people such a hack will look meaningless but for me, the ability to almost instantly customize my DE depending what I am working on with quick access to whatever folders I need, it is a real and impressive boost.

Thanks again for your help, ToZ.

Last edited by DavidB (2021-03-15 10:32:36)

Offline

Board footer

Powered by FluxBB