Multi-Search3

Power Up Puppy Lucid 510 Linux - Two Tips To Customize The Start Up Sequence!


Puppy Start Menu - Add A New Menu Group
I have seen a bunch of Live CD Linux distros but when it comes to packing a ton of packages in a small size [Puppy Lucid 5.1.0-where I am still at-under 130MB; the latest Puppy Lucid 5.2.8 just 133MB, download from here], nothing comes close to Puppy Linux. Extendable for even more versatility and power with the dev package and with the ability to run from RAM without even a hard disk, we have most of what we need to run a decent family pc or laptop! Not forgetting the save files that help us keep our sanity by storing persistent settings across shutdowns, and the multitude of open source gems out there, there is hardly very little we'll miss unless we're sitting on the bleeding edge of computing. Let us consider two simple ways to pack even more punch to the Puppy startup sequence, first by customizing the Start Menu and secondly by customizing the LHS tray. Remember we are working with Puppy Lucid 510 Linux here. Don't squat somewhere in Arch Linux and complain if you find things missing or not as found here :)

I. CUSTOMIZING THE START MENU

Before
 

After Adding New Menu[JCMenu]

Before we start anything, let's backup the /root/.jwmrc file.

$cp /root/.jwmrc /root/.jwmrc.bkup

This is the file we need to change to customize the Start Menu. We can edit, delete or even add new entries to the Start Menu by changing the entries here. It creates the Puppy Start Menu [see "Before" image above on the left].

< ?xml version="1.0"? >
< JWM >
< !-- IMPORTANT, ONLY EDIT /etc/xdg/templates/_root_.jwmrc -- >
< !-- jwm menu for puppy Linux -- >
< RootMenu label="Menu" labeled="false" height="24" onroot="3" >

< Menu label="Desktop" icon="x24.png" height="16" >
< Menu label="Desktop Settings" icon="mini.window3d.xpm" height="16" >
< Program label="Chtheme GTK theme chooser" icon="mini.window3d.xpm" >gtk-chtheme< /Program >
< Program label="Configure Xlock screen locking" icon="mini-lock.xpm" >/usr/local/apps/Xlock/AppRun -configure< /Program >
...
< /Menu>
 < Separator/ > 
... 
...
< Menu label="Shutdown" icon="shutdown24.png" height="16" >
< !-- < exit confirm="false" icon="prompt16.xpm" label="Exit to prompt" > -->
< Program label="Exit to prompt" icon="prompt16.xpm" >exec wmexit< /Program >
< Program label="Reboot computer" icon="mini-turn.xpm" >exec wmreboot< /Program >
< Program label="Power-off computer" icon="mini-stop.xpm" >exec wmpoweroff< /Program >
< Program label="Restart X server" icon="mini-x.xpm" >restartwm< /Program >
< Restart label="Restart JWM" icon="mini-windows.xpm"/>
< !-- < Program label="Change Window Manager" icon="mini-windows.xpm" >changewm.sh< /Program > -->
< /Menu >
< /RootMenu >
< /JWM >
< /exit >

Let's just look at the menus and programs at the start of the file since this is where we need to insert code if we wanted to add a new menu or programs. We'll keep things simple and consider only how to add a simple new menu [JCMenu] with a few puppy programs and one of our own scripts between two existing menus [Fun] and [JWhatGKFJ-1], (see "Before" image above on the left). Remember that we can use the [< Separator/ >] tag to separate menus or menu items(programs themselves) just as we have used two separators in our [JCMenu] to separate three program groups (see "After" image above on the right). Assume that we have coded our stuff into the following block [Note:All tags below have been padded with the space character as the second character on the LHS and the RHS. These are for code display and need to be removed before use]:

< Menu label="JCMenu" icon="games24.png" height="16" >
< Program label="ConfigureTouchpad" icon="picpuz.png" >flsynclient &< /Program >
< Program label="PupApps" icon="picpuz.png" >PupApps &< /Program >
< Program label="PupControl" icon="picpuz.png" >PupControl &< /Program >
< Program label="SearchMonkey" icon="picpuz.png" >searchmonkey &< /Program >
< Separator/ >
< Program label="HTop" icon="picpuz.png" >rxvt -e /usr/bin/htop &< /Program >
< Separator/ >
< Program label="FreeSpace1" icon="picpuz.png" >/bin/echo "Free Space[df -h] ">/tmp/1.out; /bin/df -h>>/tmp/1.out; /bin/echo>>/tmp/1.out; /bin/echo "free ">>/tmp/1.out; /bin/free>>/tmp/1.out; geany /tmp/1.out; rm /tmp/1.out< /Program >
< /Menu >
< Separator/ >


Notice how we have used a menu label, a couple of image icons and a program group for our menu above.

MENU LABEL: The label is where we name our menu [JCMenu].

