For gtk apps it's easy, just add the GTK_THEME environment variable, with a theme, and add ":dark". Since I don't want to change my code every time I replace my theme here's the solution:
GTK_THEME=`gsettings get org.gnome.desktop.interface gtk-theme | tr -d "'"`:dark COMMANDNAME
eg. if you want dark scratch-text-editor, run the command like this
GTK_THEME=`gsettings get org.gnome.desktop.interface gtk-theme | tr -d "'"`:dark scratch-text-editor
You want to always do it like this? Create bash script somewhere with the above code, make it executable and then add that to the Exec= line of the relevant .desktop file.
Getting a dark wingpanel is a bit trickier, since it is called without a desktop file from cerbere. I personally have a local bin folder in my path, so I put the shell script there, and named it wingpanel. Important that in that script I called /usr/bin/wingpanel, so there's no infinite loop.
Now the juicy part, how to get non gtk app, like mpv to use datk theme?
I created the following shell script,. to the same directory called mpv:
/usr/bin/mpv --no-terminal --force-window -- "$4" &
sleep 0.6
xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT "dark" -id `wmctrl -l | grep mpv | cut -d " " -f 1`
This script needs wmctrl so install it with apt-get. Note that the first line is bit of a hack that's needed because that's how mpv likes to be called. Add the default gui arguments (if any) for your app, if it's not mpv. The sleep time might be too fast, so if it starts, but the app still has the light titlebar then change it to 1 sec or something. Also note that the last line greps for something that's sort of relevant to the app, but you might have other windows open that have mpv in their name, so it might not work then. (And would require further hacking.)
Could you please explain a bit more what have you done with this part?
What do I have to do exactly? Do I run the script and append the file parameter via terminal?