webOS Nation Forums >  webOS Developer Forums >  artxxork > Command Library - suggest new commands
Command Library - suggest new commands
  Reply
Like Tree2Likes
  • 1 Post By artxxork
  • 1 Post By artxxork

 
Thread Tools Display Modes
Old 03/10/2012, 04:36 PM   #1 (permalink)
Homebrew Developer
 
Posts: 144
Commander (since v0.0.6) supports 'command library' - simple oneliners and scripts that can be executed quickly by selecting command from list.

Currently these scripts are included (check /media/internal/appdata/xx.commander/lib after Commander v0.0.6+ is first time launched):
disk usage (USB partition)
du -h -d 1 /media/internal
disk usage (current directory)
du -h -d 1 .
memory usage
free
echo ""
ps aux | head -1 | awk '{print $2,$5,$6,$11}'
ps aux | awk '{if ($5 != 0 ) print $2,$5,$6,$11}' | sort -k2 -n -r
files greater than 10MB
find . -type f -size +10000k -exec du -h {} \;
files greater than 100MB
find . -type f -size +100000k -exec du -h {} \;
snapshot of the current processes
ps -ef
find duplicate files
...16 lines long script...
clear Adobe Reader's cache
rm -rf /media/internal/appdata/com.quickoffice.ar/.cache
clear Quickoffice's cache
rm -rf /media/internal/appdata/com.quickoffice.webos/.cache

It is possible to add your own commands after installation - simply add them into lib directory (with special comment line as first line - see existing files).

There are some limitations and special requirements for syntax and some restrictions due to service running as prisoner in jail ... so if you have ideas and suggestions - any useful non-interactive action that you want to have - feel free to post it here. If doable with given restrictions - will be included in next version of the library...
artxxork is offline   Reply With Quote
Liked by Wheel_nut likes this.
Thanked by Hollyman, migu_be, Wheel_nut
Old 03/10/2012, 04:42 PM   #2 (permalink)
Homebrew Developer
 
Posts: 144
screenshot
Attached Images
File Type: png lib.png (58.6 KB, 33 views) Email Attachment
artxxork is offline   Reply With Quote
Old 03/10/2012, 07:13 PM   #3 (permalink)
Member
 
Posts: 242
Will mount and umount commands work? I'm thinking of mounting and unmounting the USB for the Touchpad as described in this thread: http://forums.webosnation.com/hp-tou...e-kbd-etc.html. Would save opening executah and manually typing mount command etc.
renater is offline   Reply With Quote
Old 03/12/2012, 04:52 AM   #4 (permalink)
Homebrew Developer
 
Posts: 144
After some testing - YES, it will work - Commander v0.0.6+ comes with ability to run in 'nojail' mode. There will be option to enable global hotkey launcher (quickly press/release Home button twice) - if started this way then it will be launched as 'root'. Details how to enable it will be posted once 0.0.6 is in catalog (still waiting for 0.0.5 to be accepted, only then 0.0.6 can be uploaded)
artxxork is offline   Reply With Quote
Liked by renater likes this.
Thanked By: migu_be
Old 03/15/2012, 07:50 AM   #5 (permalink)
Member
 
Goyena's Avatar
 
Posts: 893
I was able to update Commander today to 0.0.5. Sweetness.
__________________
Pixi Plus - Pre Plus - Pre 2 - Pre 3 - Touchpad 1 ;-)
Goyena is offline   Reply With Quote
Old 03/15/2012, 07:55 AM   #6 (permalink)
Member
 
kevets's Avatar
 
Posts: 570
Definitely going to give this a try - awesome that you can kick off scripts this way.
__________________
White Z10, Touchpad 16GB [Retired: Pre 3, Pre 2, Pixi Plus, Pre Plus]
Back on a BlackBerry after 2 1/2 years with WebOS.

One-step Picasa batch image upload: http://forums.webosnation.com/hp-tou...ecl-webos.html
kevets is offline   Reply With Quote
Old 05/15/2012, 04:10 AM   #7 (permalink)
Member
 