ICONS: For simplicity we are reusing existing Puppy icons games24.png from /usr/local/lib/X11/pixmaps for the menu and picpuz.png from /usr/share/pixmaps/ for the menu items.

PROGRAMS: Here are three ways we can run programs from the Start Menu.

1.For starting up most puppy default programs, we can just call them by name like this.
< Program label="PupApps" icon="picpuz.png" >PupApps &< /Program >

2.Programs such as htop that require the terminal for the whole duration of their run may need to be called like this.
< Program label="HTop" icon="picpuz.png" >rxvt -e /usr/bin/htop &< /Program >

3.Finally we may run our own one liners, shell scripts and we may even run more than one program and display the output at once. For example consider the last menu entry in our code above.
< Program label="FreeSpace1" icon="picpuz.png" >/bin/echo "Free Space[df -h] ">/tmp/1.out; /bin/df -h>>/tmp/1.out; /bin/echo>>/tmp/1.out; /bin/echo "free ">>/tmp/1.out; /bin/free>>/tmp/1.out; geany /tmp/1.out; rm /tmp/1.out< /Program >

The command sequence above runs two commands, collects the output and opens the output file with the Geany editor automatically showing us a nice human-readable free space view and also the free memory view seen below.

Free Space[df -h] 
Filesystem            Size  Used Avail Use% Mounted on
rootfs                727M  100M  628M  14% /
tmpfs                 727M  100M  628M  14% /initrd/pup_rw
tmpfs                 293M  292M  704K 100% /initrd/mnt/tmpfs
/dev/loop0            292M  292M     0 100% /initrd/pup_ro2
unionfs               727M  100M  628M  14% /
shmfs                 287M  140K  287M   1% /dev/shm
/dev/sda1             3.8G  3.3G  489M  88% /mnt/sda1
/dev/sdb1             1.9G  1.6G  305M  85% /mnt/sdb1

free 
              total         used         free       shared      buffers
  Mem:      1488768      1274172       214596            0       117244
 Swap:            0            0            0
Total:      1488768      1274172       214596

Okay, let's take our favorite menu code [shown in color red below] and plug it into the existing code just below the menu called [Fun]. Notice how nicely we have arranged four Puppy programs, htop after these, and our own command sequence menu item grouped neatly into nice blocks with seperators! After the code insert it looks like this.

< ?xml version="1.0"? >
< JWM >
< !-- IMPORTANT, ONLY EDIT /etc/xdg/templates/_root_.jwmrc -- >
< !-- jwm menu for puppy Linux -- >
< RootMenu label="Menu" labeled="false" height="24" onroot="3" >

< Menu label="Desktop" icon="x24.png" height="16" >
< Menu label="Desktop Settings" icon="mini.window3d.xpm" height="16" >
< Program label="Chtheme GTK theme chooser" icon="mini.window3d.xpm" >gtk-chtheme< /Program >
< Program label="Configure Xlock screen locking" icon="mini-lock.xpm" >/usr/local/apps/Xlock/AppRun -configure< /Program >
...
< /Menu >
 < Separator/ > 
... 
...
...
< Menu label="Fun" icon="games24.png" height="16" >
< Program label="PicPuz jigsaw puzzle" icon="picpuz.png" >picpuz< /Program >
< Program label="Rubix cube" icon="cube16.xpm" >rubix< /Program >
< Program label="Tile slider game" icon="mini-modules.xpm" >tile< /Program >
< Program label="XEmeraldia drop blocks" icon="xemeraldia.xpm" >xemeraldia< /Program >
< Program label="Xinvaders3d Arcade Game  " icon="xinvaders.png" >xinv3d< /Program >
< Program label="Xsoldier - space arcade" icon="xsoldier.xpm" >xsoldier< /Program >
< /Menu >
< Separator/ >

< Menu label="JCMenu" icon="games24.png" height="16" >
< Program label="ConfigureTouchpad" icon="picpuz.png" >flsynclient &< /Program >
< Program label="PupApps" icon="picpuz.png" >PupApps &< /Program >
< Program label="PupControl" icon="picpuz.png" >PupControl &< /Program >
< Program label="SearchMonkey" icon="picpuz.png" >searchmonkey &< /Program >
< Separator/ >
< Program label="HTop" icon="picpuz.png" >rxvt -e /usr/bin/htop &< /Program >
< Separator/ >
< Program label="FreeSpace1" icon="picpuz.png" >/bin/echo "Free Space[df -h] ">/tmp/1.out; /bin/df -h>>/tmp/1.out; /bin/echo>>/tmp/1.out; /bin/echo "free ">>/tmp/1.out; /bin/free>>/tmp/1.out; geany /tmp/1.out; rm /tmp/1.out< /Program >
< /Menu >
< Separator/ >
...
...
< Program label="Help" icon="help24.png" >exec defaulthtmlviewer file:///usr/share/doc/index.html< /Program >

