Author Topic: Replacing Thunar with PCManFM  (Read 227 times)

Offline LuizHall

  • Newbie
  • *
  • Posts: 2
Replacing Thunar with PCManFM
« on: December 03, 2018, 07:57:48 pm »

I just installed SparkyLinux, MinimalGUI edition.
So far I pretty much like the way you are doing in configuring and customizing it on top of DebianTesting. Congrats on that!
There are some non needed packages (mainly xorg and firmware related) after the default advanced installation, but I'm pretty sure, in the future, you'll manage a way of cleaning off installation "debris" -- anyway, that's irrelevant for the purpose of this post.

What's the proper way of replacing Thunar with PCManFM without breaking any of your customizations?
-- without removing sparky-desktop-openbox* (which removes sparky-libinput sudo xfce4-power-manager xfce4-power-manager-data  xfce4-power-manager-plugins)

I'm wondering about 'sudo'...


Offline paxmark1

  • Sr. Member
  • ****
  • Posts: 462
Re: Replacing Thunar with PCManFM
« Reply #1 on: December 03, 2018, 11:22:24 pm »
They can co-exist.  You could just add the package you want via
"sudo apt install blah"
where blah is the name of your package.  I start most of my programs via Alt-F2 - so ...  I type a couple of letters usually and there it is. 

  Of course you can choose between pcmanfm and pcmanfm-qt.  "apt -s install pcmanfm"  would simulate how much would be installed, probably less than "apt -s install pcmanfm-qt".    sudo not required for the "-s" switch. 

4 lines in Overview gives a very quick synopsis of differences pcmanfm vs. pcmanfm-qt

Others might post about the more invasive procedure of removing thunar.  I just use LXQT as my DE for a bit now.   
Don't make a FrankenDebian

Offline LuizHall

  • Newbie
  • *
  • Posts: 2
Re: Replacing Thunar with PCManFM
« Reply #2 on: December 04, 2018, 02:21:33 am »
Thank you, paxmark1

This is a new and clean installation, I was/am not really concerned about breaking it, so I went ahead and applied common sense procedures to accomplish what I want.

Because I have several computers and like to keep a log of every step I go trough when installing and configuring a new system and in case other users would like to follow my approach on the change, I'm leaving here my notes on what I did so far, without problems.

. Replacing Thunar with PCManFM
Code: [Select]
$ sudo apt install pcmanfm -y, sudo apt remove --purge thunar -y; sudo apt autoremove -y; su - #(enter root password)
# apt install sudo -y; exit
$ pcmanfm --desktop

. I only have Desktop directory and not all "normal" ones on my configuration. Being so I'll call them $HOME (if I decide to opt out any of it just edit '~/.config/user-dirs.dirs' and remove the one/s I don't want). [defaults dirs are: Desktop, Documents, Downloads, Music, Pictures, Public, Templates, Videos]
This step will also allow "Desktop Preferences" to be fully functional as "Show Documents folder on the desktop" wouldn't be greyed out.
Code: [Select]
$ xdg-user-dirs-gtk-update; xdg-user-dirs-update
. Having PCManFM managing Desktop:
Open to edit ~/.config/openbox/
1 - Replace entry
Code: [Select]
thunar --daemon & - with
Code: [Select]
pcmanfm --desktop &
2 - Remove these 3 lines:
Code: [Select]
if [ -f /usr/bin/xfce4-power-manager ]; then
/usr/bin/xfce4-power-manager &

. Logout/in or reboot

. To recover Sparky's Desktop wallpaper
1 - Right click on an empty spot of desktop (or right click on an empty area of the panel(tint), menu-Settings) and select "Desktop Preferences";
2 - Select "Background" - "Wallpaper mode:" - Select anything you want except "Fill with background color only";
3 - Select "Wallpaper:" - point to '/opt/artwork/' and pick "sparky-desktop.png".

. Taking care of leftovers
In ~/.config/openbox/rc.xml
Under     <!-- Keybindings for running applications -->
Code: [Select]
- with
Code: [Select]

