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 24 Jul 2014, 09:07
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
jwm_tools-0.9 (was jwm_menu_create)
Post new topic   Reply to topic View previous topic :: View next topic
Page 4 of 9 [124 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, 9 Next
Author Message
L18L

Joined: 19 Jun 2010
Posts: 2504
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Wed 31 Aug 2011, 13:56    Post subject: jwm_param_set  

Thanks for the explanation Smile
technosaurus wrote:

but if you would rather use jwm_param_set, I probably wasn't clear enough on the format

The format was clear for me.
Changing 1 value was OK but I did not get more than 1 changed correctly, parameter-value-pairs were set in the wrong order.

Could you show the code which has to be used for changing just
SUBMENU="true" DESKTOPS="3" please?

In my solution there is no limit to 9 values.
Anyhow the delimiter will have to be changed from # to |
echo "s|${param}\"${old_value}\"|${param}\"$new\"|" >>$new_values
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Wed 31 Aug 2011, 22:06    Post subject:  

to turn off submenus:
jwm_param_set 'SUBMENU=""'
to turn on submenus:
jwm_param_set 'SUBMENU="any_value"'

sed is pretty efficient at doing these kinds of things - feel free to use any tool of preference, I am just providing a shell only one that does the job ... I will be downloading yad from svn to test it out

as for setting desktops I am using the syntax in jwm-svn500 (which is in Wary) that has width and height vs. just count, but trying to make it compatible with older versions too.
(I started to implement it in v0.6, but wanted to test in an older jwm)
here is the current desktop background code that will be in v0.7
Code:
{ #desktop settings
MENU=${MENU}'
<Desktops count="'${DESKTOPS:-$((${DESKTOPWIDTH}*${DESKTOPHEIGHT}))}'" width="'${DESKTOPWIDTH}'" height="'${DESKTOPHEIGHT}'">
'
i=1 DESKNUM=1
while ([ $i -le ${DESKTOPHEIGHT} ]) do
   j=1
   while ([ $j -le ${DESKTOPWIDTH} ]) do
      DESKTOPNAME=$i","$j
      DESKTOPBGTYPE=`eval echo '$DESKTOPBG'${DESKNUM}'TYPE'`
      DESKTOPBG=`eval echo '$DESKTOPBG'${DESKNUM}`
      [ $DESKTOPBGTYPE ] && MENU=${MENU}'
   <Desktop name="'${DESKTOPNAME}'">
      <Background type="'${DESKTOPBGTYPE}'">'${DESKTOPBG}'</Background>
   </Desktop>
'
   DESKNUM=$(($DESKNUM+1))
   j=$(($j+1))
   done
   i=$(($i+1))
done

MENU=${MENU}'
</Desktops>
'
}


Note: "jwm -restart" takes much longer with multiple/different stretched jpg backgrounds

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Thu 01 Sep 2011, 02:20    Post subject:  

v0.7 released, see initial post for pet

bugfixes (some typos and omissions - thanks maxerro)
reworked jwm_param_set to be able to unlimited values
included L18L's gui for wider testing
logical partitions and swap drives no longer show up in drive tray
media cards are now displayed in the drive tray
added the desktop related stuff including backgrounds and new jwm500 formatting
TODO - update jwm_image_view to change background now

NOTE - the default settings in the JWMRC are set to show multiple per-desktop background images ... these settings are temporary and only for demonstration purposes, because it hogs a lot of RAM and drastically increases the time to do a "jwm -restart"

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2504
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Thu 01 Sep 2011, 13:40    Post subject: jwm_param_gui  

Code:
#!/bin/sh
# jwm_param_gui
# version added, same as jwm_tools
# no more sed
# fixed:blank in values
# filtered empty lines and commented lines
# form field types: number, font, combo and color
# TODO: images...
#
version=0.7
conf=${HOME}/.jwm/JWMRC
. $conf

text1=$(gettext "Select <span color='darkgreen'>one</span> ore <span color='darkred'>several</span> items
 then click or press OK button
 to change the <span color='darkred'>values</span> of the <span color='darkgreen'>selected</span> items")

text2=$(gettext "Now change value")

# ask what has to be changed
change_it=$(cat $conf \
| yad --title="jwm-tools $version"  --image="gtk-preferences" --text="$text1" --height=300 \
      --list --multiple \
      --column="" \
| tr ' ' '_' ) # ex: DejaVu Sans12 -> DejaVu_Sans12
choice=$?
[[ $choice -eq 1 || $choice -eq 252 ]] && exit 0     
echo $change_it
 
# let user change selected values

for ONEchange in $change_it ; do
    case "${ONEchange:0:1}" in
      "|") continue;; # was blank line
      "#") continue;; # was comment
   esac      
    param=${ONEchange//${ONEchange#*=}}
    old_value=`echo "$ONEchange" | cut -d '"' -f 2`
   
    field_type=""
    case $param in
#         SUBMENU=) field_type=':CHK';;
#          DRIVES=) field_type=':CHK';;
           *FONT*) field_type=':FN';;
        DESKTOPS=) field_type=':NUM';;
          *WIDTH=) field_type=':NUM';;
         *HEIGHT=) field_type=':NUM';;
          *SPEED=) field_type=':NUM';;
          *DELTA=) field_type=':NUM';;
       *DISTANCE=) field_type=':NUM';;
              BG=) :               ;;
             *BG=) field_type=':CLR';;
             *FG=) field_type=':CLR';;
        *OUTLINE=) field_type=':CLR';;
           *TEXT=) field_type=':CLR';;
    esac
    field_values=""
    case $param in
        SUBMENU=) field_type=':CB' && field_values='!TRUE!FALSE';;
         DRIVES=) field_type=':CB' && field_values='!TRUE!FALSE';;
         *MODEL=) field_type=':CB' && field_values='!sloppy!click';;
       SNAPMODE=) field_type=':CB' && field_values='!none!sreen!border';;
       MOVEMODE=) field_type=':CB' && field_values='!outline!opaque';;
     RESIZEMODE=) field_type=':CB' && field_values='!outline!opaque';;
    esac
   
   
    new=$(yad --image="gtk-edit" --text="$text2" \
              --form \
              --field="${param}${field_type}" "$old_value${field_values}" \
          | cut -d '|' -f1 \
          | tr '_' ' ' # ex: DejaVu_Sans12 -> DejaVu Sans12
         )

    # apply change
    jwm_param_set $param'"'"$new"'"'
