fixmenus: categories displayed in main menu

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

fixmenus: categories displayed in main menu

ASRI
This post was updated on .
Hello,

Last week I created a script that allows users to select categories displayed in the main menu. This allows to adjust the display to the user age (very convenient for children).
Everything worked perfectly.

Yesterday, I created a script to associate the size of icons in the main menu (and sub-menus) to the users preferences. For that, I used the last /usr/sbin/fixmenus (woof-ce testing).

Since then, I have a problem in the menu display.
I need your advice...

Thank you in advance.
Regards

--------------------------------------------------------
User GUI (to select /change users preferences)


--------------------------------------------------------
Current /etc/xdg/templates/_root_.jwmrc (for user kids 4)
 <RootMenu label="Menu" labeled="false" height="MENHEIGHT" onroot="3">
 
<!-- PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-desktop.menu -->
<!-- PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-system.menu -->
<!-- PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-setup.menu -->

  <Separator/>

<!-- PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-utility.menu -->
<!-- PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-filesystem.menu -->
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-graphic.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-document.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-calculate.menu
<!-- PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-personal.menu -->
<!-- PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-network.menu -->
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-internet.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-multimedia.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-fun.menu

  <Separator/>

--------------------------------------------------------
Result for main menu with new fixmenu (woof-ce)
Ok = size of icons (32 pixels)
Not Ok = all categories are displayed, even those that are commented (see _root_.jwmrc)


--------------------------------------------------------
Result for main menu with old fixmenu
Ok = only selected categories are displayed (see _root_.jwmrc)
Not Ok = size of icons (16 pixels)


--------------------------------------------------------
Differences between the new and the old fixmenus

New fixmenus
 cat $ONESRC |
 while read ONELINE
 do
  EXECMENU="`echo -n "$ONELINE" | grep -o 'PUPPYMENU.*' | cut -f 2-5 -d ' '`"
  if echo "$ONELINE" | grep -q "MENHEIGHT" ;then #131213 designed to be backward compatible
   [ "$MENHEIGHT" ] && echo $ONELINE | sed "s%MENHEIGHT%$MENHEIGHT%" >> $ONEDEST \
   || echo $ONELINE | sed "s%MENHEIGHT%24%" >> $ONEDEST
  elif [ "$EXECMENU" = "" ];then
   echo "$ONELINE" >> $ONEDEST
  else
   ${EXECMENU} ${MENHEIGHT} >> ${ONEDEST}
  fi
 done

Old fixmenus
# cat $ONESRC |
 while read ONELINE #130411
 do
# EXECMENU="`echo -n "$ONELINE" | grep -o 'PUPPYMENU.*' | cut -f 2-5 -d ' '`"
  case $ONELINE in #130411
   *PUPPYMENU*)   
      EXECMENU="${ONELINE##*U }" #remove bits before the "U "    
      #echo EXECMENU=$EXECMENU
      $EXECMENU >> ${ONEDEST}     ;;
   *) echo "$ONELINE" >> $ONEDEST ;;
  esac
 done < $ONESRC #130411
#done

--------------------------------------------------------

What I can not do: take advantage of the selection of categories (old fixmenus) and the size of the icons (new fixmenus).
Projet ASRI éducation => Association | Forum | Deposit
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: fixmenus: category view

ASRI
I think, I have a solution to not display commented categories.

Just need to add ^ before PUPPYMENU in line:
EXECMENU="`echo -n "$ONELINE" | grep -o '^PUPPYMENU.*' | cut -f 2-5 -d ' '`"

A possible commit for woof-ce (testing)...

Regards
Projet ASRI éducation => Association | Forum | Deposit
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: fixmenus: category view

ASRI
Commit added to woof-ce testing.
https://github.com/puppylinux-woof-CE/woof-CE/commit/483c409943e43389400ae89890430773de54b5b9
Thank you mavrothal.
Projet ASRI éducation => Association | Forum | Deposit
Loading...