< Menu label="Shutdown" icon="shutdown24.png" height="16" >

< Program label="Exit to prompt" icon="prompt16.xpm" >exec wmexit< /Program >
< Program label="Reboot computer" icon="mini-turn.xpm" >exec wmreboot< /Program >
< Program label="Power-off computer" icon="mini-stop.xpm" >exec wmpoweroff< /Program >
< Program label="Restart X server" icon="mini-x.xpm" >restartwm< /Program >
< Restart label="Restart JWM" icon="mini-windows.xpm"/ >
< !-- < Program label="Change Window Manager" icon="mini-windows.xpm">changewm.sh< /Program > -- >
< /Menu >
< /RootMenu >
< /JWM >

Remember to run the Restart JWM menu option from the Puppy Start Menu every time after any change is made to the /root/.jwmrc file to view changes. [Menu->Shutdown->Restart JWM].
Run Restart JWM After Changes
Once we do that we get to see the new menu [JCMenu] displayed as seen on the "Before" and "After" images above. That's our very own customized Start Menu, don't you love it? I do!



II. CUSTOMIZING THE LHS TRAY ON THE TASKBAR AT THE BOTTOM

Taskbar LHS Tray-Before
  
Taskbar LHS Tray-After Adding More Program Icons
   

Let's look at how we can improve the LHS tray next to the Start Menu icon on the taskbar at the bottom by adding some more icons there. As you know, this is probably the best place to keep icons of the top few programs we run everytime day after day. This time we'll modify the /root/.jwmrc-tray file to add more items to the LHS tray. As usual, let's backup the current file before we start.

$cp /root/.jwmrc-tray /root/.jwmrc-tray.bkup

This is what the code looks like initially:
< JWM > 
   < Tray  autohide="false" insert="right" x="0" y="-1" border="1" height="28" > 
      < !-- Additional TrayButton attribute: label -- > 
      < TrayButton label="Menu" icon="mini-dog.xpm" >root:3< /TrayButton > 
      < !-- < traybutton icon="gexec.xpm" popup="Run commandline" >exec:gexec< /TrayButton > -- > 
      < TrayButton popup="Show Desktop" icon="mini-desktop.xpm" >showdesktop< /TrayButton > 
      < TrayButton popup="Free space in drives" icon="mini-hdisk.xpm" >exec:partview< /TrayButton > 
      < TrayButton popup="Choose Default Browser" icon="www24.png" >exec:browser-default< /TrayButton > 
        
      < !-- Additional Pager attributes; width, height -- > 
      < Pager/ > 
      < !-- Additional TaskList attribute: maxwidth -- > 
      < TaskList/ > 
      < Dock/ > 
      < !-- Additional Swallow attribute: height -- > 
      < Swallow name="blinky" > 
  blinkydelayed -bg "#4D525B"
      < /Swallow > 
      < !--  -- > 
      < !--    asapmshell -u 4 -- > 
      < !--  -- > 
      < Swallow name="freememapplet" width="34" > 
        freememappletshell 
      < /Swallow > 
      < Swallow name="xload" width="32" > 
  xload -nolabel -fg red -hl white -bg "gray45"
      < /Swallow > 
      < Clock >minixcal< /Clock > 
   < /Tray > 
< /JWM >

This below is our code to add more programs to the LHS tray RIGHT next to the Start Menu icon:

        < TrayButton popup="Pupdial" icon="/usr/local/apps/Connect/.DirIcon" >exec:/usr/sbin/pupdial< /TrayButton > 
        < TrayButton popup="Term" icon="/usr/local/lib/X11/pixmaps/console48.png" >exec:/usr/bin/urxvt< /TrayButton > 
        < TrayButton popup="Rox" icon="/usr/local/lib/X11/pixmaps/home48.png" >exec:/usr/local/bin/rox< /TrayButton > 
        < TrayButton popup="Gny" icon="/usr/local/lib/X11/pixmaps/edit48.png" >exec:/usr/local/bin/defaulttexteditor< /TrayButton > 
        < TrayButton popup="Lck" icon="/usr/local/apps/Xlock/.DirIcon" >exec:/usr/bin/xlock< /TrayButton >
        < TrayButton popup="Save" icon="/usr/local/lib/X11/pixmaps/save48.png" >exec:/usr/sbin/save2flash< /TrayButton >
        < TrayButton popup="Htop" icon="/usr/local/lib/X11/pixmaps/draw48.png" >exec:/usr/bin/urxvt -e /usr/bin/htop< /TrayButton >

This is the final code with our inserted code in red. Remember to remove the spaces at start and end of every line, if copy/pasting:

< JWM > 
   < Tray  autohide="false" insert="right" x="0" y="-1" border="1" height="28" > 
      < !-- Additional TrayButton attribute: label -- > 
      < TrayButton label="Menu" icon="mini-dog.xpm" >root:3< /TrayButton > 
   < !-- exec:gexec< /TrayButton > --> 
      < TrayButton popup="Show Desktop" icon="mini-desktop.xpm" >showdesktop< /TrayButton > 
      < TrayButton popup="Free space in drives" icon="mini-hdisk.xpm" >exec:partview< /TrayButton > 
      < TrayButton popup="Choose Default Browser" icon="www24.png" >exec:browser-default< /TrayButton > 

  
        < TrayButton popup="Pupdial" icon="/usr/local/apps/Connect/.DirIcon" >exec:/usr/sbin/pupdial< /TrayButton > 
        < TrayButton popup="Term" icon="/usr/local/lib/X11/pixmaps/console48.png" >exec:/usr/bin/urxvt< /TrayButton > 
        < TrayButton popup="Rox" icon="/usr/local/lib/X11/pixmaps/home48.png" >exec:/usr/local/bin/rox< /TrayButton > 
        < TrayButton popup="Gny" icon="/usr/local/lib/X11/pixmaps/edit48.png" >exec:/usr/local/bin/defaulttexteditor< /TrayButton > 
        < TrayButton popup="Lck" icon="/usr/local/apps/Xlock/.DirIcon" >exec:/usr/bin/xlock< /TrayButton >
        < TrayButton popup="Save" icon="/usr/local/lib/X11/pixmaps/save48.png" >exec:/usr/sbin/save2flash< /TrayButton >
        < TrayButton popup="Htop" icon="/usr/local/lib/X11/pixmaps/draw48.png" >exec:/usr/bin/urxvt -e /usr/bin/htop< /TrayButton >    
        
        
      < !-- Additional Pager attributes; width, height -- > 
      < Pager/ > 
      < !-- Additional TaskList attribute: maxwidth -- > 
      < TaskList/ > 
      < Dock/ > 
      < !-- Additional Swallow attribute: height -- > 
      < Swallow name="blinky" > 
  blinkydelayed -bg "#4D525B"
      < /Swallow > 
      < !--  -- > 
      < !--    asapmshell -u 4 -- > 
      < !--  -- > 
      < Swallow name="freememapplet" width="34" > 
        freememappletshell 
      < /Swallow > 
      < Swallow name="xload" width="32" > 
  xload -nolabel -fg red -hl white -bg "gray45"
      < /Swallow > 
      < Clock >minixcal< /Clock > 
   < /Tray > 
< /JWM >
< /traybutton >

Remember to run the Restart JWM menu option from the Puppy Start Menu every time after any change is made to the /root/.jwmrc-tray file to view changes. [Menu->Shutdown->Restart JWM] and look what we got! A whole new bunch of icons added to the LHS tray! Hooray!

Taskbar LHS Tray-Before

Taskbar LHS Tray-After Adding More Program Icons


Look at the image above to see the before and after views of how the LHS tray looks at the bottom of the screen. This completes the first set of two power tips to enrich the start up sequence of Puppy Lucid 510 Linux. More to follow soon!

IMPORTANT INFORMATION!

A [space] character has been inserted after the first character and before the last character of some xml tags in the display code blocks to protect display and need to be removed before use if copy/pasted. For example,

 < Menu >
 < Separator/ > 
 < TaskList/ > 
 < Dock/ > 
from code display must have the spaces removed when used in xml source code.

UPDATE

Remember to use the bulk replace option in the text editor you use to save time and also to 
prevent some angry cursing. For example, in Geany and gnome-text-editor I used this method to 
remove the extraneous spacing in a few key strokes and a few seconds instead of individual 
replacements that might have taken for ever. Make changes first in a fresh new blank editor page so you can transfer the text to the script after the editing is complete. Where it applies 
below, remove the square brackets used for accent and to mark out the space character.

GEANY
   Type [geany] leaving out the square brackets from command line or start it from [Start Menu]->[Accessories]
   Paste and select the text to change.
   Press [Ctrl-H] to bring up the replace box and click on [Replace All] to expand. 
   Type [< ] in the [Search for] input box. 
   Type [<] in the [Replace with] input box.
   Press the [In Selection] button to complete.
   Similarly, repeat the same steps for [ >].

GNOME TEXT EDITOR
   Type [gnome-text-editor] leaving out the square brackets from command line or start it from [Start Menu]->[Programming] and paste the code.
   Press [Ctrl-H] to bring up the replace box.
   Type [< ] in the [Find what] input box. 
   Type [<] in the [Replace with] input box.
   Click on [Replace all at once] to select it.
   Type [Find and replace] to complete.
   Similarly, repeat the same steps for [ >].


BlogCollage


Blog Collage - Top Random Posts In No Particular Order

Mouseover the images for title and comments

Most Recent Posts