Change theme in xboard

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

Change theme in xboard

Postby rigao » 16 Nov 2010, 20:08

Hello everyone.

I've been playing with what I thought would be the new xboard (I downloaded the .deb HGM provided and forced its installation as it is a 32 bit package). On the "About Xboard" however it says it is version 20100112, which I think is a version from january this year.

But, it has this new option -saveSettingsFile, so who knows, maybe I don't understand the way HGM names its versions... :-)

Anyway, as I was playing with the -settingFile option (so I have one file for FICS and another one for stockfish, which are completely different stories) I decided it was about time for me to change the default theme.

I tried everything, I googled it and I did my best, but with no success.

Here are the changes I reckon must be made, but without result (the board is still at its default, nothing wrong with it, but I want to change it if I can):

Code: Select all
-liteBackTextureFile "/home/usuari/Imatges/Textures/bp_wood_lite.bmp"
-darkBackTextureFile "/home/usuari/Imatges/Textures/bp_wood_dark.bmp"
-liteBackTextureMode 2
-darkBackTextureMode 2
-renderPiecesWithFont ""


Of course this images exist in that path, so, what's the deal?

Is xboard capable of changing the theme? What am I doing wrong?

Thank you very much.
rigao
 
Posts: 63
Joined: 14 Dec 2008, 17:33

Re: Change theme in xboard

Postby K Inuen » 17 Nov 2010, 02:16

rigao,

Just place the .bmp files in the same folder with the Winboard.exe and Winboard.ini. The path is relative:

/liteBackTextureFile="bp_wood_lite.bmp"
/darkBackTextureFile="bp_wood_dark.bmp"
K Inuen
 
Posts: 50
Joined: 27 Apr 2010, 02:25

Re: Change theme in xboard

Postby H.G.Muller » 17 Nov 2010, 09:22

The board textures used to be a WinBoard-only option, and I only ported them to XBoard very recently. And indeed the Debian package has not been updated for a long time. If you can install from source, you could download the latest snapshot from GNU Savannah and compile it yourself (then you would also have a 64-bit version). We just discovered yesterday that the latest version has a problem loading PGN files, though, (it can crash while doing it), but I still have to figure out when this first was introduced, and how to fix it. It makes little sense to make a new Debian package for a version we know to be defective...
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Change theme in xboard

Postby H.G.Muller » 17 Nov 2010, 14:22

OK, the problem seems fixed, and I prepared a new i386 debian package now, (sort of, at least it contains the latest xboard binary and man file, the latter being not completely up to date anyway), at the XBoard link on my main XBoard web page ( http://hgm.nubati.net ). It is xboard_4.devel~hgm-9_i386.

Note that for XBoard the texture files have to be .xpm files, but that the Linux utility 'convert' has no problems convertimg .bmp to .xmp.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Change theme in xboard

Postby rigao » 17 Nov 2010, 18:16

Thank you everybody for the answers.

However, I'm unable to make this work.

I've downloaded the sources from http://hgm.nubati.net/cgi-bin/gitweb.cg ... git;a=tree, clicking on 'snapshot' and compiled it.

In 'about xboard' now it says it is a version from August (20100806) which doesn't seem to be the latest...

I converted the .bmp files to .xpm (note I used .xpm because .xmp as HGM suggests doesn't seem to work with the 'convert' program), and used the same exact options than in my first post except for the file extension, which is changed to .xpm. It does not work. The board is still in the default theme.

As I think I downloaded old code, I tried the .deb package, but when I try xboard on the terminal, this is what it tells me:

Code: Select all
xboard: error while loading shared libraries: libreadline.so.5: cannot open shared object file: No such file or directory


which seems some reference is wrong in that package (old one worked well).

So, some questions remain:

1) Is the 20100806 the last version and just the name is wrong? If not, where is the exact link to download the last source?

2) Is xpm the right extension for the squares? If it is .xmp, how can I convert from a bmp? I tried
Code: Select all
convert file.bmp file.xmp
with no success.

3) Are the options I showed enough, in theory at least, to change the default squares of the board? Here are the options again:

Code: Select all
-liteBackTextureFile "/home/usuari/Imatges/Textures/bp_wood_lite.xpm"
-darkBackTextureFile "/home/usuari/Imatges/Textures/bp_wood_dark.xpm"
-liteBackTextureMode 2
-darkBackTextureMode 2


Thank you.
rigao
 
Posts: 63
Joined: 14 Dec 2008, 17:33

Re: Change theme in xboard

Postby H.G.Muller » 19 Nov 2010, 10:04

This could still be the latest version. The version number does not automatically adapt when I commit a patch to the repository. It only changes when I change it by hand, and I don't do that unless we are preparing for an official release point. If you got it from the hgm6 branch (selectable from the list of branches at the bottom of the git page, last patch "fix safety crash...") it should be OK.

