Skip to main content

Custom Menus

Choose from a selection of different Start pages

The VM selector is usually the first page to load. As your collection of distros expands and as you add different folders, you may want to choose a more compact style of display.

You may have already tried the style previews from inside the VM menu. But you you can also customize too.

custom-vm-menu-arrowed

Originally for 1.6.03, now released in 1.7.02.

Add your name and greeting (difficulty level: easy)

Step One

With your file manager, go to your Default VM location, possibly $HOME/VMQ's, and create a folder called 'qqX.custom'.

In that folder, create an empty file and name it 'custom_vm_selectors'.

Step Two

From the release folder, navigate in the file manager to the folder 'qqX.main' and find the file 'qqX_VM_selector_styles'

Open this up in any standard text editor.

There are short notes at the bottom but we will explain all about those here:

##  Custom styles

if [[ -e "$Default_VM_Folder/qqX.custom/custom_vm_selectors" ]]; then source "$Default_VM_Folder/qqX.custom/custom_vm_selectors" ; fi

# Method: Use an existing style as a template. More than one function may be created.
# Create above stated folder & file. Add "#!/usr/bin/env bash" to line 1 then paste-in and edit the functions.
# Use style letters from end of alphabet eg R to Z Letters must be CAPS but sequence may be non-contiguous.

Those of you who already know Bash scripting will have noticed the 'if' line and see that qqX will automatically load our new file, if it finds it.

Open our new empty file in another tab of your text editor. If you don't have tabs, you will have to adapt this method. Most text editors should have them though.

Without the quotes, paste "#!/usr/bin/env bash" at the very top, at the start of line one.

Now switch tabs to the Styles script. Highlight and copy the style that you want to use. For example style E, which is at the bottom:

print_selector_array_E_style () {

....

}

All the way down the closing '}' brace, which is just before where the notes start.

Paste this into your new file and save.

Step Three

Most of the work is now done.

Change the style letter, in this case 'E' to another letter from the end of the alphabet, eg 'X' and add your greetings line:

custom-script-edit

In this case, line 11. printf "\n Hello ALEX \n"

Leave the other code, the style E items per line, unless customising further. Your style 'X' may still use the style E setting, if you wish.

Save and start up qqX. Open the settings file and set to style 'X'. Done. 🚀

Advanced

The custom file can hold several styles, as long as they all have different letters assigned to them.

Items per line may be manual assigned in fixed manners to each letter designation. For example style B single column:

vm-menu-b

Those of you who are more knowledgable with Bash scripts can obviously do more.

I look forward to possibly seeing some new designs being submitted. They don't have to be formal Pull Requests, if that is unfamiliar territory.

If they are sufficiently different and you think that others would like to use them, then pasting them as issues will be probably sufficient. Screenshots would be appreciated. Use treble backticks " ``` " to enclose the code.