Pmxl Funny Business


Pleng

Well-Known Member
Joined
Dec 28, 2006
Messages
3,030
OK SO I've created two folders in my 'menu' directory, one called CPUSpeeds and one called MPlayer.

In CPUSpeeds there are a bunch of bash scripts and the following PXML.xml file:

Code:
<PXML xmlns="http://openpandora.org/namespaces/PXML">
 
 <application id="pleng_cpu_500">
      <title lang="en_US">Set CPU: 500Mhz</title>
      <description lang="en_US">
      Set the CPU speed of your Pandora to 500MMhz
      </description>
      <exec background="false" startdir="/" standalone="true" command="./500.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="System">
      </category>
      <category name="CPU">
      </category>
  </application>
  
  <application id="pleng_cpu_600">
      <title lang="en_US">Set CPU: 600Mhz</title>
      <description lang="en_US">
      Set the CPU speed of your Pandora to 600MMhz
      </description>
      <exec background="false" startdir="/" standalone="true" command="./600.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="System">
      </category>
      <category name="CPU">
      </category>
  </application>
  
  <application id="pleng_cpu_700">
      <title lang="en_US">Set CPU: 700Mhz</title>
      <description lang="en_US">
      Set the CPU speed of your Pandora to 700MMhz
      </description>
      <exec background="false" startdir="/" standalone="true" command="./700.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="System">
      </category>
      <category name="CPU">
      </category>
  </application>
  
  <application id="pleng_cpu_750">
      <title lang="en_US">Set CPU: 750Mhz</title>
      <description lang="en_US">
      Set the CPU speed of your Pandora to 750MMhz
      </description>
      <exec background="false" startdir="/" standalone="true" command="./750.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="System">
      </category>
      <category name="CPU">
      </category>
  </application>
  
  <application id="pleng_cpu_800">
      <title lang="en_US">Set CPU: 800Mhz</title>
      <description lang="en_US">
      Set the CPU speed of your Pandora to 800MMhz
      </description>
      <exec background="false" startdir="/" standalone="true" command="./800.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="System">
      </category>
      <category name="CPU">
      </category>
  </application>
  
  <application id="pleng_cpu_870">
      <title lang="en_US">Set CPU: 870Mhz</title>
      <description lang="en_US">
      Set the CPU speed of your Pandora to 870MMhz
      </description>
      <exec background="false" startdir="/" standalone="true" command="./870.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="System">
      </category>
      <category name="CPU">
      </category>
  </application>
  
</PXML>

And in the Mplayer directory is a single bash script and the following PXML.xml

Code:
 <PXML xmlns="http://openpandora.org/namespaces/PXML">
 
 <application id="pleng_mplayer">
      <title lang="en_US">Media Player</title>
      <description lang="en_US">
      Gnome's Media Player
      </description>
      <exec background="false" startdir="/" standalone="true" command="./mplayer.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="Game">
            </category>
  </application>
  
</PXML>

Now, I was expecting the CPU Speeds to appear in the System menu, and also create a new menu called CPU Speeds. As it happens, the items appear in "Accessories" and "Network"!!!

