JWM title bar window buttons bitmask? [SOLVED]

Themes, icons, wallpapers, etc.
Post Reply
Message
Author
User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

JWM title bar window buttons bitmask? [SOLVED]

#1 Post by Argolance »

Hello,
In earlier version of jwm, it was possible to replace default JWM window title bar buttons pictures with xbm pictures (such as ".jwm-bClose.xbm", etc.) copied inside home directory. This seems not to work with latest version of jwm.

Does somebody know how to do this nevertheless?

Cordialement.
Last edited by Argolance on Sun 12 Aug 2012, 10:17, edited 1 time in total.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#2 Post by technosaurus »

You can always change the hard coded ones... Otherwise can you point to a version that works as such?
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
`f00
Posts: 807
Joined: Thu 06 Nov 2008, 19:13
Location: the Western Reserve

#3 Post by `f00 »

reply here in eyecandy §..

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#4 Post by Argolance »

Hello,
Cannot answer to your post because thread is locked! So I do it here...
Yes, it was back when Patriot was doing betas of jwm for translucency effects
I noticed that (with latest JWM versions) it is no need anymore to configure the Xorg file for tranlucency effects: they work out of the box.
Option "Composite" "Enable"
and
Section "Extensions"
Option "Composite" "Enable"
EndSection
This should cover some of the versions to use masks for titlebar buttons
This thread learned me how to use the xbm pictures to replace standard window buttons.
I never got the fancy effects like icewm, pekwm and 'box looks can give (prelight, animation, 3D borders and so on)
Yes, it is true but, (I don't know why?), I like JWM and Rox, which are as both lungs of original Puppy...
Though it should be a great thing Joe to enhanced his wonderful WM, especially these window buttons...

Cordialement.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#5 Post by technosaurus »

use the source Luke

I use grep -i (case insensitive) to find likely candidates

grep -i 0x * --> border.c

leads to bmpfiles also in border.c, which pointed setbuttonmask to parse.c which leads to TOK_BUTTON... in lex.c and from there you can see that the tags are:
  • "ButtonClose",
    "ButtonMax",
    "ButtonMaxActive",
    "ButtonMin",
but I think if you do one, you may have to do them all (looking at the code it looked like it did either/or) so something like

Code: Select all

<ButtonClose>/usr/share/pixmaps/close.xbm</ButtonClose>
<ButtonMax>/usr/share/pixmaps/max.xbm</ButtonMax>
<ButtonMaxActive>/usr/share/pixmaps/maxact.xbm</ButtonMaxActive>
<ButtonMin>/usr/share/pixmaps/min.xbm</ButtonMin>
I assume they can just be in the pixmap path, but don't have the properly sized xbm files around to test, but I did one of them for reference:

Code: Select all

#define close_width 16
#define close_height 16
static unsigned char close_bits[] = {
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x30, 0x06, 0x70, 0x07,
0xE0, 0x03, 0xC0, 0x01,
0xE0, 0x03, 0x70, 0x07,
0x30, 0x06, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 };
save as close.xbm and open in mtpaint
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#6 Post by technosaurus »

rather than editing my last post I'll just condense it:

the jwmrc (or its template or one of its include files) should have any/all of these tags containing the full path to 16x16 xbm image(s)

Code: Select all

   <ButtonClose>/usr/share/pixmaps/close.xbm</ButtonClose>
   <ButtonMax>/usr/share/pixmaps/max.xbm</ButtonMax>
   <ButtonMaxActive>/usr/share/pixmaps/maxact.xbm</ButtonMaxActive>
   <ButtonMin>/usr/share/pixmaps/min.xbm</ButtonMin>
anyone want to do ttuuxxx's paw prints from his icewm theme?
Attachments
example.png
a quick example with bitmaps at max 16x16 size
(613 Bytes) Downloaded 2673 times
xbm.tar.gz
you can edit these in mtpaint
(449 Bytes) Downloaded 990 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#7 Post by technosaurus »

another example based on paws and bones
Attachments
xbm.tar.gz
(463 Bytes) Downloaded 988 times
example.png
(902 Bytes) Downloaded 2511 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#8 Post by technosaurus »

and mac-ish circles
Attachments
example.png
(826 Bytes) Downloaded 2508 times
xbm.tar.gz
(451 Bytes) Downloaded 1028 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#9 Post by Argolance »

Hello technosaurus,
Waou! :D !
Thank you a lot: this is quite perfect. I thought this would be more complicated! Possible pictures are obviously a bit poor but it is better than nothing...

Cordialement.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#10 Post by technosaurus »

I am 90% sure the xbm format is a holdover from early versions. It is feasible to patch it for xpm/png/jpg, but it would also make themeing more complex and add a small amount of overhead... Probably not worth it since icewm basically does that already.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
`f00
Posts: 807
Joined: Thu 06 Nov 2008, 19:13
Location: the Western Reserve

#11 Post by `f00 »

How hard would it be code-wise to make the three 'standard' buttons multifunction (according to which mousebutton is clicked)? This is a real convenience for mouse users and one of the reasons I regularly switch out of jwm - the scrollwheel on my old mouse died quite some time ago so shading is a bit awkward in jwm, plus I use vertical/horizontal maximize much more often than full. The close button is fine as-is since if the window needs killing, chances are the button on it won't work anyway.

I'm thinking something along the lines of

Code: Select all

minimize-button        maximize-button                    close-button
m1=minimize/m2=shade   m1=full/m2=vertical/m3=horizontal  m(any)=close
nice job on the variations (new looks keep things from getting stale)

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#12 Post by technosaurus »

some 3d-ish buttons
Attachments
xbm.tar.gz
(406 Bytes) Downloaded 1023 times
example.png
(785 Bytes) Downloaded 2553 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#13 Post by Argolance »

Hello,
nice job on the variations (new looks keep things from getting stale)
:)
As well as I think it is a pity to drink some good wine in a plastic timbale mold (even if a glass is a bit... heavier...)!

