Creating a buttonbar for use in PuppyLinux

A home for all kinds of Puppy related projects
Message
Author
User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#21 Post by HairyWill »

CatDude
I'm glad you like the flyout trays. I didn't realise anybody was actually using it. One thing to note is that it uses jwm 1.8 which requires slightly different configuration tags to 2.01. I did look yesterday at porting the patch to 2.01 but it is going to take a couple more hours than I have free at the moment. I did write a script which parses your .jwmrc and creates a set of trays for all the menus items.

Code: Select all

#!/bin/sh
if [ -e /root/.jwmrc-tray2 ] ; then
echo I will not overwrite existing .jwmrc-tray2 please delete it before rerunning
exit
fi
grep -E '<Menu|<Program' '.jwmrc' | grep -Ev '<MenuStyle|<!--' > /tmp/dotjwmrc-tray
sed -i 's/<Program label=/<TrayButton popup=/' /tmp/dotjwmrc-tray
sed -i 's/>/>exec:/;s/exec:$//' /tmp/dotjwmrc-tray
sed -i 's/<\/Program>/<\/TrayButton>/' /tmp/dotjwmrc-tray

Y=2
:>/tmp/tray-bottom
echo '<Tray  autohide="true"  x="0" y="0" border="1" width="34" layout="vertical">' > /tmp/tray-top
while read LINE ;do
if [ "$(echo $LINE | grep '<Menu')" ];then
echo $LINE | sed 's/<Menu label=/<TrayButton popup=/;s/>/>exec:<\/TrayButton>/' >> /tmp/tray-top
[ $Y -gt 2 ] && echo '</Tray' >> /tmp/tray-bottom
echo '
<Tray autohide="true"  x="0" y="'$Y'" border="1" height="30" layout="horizontal_flyout">
' >> /tmp/tray-bottom
let "Y += 32"
else
echo $LINE >> /tmp/tray-bottom
fi
done < dotjwmrc-tray
echo '</Tray' >> /tmp/tray-bottom
echo '</Tray>' >> /tmp/tray-top
echo '<JWM>' > /root/.jwmrc-tray2
cat /tmp/tray-top >> /root/.jwmrc-tray2
cat /tmp/tray-bottom >> /root/.jwmrc-tray2
echo '</JWM>' >> /root/.jwmrc-tray2
if [ ! "$(grep '<Include>/root/.jwmrc-tray2</Include>' /root/.jwmrc)" ]; then
sed -i 's/<\/JWM>/<Include>\/root\/.jwmrc-tray2<\/Include>\n<\/JWM>/' /root/.jwmrc
fi
jwm -p
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#22 Post by aragon »

Hi Will, hi CatDude,

no, i haven't seen that one, looks great. I'm looking forward to see the jwm 2.01-version to test it with 3.01.

Or did i go wrong and i'm able to use this one with 301?

cheers
aragon

User avatar
nutts4life
Posts: 263
Joined: Fri 15 Feb 2008, 09:52
Location: UK

#23 Post by nutts4life »

HairyWill,

Your strikes of genius all over this forum never cease to amaze me. Great work.

These are all good suggestions, but i'm really looking to create an entire environment on the desktop, rather than use the taskbar. I'm not saying stop using the taskbar, i'm saying bring the menu items onto the desktop in a well formatted Linpus / eeePC like fashion. I guess i'm looking to replace the ROX pinboard with a tabbed interface.

So HairyWill, how would you go about creating an app like the eeePC's UI or Linpus Lite's, that just sits on top of the desktop (leaving the taskbar still there, but without a menu)? Obviously it might need a bit of bling , so i guess it will be more gtk / qt / fltk toolkit stuff?

Thanks,

n4l

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#24 Post by HairyWill »

nutts4life wrote:Your strikes of genius all over this forum never cease to amaze me.
no I'm not going to build one ;-)

I think the choice of toolkit makes no difference to the application, though it would seem silly to require users to install extra libraries. On that basis gtk or raw xlib would be sensible choices. Well written xlib is I believe much less costly in terms of resources.

Richards gtkdialog bars could get very close to what you are looking for. It depends on how import bling is to you. It is easy to remove the window manager decorations for specific apps in your jwm config and you can vary the button size. Instead of one program consider 4 of them each with the same row of main buttons at the top to select the category and exactly the same size. Under this is a set of buttons that applies to the current category. When you hit a particular category button it kills the current window and loads the new one in exactly the same place. You could use one program to generate the different windows dynamically.