You are right about the .xpm extension.

The new debian package works for me; the error suggests that you are missing a library. This is for the GNU ReadLine support. Not sure what the package name is, but if you manage to install the mentioned .so file, the error should go away. I am not sure we will keep the ReadLine support in. It seems to cause a lot of problems (see also in the other thread), and was only added to solve a problem that IMO was already solved in a better way through the ICS Input Box.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Change theme in xboard

Postby rigao » 22 Nov 2010, 11:15

Ok, so I've spotted the problem. I was using an old version of xboard, and that was why I could not change the theme.

For completeness, I'll post what I've done to be able to have a theme:

1.- Download the lastest source (in the future I guess it will be enough to have the xboard 4.5 sources) from the hgm6 in the git repository:

http://hgm.nubati.net/cgi-bin/gitweb.cg ... heads/hgm6 (click in the first 'snapshot')

2.- Compile it as usual: decompress it and browse in a command line interface to that directory. Execute the following commands:

Code: Select all
sudo apt-get install g++ autoconf xorg-dev flex texinfo
./autogen.sh
./configure
sudo make install


The first command will download the necessary packages to compile xboard, at least in ubuntu 10.10. Maybe other distros will need other commands.

3.- Now we have a working xboard, but we need the new theme. You can do it yourself or you can download it. It needs to be in .xpm format thought, so if you download it in .bmp you will need to change it. This is what I've done:

3.1. Download the theme you like. In particular I've gone to this page http://www.ascotti.org/programming/chess/winboard_x.htm which has some nice themes. I've downloaded the wood theme which I like the most.

3.2. Change the file format, from .bmp to .xpm: In order to do so you will need a program called 'convert'. Open a CLI and type

Code: Select all
convert --help


to see if you have it installed. I already had it, but if not, normally it will inform you that this program is not installed but it comes in the package 'whatever', so you install this package. Then in a CLI browse to the directory you store the theme (I store it in ~/Images/Themes) and use this command

Code: Select all
convert file.bmp file.xpm


where file is the name of an image to convert. You must to it for all the images that comes with the theme (in my case, there where two of them).

4.- Now you have a working xboard installation and a theme. Now you only need to start xboard with the new theme:

Code: Select all
xboard -liteBackTextureFile "/home/usuari/Imatges/Textures/bp_wood_lite.xpm" -darkBackTextureFile "/home/usuari/Imatges/Textures/bp_wood_dark.xpm"


Beware that you need to change this command to point the actual images you want to use in your theme.

With the new persistent options feature, you will probably set this theme as default, but if you do not have the option 'save settings on exit' enabled, you will need to use the option 'save settings now' in order to make this your default theme. Next time you can simply use the command:

Code: Select all
xboard


NOTE: In the past, I had problems starting xboard because it will try to load Fairy-Max engine by default if you do not specify anything. When trying to change the theme, I did not encounter this problem. There are two possible explanations: maybe now Fairy-Max is packaged with xboard, so you do not need to do anything for xboard to work out of the box, or, most probably, I've previously installed fairy-max. If when running xboard with the simple command :

Code: Select all
xboard


it says that it could not find fairy-Max, just install it with

Code: Select all
sudo apt-get install fairymax


and your xboard will work alright, at least to try to setup a theme. There are other places where it is explained how to initiate xboard with other engines, so I won't repeat it here.
rigao
 
Posts: 63
Joined: 14 Dec 2008, 17:33

Re: Change theme in xboard

Postby H.G.Muller » 22 Nov 2010, 19:05

OK, great it works now. Note that Arun decided to revert the GNU ReadLine patch, so that the misery to compile it on Mac should now also be in the past.

Also note that the source tree does come with two sample themes in the pixmaps folder, namely wood_l.xmp / wood_d.xpm and marble_l.xpm / marble_d.xpm. (Plus two complete Xiangqi boards.)

This is the wood theme (my favorite, which I consider configuring as default in the binary distribution):

Image
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Change theme in xboard

Postby rigao » 22 Nov 2010, 20:25

This are great news. I looked to the pixmaps folder in order to see if I could use some themes, but missed both ... I don't know, maybe it would be better to have a separate folder for pieces and for squares, making it easy to find them... Anyway once you know they are there, you won't miss them. Maybe just saying where they are in the manual would be enough.

Anyway, I thought the installation process would save the pixmaps somewhere else, but it does not (at least in my Ubuntu 10.10), so the process to use the pixmaps would be very easy, allowing us to skip step 3. Supposing you saved the sources in ~/xboard/

Wood:
Code: Select all
xboard -liteBackTextureFile "~/xboard/pixmaps/wood_l.xpm" -darkBackTextureFile "~/xboard/pixmaps/wood_d.xpm"


