Re: [As-users] Theme generating and such

Sasha Vasko (sasha@aftercode.net)
Mon, 24 Oct 2005 15:30:38 -0500




Shadow God wrote:
>  figured I'd throw this here.. 
> 
> Trying to work on making a theme tarball for my XP look.
> 
> And infact, maybe my additions b0rked something.. Cause I noticed there were
> no Install* functions for installing desktop/bars or desktop/buttons. So I
> tried adding them (though they don't seem to work.. Yet).

Don't just do a tarball - supply an installation script with it.
Such script should have a filename of "install_script"
First line in it should have the following comment :

#AfterStep theme

Inside this script there should be 2 AfterStep functions defined :

Function "InstallTheme"
	InstallLook ...
	InstallFeel ...
	InstallIcon ...
	InstallIcon ...
	InstallIcon ...
	InstallIcon ...
EndFunction

#and : 	

Function "ApplyTheme"
	ChangeLook ...
	ChangeFeel ...
	Module ...
	Module ...
	Exec ...
EndFunction


If you do not have such an install script - AfterStep will try to build 
one for you using some primitive logic based on the way old theme 
tarballs were built. I would not recommend this for any new theme - this 
is for compatibility with the old stuff only !!!!


> In my tarball (not gz or anything)
> 
> I have a file called install_script
> With:
> 
> #AfterStep theme
> 
> Function "ApplyTheme"
>         InstallIcon     "name"  sgxp-wharfbg
>         InstallIcon     "name"  sgxp-wharfbg-sel
> EndFunction
> 
> Just for testing the installicon function. Those two files are in the
> tarball with the script, not in any subdir or anything.
> 
> In the console I get:
> can't open sgxp-wharfbg !
> can't open sgxp-wharfbg-sel !
> 
> Now.. I go into ~/.afterstep/desktop/icons and the files are listed there,
> with 0 bytes. Like it did a touch of those files.
> 
> Also, for the code side of things.. 
> 
> In src/afterstep/theme.c line 243 (or there bouts) is:
> 
> 					int len = strlen( name );
> 					added_new = False ;
> 					if( len > 4 )
> 						if( mystrncasecmp(
> &(name[len-4]), ".xpm", 4 ) == 0 )
<snip>
> Now, this means it will only install files with a filename longer than 4
> characters (lack of brackets also confuses me a bit)? Though the .xpm check
> there is also throwing me off.. Is it seeing if its not or is .xpm before
> doing the install_func stuff?

All of it is becouse old tarballs had .xpm in them. Like I said logic is 
primitive and for compatibility purposes only. If you are building a new 
theme - please be a good boy and supply an install_script yourself.

If anyone could implement theme builder GUI using GTK  - I would 
greately appreciate this. Note that groundwork for such a GUI is laid 
out using libASGTK - see src/tools/ASWallpaper and in the near future -
src/tools/ASFileBrowser.


> 
> Btw.. I'm trying to work out a little howto for creating theme
> tarballs/files. Its at
> http://hacksess.com/~shadowgod/AS/theme-howto.txt

That'd be nice. Also maybe somebody wants to implement such a theme 
builder in PHP or something? to be put directly on www.afterstep.org ?

> 
> Taken from what sasha told us some days ago on irc.
> 
> -sG-

Thanks
Sasha
_______________________________________________
As-users mailing list
As-users@afterstep.org
http://mail.afterstep.org/mailman/listinfo/as-users