Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old October 29th, 2007   #21
mdpalow
Extra Foam Sugar Free Ubuntu
 
mdpalow's Avatar
 
Join Date: Oct 2007
Beans: 832
Ubuntu 9.04 Jaunty Jackalope
Re: HOWTO: Change colors of wine applications

do I copy this into a file and then run it? Can you pls explain this a little more detailed for the novice.

Thanks in advance...
mdpalow is offline   Reply With Quote
Old October 29th, 2007   #22
MemoryDump
Way Too Much Ubuntu
 
MemoryDump's Avatar
 
Join Date: Apr 2005
Location: C A N A DA
Beans: 291
Ubuntu 8.10 Intrepid Ibex
Re: HOWTO: Change colors of wine applications

Quote:
Originally Posted by KillerKiwi View Post
I've started this... it grabs the color scheme from GTK and produces a wine user.cfg at least it will

Code:
#!/usr/bin/env python
import pygtk
pygtk.require("2.0")
import gtk


def format_color_string( Color ):
	return "%s %s %s" % (Color.red /256, Color.green/256,  Color.blue/256)
	
def format_color_key( key, Color):
	return "\"%s\"=\"%s\"\n" % (key, format_color_string( Color ))
	
style = gtk.Style()

user_reg = """WINE REGISTRY Version 2
;; All keys relative to \\User\\S-1-5-4

[Control Panel\\\\Colors]
"""

# REF - http://www.moeraki.com/pygtkreference/pygtk2reference/class-gtkstyle.html
user_reg += format_color_key('ButtonHilight', style.bg[gtk.STATE_ACTIVE] )
user_reg += format_color_key('ButtonLight', style.bg[gtk.STATE_NORMAL] )
user_reg += format_color_key('ButtonShadow', style.dark[gtk.STATE_NORMAL] )
user_reg += format_color_key('ButtonText', style.text[gtk.STATE_NORMAL] )
user_reg += format_color_key('ButtonFace', style.bg[gtk.STATE_PRELIGHT])

print user_reg
It should just be a matter of finding the correct mappings from here.....
omg this worked like a charm!! thxs

Quote:
Originally Posted by mdpalow View Post
do I copy this into a file and then run it? Can you pls explain this a little more detailed for the novice.

Thanks in advance...
to answer mdpalow's question..
copy and paste the code provided in a new document.. like getcolors.py for example.
then in a shell simply type: python getcolors.py
it'll spit out the colors you can copy and paste in your user.reg file as described in the first post. Good luck!
__________________
Running: Ubuntu 9.04 & Windows 7 RC
Registered Linux User #373810
Become a Registered Linux User Here.
MemoryDump is offline   Reply With Quote
Old October 29th, 2007   #23
KillerKiwi
Gee! These Aren't Roasted!
 
KillerKiwi's Avatar
 
Join Date: Jun 2005
Beans: 187
Re: HOWTO: Change colors of wine applications

A bit more tweaking.... the mappings still arnt correct but its closer

Code:
#!/usr/bin/env python
import pygtk
import gtk


def format_color_string( Color ):
	return "%s %s %s" % (Color.red /256, Color.green/256,  Color.blue/256)
	
def format_color_key( key, Color):
	return "\"%s\"=\"%s\"\n" % (key, format_color_string( Color ))
	

invisible1 = gtk.Invisible()
style1 = invisible1.style

button1 = gtk.Button()
buttonstyle = button1.style

scroll1 =  gtk.VScrollbar()
scrollbarstyle = scroll1.style

menu1 = gtk.Menu()
menuitem1 = gtk.MenuItem()
menu1.add(menuitem1)
menustyle = menuitem1.style

user_reg = """WINE REGISTRY Version 2
;; All keys relative to \\User\\S-1-5-4

[Control Panel\\\\Colors]
"""

# http://www.moeraki.com/pygtkreference/pygtk2reference/class-gtkstyle.html
# http://lists.ximian.com/pipermail/mono-winforms-list/2003-August/000469.html