I was expecting Media Player to appear in the Game menu (I previously tried it with the category Multimedia, but it didn't show up anywhere) but it also showed up in Accessories and Network!!!

Worse still, none of the links actually work. When I click them, the SD access light flickers, but the cpu speeds don't change, and media player doesn't run. If I run the scrips directly from the directory they are stored in (the card is formatted in Fat32 so can't store permissions) they run perfectly.

I have tried the PXMLs both with and without the leading ./ in the command parameter.

What am I doing wrongs?
 
Pleng, would love to see your code, BUT for
me the show button has never worked ever
Using Konqueror in Slax

dave
 
@wdt

Code:
<PXML xmlns="http://openpandora.org/namespaces/PXML">
 
 <application id="pleng_cpu_500">
      <title lang="en_US">Set CPU: 500Mhz</title>
      <description lang="en_US">
      Set the CPU speed of your Pandora to 500MMhz
      </description>
      <exec background="false" startdir="/" standalone="true" command="./500.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="System">
      </category>
      <category name="CPU">
      </category>
  </application>
  
  <application id="pleng_cpu_600">
      <title lang="en_US">Set CPU: 600Mhz</title>
      <description lang="en_US">
      Set the CPU speed of your Pandora to 600MMhz
      </description>
      <exec background="false" startdir="/" standalone="true" command="./600.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="System">
      </category>
      <category name="CPU">
      </category>
  </application>
  
  <application id="pleng_cpu_700">
      <title lang="en_US">Set CPU: 700Mhz</title>
      <description lang="en_US">
      Set the CPU speed of your Pandora to 700MMhz
      </description>
      <exec background="false" startdir="/" standalone="true" command="./700.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="System">
      </category>
      <category name="CPU">
      </category>
  </application>
  
  <application id="pleng_cpu_750">
      <title lang="en_US">Set CPU: 750Mhz</title>
      <description lang="en_US">
      Set the CPU speed of your Pandora to 750MMhz
      </description>
      <exec background="false" startdir="/" standalone="true" command="./750.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="System">
      </category>
      <category name="CPU">
      </category>
  </application>
  
  <application id="pleng_cpu_800">
      <title lang="en_US">Set CPU: 800Mhz</title>
      <description lang="en_US">
      Set the CPU speed of your Pandora to 800MMhz
      </description>
      <exec background="false" startdir="/" standalone="true" command="./800.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="System">
      </category>
      <category name="CPU">
      </category>
  </application>
  
  <application id="pleng_cpu_870">
      <title lang="en_US">Set CPU: 870Mhz</title>
      <description lang="en_US">
      Set the CPU speed of your Pandora to 870MMhz
      </description>
      <exec background="false" startdir="/" standalone="true" command="./870.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="System">
      </category>
      <category name="CPU">
      </category>
  </application>
  
</PXML>
Code:
 <PXML xmlns="http://openpandora.org/namespaces/PXML">
 
 <application id="pleng_mplayer">
      <title lang="en_US">Media Player</title>
      <description lang="en_US">
      Gnome's Media Player
      </description>
      <exec background="false" startdir="/" standalone="true" command="./mplayer.sh"/>
      <version major="1" minor="1" release="1" build="1"/>
      <category name="Game">
            </category>
  </application>
  
</PXML>
 
EvilDragon said:
Well, without seeing your script or the output of /tmp/pndrun*, I can't tell you what's wrong.

Code:
 #!/bin/bash
 gnome-mplayer

It works just fine when I run it outside of the pnd.

pndrunpleng_mplayer.out:

Code:
 in fork!
 mountpoint: /media/mmcblk1p1
 /usr/pandora/scripts/pnd_run.sh: line 120: [: !: integer expression expected
 not mounted on loop yet, doing so
 Usage: grep [OPTION]... PATTERN [FILE]...
 Try `grep --help' for more information.
 Usage: grep [OPTION]... PATTERN [FILE]...
 Try `grep --help' for more information.
 Filetype is directory
 sudo mount --bind -o ro /media/mmcblk1p1/pandora/menu/Mplayer/ /mnt/pnd/pleng_mplayer
 mount: warning: /mnt/pnd/pleng_mplayer seems to be mounted read-write.
 mounting union!
 Filesystem is vfat
 /usr/pandora/scripts/pnd_run.sh: line 194: ././mplayer.sh: No such file or directory
 app exited
 rmdir: failed to remove `/mnt/utmp/pleng_mplayer': Device or resource busy
 rm: cannot remove `/mnt/utmp/pleng_mplayer': Is a directory
 rmdir: failed to remove `/media/mmcblk1p1/pandora/appdata/pleng_mplayer/.wh..wh.plnk': No such file or directory
 rmdir: failed to remove `/media/mmcblk1p1/pandora/appdata/pleng_mplayer/.wh..wh..tmp': No such file or directory
 rmdir: failed to remove `/media/mmcblk1p1/pandora/appdata/pleng_mplayer/': Directory not empty
 cleanup done


As for categories: XFCE4 expects standard Freedesktop Categories.

So why are items appearing in 'Network' and 'Accessories' when they've been assigned the category 'Game'?
 
Last edited by a moderator:
http://pandorawiki.org/PXML_specification#The_exec_element
# The startdir attribute specifies the starting directory (Also known as the working directory) that the application should start in. This should be a relative path to a directory within the PND package, or to a well-known directory in the Pandora file system.
startdir="/" means root, you know :p

EDIT:
http://pandorawiki.org/PXML_specification#The_categories_element
Example

<categories>
<!-- This app belongs in the "Game/StrategyGame" category -->
<category name="Game">
<subcategory name="StrategyGame"/>
</category>
<!-- This app also belongs in the "Graphics/ImageProcessing" category -->
<category name="Graphics">
<subcategory name="ImageProcessing"/>
</category>
</categories>

I think you should put your category tags inside a categories tag...
 
  1. Your categories are in an unbounded list. This shouldn't be; you have to do <categories>...</categories> and add your categories within. I'd like to have done the same for titles (e.g. <titles><title lang="zh">...</title></titles> or even better <localizations><localization lang="..."><title></title><description></description></localization></localizations>) but wasn't able to for legacy reasons related to the libpnd structure. Anyways: categories belong in a bounded list. See the archetype for more info: http://pandorawiki.org/PXML_archetype . That's why the things show up in the wrong menus: no categories are detected at all.
  2. Do you really want your scripts to start in root ("/")? Just leave out the attribute completely if you don't care.
  3. Clock speeds are only active until the specified application has quit. So the clock will only change for the duration of your script. I hope that you realize this. Also: I don't even know if most implementations respect the clockspeed attribute yet.

EDIT: :ph34r:, that's what I get for going afk while posting
 
dflemstr said:
  1. Your categories are in an unbounded list. This shouldn't be; you have to do <categories>...</categories> and add your categories within. I'd like to have done the same for titles (e.g. <titles><title lang="zh">...</title></titles> or even better <localizations><localization lang="..."><title></title><description></description></localization></localizations>) but wasn't able to for legacy reasons related to the libpnd structure. Anyways: categories belong in a bounded list. See the archetype for more info: http://pandorawiki.org/PXML_archetype . That's why the things show up in the wrong menus: no categories are detected at all.

OK. Will fix that. Thanks

  1. Do you really want your scripts to start in root ("/")? Just leave out the attribute completely if you don't care.

Aha I misread that in the wiki as to be relative to the PNDs root. must have been confusing it with something else. Might be worth adding to the Wiki that this is an optional attribute

  1. Clock speeds are only active until the specified application has quit. So the clock will only change for the duration of your script. I hope that you realize this. Also: I don't even know if most implementations respect the clockspeed attribute yet.

EDIT: :ph34r: , that's what I get for going afk while posting

I dont use the CPU speed attribute in PXML. I'm running scripts like this one:

Code:
#!/bin/bash
echo 700 > /proc/pandora/cpu_mhz_max
exit

Yes, I've chmoded the /proc/pandora/cpu_mhz_max to allow all to have write access
 
Last edited by a moderator:
Back
Top