done

#jwm_menu_create && jwm -restart

#end

Smile
Edited:
forget this one please
Use next 2 posts down

Last edited by L18L on Sun 04 Sep 2011, 11:57; edited 1 time in total
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Fri 02 Sep 2011, 17:49    Post subject:  

thinking of adding support for sfs handling as part of the trays implementation (the rox part at the end will be replace with a read of the desktop file for Exec=)

I currently have it mounting and linking an sfs then running all apps in that sfs with a *.desktop file (or unlinking and unmounting if already mounted)

here is the code I have so far:
Code:
#!/bin/ash

linkmount(){ # link/copy as appropriate everything in dir $1 and suffix list them in $2
[ ! -d ${1} ] && echo usage $0 /mnt/directory not $1 && exit
for F in ${1}/* ; do #all files in directory passed in 1st arg
NF=/${F#/*/*/} #packages are mounted at /mnt/package ... remove those for its "/" equivalent
if [ -L ${F} ];then #we need to do symlinks 1st in case a dir is a symlink to .
   busybox cp ${F} ${NF} && echo ${NF} >>${2} #we copy symlinks in case they are a relative path
# the echo after && only executes if cp has no errors, but cp without -f errors and doesn't
#overwrite an existing file ... that way we only get a list of new files that can be removed
elif [ -d ${F} ];then #better to make directories than symlink them... no real size anyways
#and a symlink would prevent anything within from being writeable
   [ ! -e ${NF} ] && mkdir ${NF} && echo ${NF} >>${2}
   linkmount ${F} $2 & #this is recursion + threading in action
elif [ -f ${F} ];then # -f tells us its _not_ a block or char device ... they need write capability
   busybox ln -s ${F} ${NF} && echo ${NF} >>${2} # todo cp files in $HOME may need 2b rw
else # we assume it does need to be copied (block or char device)
   busybox cp ${F} ${NF} && echo ${NF} >>${2}
