Group and parametrize tweaks #241
Description
The idea
Currently the tweaks are as individual unparametrized idempotent functions. This was generally OK in the beginning of the project as all the tweaks were just enable/disable. Then we got things like #45, #55 or #78 where there were more than two possibilities how to customize one particular control or item.
E.g. in case of
HideTaskbarSearch / ShowTaskbarSearchIcon / ShowTaskbarSearchBox
we could have something like
TaskbarSearch -Hide
TaskbarSearch -Icon
TaskbarSearch -Box
or more PowerShell-y
TaskbarSearch -Type Hide
TaskbarSearch -Type Icon
TaskbarSearch -Type Box
Furthermore, we have tweaks like
HideDesktopFromThisPC / ShowDesktopInThisPC
HideDocumentsFromThisPC / ShowDocumentsInThisPC
HideDownloadsFromThisPC / ShowDownloadsInThisPC
HideMusicFromThisPC / ShowMusicInThisPC
HidePicturesFromThisPC / ShowPicturesInThisPC
HideVideosFromThisPC / ShowVideosInThisPC
Hide3DObjectsFromThisPC / Show3DObjectsInThisPC
which could also benefit from grouping and parametrization, so we'd have something like
HideFromThisPC -Desktop -Documents
ShowInThisPC -Downloads -Music
or
ThisPCLibraries -HideDesktop -HideDocuments -ShowDownloads -ShowMusic
or
ThisPCLibraries -Desktop Hide -Documents Hide -Downloads Show -Music Show
or
ThisPCLibraries -Hide "Desktop", "Documents" -Show "Downloads", "Music"
This has been also proposed (by @r3incarnat0r in #165 and possibly by others elsewhere) for bloatware removal functions where this would enable use of -AllUsers
and exclusion lists.
Lastly, proposals like #199 couldn't be even done by any other way as the complexity and repetition needed for such a tweak if it would be done in the classical way would be way too large.
Upsides:
Much lower number of individual tweak functions, as the tweaks would be grouped thematically.
Better possibilities for customization.
Hopefully more comprehensive tweaking as the user would see what options can one particular tweak have and wouldn't need to look up another tweaks just to get the overview. Also tab-completion would work in case of interactive scripting.
Downsides:
Absolutely all tweaks need to be renamed and rewritten. Basically the project would restart from scratch and it may be extremely confusing for occasional and non tech-savvy users.
Parametrization makes the tweaks more difficult to use as the user needs to know appropriate PowerShell syntax for appropriate data types.
It would be less obvious to determine what was the default value before modification and what would be the appropriate parameter to pass in order to restore the defaults. For this, Wiki proposed in #225 would help.
One of the core rules of the project would be broken, as the tweak function body couldn't be simply copy-pasted and run without any context anymore. Though this might be downside only for me. :)
Most importantly, the tweaks couldn't be passed directly from command line anymore as it would be no longer possible to properly parse all the options, not to mention correctly pass them to elevated command in case of RequireAdmin
. Only preset files could be used.