Wheel_nut's Avatar
 
Posts: 426
Quote:
Originally Posted by renater View Post
Will mount and umount commands work? I'm thinking of mounting and unmounting the USB for the Touchpad as described in this thread: http://forums.webosnation.com/hp-tou...e-kbd-etc.html. Would save opening executah and manually typing mount command etc.
Have you or anybody else had success at running Scripts from the cmd facility of Command?

It seems to start the script but the script does not execute correctly. Could this be a "Path" problem?
Wheel_nut is offline   Reply With Quote
Old 05/15/2012, 04:39 AM   #8 (permalink)
Homebrew Developer
 
Posts: 144
Can you publish (example) script you are trying to run that does not work?
artxxork is offline   Reply With Quote
Old 05/15/2012, 07:57 AM   #9 (permalink)
Member
 
Wheel_nut's Avatar
 
Posts: 426
Quote:
Originally Posted by artxxork View Post
Can you publish (example) script you are trying to run that does not work?
Hi artxxork,

Sorry, it was my finger trouble. The Script was executing correctly all the time! My bad

I have also found a way to run shell scripts from the Just Type line which is almost as easy ac clicking on an Icon. See my posts here: http://forums.webosnation.com/hp-tou...ml#post3325181

However, Commander is a "one-stop-shop" which allows me to load OTG Drives and then manage them using your dual panel display so I am going to persevere with it and will come back here to report my experience.

Thank you for a great App.

Last edited by Wheel_nut; 05/23/2012 at 08:52 PM.
Wheel_nut is offline   Reply With Quote
Old 05/15/2012, 01:31 PM   #10 (permalink)
Member
 
Wheel_nut's Avatar
 
Posts: 426
First: A couple of suggestions:

a) on the cmd command line, the first character automatically gets capitalised. Since the cmd interpreter is case sensitive, this is a niggle

b) It would be nice if the panels either auto-refreshed or there was a refresh button. I am using the cmd line to mount and unmount USB OTG Drives so need to see these appear and disappear when mounted/ umounted.

c) It would be nice if the current item was highlighted in a different colour - or reversed background/ foreground. I use my TouchPad with the brightness set very low and this makes it difficult to see the current item.

That said, I am absolutely overwhelmed by the useability of your App. It lets me mount OTG Drives and transfer files to and from the TouchPad's native storage in a single application. Fantastic piece of work!

I have added two cmd library items in Folder: /media/internal/appdata/xx.commander/lib/

File 010-otg-mount-fat.sh
#library#mount up to four USB OTG Drives using otg script
otg

and

File 011-otg-unmount.sh
#library#unmount all USB OTG Drives
otg u
Wheel_nut is offline   Reply With Quote
Old 05/21/2012, 07:41 PM   #11 (permalink)
Member
 
Wheel_nut's Avatar
 
Posts: 426
Quote:
Originally Posted by artxxork View Post
Can you publish (example) script you are trying to run that does not work?
Hi Artxxork,

I managed to get a test script to ececute from cmd but my script to mount and umount OTG drives needs to be run with root access. Setting the WTerm misc Preferences to root works when WTerm is started from its icon but when it is kicked off from cmd or Just Type, it starts as non-root wterm.

I have posted in the Wterm forum here but have not had a response to date wTerm: The WebOS Terminal Emulator

Any help would be much appreciated.
Wheel_nut is offline   Reply With Quote
Old 05/22/2012, 04:20 AM   #12 (permalink)
Homebrew Developer
 
Posts: 144
Commander runs as root only when launched via hotkey ... Commander
artxxork is offline   Reply With Quote
Old 05/22/2012, 08:17 AM   #13 (permalink)
Member
 
Wheel_nut's Avatar
 
Posts: 426
Thank you Artxxork and sorry for posting in the wrong thread. I didn't see the other one.

I have now implemented the nojail trick and will test whethere wterm opens as root and report my findings in the Commander thread.

Many thanks for an excellent app and your attention.
Wheel_nut is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0