Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 23 Oct 2014, 02:49
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to Add a Launchbar To the Top of Your Screen, Puppy 4.3
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [29 Posts]   Goto page: 1, 2 Next
Author Message
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Mon 21 Sep 2009, 07:46    Post subject:  How to Add a Launchbar To the Top of Your Screen, Puppy 4.3  



Puppy 4.1 and the brilliant new 4.3 provide a wonderful base upon which to build a distro customised exactly the way you want. This section deals with adding a launchbar to the top of your screen, WITHOUT resorting to adding more megabytes of new program.
A top launchbar is actually a JWM feature, all you have to do is set it up. It consists of nothing more than a text file called whatever you like, in your /root/ directory. Conventionally it is called
.jwmrc-tray-top
Once you have created the text file, you tell jwm where to find it by adding this code to /root/.jwmrc AND /etc/xdg/templates/_root_.jwmrc

Code:
<Include>/root/.jwmrc-tray-top</Include>


Just find the section which has
<Include/root/.jwmrc-tray</Include>

and add your tray beneath it so that it looks like this

Code:
<Include>/root/.jwmrc-tray</Include>
    <Include>/root/.jwmrc-tray-top</Include>


The format for the tray text file is as below (this is my top tray)

Code:
<JWM>
  <Tray autohide="true" insert="right" valign="top" halign="center" height="36" >
  <TrayButton popup="Account" icon="/usr/share/midi-icons/openofficeorg36-base.png">exec:sbase /mnt/sda3/my-documents/data/accounts.odb</TrayButton>
  <TrayButton popup="Files, Root" icon="/usr/share/midi-icons/home24.png">exec:rox</TrayButton>
  <TrayButton popup="My-Documents" icon="/usr/share/midi-icons/folder24.png">exec:rox /mnt/sda3/my-documents</TrayButton>
  <TrayButton popup="Email" icon="/usr/share/midi-icons/email24.png">exec:firefox</TrayButton>
  <TrayButton popup="Browser" icon="/usr/share/midi-icons/www24.png">exec:firefox</TrayButton>
 <!-- <TrayButton popup="Grsync" icon="/usr/local/lib/X11/pixmaps/grsync36.png">exec:grsync</TrayButton> -->
  <TrayButton popup="TKSpider" icon="/usr/share/mini-icons/mini-trebol.xpm">exec:tkspider</TrayButton>
  <TrayButton popup="Rxvt - terminal emulator" icon="/usr/share/midi-icons/console24.png">exec:rxvt</TrayButton>
  <TrayButton popup="Geany - text editor" icon="/usr/share/midi-icons/edit24.png">exec:geany</TrayButton>
  <TrayButton popup="Pfind - file finder" icon="/usr/local/lib/X11/mini-icons/mini-search.xpm">exec:pfind</TrayButton>
  <TrayButton popup="Pwireless - wireless scanner" icon="/usr/share/midi-icons/network24.png">exec:Pwireless</TrayButton>
  <TrayButton popup="Galculator - 3 way calculator" icon="/usr/share/pixmaps/galculator_48x48.png">exec:galculator</TrayButton>
  <TrayButton popup="CUPS Printer Wizard" icon="/usr/share/midi-icons/printer24.png">exec:cups_shell</TrayButton>
 </Tray>
</JWM>


You should be able to use this as a template to set it up just the way you want, which is what JWM is all about.
The top part of the code tells JWM where to put the tray. The line in the middle that starts <!-- and ends --> is the way you tell JWM to ignore an entry, and is more flexible than deleting the entry, in case you change your mind.

It looks like a lot of work, but this is how to get a system working JUST the way you want, and it is easier working with a template Smile
Once you have set it up, re-start JWM to activate it, and customise the heck out of it!
Dont forget to add your 'include' command to the JWM master template at /etc/xdg/templates/_root_.jwmrc
Good luck.
Questions? Just ask................

_________________
Spup Frugal HD and USB
Root forever!

Last edited by DaveS on Mon 14 Jun 2010, 02:48; edited 2 times in total
Back to top
View user's profile Send private message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Mon 21 Sep 2009, 07:49    Post subject:  

The Text File Format

Creating the text file .jwmrc-tray-top is no big problem, just use your favourite text editor, Geany is good.

It really consists of three sections, the overall 'envelope', the command that sets the screen position etc of the bar, and the commands the bar contains.

The envelope is just a command at the very top that says
Code:
<JWM>
and at the very bottom a matching ending,
Code:
</JWM>


The command that defines the bar is also a kind of envelope, it starts
Code:
<Tray
, and ends
Code:
</Tray>


The stuff in between are the commands you want. Here is a simple example:
Code:
<JWM>
  <Tray autohide="true" insert="right" valign="top" halign="center" height="36" >
  <TrayButton popup="Browser" icon="/usr/share/midi-icons/www24.png">exec:firefox</TrayButton>
 </Tray>
</JWM>


This bar would sit at the top of the screen in the centre and would auto-hide. It would have a depth of 36. It would contain just one command, the command to launch Firefox (if you have it on your system of course).
The command line begins <TrayButton. Next is the word popup. Popup defines the text that will pop up if the mouse is hovered over the button, and the syntax is popup="Browser" where Browser is the word you want to appear. Next, comes the icon required and its path. This has fully defined the button itself, so it gets this > at the end of the definition, thus:

<TrayButton popup="Browser" icon="/usr/share/midi-icons/www24.png">

Next, we give the command to execute like this
Code:
exec:firefox
, so now we have

<TrayButton popup="Browser" icon="/usr/share/midi-icons/www24.png">exec:firefox

Then we finish the command line with this
Code:
</TrayButton>


to give us this:

<TrayButton popup="Browser" icon="/usr/share/midi-icons/www24.png">exec:firefox</TrayButton>


You can go on adding commands until you have the bar set up just the way you want.

_________________
Spup Frugal HD and USB
Root forever!

Last edited by DaveS on Mon 21 Sep 2009, 08:28; edited 2 times in total
Back to top
View user's profile Send private message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Mon 21 Sep 2009, 07:49    Post subject:  

More Complex Launchers

Its worth bearing in mind that you can use these buttons to execute more complex commands. Suppose you use a particular file regularly, maybe a database or home banking file. Maybe you would go to the menu, launch Gnumeric, and then open your file. Well, you could add a launcher that would go straight to it. The command bit of the line would look something like this:

exec:gnumeric /root/my-documents/myfile.*

where myfile.* is the name of your file with its extension.

Pretty much if you can get a command to run in a terminal window, you can make the same command run via a JWM launcher button.

_________________
Spup Frugal HD and USB
Root forever!

Last edited by DaveS on Mon 21 Sep 2009, 10:51; edited 1 time in total
Back to top
View user's profile Send private message 
aarf

Joined: 30 Aug 2007
Posts: 3620
Location: around the bend

PostPosted: Mon 21 Sep 2009, 08:17    Post subject:  

thanks for your efforts DaveS but.....

can we just have a pet to download and click Very Happy , my mind is now reluctant to do anything more arduous now that puppy has spoiled me Laughing

_________________

ASUS EeePC Flare series 1025C 4x Intel Atom N2800 @ 1.86GHz RAM 2063MB 800x600p ATA 320G
_-¤-_