user_reg += format_color_key('Scrollbar', scrollbarstyle.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('Background', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('ActiveTitle', menustyle.bg[gtk.STATE_PRELIGHT])
user_reg += format_color_key('InactiveTitle', menustyle.bg[gtk.STATE_PRELIGHT])
user_reg += format_color_key('Menu', menustyle.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('Window', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('WindowFrame', style1.fg[gtk.STATE_INSENSITIVE])
user_reg += format_color_key('MenuText', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('WindowText', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('TitleText', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('ActiveBorder', menustyle.bg[gtk.STATE_PRELIGHT])
user_reg += format_color_key('InactiveBorder', menustyle.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('AppWorkSpace', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('Hilight', menustyle.bg[gtk.STATE_PRELIGHT])
user_reg += format_color_key('HilightText', style1.bg[gtk.STATE_PRELIGHT])
user_reg += format_color_key('ButtonFace', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('ButtonShadow', style1.bg[gtk.STATE_INSENSITIVE])
user_reg += format_color_key('GrayText', style1.fg[gtk.STATE_INSENSITIVE])
user_reg += format_color_key('ButtonText', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('InactiveTitleText', style1.fg[gtk.STATE_INSENSITIVE])
user_reg += format_color_key('ButtonHilight', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('ButtonShadow', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('ButtonLight', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('InfoText', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('InfoWindow', style1.fg[gtk.STATE_NORMAL])
user_reg += format_color_key('ButtonAlternateFace', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('ButtonHilight', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('GradientActiveTitle', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('GradientInactiveTitle', style1.bg[gtk.STATE_NORMAL])
user_reg += format_color_key('MenuHilight', menustyle.bg[gtk.STATE_NORMAL])

print user_reg
KillerKiwi is offline   Reply With Quote
Old November 9th, 2007   #24
dnns123
Gee! These Aren't Roasted!
 
dnns123's Avatar
 
Join Date: Sep 2007
Beans: 159
Ubuntu 9.10 Karmic Koala
Re: HOWTO: Change colors of wine applications

Thanks! But I think its too bright
dnns123 is offline   Reply With Quote
Old March 1st, 2008   #25
mscir
5 Cups of Ubuntu
 
Join Date: Dec 2007
Beans: 19
Re: HOWTO: Change colors of wine applications

Thanks, that looks a lot better.

My menu text (Ubuntu 7.10) is still grey instead of black, is there any way to fix that?
mscir is offline   Reply With Quote
Old April 25th, 2008   #26
bg1256
Dipped in Ubuntu
 
bg1256's Avatar
 
Join Date: Sep 2006
Beans: 537
Ubuntu 8.04 Hardy Heron
Re: HOWTO: Change colors of wine applications

http://tombuntu.com/index.php/2008/0...he-ugly-stick/
__________________
Loving Ubuntu every step of the way.
bg1256 is offline   Reply With Quote
Old June 18th, 2008   #27
LeeU
A Carafe of Ubuntu
 
LeeU's Avatar
 
Join Date: Jan 2007
Location: Florida
Beans: 128
Ubuntu 8.04 Hardy Heron
Re: HOWTO: Change colors of wine applications

Quote:
Originally Posted by Super Jamie View Post
many months too late, but this page has good google rating

here are wine xp settings, which i lifted from http://www.winehq.org/pipermail/wine...st/010161.html
Sweet! Thanks!
__________________
Lee | http://leeunderwood.org/

"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened." - Sir Winston Churchill
LeeU is offline   Reply With Quote
Old June 18th, 2008   #28
WillemToerien
5 Cups of Ubuntu
 
WillemToerien's Avatar
 
Join Date: Feb 2008
Location: South Africa
Beans: 19
Ubuntu 8.04 Hardy Heron
Send a message via MSN to WillemToerien Send a message via Yahoo to WillemToerien
Exclamation Re: HOWTO: Change colors of wine applications

Quote:
Originally Posted by ice60 View Post
I've installed the theme in wine, and it looks great.

...however... its way slower and eats a ton of your cpu usuage just by for example selecting another tab.
__________________
Assumption is the mother of all f*ckups.
WillemToerien is offline   Reply With Quote
Old August 1st, 2008   #29
Endolith
100% Pure Ubuntu
 
Join Date: Feb 2007
Location: New York
Beans: 852
Ubuntu 9.10 Karmic Koala
Re: HOWTO: Change colors of wine applications

Quote:
Originally Posted by KillerKiwi View Post
A bit more tweaking.... the mappings still arnt correct but its closer
I decided to take a stab at fulfilling my own request in Bug 111061. While researching, I found that you had already done much of the work for me.

I fixed some mappings and got it working so that it does everything automatically now; reads the color codes from various places, creates a .reg file, and then imports that into the Wine registry. So you just run the script once after changing themes and it updates. Although some of your choices looked better than nothing, and work pretty well on some themes, they don't work on all, so I've disabled them for now so we can find the real settings. It's a lot harder than I expected to get the correct colors that the system is currently using:
  • 'ActiveBorder' = Active window border
  • 'ActiveTitle' = Left end of active title bar
  • 'GradientActiveTitle' = Right end of active title bar
  • 'GradientInactiveTitle' = Right end of inactive title bar
  • 'InactiveBorder' = Inactive window border
  • 'InactiveTitle' = Left end of inactive title bar
  • 'InactiveTitleText' = Inactive title bar text
  • 'TitleText' = Active title bar text
Aren't all of these defined by the window manager; not GTK? How do we access those settings? There's a metacity module for python, but I can't find any documentation.
  • 'AppWorkSpace' = Background color of multiple-document interface
Seems like Gnome has pretty much abandoned MDIs, and I don't know where to read this color from. Seems like a GTK setting, though.
  • 'Background' = Gnome desktop color
I scraped this from gconf, but there might be a better way.
  • 'HotTrackingColor' = Single-click navigation hover color
Is there an equivalent of this in Gnome? It's used in Windows Explorer and Internet Explorer as the hover color for single-click navigation.
  • 'InfoText' = ToolTip text
  • 'InfoWindow' = ToolTip background
I think this is in GTK, but I don't know where to look.

tooltips1 = gtk.Tooltips() ?

'gtk.Tooltips' object has no attribute 'style'
  • 'Menu' = Background for menus, also background for menu bars in 3D mode
  • 'MenuBar' = Background for menu bars - rarely seen with 3D menus
  • 'MenuHilight' = Highlight for flat menus - in 3D mode, Hilight is used instead
  • 'MenuText' = Menu text
The menustyle.bg thing returns values for these, but they don't usually match with the theme. For instance, menustyle.bg[gtk.STATE_SELECTED] gives me a blue in the Human theme, when the selected menu background is actually yellow. I don't get it. (Note that these really only work in Wine when you enable flat menus.)
  • 'Scrollbar' = Background color of scrollbar, but only in some apps.
I don't think scrollbarstyle.bg[gtk.STATE_NORMAL] matches the real color, either.

If anyone can help with this, it would be very appreciated.

Also, it took me a while (and tweaking in actual Windows) to figure out what all the Wine registry values do. Some are obvious, but others are not. I still don't know what ButtonAlternateFace does. (As far as I can tell, "ButtonAlternativeFace" is just a typo of "ButtonAlternateFace".) I wish there were more documentation for this, but I'll post what I've found somewhere so that others don't have to reverse-engineer it again like I did.

I also want to look into importing font faces, sizes, and widget sizes as well. I'm sure some of these would be a further improvement, while others would just make Wine look stupid.

Attached is the script as well as a spreadsheet of all the registry values and the mappings I've found. This is my first Python script; be nice.

Edit: Latest version is on Launchpad: http://bazaar.launchpad.net/~endolit...-scraper/files
Attached Files
File Type: py winethemefromgtk.py (5.9 KB, 32 views)
__________________
"Please remember to do things the Ubuntu way. There is always more than one solution to a problem, choose the one you think will be the easiest for the user. ... Try to think as a green user and choose the simplest solution." — Code of Conduct

Last edited by Endolith; October 21st, 2008 at 04:46 PM.. Reason: latest version is on Launchpad
Endolith is offline   Reply With Quote
Old August 3rd, 2008   #30
Endolith
100% Pure Ubuntu
 
Join Date: Feb 2007
Location: New York
Beans: 852
Ubuntu 9.10 Karmic Koala
Re: HOWTO: Change colors of wine applications

The spreadsheet of Wine color names is too big to upload here, but I created a page explaining them all anyway:

http://www.endolith.com/wordpress/20...3/wine-colors/
__________________
"Please remember to do things the Ubuntu way. There is always more than one solution to a problem, choose the one you think will be the easiest for the user. ... Try to think as a green user and choose the simplest solution." — Code of Conduct
Endolith is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:05 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry