Prepare Your Nokia X2 for Battle with Nokia X2 Tools

Unveiled in June this year, the Nokia X2 is the Finnish companys second crack at an … more

Increase the Speaker Volume of Your Samsung Gear 2 with Tool and Tutorial

I think its pretty safe to say that any sound coming out of a … more

Unlock Hidden Camera Settings on Your Moto G

At one point in time or another, weve all gotten very fiddly with the camera settings on our … more

XDA Partners with LG for Developer Challenge

Many Android enthusiasts know the name LG. LG is the maker of some Google Nexus devices and some … more
Post Reply

[APP][14/01/2011] FoddTweak using DynamicMenu - ROM customisation & Menu Tool Kit

11th December 2010, 04:07 PM   |  #1  
OP Senior Member
Flag Newcastle upon Tyne
Thanks Meter: 71
 
422 posts
Join Date:Joined: Nov 2008
Donate to Me
More
Hi there chef's! I'm not sure if any of you will find this useful but I'll post it in case you do...

I designed this little mortscript application so that users of my rom can tweak a few settings to their needs and because all of the other tweak applications couldn't be tweaked easily themselves without learning .NET or something similar.

I wasn't getting much feedback so I thought perhaps it wasn't customisable enough or maybe you didn't like my selection of tweaks. Perhaps you thought the menu layout sucked?

Anyway, to address those problems I've moved this on quite a way. It now includes a set of functions for creating Menu's. To Find out how, see the section titled DynamicMenu.

FoddTweak
  • Backup and restore of important data (Full registry, Titanium configuration, Start menu cpr files, Start menu icon registry settings)
  • Icon removal to save RAM (all, or all but settings (HTC icons are excluded))
  • Titanium plugin injection/removal and plugin order settings
  • Slide lock settings (both manila and wm6.5)
  • Enable/Disable Sleuth's myLocation service (soft-reset needed)
  • Enable/Disable start menu replacements and complete removal of the WM6.5 start menu

FoddTweak depends on a few things:
  • MortScript! (tested on 4.3.b15)
  • DynamicMenu (included in versions>0.0.1)
  • TICS Installer (for plugin injection/removal, included in versions>0.0.1)
  • FDC task manager (for backup purposes, included in versions>0.0.1)

DynamicMenu
It works like this; the menu system 'compiles' a master menu source file with extension mgs to it's component mgc files for each menu. If you want DynamicMenu to 'recompile' then just delete the top level compiled menu (e.g. If you add new options to "FoddTweak.mgs" then delete "FoddTweak.mgc" then re-run FoddTweak.)

This is a sample file, which is used to create menu's for the FoddTweak application:

