4

I'm using a dark theme in Debian, but the Dolphin file manager just ignores it.

I have seen some examples of a dark theme in Dolphin, but I can't find a way to do it. I've seen some ways to set a background image, but of course that doesn't help me, because I would have black text on black background.

From what I've seen I might need a KDE theme. I have found this, but it gives me a .qtcurve file.
I looked up how to use it and this page told me to use KDE system settings. Sounds weird, but ok, I installed the systemsettings package.
But in the KDE system settings I only had the categories "shortcuts", "network settings" and "network connectivity". So I installed kde-config-gtk-style and it did indeed add the "application style" category to the KDE settings.
There I first tried setting "BlackMATE" as the GTK2 and GTK3 theme, which did nothing. Then I tried importing the downloaded theme file, which didn't work, because it expected a .tar file.
So I packed the theme file into a .tar archive (which seems weird, why would I need to do that?) and imported that, which made the settings window become unresponsive and then close itself. I guess it's not the sort of tar file it expects?
When I click "download GTK2 themes" or "download GTK3 themes", it stays at "initialising" and does nothing.

So how do I set a dark theme in Dolphin? Do I even need the KDE settings?

Debian 9.5
Cinnamon 3.2.7
Dolphin 16.08.3

Fabian Röling
  • 319
  • 1
  • 6
  • 20
  • Great, Google sent me back to my own question. Since asking this question, I switched to Manjaro, using the Mate desktop environment. I can use the program "qt5ct" to switch most of Dolphin to a dark theme, but not the background of the are with all the folders and files, which is of course the most important thing. – Fabian Röling Feb 10 '20 at 16:24

4 Answers4

6

I recently switched from Debian to Manjaro and from Cinnamon to Mate, but this solution should hopefully apply to all distributions and desktop environments:

Firstly, the program "qt5ct" can be used to edit the theme of programs using Qt themes instead of whatever Cinnamon, Mate, etc. use. On Manjaro I installed it with yay qt5ct, on Debian it's probably sudo apt-get install qt5ct. I selected an arbitrary dark theme ("style") in there.

But that doesn't change the background image, that is still white. So I found this answer on AskUbuntu. It's pretty long, but what matters, if you just want a black background, is:

  • Create a file somewhere that contains a custom Qt style sheet, with this content:
DolphinViewContainer > DolphinView > QAbstractScrollArea {
      background-color: black;
}
  • Start Dolphin like this in the future: dolphin -stylesheet /path/to/style_sheet.qss
Fabian Röling
  • 319
  • 1
  • 6
  • 20
  • it's `yay -S qt5ct` in arch and manjaro you forget `-S` and worked for me thanks. – SAYE Jun 10 '20 at 15:57
  • Just `yay search_term` gives a list of possible packages. Since you can often choose between the default package, the Git version, older version, differently packaged ones, etc., I find it useful to always open the menu, even if you know the package name. Of course in a script you would use `pacman` directly or something else, but this is not a script usecase. – Fabian Röling Jul 01 '20 at 14:44
  • BTW, I switched from Mate to KDE after I wrote this answer and there it simply uses the system theme, even for the background colour, no special treatment required. – Fabian Röling Jul 01 '20 at 14:45
  • i was switched to `Thunar` filemanager from `dolphin` in **archlinux** with **xfce4** desktop – SAYE Jul 01 '20 at 17:44
  • I don't know what you mean with "I was switched", but you can just install and use Dolphin if you prefer that. It's mostly independent of the desktop environment. – Fabian Röling Jul 01 '20 at 20:27
  • That means I did it a week ago.`dolphin` is annoying – SAYE Jul 02 '20 at 12:15
3

Go to the ~/.config/kdeglobals and add these lines

[Colors:View] BackgroundNormal=94, 104, 109

the numbers representing the RGB value of whatever color you choose.

AdminBee
  • 21,637
  • 21
  • 47
  • 71
Don Cream
  • 31
  • 1
  • Your solution worked for me. But is there a way to also change text color to white ? I mean, if I make my foreground black (and not only grey like in your example), I will be unable to read text. – ewen-goisot Mar 23 '21 at 15:46
  • Thanks, working for my in MX Linux 19 with openbox (using the Breeze Dark Theme inside the package Breeze) – Indacochea Wachín Jul 22 '21 at 22:41
2

I'm using a dark theme and it simply applies to Dolphin as well.

I just tested it out again and I did notice that after switching from light to dark again, I had to close the running Dolphin instance and start a new one to have the dark theme take effect. But I guess you tried that already..?

