Jump to content
Software FX Community

Personalization part 1. Desktop Gadgets


Recommended Posts

When we say personalization we are referring to a feature in PowerGadgets where gadgets will remember previously used settings, these can be simple such as window location and size or customizations to any visual attributes e.g chart colors, gallery type, fonts, etc. This is particular handy for floating gadgets as you can place them in a specific location in your desktop and they will remember their layout for future sessions.

Personalized gadgets are simply files saved with a PGT extension (as they are in fact identical to templates you create using the -config parameter). The location of these files is a subdirectory of the current user's roaming profile and the actual path depends on the operating system.

In Vista:C:\Users\<YourUserName>\AppData\Roaming\PowerGadgets, LLC\PowerGadgets\Personalization

In XP:C:\Documents and Settings\<YourUserName>\Application Data\PowerGadgets, LLC\PowerGadgets\Personalization

Some of the implementation details depend on how gadgets are created, also note that gadgets in the sidebar are handled differently than desktop gadgets. We will talk about sidebar personalization in a future post.

PowerShell Gadgets

By default PowerShell created gadgets will not be personalized as we need some way to identify a specific gadget, this is done when you use the -name parameter as follows

ps | out-chart -values WorkingSet -name PSCHart

By assigning a name we can now store and remember any personalizations to the gadget. A file named PSChart.pgt will be saved if you modify any of the gadget settings. Groups are a little different, e.g.

ps | out-chart -values WorkingSet -group MyGroup -name Processesget-date -uformat %r | out-gauge -group MyGroup -name Time

In this case we will save the global settings such as window size and location in a file named MyGroup.pgt while visual attributes will be saved on MyGroup.Processes.pgt and MyGroup.Time.pgt. Note that we also use the name to label the current tab in a gadget group.

PowerGadgets Creator

Gadgets generated using Creator are automatically personalized, to support this we generate a GUID when a gadget file is created or you use the Save As menu option, this means that personalization templates will have very long names but we do not expect users to handle these files and it allows us to expose this feature without the need to prompt a name. This also means that personalizations are not lost if you rename your gadget files or move them to a different folder. In groups, the file names for individual items in a group are saved concatenating the GUID with the item's index.

Personalizations also use a sort of version number, when you make modifications to a PGF PowerGadgets creator will increment its version so that old customizations are ignored, additionally you can turn off personalization by unchecking the "Edit - Desktop Settings - Personalizable" menu item. 

Note that these GUIDs used for personalization only so if you want 2 or more PGF files to share its personalizations you could use notepad or any other text editor to copy the <GUID> tag.


Link to comment
Share on other sites

  • Create New...