fi
done
}
mntdir=/mnt/${1##*/} # we will use /mnt + the filename as the mount location
if [ -d ${mntdir} ];then #if it exists we unmount and remove otherwise mount & run.
while read LINE; do #we are getting the list of files to remove
[ -d ${LINE} ] && rmdir ${LINE} || rm ${LINE} # rmdir directories & rm files
done <${HOME}/.packages/${1##*/}.files
rm ${HOME}/.packages/${1##*/}.files #now that the file are gone this is garbage
umount ${mntdir} #might as well unmount it and free a loop
rmdir ${mntdir} #harmless to leave, but we use it as our toggle switch
else
mkdir -p ${mntdir} # we need to create the place we will mount it.
busybox mount ${1} ${mntdir} # mount the filesystem using busybox for automatic loops
linkmount ${mntdir} ${HOME}/.packages/${1##*/}.files 2>/dev/null #silence output because
#we need the cp,ln errors for preventing "clobbering" and for creating the list of new files.
sleep 1 # wait a little bit in case recursion threads are still going.
[ -e ${mntdir}/usr/share/applications ] && rox ${mntdir}/usr/share/applications/*
#start the GUI app(s) ... todo remove dep on rox using the Exec= line ... just lazy now
fi

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2504
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Sun 04 Sep 2011, 11:52    Post subject: jwm_tools-0.7 (was jwm_menu_create)
Subject description: jwm_param_gui
 

Code:
#!/bin/sh
# jwm_param_gui
# version added, same as jwm_tools
# filtered empty lines and commented lines
# form field types: number, font, combo and color
#                   file for images (jpg and png)
# fonts: selection in yad from installed fonts, format example: DejaVu Sans 12
# TODO: further testing, ranges for numeric values
#
version=0.7.1
jwm_param_gui-0.7.1.png
 Description   
 Filesize   22.31 KB
 Viewed   1099 Time(s)

jwm_param_gui-0.7.1.png

jwm_param_gui.gz
Description  /usr/bin/jwm_param_gui
gz

 Download 
Filename  jwm_param_gui.gz 
Filesize  1.27 KB 
Downloaded  273 Time(s) 
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Tue 06 Sep 2011, 19:51    Post subject:  

here is the updated sfs linker and executor that _should_ work with multiuser and is toolkit independent (only requires jwm)
Code:
#!/bin/ash

linkmount(){
[ ! -d ${1} ] && echo usage $0 /mnt/directory not $1 && exit
for F in ${1}/* ; do
   NF=/${F#/*/*/} #the root of the mount
   case ${NF} in #multiuser support
      /root*)NF=${HOME}/${NF#/*/}
   esac
   if [ -L ${F} ];then #handle symlinks first in case of looping links (ex ., ../)
      cp ${F} ${NF} && echo ${NF} >>${2}
   elif [ -d ${F} ];then #if its a directory, we want to thread and recurse it
      [ ! -e ${NF} ] && mkdir ${NF} && NEWDIR=true
      linkmount ${F} $2 &
      [ $NEWDIR ] && echo ${NF} >>${2}
   elif [ -f ${F} ];then #we can just use symlinks for all but dir & nodes
   case ${NF} in
      ${HOME}*)cp ${F} ${NF} && echo ${NF} >>${2};;
      *)ln -s ${F} ${NF} && echo ${NF} >>${2};;
   esac
else #for /dev/* mostly ... we need write access to block/char devices
   cp ${F} ${NF} && echo ${NF} >>${2}
fi
done
}