Cordialement.
Attachments
084856_414x476_easyshot.jpg
Window title bar buttons switcher (next Toutou LINUX)
(29.5 KiB) Downloaded 2549 times

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#14 Post by 01micko »

I have been following this thread as I made a patch requested by Mavrothal for the OLPC to enlarge the deco in JWM.

I have followed your lead Argolance and made a "switcher". It is called from the jwm settings gui in the Desktop menu. It is possible (easy really) to add more themes, or delete the stock ones.

Be aware that the xdg template I attach is for Slacko (don't know the consequences in other pups, be warned) and so optional. You probably should add the code that technosaurus posted to your jwmrc-personal file;

Code: Select all

  <ButtonClose>/usr/share/pixmaps/close.xbm</ButtonClose>
   <ButtonMax>/usr/share/pixmaps/max.xbm</ButtonMax>
   <ButtonMaxActive>/usr/share/pixmaps/maxact.xbm</ButtonMaxActive>
   <ButtonMin>/usr/share/pixmaps/min.xbm</ButtonMin>	
Attachments
jwm_window_decor-switcher-0.1.pet
(5.36 KiB) Downloaded 1003 times
jwm_xdg_template-0.1-hack.pet
BE CAREFUL with this one .. backup your original /etc/xdg/templates/_root_.jwmrc file if you use it
(2.16 KiB) Downloaded 1001 times
jwm-stuff.png
(149.48 KiB) Downloaded 2538 times
Puppy Linux Blog - contact me for access

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#15 Post by Argolance »

Hello,
It is a pity that JWM doesn't yet support anti aliasing: pictures are somewhat rough and I think, as JWM "lover", that it is no need sophisticated pictures to be displayed as window buttons: just smoothed simple pictures... This would be great and should be taken into account for the next releases!

Cordialement.

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#16 Post by mavrothal »

01micko wrote: Be aware that the xdg template I attach is for Slacko (don't know the consequences in other pups, be warned) and so optional.
Only took 2 months to stumbled upon this one... :oops:

What about dropping jwm_xdg_template-0.1-hack.pet for a jwm_window_decor-switcher-0.1.pet pinstall like this:

Code: Select all

if [ -f /etc/xdg/templates/_root_.jwmrc ] ; then
	sed -i "s/<\/JWM>//" /etc/xdg/templates/_root_.jwmrc
	cat << EOF >> /etc/xdg/templates/_root_.jwmrc

	<!-- window buttons -->
	<ButtonClose>/usr/share/pixmaps/close.xbm</ButtonClose>
	<ButtonMax>/usr/share/pixmaps/max.xbm</ButtonMax>
	<ButtonMaxActive>/usr/share/pixmaps/maxact.xbm</ButtonMaxActive>
	<ButtonMin>/usr/share/pixmaps/min.xbm</ButtonMin>

</JWM>
EOF
fi
Should work in any JWM puppy. No?

Later Yeap. It does. Here is Micko's pet with this change. Tested in a couple of puppies OK
Attachments
jwm_window_decor-switcher-0.2.pet
Micko's jwm_window_decor-switcher-0.1.pet (from previous page) modified for every JWM puppy
(5.57 KiB) Downloaded 752 times
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

scsijon
Posts: 1596
Joined: Thu 24 May 2007, 03:59
Location: the australian mallee
Contact:

#17 Post by scsijon »

As a reply from joe I thought it might be appropriate to copy.
It's possible (and was done in the past). I removed this feature so that JWM would draw the buttons scaled to the right size (JWM now uses Xlib drawing primitives rather than bitmaps).
I probably won't implement this (at least not in the near future) though since I would like to keep JWM as lean as possible.
regards
scsijon

ps JWM has it's own thread under Desktops.

Post Reply