I think the design questions are more interesting.
Should the panels/buttons be user editable?
Do you want the panel to die when it loses focus?
Should it be running permanently on a lower z level to all the other windows?
Would it be better for it to be launched from a great big drop down button at the top of the screen.

There are lots of ways of redesigning your environment to make it more efficient for you. It is more difficult to ensure that these methods are intuitive and work for others, especially if all they are used to is windows. linux abounds with all sorts of weird and wonderful window managers which work really well if you know ow to use them

Personally I don't have a big screen. Many of my applications are running full screen so I don't see the desktop very often. That is why I liked the flyout trays because all they needed to start a new app was a fairly linear mouse movement and a single click.

good luck

Aragon
All of the current 3 and 4 series puppies use jwm 2.01. You can replace jwm in them with mine or a conventional jwm 1.8. It will still work but the windows will all have red borders and titlebars and you will not get gradient colours. On the plus side you will be able to resize your windows from the top. There are a few other minor functional differences. I'm not sure if 2.01 squashed any major bugs.
Instead of overwriting the jwm at /usr/X11R7/bin/jwm you could just copy the modified one to /usr/bin where it will get found first. When you have had enough just delete it and the original will get used.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#25 Post by CatDude »

Hi HairyWill
HairyWill wrote:CatDude
I'm glad you like the flyout trays. I didn't realise anybody was actually using it.
Im not the only one who likes it, the missus is also using them.
She loves them.

Also thankyou for the script, ill give that a try later

CatDude
.
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#26 Post by aragon »

hi nuts,

one idea: have you looked at wbar? i used it with fluxbox, i think it's very nice.