Marble:
Code: Select all
xboard -liteBackTextureFile "~/xboard/pixmaps/marble_l.xpm" -darkBackTextureFile "~/xboard/pixmaps/marble_d.xpm"


By the way, I completely support the new default theme. It is gorgeous.

Oh, I know this is not the place to ask, but I don't want to make a new thread: Is it planned to keep track of the last commands when in ICS mode and access it with the up and down arrows? This is my only issue when using xboard on FICS, the need to type all the time 'seek 3 0 1800-5555' anytime I want to play. One would think that as you are in a terminal, it would work, but it doesn't, and it is a bit annoying.
rigao
 
Posts: 63
Joined: 14 Dec 2008, 17:33

Re: Change theme in xboard

Postby H.G.Muller » 22 Nov 2010, 22:07

Indeed, the textures are very new, and I have not incorporated them into the installation pocess yet. If we are going tomakeit the default theme, we obviously should. So far policy has always been to not include or even bother with external pixmaps for the pieces, and leave that to the users. As a consequence the source tree did never contain any other pixmaps than the built-ins. To facilitate beta testing I temporarily parked some texture pixmaps I ad used myself for testing in the pixmaps directory, so others that download from git would have it too. We had not even decided if they would have to be packed in a distribution tar ball. (Similar for the Shogi pixmaps,and perhaps I am still going to prepare a set of Xiangqi pixmaps. The Xiangqi board is already in the pixmaps directory too. But we might decide to distribute all that separately from the normal sources, perhaps make special web pages at GNU for pieces and textures.)

On your other question: There is an option -icsinput / -internetChessServerInputBox, which provides a place to type input for the ICS without being disturbed by output, where you can do local line editing, and also recall the history with the arrows. I think you can evenswitch in on from the menu. (This feature was already in 4.2.7; I just added the arrows.) I actually have a side branch in my git (quite obsolete by now) with a patch that wouldalso create an output widget in that same window, where the ICS output would appear, as a first step towards getting rid of the X-term console, and create something similar to the WinBoard ICS Interaction Window. (I could then also implement the ICS context menu there.) My attempts stranded, however, because I could not find a way to colorize the text on a line by line basis in a text widget. It seems the Athena widget set only allows you tochange foregound and background colors for the entire widget. :(
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Change theme in xboard

Postby Josh Pettus » 23 Nov 2010, 01:20

It works on my mac! Thank you so much!
Does render with font work in xboard yet or is that command just a place holder?
Josh Pettus
 
Posts: 317
Joined: 11 Mar 2009, 01:11

Re: Change theme in xboard

Postby H.G.Muller » 23 Nov 2010, 09:59

This is still a place holder. I am not sure I will ever port that to XBoard, as XBoard does already have its own way for people to configure their own piece symbols, through bitmaps or pixmaps.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Change theme in xboard

Postby Josh Pettus » 24 Nov 2010, 03:55

I tried making a pixmap set of the xiangqi set but ran into a bit of a snag
How do you make it so that the background of the piece is invisible? I tried using an alphachannel but it just shows up as black in xboard.
Josh Pettus
 
Posts: 317
Joined: 11 Mar 2009, 01:11

Re: Change theme in xboard

Postby H.G.Muller » 24 Nov 2010, 09:11

You have to supply pixmaps for an empty light and dark square too. The way XBoard creates the clip masks for the pieces (which it already used for animating dragging and moving, I just apply these existing masks even to the static pieces now) by comparing the empty-square pixmap with the pixmap for the piece, and assuming that every pixel that is equal between the two is background.

What I actually did was make sure the background in the supplied pixmaps for the pieces is equal to the default colors of the empty squares, so that I don't have to supply an external pixmap for the empty squares, but it can use its internal ones. Just look into one of the built-in pixmaps to see what square colors are used, and copy that.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Change theme in xboard

Postby Josh Pettus » 24 Nov 2010, 16:13

Thanks for the tips! I got it working. I used the default colors that were in the xboard.conf file. Thing was, I did use the colors that were in the default pixmap folder but they were an odd shade of florescent green and gray, for dark and light squares respectively, and didn't match the default green and tan setting.

I should also point out that I tried compiling xboard from your HGM6 repository and the same old error popped up, I take it your not in sinc with the savanah git?
Josh Pettus
 
Posts: 317
Joined: 11 Mar 2009, 01:11

Re: Change theme in xboard

Postby H.G.Muller » 24 Nov 2010, 17:25

You mean the GNU Readline stuff? Indeed, this was reverted in the GNU repository by Arun, which made me out of sync. I cannot resync easily, because I was already out of sync before that (although identical in content). I would have to make a new branch for that. I could of course try to do the revert myself in hgm6.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL


Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 3 guests