Btw, I use the Breeze Dark theme: Breeze Dark theme

You can find this setting under KDE's System Settings > Appearance > Workspace theme > Look and Feel enter image description here Maybe it is a bug in that KDE version or debian release, did you try testing out the latest version (in a virtual machine)? I'm on Dolphin 17.04.2.

mx1up
  • 281
  • 1
  • 5
  • 1
    My Dolphin version is 16.08.3 and Synaptic (and `apt-get`) doesn't find any updates for it. My settings have the categories "Startup", "View modes", "Navigation", "Services", "Trash" and "General", also there are less buttons at the bottom. Since I didn't really write that into the question, my Debian version is 9.5. – Fabian Röling Oct 02 '18 at 19:28
  • The setting I showed is in the KDE System Settings. I updated the answer to explain where to find it. In your question you mention the categories you have in your System Settings but Workspace Theme does not seem present. Maybe you have to install a package to have the workspace theme settings? – mx1up Oct 02 '18 at 20:01
  • btw, I looked up: the workspace settings are in the package `plasma-workspace', for debian stretch I found a package here: https://packages.debian.org/stretch/plasma-workspace . The dark theme itself (I'm using), is contained in breeze5-style, for debian, that seems to be https://packages.debian.org/stretch/breeze – mx1up Oct 02 '18 at 20:08
  • I installed `plasma-workspace` and it does add a few more menus, but not that one. I have now: "Application style", "Desktop behaviour", "Shortcuts", "Applications", "Settings", "Connectivity", "Power management". – Fabian Röling Oct 02 '18 at 22:51
  • I looked up the file to be responsible for the "Workspace Theme" settings: settings-appearance-workspacetheme.desktop. This file is contained in the `systemsettings` package: https://packages.debian.org/stretch/amd64/systemsettings/filelist . Do you have this one installed? – mx1up Oct 03 '18 at 10:10
  • After letting a file search in Dolphin run for more than a day without results, I let Konqueror search for that file and it found it in a second, wow. That file is in `/usr/share/kservices5` for me. The package `systemsettings` is installed, that's how I got KDE system settings at all. – Fabian Röling Oct 04 '18 at 21:34
  • I recommend rebuilding the KService desktop file system configuration cache. You can do that for your user with the command `kbuildsycoca5 --noincremental` and see of the "workspace theme" setting appears. If that doesn't help, try rebuilding the global (=system) cache: `sudo kbuildsycoca5 --noincremental --global`. If any of those commands yields an error, please post the output – mx1up Oct 05 '18 at 09:53
  • First command: `kbuildsycoca5 running... Recreating ksycoca file ("/home/fabian/.cache/ksycoca5_en-GB_4PUFeZmyndN20Om1YAsxYs8NJdk=", version 303) kf5.kservice.sycoca: Parse error in "/home/fabian/.config/menus/applications-merged/xdg-desktop-menu-dummy.menu" , line 1 , col 1 : "unexpected end of file" Menu "applications-kmenuedit.menu" not found. The desktop entry file "/usr/share/applications/evince.desktop" has an empty mimetype! The desktop file "/home/fabian/.local/share/applications/appimagekit-shotcut.desktop" references the action "Uninstall" but doesn't define it Saving` – Fabian Röling Oct 05 '18 at 20:19
  • Second command: `QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' kbuildsycoca5 running... Recreating ksycoca file ("/usr/local/share/ksycoca/ksycoca5_en-GB", version 303) Menu "applications-kmenuedit.menu" not found. The desktop entry file "/usr/share/applications/evince.desktop" has an empty mimetype! Saving` – Fabian Röling Oct 05 '18 at 20:19
  • I installed the package `kmenuedit`, but that also doesn't change anything, the output is the same and the menu item is still not there. – Fabian Röling Oct 05 '18 at 20:23
0

If you start Dolphin with the stylesheet containing

DolphinViewContainer > DolphinView > QAbstractScrollArea {
      background-color: black;
    }

you will lose almost all the file icons. The files are displayed with their names only, without the fancy icons. Of course, this will happen if you are not using Gnome as your desktop environment but, for example, xfce. To remedy this, make sure an icon theme is set in qt5ct.

Gerd
  • 1
  • 1
  • 1
    This would be better as an edit to my answer. Also, the icons are not definitely gone, only if the theme doesn't work properly. – Fabian Röling Sep 07 '20 at 22:46