How to change tooltip background color in Unity?
2012-05-01 20:51
471 查看
Here is a screenshot of Eclipse which displays some source code in a tool tip with black text on black background:I had to edit these files:
(Addition: for Ubuntu 12.04, it seems youjust have to modify the file:/usr/share/themes/Ambiance/gtk-2.0/gtkrc , replacing the tooltip backround and foreground color, with the #000000 and the #f5f5b5 color, respectively)You require root privileges to edit the files. Use
/usr/share/themes/Ambiance/gtk-3.0/settings.ini /usr/share/themes/Ambiance/gtk-3.0/gtk.css /usr/share/themes/Ambiance/gtk-2.0/gtkrc
(Addition: for Ubuntu 12.04, it seems youjust have to modify the file:/usr/share/themes/Ambiance/gtk-2.0/gtkrc , replacing the tooltip backround and foreground color, with the #000000 and the #f5f5b5 color, respectively)You require root privileges to edit the files. Use
sudo geditto edit them.Search for
tooltipin these files and you'll find the color definitions for the foreground and the background. I use
#000000as foreground and
#f5f5b5as background and now the tooltips in all applications are again readable. After changing the color values simply switch to some other theme and then back to Ambiance and the tooltip color is now fixed.Here is the result:I created a small script :
#/bin/sh
# Tooltip fix
# A script to fix themes files in Ubuntu 11.10
# to have readable tooltips in applications such
# as eclipse.
# The script edits the gtk.css, settings.ini and gtkrc files
# Author: Victor Pillac
# http://victorpillac.wordpress.com
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fipath=/usr/share/themes
theme=Ambianceif [ $# = 1 ]; then
theme=$1
fiecho "Fixing tooltips for theme $theme"
echo " (you can select a different theme by passing its name as argument)"
sed -i 's/tooltip_bg_color #000000/tooltip_bg_color #f5f5b5/g' $path/$theme/gtk-3.0/gtk.css
sed -i 's/tooltip_fg_color #ffffff/tooltip_fg_color #000000/g' $path/$theme/gtk-3.0/gtk.css
sed -i 's/tooltip_bg_color:#000000/tooltip_bg_color:#f5f5b5/g' $path/$theme/gtk-3.0/settings.ini
sed -i 's/tooltip_fg_color:#ffffff/tooltip_fg_color:#000000/g' $path/$theme/gtk-3.0/settings.ini
sed -i 's/tooltip_bg_color:#000000/tooltip_bg_color:#f5f5b5/g' $path/$theme/gtk-2.0/gtkrc
sed -i 's/tooltip_fg_color:#ffffff/tooltip_fg_color:#000000/g' $path/$theme/gtk-2.0/gtkrc
echo "Done"
相关文章推荐
- How to change the text color of the selected property sheet tab in Visual C++
- how can i change the back color on mouse out to the color specified in gridview
- How to change the Text color of Menu item in Android?
- qt 之 How to Change the Background Color of QWidget
- How to change the background color of an Edit Box
- How to change the background color of form using C++ - 如何用C++改变窗体的颜色
- How to change the highlight color in autocomplete box in Eclipse
- How to change the output color of echo in Linux
- How to change background color of gedit embedded terminal
- How To Change the Background Color of a Tab Control
- how to change the background color of actionbar
- How to change vCenter URL in VMware View
- How to: How to change SVN Repository location in JDev?
- How to change max_allowed_packet value in mysql?
- How to Change The Bootsplash In Ubuntu 8.10
- How to change statusbar text color to dark on android 4.4
- How to write a console application running in background (hidden window)?
- How to Change RabbitMQ Queue Parameters in Production?
- How to change local path in TFS 改变TFS中的local path
- How to set background image of a component in GWTEXT