mntdir=/mnt/${1##*/}

if [ -d ${mntdir} ];then
   while read LINE; do
      [ -d ${LINE} ] && rmdir ${LINE} || rm ${LINE} &
   done <${HOME}/.packages/${1##*/}.files
   rm ${HOME}/.packages/${1##*/}.files &
   umount ${mntdir} &&   rmdir ${mntdir} &
else
   mkdir -p ${mntdir} 2>/dev/null
   busybox mount ${1} ${mntdir} 2>/dev/null
   linkmount ${mntdir} ${HOME}/.packages/${1##*/}.files 2>/dev/null
   sleep .2
   if [ -d ${mntdir}/usr/share/applications ];then
      for PROG in ${mntdir}/usr/share/applications/*.desktop; do
         while read LINE; do
            case $LINE in
               Name=*)NAME=${LINE#*=};;
               Exec=*)EXEC=${LINE#*=};;
               Comment=*)COMM=${LINE#*=};;
               Icon=*)ICON=${LINE#*=};;
            esac
         done <${PROG}
         #one prog
         jwm_notify "${NAME}" "${COMM}" "${ICON}" "${EXEC}" close "click here to continue without running $NAME" mini-stop.xpm exit
      done
   fi
fi

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Tue 27 Sep 2011, 14:34    Post subject:  

I just got a bug report by PM about *.desktop files that dont end with a new line character using the desktop entry from the previous

the fix is to replace;

read LINE;
with
read LINE || [ "$LINE" ];

there are several occurrences of this and I _may_ need to a LINE="" prior to the loop?

(this fix will be in 0.Cool

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Tue 27 Sep 2011, 17:06    Post subject:  

that wasn't as bad as I thought it would be, I even added support for groups see first post for an update to 0.8

Edit:
OOps I broke keybindings trying to type in Barry's woof compat fix for the pinstall script - fixed and uploaded

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Sat 08 Oct 2011, 23:33    Post subject:  

New Todo, rewrite udevd and possibly other daemons into a single shell daemon.
http://www.bangmoney.org/presentations/hotplug/

Still todo: keybindings, trays, more translations

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2372
Location: UK

PostPosted: Thu 20 Oct 2011, 10:57    Post subject:  

I had some thoughts, these may not be of any use to you, but I think I'll have a go myself, as I need this in Akita:

Update jwm_menu_create:

- try to remove duplicates if they end up in same sub category

- maybe remove all non JWM .desktop files??

For example, in a .desktop file, we can add 'WM=openbox' or 'WM=windowmaker', and jwm_menu_create can skip any files which contain WM= (when not WM=jwm)...

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Thu 20 Oct 2011, 19:56    Post subject:  

sc0ttman wrote:
I had some thoughts, these may not be of any use to you, but I think I'll have a go myself, as I need this in Akita:

Update jwm_menu_create:

- try to remove duplicates if they end up in same sub category

- maybe remove all non JWM .desktop files??

For example, in a .desktop file, we can add 'WM=openbox' or 'WM=windowmaker', and jwm_menu_create can skip any files which contain WM= (when not WM=jwm)...

Part 1 is doable just keep a throwaway variable that contains each subcategory as it is added then use a case ... to check before adding

The 2nd seems like non standard .desktop files, so probably not, however I could have it optionally scan an additional directory like maybe:
$HOME/.jwm/applications/*.desktop
/usr/share/applications.jwm/*.desktop

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
scsijon

Joined: 23 May 2007
Posts: 1020
Location: the australian mallee

PostPosted: Fri 11 Nov 2011, 23:25    Post subject: problems after jwm2-505.pet added!  

Technosausus, with jwm2-505's pet loaded, jwm tools no longer works properly.

I'm getting :

a 2x3 virtual desktop, even if set as 1x1 in jwm config manager, and I can't change it;

multiple menu items for the same application appearing;

it won't start (but no error message either onscreen or the logs).

If I unload 0.8 it's all back to normal(, 0.7 gives the same result).

Could you have a look please.

thanks
scsijon
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4277

PostPosted: Sat 12 Nov 2011, 03:30    Post subject:  

jwm config manager is not distributed with jwm_tools and probably makes some assumptions about include files, you can try jwm_param_gui (requires yad) - thus far that is the only gui that is supported (but it doesn't currently have a menu entry) or if you find out what include file jwm config manager stores the desktop config in, I can add it to the list of include files that are there to support other/legacy jwm config apps (though it would be much better to to just have jwm config modify the JWMRC file directly if possible)

The multiple menu items are there because the developers wanted it to be in multiple categories (they put multiple categories in the .desktop file) If you use submenus, there shouldn't be duplicates in the same submenu though.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
scsijon

Joined: 23 May 2007
Posts: 1020
Location: the australian mallee

PostPosted: Sat 12 Nov 2011, 18:20    Post subject:  

technosaurus wrote:
If you use submenus, there shouldn't be duplicates in the same submenu though.


their are though, in at least the latest wary and lucid528!

and sorry but the first paragraph is goggledegoop to me this morning, rebuilding after losing the dev box's brand new hard drive is still getting to me. The jwm config manager is part of puppy, and to use the gui I also need to have yad installed, is that right?

regards
scsijon
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 4 of 9 [124 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, 9 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
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.1224s ][ Queries: 12 (0.0105s) ][ GZIP on ]