<º))))><.¸¸.•´¯`•.#.•´¯`•.¸¸. ><((((º>
Back to top
View user's profile Send private message Visit poster's website 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Mon 21 Sep 2009, 08:31    Post subject:  

aarf wrote:
thanks for your efforts DaveS but.....

can we just have a pet to download and click Very Happy , my mind is now reluctant to do anything more arduous now that puppy has spoiled me Laughing

LOL
Well I guess that is exactly what Ptray is, but it is tough to second guess what folks will add to their systems.

_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
aarf

Joined: 30 Aug 2007
Posts: 3620
Location: around the bend

PostPosted: Mon 21 Sep 2009, 08:42    Post subject:  

DaveS wrote:
aarf wrote:
thanks for your efforts DaveS but.....

can we just have a pet to download and click Very Happy , my mind is now reluctant to do anything more arduous now that puppy has spoiled me Laughing

LOL
Well I guess that is exactly what Ptray is, but it is tough to second guess what folks will add to their systems.

didnt see any complaints from the standard one in 421 so that composition would be a good start. if modification is required then they can do some reading here.

_________________

ASUS EeePC Flare series 1025C 4x Intel Atom N2800 @ 1.86GHz RAM 2063MB 800x600p ATA 320G
_-¤-_

<º))))><.¸¸.•´¯`•.#.•´¯`•.¸¸. ><((((º>
Back to top
View user's profile Send private message Visit poster's website 
caleb72

Joined: 15 May 2009
Posts: 57

PostPosted: Tue 22 Sep 2009, 09:39    Post subject:  

Thanks for this - I didn't realise that you could do this without the application. I actually prefer this method of adding the launch bar.

Regards
Caleb
Back to top
View user's profile Send private message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Tue 22 Sep 2009, 10:28    Post subject:  

caleb72 wrote:
Thanks for this - I didn't realise that you could do this without the application. I actually prefer this method of adding the launch bar.

Regards
Caleb


Great. Also, doing it this way adds about 1500 bytes! not Kilobytes or Megabytes, just Bytes! Less than writing an email.

_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
Kal

Joined: 05 May 2005
Posts: 624
Location: California, High Desert

PostPosted: Tue 22 Sep 2009, 12:23    Post subject: Ptray  

Ptray was a little too involved and I had to modify the configure file all the time anyway. I earlier had added the top tray to 412, and 430, just the same as you have said. A very nice write up.

Here is a Tray Button I add for getting to the config file:

Code:
<TrayButton popup="Tray Config" icon="utility24.png">exec:geany /root/.jwmrc-tray-top</TrayButton>


Kal
Back to top
View user's profile Send private message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Tue 22 Sep 2009, 12:51    Post subject:  

Dont forget, you are not restricted to only a top try, or even a single top tray. Here is the code for a side tray that I have for downloading podcasts when I want them:

Code:
<JWM>
   <Tray autohide="true" border="0" y="10" halign="left" width="36" layout="vertical">
       <TrayButton popup="Handel" icon="/usr/share/midi-icons/handel.png">exec:/usr/local/pods/call_handel.sh</TrayButton>
      <TrayButton popup="Tuxradar" icon="/usr/share/midi-icons/tuxradar.png">exec:/usr/local/pods/call_txradar.sh</TrayButton>
      <TrayButton popup="OTM" icon="/usr/share/midi-icons/otm.png">exec:/usr/local/pods/call_otm.sh</TrayButton>
      <TrayButton popup="Outlaws" icon="/usr/share/midi-icons/outlaws36.png">exec:/usr/local/pods/call_outlaws.sh</TrayButton>
      <TrayButton popup="Common Sense" icon="/usr/share/midi-icons/sense.png">exec:/usr/local/pods/call_sense.sh</TrayButton>
      <TrayButton popup="Hardcore History" icon="/usr/share/midi-icons/history.png">exec:/usr/local/pods/call_history.sh</TrayButton>
      <TrayButton popup="Radio Lab" icon="/usr/share/midi-icons/radiolab.png">exec:/usr/local/pods/call_radiolab.sh</TrayButton>
      <TrayButton popup="Friday Commedy" icon="/usr/share/midi-icons/fricom.png">exec:/usr/local/pods/call_fricom.sh</TrayButton>
      <TrayButton popup="Planet Money" icon="/usr/share/midi-icons/money.png">exec:/usr/local/pods/call_money.sh</TrayButton>
      <TrayButton popup="Aqualung audio player and ripper" icon="aqualung.png">exec:aqualung</TrayButton>
      <TrayButton popup="Files" icon="/usr/share/midi-icons/folder24.png">exec:rox ~/Podcast</TrayButton>
   </Tray>
</JWM>


Same approach, just specify the position you want.







I have it set to auto-hide, so just touching the edge of the screen in the general area pops it out.

_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
aarf

Joined: 30 Aug 2007
Posts: 3620
Location: around the bend

PostPosted: Tue 22 Sep 2009, 13:10    Post subject:  

have found a time where my mind was not on strike or R&R.
from 421
Code:
    <JWM>
 <Tray autohide="true" insert="right" valign="top" halign="center" height="36" >
  <TrayButton popup="Edit tray" icon="star48.png">exec:ptray</TrayButton>
  <TrayButton popup="" icon="nothing.png">exec:</TrayButton>
  <TrayButton popup="" icon="nothing.png">exec:</TrayButton>
  <TrayButton popup="" icon="nothing.png">exec:</TrayButton>
 
  <TrayButton popup="Rxvt - terminal emulator" icon="/usr/local/lib/X11/pixmaps/console48.png">exec:rxvt</TrayButton>
  <TrayButton popup="Leafpad - text editor" icon="/usr/local/lib/X11/pixmaps/leafpad.png">exec:leafpad</TrayButton>
  <TrayButton popup="Pfind - file finder" icon="/usr/local/lib/X11/mini-icons/mini-search.xpm">exec:pfind</TrayButton>
  <TrayButton popup="Pprocess - process manager" icon="/usr/local/lib/X11/mini-icons/mini-run.xpm">exec:pprocess</TrayButton>
  <TrayButton popup="Pwireless - wireless scanner" icon="/usr/local/lib/X11/mini-icons/Pwireless.png">exec:Pwireless</TrayButton>
  <TrayButton popup="" icon="/usr/local/lib/X11/mini-icons/tb_print.xpm">exec:exec defaulthtmlviewer http://localhost:631/</TrayButton>
  <TrayButton popup="Galculator - 3 way calculator" icon="/usr/share/pixmaps/galculator_48x48.png">exec:galculator</TrayButton>

  <TrayButton popup="" icon="nothing.png">exec:</TrayButton>
  <TrayButton popup="" icon="nothing.png">exec:</TrayButton>
  <TrayButton popup="" icon="nothing.png">exec:</TrayButton>
  <TrayButton popup="Show desktop" icon="show-desktop24.png">showdesktop</TrayButton>
  <TrayButton popup="Lock screen" icon="lock-screen48.png">exec:/usr/local/apps/Xlock/AppRun</TrayButton>
  <TrayButton popup="Power OFF computer" icon="exit24.png">exec:/usr/bin/shutdownjwm</TrayButton>
  </Tray>
</JWM>



my 430
Code:
<JWM>
  <Tray autohide="true" insert="right" valign="top" halign="center" height="36" >
  <TrayButton popup="User" icon="/usr/local/lib/X11/mini-icons/dir_o.xpm">exec:rox /mnt/home/home/user/</TrayButton>
  <TrayButton popup="Puppy" icon="/usr/share/midi-icons/folder24.png">exec:rox /mnt/home/home/user/My Documents/puppy/</TrayButton>
 
  <TrayButton popup="Browser" icon="/usr/local/lib/X11/mini-icons/seamonkey16.xpm">exec:seamonkey</TrayButton>
 
  <TrayButton popup="Show desktop" icon="/usr/local/lib/X11/mini-icons/mini-desktop.xpm">showdesktop</TrayButton>
  <TrayButton popup="Rxvt - terminal emulator" icon="/usr/local/lib/X11/themes/Original/console48.png">exec:rxvt</TrayButton>
  <TrayButton popup="Geany - text editor" icon="/usr/share/icons/hicolor/48x48/apps/geany.png">exec:geany</TrayButton>
  <TrayButton popup="Pfind - file finder" icon="/usr/share/midi-icons/edit24.png">exec:pfind</TrayButton>
  <TrayButton popup="Pwireless - wireless scanner" icon="/usr/local/lib/X11/mini-icons/Pwireless.png">exec:Pwireless</TrayButton>
  <TrayButton popup="Calculator" icon="/usr/local/lib/X11/mini-icons/mini-calc.xpm">exec:ycalc</TrayButton>
   
</JWM>

would like the Power OFF computer what is its 430 equivalent?

_________________

ASUS EeePC Flare series 1025C 4x Intel Atom N2800 @ 1.86GHz RAM 2063MB 800x600p ATA 320G
_-¤-_

<º))))><.¸¸.•´¯`•.#.•´¯`•.¸¸. ><((((º>
Back to top
View user's profile Send private message Visit poster's website 
aarf

Joined: 30 Aug 2007
Posts: 3620
Location: around the bend

PostPosted: Tue 22 Sep 2009, 13:14    Post subject:  

podcasts downloader looks good.
how do you change the background colour of the tray?

Last edited by aarf on Tue 22 Sep 2009, 13:19; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Tue 22 Sep 2009, 13:17    Post subject:  

Yay aarf, way to go. The poweroff command in 4.3 is wmpoweroff and is located in /usr/bin
_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
aarf

Joined: 30 Aug 2007
Posts: 3620
Location: around the bend

PostPosted: Tue 22 Sep 2009, 13:25    Post subject:  

DaveS wrote:
Yay aarf, way to go. The poweroff command in 4.3 is wmpoweroff and is located in /usr/bin

ok got it thanks
Code:
<TrayButton popup="Power OFF computer" icon="/usr/local/lib/X11/themes/Smooth-Color/shutdown24.png">exec:/usr/bin/wmpoweroff</TrayButton>

_________________

ASUS EeePC Flare series 1025C 4x Intel Atom N2800 @ 1.86GHz RAM 2063MB 800x600p ATA 320G
_-¤-_

<º))))><.¸¸.•´¯`•.#.•´¯`•.¸¸. ><((((º>
Back to top
View user's profile Send private message Visit poster's website 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: Tue 22 Sep 2009, 13:47    Post subject:  

aarf wrote:
DaveS wrote:
Yay aarf, way to go. The poweroff command in 4.3 is wmpoweroff and is located in /usr/bin

ok got it thanks
Code:
<TrayButton popup="Power OFF computer" icon="/usr/local/lib/X11/themes/Smooth-Color/shutdown24.png">exec:/usr/bin/wmpoweroff</TrayButton>


As /usr/bin/ is in the 'path', so you probably only need
Code:
exec:wmpoweroff


Re-boot is also useful, exec:wmreboot

_________________
Spup Frugal HD and USB
Root forever!
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [29 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1249s ][ Queries: 12 (0.0060s) ][ GZIP on ]