I’ve read many people talking about integration between Fvwm style and other applications.
I wanted to change at once my Fvwm colorset and Gtk style, and for that I’ve prepared a minimalist GTK theme wich I can control from a simple bash script.
I use just three colors (well, black and white too) for both GTK/FVWM themes.
Here you have a really green screenshot. 8)
http://ozrocpablo.googlepages.com/screen_green.png/screen_green-full.jpg
I define in a file ~/.fvwm/configs/colors
SetEnv Color1 #2222ff
SetEnv Color2 #8888ff
SetEnv Color3 #0000ff
So I have a colourstyle that uses those defined colors:
# Unfocused window
Colorset 0 fg white, bg $[Color2], fgsh black
# Focused window
Colorset 1 fg black, bg $[Color1], fgsh white
# Pager Unfocused
Colorset 20 fg #ffffff, bg $[Color2]
# Pager Focused
Colorset 21 fg #ffffff, bg $[Color2]
# Windows in pager Focused
Colorset 22 fg #ffffff, bg $[Color1]
# Windows in pager Unfocused
Colorset 23 fg #ffffff, bg $[Color1]
# Icons Unfocused
Colorset 30 fg #ffffff, fgsh #000000, bg $[Color1]
# Icons Focused
Colorset 31 fg #000000, fgsh #ffffff, bg $[Color2]
# Taskbar
colorset 40 fg #ffffff, bg $[Color2], fgsh #000000
colorset 41 fg #000000, bg $[Color2], fgsh #ffffff
# Dock (Panel)
Colorset 42 fg $[Color3], bg $[Color2]
Then, I have a GTK theme called DontPanic_gtk with this file in ~/.themes/DontPanic_gtk/gtk-2.0/gtkrc_fvwm
[code]style “dontpanic_default”
{
bg[ACTIVE] = “#Color2”
fg[ACTIVE] = “#000000”
bg[NORMAL] = “#Color2”
fg[NORMAL] = “#000000”
bg[INSENSITIVE] = “#Color2”
fg[INSENSITIVE] = “#000000”
bg[PRELIGHT] = “#Color2”
fg[PRELIGHT] = “#000000”
bg[SELECTED] = “#Color2”
fg[SELECTED] = “#000000”
base[NORMAL] = “#Color2”
base[ACTIVE] = “#Color2”
base[SELECTED] = “#Color2”
base[INSENSITIVE] = “#Color2”
base[PRELIGHT] = “#Color2”
font="-adobe-helvetica-medium-r-normal---120---p-*-iso8859-1"
}
style “dontpanic_menu”
{
bg[NORMAL] = “#Color2”
fg[NORMAL] = “#000000”
bg[INSENSITIVE] = “#Color2”
fg[INSENSITIVE] = “#000000”
bg[PRELIGHT] = “#ffffff”
fg[PRELIGHT] = “#000000”
}
style “dontpanic_list”
{
bg[SELECTED] = “#ffffff”
base[NORMAL] = “#Color2”
base[ACTIVE] = “#Color2”
base[SELECTED] = “#Color1”
base[INSENSITIVE] = “#Color2”
base[PRELIGHT] = “#Color2”
}
style “dontpanic_listbutton”
{
bg[ACTIVE] = “#Color3”
fg[ACTIVE] = “#000000”
bg[NORMAL] = “#Color3”
fg[NORMAL] = “#000000”
bg[PRELIGHT] = “#Color3”
fg[PRELIGHT] = “#000000”
bg[INSENSITIVE] = “#Color3”
fg[INSENSITIVE] = “#000000”
bg[SELECTED] = “#Color3”
fg[SELECTED] = “#000000”
font="-adobe-helvetica-bold-r-normal---120---p-*-iso8859-1"
}
style “dontpanic_tooltips”
{
bg[NORMAL] = “#ffffff”
fg[NORMAL] = “#000000”
}
style “dontpanic_progressbar”
{
fg[NORMAL] = “#000000”
fg[SELECTED] = “#000000”
bg[NORMAL] = “#Color2”
bg[SELECTED] = “#Color3”
}
style “dontpanic_notebook”
{
bg[ACTIVE] = “#Color1”
bg[INSENSITIVE] = “#Color1”
}
style “dontpanic_scrollbar”
{
bg[ACTIVE] = “#Color1”
}
Common default
class “GtkWidget” style “dontpanic_default”
class “GtkWindow” style “dontpanic_default”
class “GtkDialog” style “dontpanic_default”
class “GtkButton” style “dontpanic_default”
class “GtkEntry” style “dontpanic_default”
class “GtkText” style “dontpanic_default”
class “GtkFileSelection” style “dontpanic_default”
class “GtkFontSelection” style “dontpanic_default”
class “List” style “dontpanic_list”
class “Tree” style “dontpanic_list”
class “GtkProgressBar” style “dontpanic_progressbar”
class “Scrollbar” style “dontpanic_scrollbar”
class “MenuItem” style “dontpanic_menu”
class “GtkNotebook” style “dontpanic_notebook”
widget “gtk-tooltips*” style “dontpanic_tooltips”
widget_class “List.GtkButton” style “dontpanic_listbutton”
widget_class “Tree.GtkButton” style “dontpanic_listbutton”
[/code]
With this stupid script (basically a pair of sed’s) I take the colors defined for Fvwm and put them in GTK’s one, activating it via gtk-theme-switch (ok, I know it wasn’t neccesary to make a separate script, but I’m a born2bash)
[code]#!/bin/bash
COLOR_1=$(cat ~/.fvwm/configs/colors | grep SetEnv\ Color1 | cut -d # -f 2)
COLOR_2=$(cat ~/.fvwm/configs/colors | grep SetEnv\ Color2 | cut -d # -f 2)
COLOR_3=$(cat ~/.fvwm/configs/colors | grep SetEnv\ Color3 | cut -d # -f 2)
cat ~/.themes/DontPanic_gtk/gtk-2.0/gtkrc_fvwm | sed “s/#Color1/#$COLOR_1/g” | sed “s/#Color2/#$COLOR_2/g” | sed “s/#Color3/#$COLOR_3/g” > ~/.themes/DontPanic_gtk/gtk-2.0/gtkrc
gtk-theme-switch2 DontPanic_gtk
[/code]
My GTK theme is not perfect (I’ve not tested it too much and it’s my first gtk theme), but I think the idea is quite interesting. Probably someone could do it much better, but I think nobody did it before, so here’s the idea.