. There is this leftover configuration ' inode/directory=Thunar-folder-handler.desktop; ' in ~/.config/mimeapps.list
Everything's working fine related to that, so far no issues on application associations and /usr/share/applications/mimeinfo.cache is automatically and properly configured for it.
Even though I've decided to keep the previous related configuration, doing the right substitutions:
1 - In ~/.config/mimeapps.list replace
Code: [Select]
Code: [Select]
2 - In /usr/share/applications add a file (in fact is a replacement of previous Thunar one)
Filename: PCManFM-folder-handler.desktop
Code: [Select]
[Desktop Entry]
Name=Open Folder with PCManFM
Comment=Open the specified folders in PCManFM
GenericName=Open Folder
Exec=pcmanfm %F

# vi:set encoding=UTF-8:
* Those replacements could be avoided at this stage if done prior of purging thunar.
[last edited: 12/04/2018]

All the above is, in my understanding, the basic to have PCManFM up and running on this nice SparkyLinux. Many more configs and features could be done, but that depends on each one wishes.
All process can be automatically achieved on CLI by a batch script . For the sake of understanding I'll leave it as is.

. I already did the next step by cleaning the system of thunar and xfce4 parasites. I'm not going to mention those files and directories because it's necessary caution while doing so. They will be fine where they are, anyway. So leave it if you don't want to risk breaking something or ...  find them, using any utility or command line that you like :) (I removed from this place the commands I've used to perform this task because they are too dangerous, in this context, to be in the world wild web)

. Final procedure -  Look at the logs and correct eventual errors. None on this system the way changes were made.

As paxmark1 pointed out and I thank and respect his comments, PCManFM can co-exist with Thunar so the easy way would be just installing PCManFM and not using Thunar. I don't really like that approach because I tend to have my installations clean of unused files, folders, configurations.
Btw, regarding Qt and Gtk I'm going to the lightweight one even not actively maintained as the other counterpart -  I'm not comfortable yet with the recent QT variation, mainly due to resources consuming. In meanwhile, just as an example of the indecisions and confusion on the transition, about a month ago I did a mini.iso installation of Ubuntu 18.04 LTS "Bionic Beaver"; although I've chosen the Gtk version the system were bloated of pcmanfm-qt files/folders/configurations.

I'm keeping the post open to comments in case someone want to give suggestions. I'm only concerned if there is anything that might be changed while/during future SparkyLinux upgrades, not Debian ones.
I would like to know (I didn't find yet on the forum) if the reason of replacing PCManFM with Thunar on SparkyLinux a while ago was due to something critical .

« Last Edit: December 05, 2018, 01:07:25 am by LuizHall »

Offline paxmark1

  • Sr. Member
  • ****
  • Posts: 462
Re: Replacing Thunar with PCManFM
« Reply #3 on: December 04, 2018, 08:06:47 pm »
You are very welcome to help out in this forum. Short and understandable explanations, a pleasure to read. 

 The only real xml I work with is the odd crafting of a better .epub via  sigil and I really am happy not dealing with xdg.
 I am just a hobbyist.  As you imply, pcmanfm is a file-manager.  pcmanfm-qt is a file-manager that also has some of the qualities of a desktop.   pcmanfm is not deprecated by any means and remains a well written and resource light option. 

Again, welcome.
Don't make a FrankenDebian

Offline TheFalcon

  • Newbie
  • *
  • Posts: 7
  • Thank you Linus!
Re: Replacing Thunar with PCManFM
« Reply #4 on: December 05, 2018, 10:46:56 pm »
Just a comment,

I'm very familiar with QT and much prefer it to work with rather than GTK in a development context but I concur with your unease about recent QT releases. I personally use the standard PCManFM. I found the QT version had a few variances (mostly minor) which I didn't care for and the standard version does the job very well anyway. QT5 has been a bit of a rocky road as far as upgrading and backward compatibility goes with even some of the core QT apps having issues. QT Designer is still a bit flaky in my view and struggles with QT4 based apps which is a bit sad.  :(