if !?! wbar has the ability to start with different config-files (what i don't know), you could use will's idea with wbar (little bling).

wbar 1: the groups
wbar 2: audio
wbar 3: office
wbar 4: ...

if you choose audio wbar 1 closes and wbar 2 opens in the same place. if you start f.e. xmms from audio it closes wbar 2, starts wbar 1 and then starts xmms. in every "group"-wbar you will also need a back button which closes the "group"-wbar and starts wbar 1 again.

cheers
aragon

User avatar
richard.a
Posts: 513
Joined: Tue 15 Aug 2006, 08:00
Location: Adelaide, South Australia

#27 Post by richard.a »

HairyWill wrote:Personally I don't have a big screen. Many of my applications are running full screen so I don't see the desktop very often. That is why I liked the flyout trays because all they needed to start a new app was a fairly linear mouse movement and a single click.
Mate those fly-out trays are also a feature of Gnome and I've used them to great advantage. Been around a long time, Sun's Java Desktop System was the earliest system I saw them on and that's design era was about 2002 from memory, though I think they were part of Gnome before then.

They are really a sort of dynamic version of what this article was originally written about, and will work from horizontal or vertical panels (taskbars). Great for moving everything off the desktop except then you have more than one click needed to launch something which makes it less attractive ergonomically. (I used to customise AutoCAD menus with productivity in mind).

You can also add fly-out trays to fly-out trays - which sounds strange, but this can be useful to group associated products together. :D

Off Topic
Just a thought too. You can free up memory if you need to, by making your desktop bare, particularly of busy wallpaper of many colours. This is an old tip from Windows 3.1 days with (if you were unlucky) only 16 Megs of slow RAM.

Richard
[i]Have you noticed editing is always needed for the inevitable typos that weren't there when you hit the "post" button?[/i]

[img]http://micro-hard.dreamhosters.com/416434.png[/img]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#28 Post by HairyWill »

richard.a wrote:Mate those fly-out trays are also a feature of Gnome and I've used them to great advantage.
I didn't realise that, though I think I got the inspiration from something I saw in enlightenment.
richard.a wrote:Great for moving everything off the desktop except then you have more than one click needed to launch something which makes it less attractive ergonomically.
what I have written is strictly one-click. It works in the same way as other jwm auto hidden trays. There is a one pixel border at the edge of the screen that enables the tray when you mouse over it. The flyout trays have small gaps in between them so that if you slide your mouse along the edge of the screen it also launches a conventional hidden tray. This sits underneath the flyouts and can be used to provide a first level menu to find the other trays. The buttons on the first level menu don't have any action associated with them they just provide a visual clue.
richard.a wrote:You can also add fly-out trays to fly-out trays - which sounds strange, but this can be useful to group associated products together
I think this would be hard to do with jwm

I have upgraded my mods to be compatible wth jwm 2.01 jwm flyout trays. At the moment I am running it with 50 pixel high buttons. These aren't particularly pretty as they use the icons in the jwm menu which are only 16 pixels high but this could be fixed by a pack of icons in $HOME/.icons. Before writing this I did try an icon launcher written by MU but it did require the extra click and was a bit slow, these babies are like $^!t off a shovel. :-)
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
richard.a
Posts: 513
Joined: Tue 15 Aug 2006, 08:00
Location: Adelaide, South Australia

#29 Post by richard.a »

HairyWill wrote:I didn't realise that, though I think I got the inspiration from something I saw in enlightenment.
I notice that Mint (which is a green tinged ubuntu with Gnome and many goodies) has it too; was playing with panels in a Mint I managed to install on one older computer (usually a no-no, ubuntu 5 is about the latest I've got going in most of them). The usual right click to add apps, menus, whatever and the trays are a choice of what you can add in the menu. In Gnome you can simply change icons for the trays by using the properties right-click, so it's all straight forward and integrated.

I rather like trays because you can still do a single click, albeit a long duration one :D by holding the button down and sliding over the functions you don't wish to use and releasing the button over the one you want.

The rest of your post is very interesting; however with older machines, I haven't explored recent JWM and the recent puppy versions that use it because recent puppies won't work on many older boxes.

Wondering if it possible to retro-fit later JWM versions.

And completely off topic, I dislike the XDG menu concept. Nobody ever needs more than one menu system at a time, surely? Let's face it, nobody complains about the plain looking bars and menu in ubuntu... and if you have to have KDE, then you get the K version - Kubuntu.

I've been working on several adaptions of the bars for specific purposes, and I suppose it's what you become familiar with really... but I think it is such a simple way to do things, and so easy to modify on-the-fly if you need to change something.
[i]Have you noticed editing is always needed for the inevitable typos that weren't there when you hit the "post" button?[/i]

[img]http://micro-hard.dreamhosters.com/416434.png[/img]

jonyo

#30 Post by jonyo »

richard.a wrote:That thread is here
Can't access the link?

User avatar
richard.a
Posts: 513
Joined: Tue 15 Aug 2006, 08:00
Location: Adelaide, South Australia

#31 Post by richard.a »

jonyo wrote:
richard.a wrote:That thread is here
Can't access the link?
Must be a portion of their forums that requires a subscription, though I can't think why except for creating an elitist feeling :)

I didn't say anything more of interest though, posted the same graphic and there were a couple of other graphics posted by others, showing similar stuff.


Richard
[i]Have you noticed editing is always needed for the inevitable typos that weren't there when you hit the "post" button?[/i]

[img]http://micro-hard.dreamhosters.com/416434.png[/img]

jonyo

#32 Post by jonyo »

Thx. Is that subscription something you have to pay for?

jayz
Posts: 9
Joined: Tue 03 Jun 2008, 15:28
Contact:

gtk buttonbars

#33 Post by jayz »

Is there a way to refresh gtk button bars? In some cases they stop working once I have click on one button.
Also, is there a way to launch a jwm tray form a jwm tray, or a menu entry?
I have puppy 3.01 and changed richard.a's scripts from 'gtkdialog' to 'gtkdialog3'.
Learn to laugh at your troubles and you'll never run out of things to laugh at. [Walt Kelly]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

Re: gtk buttonbars

#34 Post by HairyWill »

jayz wrote:Also, is there a way to launch a jwm tray form a jwm tray, or a menu entry?
I know a fair bit about jwm configuration and don't think this is possible. I think the trays must be created when jwm starts and can either be visible or hidden. As far as I know the only event that can be used to toggle that status is the mouse moving over the 1 pixel wide exposed strip
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
richard.a
Posts: 513
Joined: Tue 15 Aug 2006, 08:00
Location: Adelaide, South Australia

Re: gtk buttonbars

#35 Post by richard.a »

jonyo wrote:Thx. Is that subscription something you have to pay for?
Sorry to not have seen this before.

No cost to the subscription. I think I may have saved it online somewhere... let me know if you'd like me to post the saved url.

jayz wrote:Is there a way to refresh gtk button bars? In some cases they stop working once I have click on one button.
I've noticed this also. Investigating, I've found what I think causes it, but not how to fix it.

It doesn't seem to happen if you click on a link that doesn't work - like starting a non-existent application. Or one that that is working properly.

It seems to happen when you click on a link that fails because the appllication did not start properly, or is broken in other ways. Most times the solution is to close the application if you can.

Often using the kill facility will still leave the bar gasping for breath, so you will need to kill the bar (using the menu from the left-hand button common to all windows) and reopen it :(

jayz wrote:I have puppy 3.01 and changed richard.a's scripts from 'gtkdialog' to 'gtkdialog3'.
Thanks, that's good to know :)

Richard
[i]Have you noticed editing is always needed for the inevitable typos that weren't there when you hit the "post" button?[/i]

[img]http://micro-hard.dreamhosters.com/416434.png[/img]

jayz
Posts: 9
Joined: Tue 03 Jun 2008, 15:28
Contact:

buttonbars

#36 Post by jayz »

OK. thanks to Richard.a and HairyWill. I like the idea of making buttonbars from things that are already in Puppy.
Learn to laugh at your troubles and you'll never run out of things to laugh at. [Walt Kelly]

jayz
Posts: 9
Joined: Tue 03 Jun 2008, 15:28
Contact:

buttonbars

#37 Post by jayz »

Keep gtk buttonbar active.
End each action command with an ampersand.
Example:
<action>exec beep-media-player &</action>
From gtkdialog2.txt:
Commands usually can be run in the background by
writing a `&' as last character, so the subshell will not wait
the program to complete.

This works on the three examples I have tried so far.
Learn to laugh at your troubles and you'll never run out of things to laugh at. [Walt Kelly]

User avatar
richard.a
Posts: 513
Joined: Tue 15 Aug 2006, 08:00
Location: Adelaide, South Australia

Re: buttonbars

#38 Post by richard.a »

jayz wrote:Keep gtk buttonbar active.
End each action command with an ampersand.
Example:
<action>exec beep-media-player &</action>
From gtkdialog2.txt:
Commands usually can be run in the background by
writing a `&' as last character, so the subshell will not wait
the program to complete.

This works on the three examples I have tried so far.
Thankyou, I completely overlooked that :(


Completely off topic, re your signature
parenthesis sinister laugh parenthesis
I was reminded of the unofficial definition of the LISP language...
Lost In Stupid Parentheses :) :D
[i]Have you noticed editing is always needed for the inevitable typos that weren't there when you hit the "post" button?[/i]

[img]http://micro-hard.dreamhosters.com/416434.png[/img]

nic2109
Posts: 405
Joined: Mon 01 Jan 2007, 20:24
Location: Hayslope, near Middlemarch, Midlands, England

Re: buttonbars

#39 Post by nic2109 »

richard.a wrote: Completely off topic, re your signature
parenthesis sinister laugh parenthesis
I was reminded of the unofficial definition of the LISP language...
Lost In Stupid Parentheses :) :D
..... and I was reminded of the equally unofficial definition of PERL : Pathologocally Eclectic Rubbish Lister.
[color=darkblue][b][size=150]Nick[/size][/b][/color]

yangmusa
Posts: 21
Joined: Fri 10 Aug 2007, 20:36

#40 Post by yangmusa »

Dougal wrote:Note that JWM allows multiple "trays" (panels), so you can just add at the bottom of jwmrc an include for jwmrc-tray2, then create it with only buttons -- it can be positioned anywhere along the edges of the screen, vertical or horizontal.
I tried this last night, but with no luck. This is what I did:
  • 1) added include for jwmrc-tray2 in jwmrc
    2) created jwmrc-tray2 based on jwmrc-tray. Added buttons with the same syntax as used in jwmrc-tray.
    3) restart jwm.
    4) I don't see my extra tray...
However, there are some uncertainties here. I'd like to have tray 2 at the top center of the screen, with autohide on. Using halign=center and valign=top seems fairly obvious, but then there's the x and y coordinates? I've looked at JWM's homepage, but it doesn't go into detail. Does anyone know what I need to add?

thanks, Magnus

UPDATE: I meant to add - searching for all the "obvious" terms didn't bring up anything useful in the forum or the wiki. However, I was browsing the now huge JWM theme repository, and just happened to come across something that looks like it's what I need:
  • Tray autohide="true" insert="right" x="0" y="-1" valign="top" halign="center" height="48"
So, unless anyone knows differently, I'll try that! It looks like I don't need to change the x,y coordinates between the top & bottom trays.

Post Reply