Page 1 of 2

Desktop Icons and background with jwm ONLY(no ROX, xtdesk..)

Posted: Sun 10 Jan 2010, 18:26
by technosaurus
For all of you minimalists out there, here is a way to get rid of ROX if you are only using it for desktop icons

here is an example using gparted:
<Tray x="-25" y="-32" height="64" layer="0">
<TrayButton icon="gparted.png">exec:gparted</TrayButton>
</Tray>

You can save them to a file /root/.jwmrc and add this in /etc/xdg/templates/_root_.jwmrc like:
<Include>/root/.jwmrc-desktop</Include>
after
<Include>/root/.jwmrc-tray</Include>

You can also use it for the desktop background - I would recommend using /usr/share/background/default.jpg as a symlink and changing the symlink

Code: Select all

ln-s -f $1 /usr/share/background/default
and running refreshing

Code: Select all

jwm -restart
more on that here:
http://joewing.net/programs/jwm/config.shtml
and here:
http://wiki.archlinux.org/index.php/JWM

Posted: Tue 12 Jan 2010, 02:04
by technosaurus
Here is further info:

First edit /root/.xinitrc and comment out the rox lines
{just restart X to close rox or use pprocess to kill it
afterwards you can just restart jwm to apply changes}
add my code to your /root/.jwm/jwmrc-personal ... replace <Desktops count="2"/>
{alternatively you can put it in a separate file and use <Include>/pathto/file</Include>}


<!-- Number of virtual desktops -->
<Desktops count="2">
<Desktop Name="One">
<Background type="image">/usr/share/backgrounds/default.jpg</Background>
</Desktop>
<Desktop Name="Two">
<Background type="image">/usr/share/backgrounds/default.jpg</Background>
</Desktop>
</Desktops>

<Tray layout="horizontal" x="10" y="-32" layer="0" border="0">
<TrayButton popup="sda1" icon="drive48.png">exec:rox /mnt/sda1</TrayButton>
<TrayButton popup="sda5" icon="drive48.png">exec:rox /mnt/sda5</TrayButton>
<TrayButton popup="sda7" icon="drive48.png">exec:rox /mnt/sda7</TrayButton>
<TrayButton popup="sda8" icon="drive48.png">exec:rox /mnt/sda8</TrayButton>
</Tray>

<Tray layout="vertical" x="10" y="10" layer="0" border="0">
<TrayButton popup="File Manager" icon="folder48.png">exec:rox</TrayButton>
<TrayButton label="Home"></TrayButton>
</Tray>

<Tray layout="vertical" x="74" y="10" layer="0" border="0">
<TrayButton label="Tools"></TrayButton>
<TrayButton popup="Terminal" icon="console48.png">exec:rxvt</TrayButton>
<TrayButton popup="Control Panel" icon="configuration48.png">exec:wizardwizard</TrayButton>
<TrayButton popup="Manage Drives" icon="gparted.png">exec:gparted</TrayButton>
</Tray>

<Tray layout="vertical" x="138" y="10" layer="0" border="0">
<TrayButton label="Internet"></TrayButton>
<TrayButton popup="Default Browser" icon="www48.png">exec:defaultbrowser</TrayButton>
<TrayButton popup="Default Mail" icon="email48.png">exec:defaultemail</TrayButton>
<TrayButton popup="Default Chat" icon="chat48.png">exec:defaultchat</TrayButton>
</Tray>

<Tray layout="vertical" x="202" y="10" layer="0" border="0">
<TrayButton label="Office"></TrayButton>
<TrayButton popup="Abiword Word Processor" icon="word48.png">exec:abiword</TrayButton>
<TrayButton popup="Gnumeric Spreadsheet" icon="gnumeric48.png">exec:gnumeric</TrayButton>
</Tray>

<Tray x="266" y="10" layer="0" border="0">
<!-- We can use this with sed to place a NEWICON1 -->
</Tray>
<!-- More NEWICONS -->

<Tray x="-12" y="12" layer="0" border="0">
<TrayButton popup="Xlock lock screen" icon="lock-screen48.png">exec:/usr/local/apps/Xlock/AppRun -locknow</TrayButton>
</Tray>

Posted: Tue 12 Jan 2010, 02:56
by ttuuxxx
kind of a creative approach :) nice work, hmmm I bet plug'in play usb sticks don't come up when plugged in :)
ttuuxxx

Posted: Tue 12 Jan 2010, 03:33
by technosaurus
I have already thought about that one - since the files are just xml it shouldn't be that hard to adapt the eventmanager

Put <Include>/root/.jwmrc-drives</Include> in the .jwmrc template
When new drive is inserted (or mounted/unmounted) rebuild .jwmrc-drives then jwm -restart

bonus is all of the fixpuppypin stuff can go away

hmmm... what command to use when it is clicked since right click is the same as left click??? ... Xdialog script or just mount if not mounted and open it with <defaultfilemanager> <-- I guess this would be possible too

Posted: Tue 12 Jan 2010, 03:46
by sunburnt
Not to mention folks that don`t like the mess HotPup makes of the desktop.
It doesn`t position the icons very well, and it`s interface is less than intuitive.
It would be much better if it`s icons were on an edge docked panel.

Posted: Tue 12 Jan 2010, 06:47
by technosaurus
As you can see these trays can be put anywhere so that would be solved. I just wish I could make the background of the tray clear or at least translucent.

I also added these ON/OFF tags to /root/.jwmrc-tray to later be able to turn them on and off using sed and jwm -restart
Does anyone know a good way to toggle this other than sed?
  • <!-- BLINKYON --><Swallow name="blinky">blinkydelayed -bg "#DCDAD5"</Swallow><!-- BLINKYON -->
    <!-- ASAPMON --><Swallow name="asapm">asapmshell -u 4 </Swallow><!-- ASAPMON -->
    <!-- FREEMEMAPLETON --> <Swallow name="freememapplet" width="34">freememappletshell</Swallow><!-- FREEMEMAPLETON -->
    <!-- XLOADOFF <Swallow name="xload" width="32">xload -nolabel -bg "#888888" -fg red -hl white</Swallow> XLOADOFF -->
as well as an option to turn off absvolume by editing /root/.xinitrc (similar to glipper)
if [ -f /root/.absvolume_on ];then
...
fi
to turn it on echo >/root/.absvolume_on
to turn it off rm /root/.absvolume_on

Posted: Tue 12 Jan 2010, 07:12
by magerlab
may be it would be better to use approach what gray uses in NOP with drive icons - to open a dialog when icon is clicked ( mount or unmount)

Posted: Tue 12 Jan 2010, 19:32
by technosaurus
magerlab wrote:may be it would be better to use approach what gray uses in NOP with drive icons - to open a dialog when icon is clicked ( mount or unmount)
thanks, I'll check it out.

Another hack:
If you want desktop "icons" instead of buttons there is an Opacity tag that you can apply to its associated tray (I haven't experimented yet, but I have seen it used before in a puplet for the main tray - same concept) Anyhow I can't find any documentation of its usage except for examples in Patriot's thread.

This would also be good for automatic spacing (such as for drive icons) by including a blank tray button(s) as a separator, while still grouping them in a single tray (avoids having to calculate locations)

Posted: Tue 12 Jan 2010, 19:38
by sunburnt
technosaurus; My thought exactly about the transparent panels.
Much better than icons on the desktop...

Sed and grep are the only ways I`ve ever changed any config. files.
If you must do it a lot, make a utility like mine I made for locating,
changing, and removing ROX desktop icons ( sed and grep ).

The best setup I can think of would be ( with separators in between ):
The taskbar and tray docked on the left side of the screen vertically.

The top is buttons to select which desktop ( 1, 2, 3 ,4 ).
----------------------------
Then drive buttons for all drives fixed and removable.
----------------------------
Then the task buttons ( there`s lots of room for many of them ).
----------------------------
And the clock that`s the Menu button at the bottom.

It`d be really cool if it slid out from the left border...

Posted: Tue 12 Jan 2010, 21:12
by dejan555
This is cool:

Image

8)

Panel code:

Code: Select all

<JWM>
<Tray y="-32" halign="center" layer="0">
<TrayButton icon="/usr/local/lib/X11/pixmaps/home48.png">exec:rox ~</TrayButton>
<TrayButton icon="/usr/local/lib/X11/pixmaps/console48.png">exec:rxvt -bg black -fg white -sr</TrayButton>
<TrayButton icon="/usr/local/lib/X11/pixmaps/www48.png">exec:defaultbrowser</TrayButton>
<TrayButton icon="/usr/local/lib/X11/pixmaps/drive48.png">exec:pmount</TrayButton>
<TrayButton icon="/usr/local/lib/X11/pixmaps/chat48.png">exec:defaultchat</TrayButton>
<TrayButton icon="/usr/local/lib/X11/pixmaps/multimedia48.png">exec:defaultmediaplayer</TrayButton>
<TrayButton icon="/usr/local/lib/X11/pixmaps/paint48.png">exec:defaultpaint</TrayButton>
<TrayButton icon="/usr/local/lib/X11/pixmaps/shutdown24.png">exec:/usr/bin/shutdownjwm</TrayButton>
</Tray> 
</JWM>
For gradiented background:

Code: Select all

<Background type="gradient">black:#6EBDC7</Background>

Basic Volume Control for jwm

Posted: Fri 15 Jan 2010, 05:43
by technosaurus
Here is a tray button and bash script (Xsetvol) to replace absvolume

Tray button recommend putting it after <Dock/> in /root/.jwmrc-tray
<TrayButton popup="Audio Control" icon="audio-volume-high.png">exec:Xsetvol</TrayButton>

Xsetvol bash script to set volume

Code: Select all

#!/bin/sh
VOLUME=`amixer get Master | grep 'Mono:' | cut -d '%' -f 1 | cut -d '[' -f 2`
VOLUME=`Xdialog 2>&1 --under-mouse --title "Volume Control" --icon /usr/share/mini-icons/audio-volume-high.png --ok-label Set --cancel-label Advanced --wrap --help "Click on Advanced to adjust Mic, input, CD and other settings." --rangebox "Master Volume" 9 45 0 100 $VOLUME`
if [ $? -eq 0 ];then
amixer set Master $VOLUME"%"
else
rxvt +sb -geometry 90x20 -e alsamixer
fi
aplay /usr/share/audio/2barks.au &

Posted: Fri 15 Jan 2010, 14:32
by technosaurus
I forgot to post a screenshot for my volume control script. It pops up a slider with a "Set" and "Advanced" button (will post a shot tonight)

Set: changes the Master Volume

Advanced: brings up an nicely formatted alsamixer

The problem with Xdialog is that it doesn't always behave as documented/expected.
1. exiting other than pressing cancel does not set $? to 255 (but maybe that is jwm?)
2. pressing the UP arrow in a slider menu makes the value go down (Lets call it pilot mode)
3. geometry is random XxY-X-Y does not give you an X by Y window X and Y from the bottom right


"rxvt +sb -geometry 90x20 -e alsamixer" should be the default for starting alsamixer in its .desktop file (maybe something in the title bar saying something like "Use your keyboard to change volume settings")

Posted: Sat 16 Jan 2010, 11:24
by bugman
ah, this is great, i love it, many thanks!!!

Posted: Sun 17 Jan 2010, 04:58
by technosaurus
bugman wrote:ah, this is great, i love it, many thanks!!!
I'm glad you approve - I had you in mind when I started doing this.

I've been trying to find the specific code that builds the drive icons... in the mean time a single icon for pmount works fair enough

What else am I missing?

Posted: Sun 17 Jan 2010, 11:21
by bugman
i'm using pmount for the cd, my hard drives are all mounted at boot

the pup event thing was always flaky for me anyways, sometimes it worked right, other times it brought up pmount anyways

i've also disabled cups and a couple of other unused services, and i use the 24px icons

kept absvolume and blinky as i like them--bad internet connection so blinky helps me keep an eye open, weird volume control on my speakers so absvolume is often used as well

my starting ram usage varies [why is that?], ranging from the high 40s to low 60s

8)

Posted: Mon 18 Jan 2010, 00:50
by technosaurus
I posted a new xfe here:
http://www.murga-linux.com/puppy/viewtopic.php?t=39223
this XFE uses < 1/2 of the resources that ROX does (but then I didn't try compiling ROX against static gtk2)
and a more resource friendly volume control in gtkdialog tips, but here it is again

make a symlink for Xdialog-notitle and set up a group to set its properties in the .jwmrc template - I have done it for Xdialog here to make a volume slider activated by a tray button (the symlink is so that programs that NEED the title bar will still have them) This should work for Gtkdialog as well.

<Group>
<Name>Xdialog-notitle</Name>
<Option>notitle</Option>
<Option>layer:12</Option>
</Group>

This will make it stay on top and have no title bar

here is the button for /root/.jwmrc-tray (it goes after the "dock" and before swallowed applets)

<Dock/><TrayButton popup="Audio Control" icon="audio-volume-high.png">exec:SetVol</TrayButton>
Quoting myself... now that is vanity.

Code: Select all

#!/bin/sh
VOLUME=`amixer get Master | grep 'Mono:' | cut -d '%' -f 1 | cut -d '[' -f 2`
VOLUME=`Xdialog-notitle --stdout --under-mouse --title "SetVol" --buttons-style text --icon /usr/share/mini-icons/audio-volume-high.png \
--ok-label Set --cancel-label Advanced --rangebox "Master Volume" 9 25 0 100 $VOLUME`
if [ $? -eq 1 ];then
rxvt +sb -geometry 95x20 -e alsamixer
else
amixer set Master $VOLUME"%"
fi
aplay /usr/share/audio/2barks.au &

Posted: Sun 24 Jan 2010, 01:46
by pri
great, now i have w bar from jwm.

now how to make it not covered with program windows, like originaly jwm taskbar? can it ?

Posted: Tue 22 Mar 2011, 20:17
by technosaurus
ok, some more ideas to extend jwm:

patch jwm make a generic message using the shutdown/restart verification: using jwm -msg "your message here"

(I still haven't figured out how to make icons opaque but the trays translucent)

use jwm -restart in scripts for regenerating trays (see pupng, and puplite for drive icon examples) ... could be used for a number of things

apply these to allow jwm to start at the beginning of init and update boot process in real time (with option to stay in Xvesa/jwm only env or to configure their system and switch to a full Xorg+rox environment)

Posted: Sat 14 May 2011, 07:29
by technosaurus
no patching necessary

a way to do notifications with jwm using no additional resources ... basically have a tray with a button whose text is the notification (with optional image and tooltip)
use an include in .jwmrc for ".jwmrc-notify" (not existent by default)
to generate one echo the xml data to .jwmrc-notify put at level 12, halign=center, y=0, tray, button, image, short notification, long notification (tooltip)
- clicking on it deletes the .jwmrc-notify xml file and then does jwm -refresh (cool eh?)

no code yet because no time

Posted: Sat 14 May 2011, 10:10
by sc0ttman
technosaurus wrote:no patching necessary

a way to do notifications with jwm using no additional resources ... basically have a tray with a button whose text is the notification (with optional image and tooltip)
use an include in .jwmrc for ".jwmrc-notify" (not existent by default)
to generate one echo the xml data to .jwmrc-notify put at level 12, halign=center, y=0, tray, button, image, short notification, long notification (tooltip)
- clicking on it deletes the .jwmrc-notify xml file and then does jwm -refresh (cool eh?)

no code yet because no time
sounds good... I'm gonna make a new Puplite at some point, wil defo keep my eye in this thread, as I used so much of it already!!