Code:
menu(FoddTweak:Main Menu)
	item(Toggle Lock on Screen Dim:true:Call:"AnyRegWrite", "Toggle", "HKCU", "ControlPanel\Backlight", "AutoDeviceLockEnable")
	item(Sleuth's myLocation Service:true:Call:"AnyRegWrite", "Toggle", "HKLM", "Services\myLocation", "Enabled")
	item(:false)
	menu(RAM Savings:RAM Saving Options)
		item(Remove all Start Menu Icons:false:Call:"RmAllStartIcons")
		item(Remove all but Settings Icons:false:Call:"RmAllButSettings")
		item(Remove the Start Menu:false:Call:"RmStartMenu")
	endmenu
	item(:false)
	menu(WM6.5 Settings:WM6.5 Specific Settings)
		item(Toggle WM6.5 Slide Lock:true:Call:"AnyRegWrite", "Toggle", "HKLM", "Software\Microsoft\Shell\LockScreen", "Enable")
		item(:false)
		item(Titanium Plugin Injector:false:Call:"TitaniumPluginInjector")
		item(Titanium Plugin Uninstaller:false:Call:"TitaniumPluginUninstaller")
		item(Titanium Plugin Order:false:Call:"TitaniumPluginOrder")
	endmenu
	item(:false)
	menu(HTC Sense:HTC Sense Options)
		item(Toggle Sense 2.5 Slide Lock:true:Call:"AnyRegWrite", "Toggle", "HKCU", "Software\HTC\Manila", "Home.lock.Enabled")
		item(Toggle Sense Menu Replacement:true:Call:"ToggleSenseMenuRep", "Toggle")		
	endmenu
	item(:false)
	menu(Backup:Backup Options)
		item(Make Backup:false:Call:"Backup")
		item(Select Backup Folder:false:Call:"SelectBackup")
		item(:false)
		item(Restore ZIP Backup:false:Call:"RestoreZIP", backupdir\"*.zip", "\Windows")
		item(Restore REG Backup:false:Call:"RestoreREG", backupdir\"*.reg")
	endmenu
endmenu
Syntax
It should be quite obvious how the menu/submenu entries work with a title and description-those can be nested without any problems (though, I only tested one nesting at present.)

Menu syntax is a little restricted, you can't have the colon (":") symbol in the name or description as it's used as a field delimiter and they must be string literals:
Code:
menu(name:description)
...
endmenu
For your menu items, the ItemName and Mortscript Command are string literals. Arguments which are not enclosed in double quotes will be interpreted as variables (I haven't tested this though,) which obviously must be set by the calling script before the call to DynamicMenu().

You can make use of any Mortscript function that the script which calls DynamicMenu() has access to and of course Mortscript commands such as "Run" etc will also work just fine so with this you can access any system command as well.

The testing field for the items is important, if your function supports taking it's first argument as the word "test" and outputting something, that something will be output in brackets next to the menu item. Sounds vague? Well, it is. That something can be anything, true/false, a string. Whatever. So the idea is that it'll be used to denote whether a switch is on/off or the value of that particular menu item...
Code:
item(ItemName:Can it be tested?:Mortscript Command:Argument1, Argument2, ..., ArgumentN)
To put in a seperator you can include a blank line in the menu using the code below. I wouldn't recommend it due to differences in screen size, but if you wanted a dashed line as the seperator, for example, then just fill the first field with hyphens. Seperators are as follows:
Code:
item(:false)
It's a v.simple language, I haven't included any comment support and it's line by line but see what you make of it
Attached Files
File Type: 7z FoddTweak - 0.0.3.7z - [Click for QR Code] (368.5 KB, 347 views)
Last edited by arealityfarbetween; 16th January 2011 at 10:03 AM. Reason: Fleshed out syntax section of DynamicMenu description
The Following 3 Users Say Thank You to arealityfarbetween For This Useful Post: [ View ]
11th December 2010, 04:17 PM   |  #2  
ai6908's Avatar
Senior Member
Flag Land of Lincoln
Thanks Meter: 266
 
3,605 posts
Join Date:Joined: Nov 2006
Donate to Me
More
Interesting line of thinking. I like the idea of removing the SM icons. I will play with this and see what it can offer. Thanks...
14th January 2011, 05:10 PM   |  #3  
OP Senior Member
Flag Newcastle upon Tyne
Thanks Meter: 71
 
422 posts
Join Date:Joined: Nov 2008
Donate to Me
More
sorry to bump this, but I've updated the menu compiler a little so it shouldn't be thrown off by menus or items which have parentheses in the name or description...

Plus, I added the menu option for the RAM savings again. Hope you like it.
The Following User Says Thank You to arealityfarbetween For This Useful Post: [ View ]
14th January 2011, 08:20 PM   |  #4  
claros's Avatar
Senior Member
Flag L'Aquila
Thanks Meter: 6
 
250 posts
Join Date:Joined: Jul 2007
Quote:
Originally Posted by arealityfarbetween

sorry to bump this, but I've updated the menu compiler a little so it shouldn't be thrown off by menus or items which have parentheses in the name or description...

Plus, I added the menu option for the RAM savings again. Hope you like it.

Very good idea, trying it now

ciao
15th January 2011, 09:15 PM   |  #5  
ai6908's Avatar
Senior Member
Flag Land of Lincoln
Thanks Meter: 266
 
3,605 posts
Join Date:Joined: Nov 2006
Donate to Me
More
Removing the reg is almost equivalent to disabling the SM. I do love your concept, and have included this in my personal ROM...
16th January 2011, 03:09 AM   |  #6  
OP Senior Member
Flag Newcastle upon Tyne
Thanks Meter: 71
 
422 posts
Join Date:Joined: Nov 2008
Donate to Me
More
glad you like it that much!

I was hoping that chefs and users alike would get involved writing menu source files so if you think any would like this then point them to here. Tell them that, FoddTweak is the Tweakable Tweak app
16th January 2011, 03:34 PM   |  #7  
ai6908's Avatar
Senior Member
Flag Land of Lincoln
Thanks Meter: 266
 
3,605 posts
Join Date:Joined: Nov 2006
Donate to Me
More
I am still trying to get a grasp of the menu source! Havent checked into your latest files yet...but planning on soon...
19th May 2011, 01:01 AM   |  #8  
wapvirus's Avatar
Senior Member
Flag London
Thanks Meter: 70
 
1,716 posts
Join Date:Joined: Jan 2008
More
Thanks a bit late finding this but looks a great tool

Post Reply Subscribe to Thread

Tags
mortscript, xda_uc
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes