You are not logged in.
Pages: 1
Topic closed
I've looked for a GTK visual diff tool and I couldn't find anything except "meld". Meld is a nice tool, except that it is totally unusable with the "Xfce-Dusk" theme (text is written black on black, or white on white...)
Searching the web didn't return any solution, only a post 9 months ago on their mailing list that apparently didn't lead to anything.
So I had a look at the source files and found how to change the colors. If anyone's interested, hop to /usr/lib/meld/ and open meldapp.py in your editor. Search for color and change the following lines:
"color_delete_bg" : prefs.Value(prefs.STRING, "#003300"),
"color_delete_fg" : prefs.Value(prefs.STRING, "Red"),
"color_replace_bg" : prefs.Value(prefs.STRING, "#112233"),
"color_replace_fg" : prefs.Value(prefs.STRING, "gray80"),
"color_conflict_bg" : prefs.Value(prefs.STRING, "Pink"),
"color_conflict_fg" : prefs.Value(prefs.STRING, "White"),
"color_inline_bg" : prefs.Value(prefs.STRING, "#223344"),
"color_inline_fg" : prefs.Value(prefs.STRING, "White"),
"color_edited_bg" : prefs.Value(prefs.STRING, "gray20"),
"color_edited_fg" : prefs.Value(prefs.STRING, "White"),
(The values here are the ones I came up with; they should be a good starting point for people using dark themes.)
You can also edit tree.py and look for foreground=.
'<span foreground="white">%s</span>', # STATE_NORMAL
'<span foreground="white" style="italic">%s</span>', # STATE_NOCHANGE
(I only changed those two lines from black to white.)
Edit: Does not work anymore; see https://wiki.gnome.org/Meld/DarkThemes instead.
Last edited by stqn (2013-09-09 12:52:47)
Offline
Hmm, doesn't look like it'd be too hard to write a script to handle that (just some sed lines), similar to openoffice-dark-gtk-fix.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Thanks stqn, I like your solution!
Here's a script to do that:
#!/bin/sh
cd /usr/lib/meld/
echo "Patching files in $(pwd)"
sed '
s/\(color_delete_bg"[^"]*\)"[^"]*"/\1"#003300"/
s/\(color_replace_bg"[^"]*\)"[^"]*"/\1"#112233"/
s/\(color_replace_fg"[^"]*\)"[^"]*"/\1"gray80"/
s/\(color_conflict_fg"[^"]*\)"[^"]*"/\1"White"/
s/\(color_inline_bg"[^"]*\)"[^"]*"/\1"#223344"/
s/\(color_inline_fg"[^"]*\)"[^"]*"/\1"White"/
s/\(color_edited_bg"[^"]*\)"[^"]*"/\1"gray20"/
s/\(color_edited_fg"[^"]*\)"[^"]*"/\1"White"/
' meldapp.py > meldapp.py.new
sed '
s/foreground="[^"]*"\([^#]*#[ ]*STATE_NORMAL\)/foreground="white"\1/
s/foreground="[^"]*"\([^#]*#[ ]*STATE_NOCHANGE\)/foreground="white"\1/
' tree.py > tree.py.new
for file in meldapp.py tree.py; do
mv "$file.new" "$file"
done
echo -e "\e[32;1mDone\e[0m (Note: In case meld doesn't work anymore, please reinstall it.)"
edit: added some messages
Last edited by lxz (2010-08-09 10:27:57)
Offline
Thanks stqn, I like your solution!
Here's a script to do that:
edit: added some messages
The latest meld has moved some stuff, here's the changes.
#!/bin/sh
cd /usr/lib/meld/meld/
echo "Patching files in $(pwd)"
sed '
s/\(color_delete_bg"[^"]*\)"[^"]*"/\1"#003300"/
s/\(color_replace_bg"[^"]*\)"[^"]*"/\1"#112233"/
s/\(color_replace_fg"[^"]*\)"[^"]*"/\1"gray80"/
s/\(color_conflict_fg"[^"]*\)"[^"]*"/\1"White"/
s/\(color_inline_bg"[^"]*\)"[^"]*"/\1"#223344"/
s/\(color_inline_fg"[^"]*\)"[^"]*"/\1"White"/
s/\(color_edited_bg"[^"]*\)"[^"]*"/\1"gray20"/
s/\(color_edited_fg"[^"]*\)"[^"]*"/\1"White"/
' preferences.py > preferences.py.new
sed '
s/foreground="[^"]*"\([^#]*#[ ]*STATE_NORMAL\)/foreground="white"\1/
s/foreground="[^"]*"\([^#]*#[ ]*STATE_NOCHANGE\)/foreground="white"\1/
' tree.py > tree.py.new
for file in preferences.py tree.py; do
mv "$file.new" "$file"
done
echo -e "\e[32;1mDone\e[0m (Note: In case meld doesn't work anymore, please reinstall it.)"
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Thanks, lxz and ngoonee!
Offline
yep, very handy. Thanks, I can use meld again.
Archer since 03/2009 - AUR packages
Offline
Seems not to work with last version of meld aka meld 1.7.5-1
Offline
You can now change the color with ~/.gtkrc-2.0. The default colors are defined in /usr/share/meld/gtkrc.
https://mail.gnome.org/archives/meld-li … 00051.html
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Have you tried e.g. https://wiki.gnome.org/Meld/DarkThemes ?
Offline
Yep,
I was on it until now trying to tweak it according to my "dark" NOX theme.
Offline
Have you tried e.g. https://wiki.gnome.org/Meld/DarkThemes ?
Great! These colors are ugly, but readable.
Thanks.
Offline
karol wrote:Have you tried e.g. https://wiki.gnome.org/Meld/DarkThemes ?
Great! These colors are ugly, but readable.
Thanks.
You can try using values from https://bbs.archlinux.org/viewtopic.php … 95#p812795
Offline
For newer version, this trick does not work anymore (likely due to the switch to GTK 3). However, it's possible to create a css file located in ~/.config/gtk-3.0/gtk.css similar to this:
https://github.com/GNOME/meld/blob/master/data/meld.css
My gtk.css
--
falstaff
Offline
My gtk.css
Thanks a lot! It’s working perfectly. I had to put gtk.css in /root/.config/gtk-3.0/ for "sudo meld" to get the css, of course… (forgot it at first and was disappointed it wasn’t working).
Now we just have to wait a couple months for the next breaking change by the meld authors…
Offline
@stqn
Naaa , you were wrong:
- they implemented in the app settings and now we are all happy
Offline
Compare the dates, one would think that this has changed quite a bit in three years.
Do not necropost.
Closing.
Last edited by V1del (2017-09-07 12:24:59)
Online
Pages: 1
Topic closed