#!/bin/ksh ## ## gets the colors for the Buffalo task bar button from ## the ICE theme ## # Programmer: H.C. King 1 May 2004 # remove any theme buttons for fle in `ls /usr/local/share/icewm/themes/*/taskbar/linux.xpm 2>/dev/null` do sudo mv $fle ${fle%linux.xpm}oldlinux.xpm done # remove any theme fonts for fle in `ls /usr/local/share/icewm/themes/*/default.theme 2>/dev/null` do grep -v Font $fle >/tmp/tmp_dflt.$$ sudo mv /tmp/tmp_dflt.$$ $fle done set - '' shift set - `grep heme ~/.icewm/theme | cut -d= -f2 | tr '"/' ' '` theme=$1 bgclr=#FFFFFF fgclr=#000000 set - '' shift set - `grep ColorActiveTaskBarApp /usr/local/share/icewm/themes/$theme/default.theme | head -1 | cut -d= -f2 | sed s/rgb// | tr '/":' ' '` if [ $# -eq 0 ] then set - '' shift set - `grep ColorDefaultTaskBar /usr/local/share/icewm/themes/$theme/default.theme | head -1 | cut -d= -f2 | sed s/rgb// | tr '/":' ' '` fi if [ $# -eq 3 ] then bgclr=#$1$2$3 else if [ $# -eq 1 ] then bgclr=$1 fi fi set - '' shift set - `grep ColorActiveTaskBarAppText /usr/local/share/icewm/themes/$theme/default.theme | head -1 | cut -d= -f2 | sed s/rgb// | tr '/":' ' '` if [ $# -eq 0 ] then set - '' shift set - `grep ColorActiveTaskBarApp /usr/local/share/icewm/themes/$theme/default.theme | head -1 | cut -d= -f2 |sed s/rgb// | tr '/":' ' '` fi if [ $# -eq 3 ] then fgclr=#$1$2$3 else if [ $# -eq 1 ] then fgclr=$1 fi fi cat <<-START >$HOME/.icewm/buffalo.xpm /* XPM */ static char * buffalo_xpm[] = { "48 20 3 1", " c None", ". c $bgclr", "+ c $fgclr", "................................................", "................................................", "................................................", "................................................", "................................................", "......................+++..+++.......+++........", "..+++++++;...........++...++.,........++........", "...++...++...........++...++..........++........", "...++...++.+++.+++..++++.++++.+++++...++..+++++.", "...++++++...++..++...++...++.....+++..++.+++.+++", "...++...++..++..++...++...++...+++++..++.++...++", "...++..+++..++..++...++...++..++..++..++.++...++", "...++...++..++..++...++...++..++..++..++.+++.+++", "..++++++.....++++++.++++.++++..+++++.++++.+++++.", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................"}; START ln -sf $HOME/.icewm/buffalo.xpm /usr/local/share/icewm/taskbar/icewm.xpm