Skip to content

Command Reference

ppkantorski edited this page Sep 5, 2024 · 73 revisions

Make sure to follow the correct syntax and provide the required arguments for each command.

You can configure these commands in the package.ini file by specifying them under the corresponding options. Make sure to provide the necessary arguments as described for each command.

Ultrahand currently supports the following commands:

System Commands

  • reboot: Restarts the system. Can also be used to reboot into Hekate / UMS or Hekate ini boot entries by entry name.

    • Usage: reboot or reboot hekate or reboot ums or
      • reboot boot <NAME_OF_BOOT_ENTRY> (for entries within hekate_ipl.ini)
      • reboot ini <NAME_OF_INI_ENTRY> or reboot ini <NAME_OF_INI_ENTRY> <DUPLICATE_INDEX>
  • shutdown: Shuts down the system or all bluetooth controllers.

    • Usage: shutdown or shutdown controllers
  • backlight: Modify the current backlight value.

    • Usage: backlight on or backlight off or backlight <PERCENTAGE_INTEGER>

Filesystem Commands

  • make or mkdir: Creates a directory.

    • Usage: mkdir <directory_path>
  • copy or cp: Copies a file or diectory.

    • Usage: copy <source_file_path> <destination_file_path>
  • mirror_copy or mirror_cp: Mirrors the contents of a directory.

    • Usage: mirror_copy <source_file_path> <destination_file_path>
  • delete or del: Deletes a file or directory.

    • Usage: delete <file_path>
  • mirror_delete or mirror_del: Uses contents of a source directory as for files to remove within the destination path.

    • Usage: mirror_delete <source_file_path> <destination_file_path>
  • move or mv: Moves/renames a file/directory to a new location/label.

    • Usage: move <file_path> <destination_directory_path>
  • download: Downloads files from a specified URL to a local destination.

    • Usage: download <file_url> <destination_file_path>
  • unzip: Extracts files from a specified ZIP archive to a local destination.

    • Usage: unzip <zip_file_path> <destination_file_path>

INI Commands

  • set-ini-val or set-ini-value: Edits/makes an INI file by updating/adding a section with a desired key-value pair.

    • Usage: set-ini-val <file_to_edit> <desired_section> <desired_key> <desired_value>
  • set-ini-key: Edits an INI file by updating a section with a new key.

    • Usage: set-ini-key <file_to_edit> <desired_section> <desired_key> <desired_new_key>
  • remove-ini-section: Remove a section from an INI file.

    • Usage: remove-ini-section <ini_file_path> <section_name>

Hex Editing Commands

  • hex-by-offset: Edits the contents of a file at a specified offset with the provided hex data.

    • Usage: hex-by-offset <file_path> <offset> <hex_data>
  • hex-by-custom-offset: Edits the contents of a file at a specified custom pattern offset with the provided hex data.

    • Usage: hex-by-custom-offset <file_path> <custom_pattern> <offset> <hex_data>
  • hex-by-swap: Edits the contents of a file by replacing a specified hex data with another.

    • Usage: hex-by-swap <file_path> <hex_data_to_replace> <hex_data_replacement>
  • hex-by-decimal: Edits the contents of a file by replacing a specified decimal data with another.

    • Usage: hex-by-decimal <file_path> <decimal_data_to_replace> <decimal_data_replacement>
  • hex-by-rdecimal: Edits the contents of a file by replacing a specified reverse decimal data with another.

    • Usage: hex-by-rdecimal <file_path> <decimal_data_to_replace> <decimal_data_replacement>
  • hex-by-string: Edits the contents of a file by replacing a specified string data with another.

    • Usage: hex-by-string <file_path> <string_data_to_replace> <string_data_replacement>

Mod Conversion Commands

  • pchtxt2ips: Converts a .pchtxt mod into a .ips.

    • Usage: pchtxt2ips <pchtxt_file_path> <output_file_path>
  • pchtxt2cheat: Converts and installs a .pchtxt mod into a cheat.

    • Usage: pchtxt2cheat <pchtxt_file_path>

Sourced Placeholder Functions

  • * (Asterisk):

    • The asterisk * is often used as a wildcard or placeholder, representing a value that will be dynamically filled in during execution. It's commonly used in contexts where specific values are expected, and the actual value will be determined at runtime.
  • package_source:

    • Package source allows users to forward one Ultrahand package ini from another. Can help users organize their code as well as chain up longer menus.
    • Used with ;mode=forwarder, called package_source /path/to/forwarder_package.ini.
  • list_source:

    • List source is a way to store variables for dropdown menus within the package.ini. It's used as a placeholder for the individual values within the list source variable. The code replaces list_source references with the corresponding value.
  • list_file_source:

    • Similar to list_source but utilizes a text file directory as input with the text file containing each entry separated by newlines.
  • file_source:

    • Representation of a source file or resource. It's a placeholder for the actual filename or source location. The code replaces source with the appropriate file path when executing certain commands.

      Here's a breakdown of the additional variables accessible by use of file_source:

      • file_name: The name of the individual file.
      • folder_name: The name of the parent folder for the file.
    • file_source in an on: section implies that a command or action should be executed when a specific source is "on" or enabled.

    • file_source in an off: section implies that a command or action should be executed when a specific source is "off" or disabled.

    • Evaluates the state of a toggle or a condition and then selects the appropriate command for execution based on whether the source is on or off.

    • For file_source function toggles, please refer to the Broomstick package example.

  • ini_file_source:

    • Similar to list_file_source but utilizes entry names from an ini file for its list value. It also retains other ini functions similar to ini_file.
  • json_file_source:

    • This command is used to define a JSON data source. It specifies a file path to a JSON file that contains data. This JSON data source is used for various purposes within the code.
    • The code reads data from the specified JSON file, and based on the context and logic in the code, it may perform actions or operations using this data.
    • In some cases, it might also accept an additional argument (e.g., jsonKey) to indicate a specific key or property within the JSON data to be used for display or processing.
    • This command is used to retrieve structured data from JSON files and incorporate it into the program's functionality.

    Here's a breakdown of the additional variables accessible by use of json_file_source:

    • jsonPath: The file path to the JSON data source.

    • jsonKey: An optional key within the JSON data for specific data retrieval.

    • For information on json_file_source function implementations, please refer to the Easy Installer package example.

Placeholder Functions

{ram_vendor}

  • Description: Returns the vendor of the device's RAM.
  • Example: Displays "Samsung" for a device with Samsung RAM.

{ram_model}

  • Description: Returns the model number of the RAM in the device.
  • Example: Displays "M471A1K43BB1-CTD" as the model number.

{ams_version}

  • Description: Returns the Atmosphere version installed on the device.
  • Example: Displays "1.4.0" for Atmosphere version 1.4.0.

{hos_version}

  • Description: Returns the Horizon OS version.
  • Example: Displays "17.0.0" for Horizon OS version 17.0.0.

{cpu_speedo}

  • Description: Returns the CPU speedo value of the device.
  • Example: Displays "0x1F" for the device's CPU speedo value.

{cpu_iddq}

  • Description: Returns the CPU IDDQ value of the device.
  • Example: Displays "0x03" for the device's CPU IDDQ value.

{gpu_speedo}

  • Description: Returns the GPU speedo value of the device.
  • Example: Displays "0x2A" for the device's GPU speedo value.

{gpu_iddq}

  • Description: Returns the GPU IDDQ value of the device.
  • Example: Displays "0x04" for the device's GPU IDDQ value.

{soc_speedo}

  • Description: Returns the SOC speedo value of the device.
  • Example: Displays "0x10" for the device's SOC speedo value.

{soc_iddq}

  • Description: Returns the SOC IDDQ value of the device.
  • Example: Displays "0x05" for the device's SOC IDDQ value.

{slice(<STRING>,<START_INDEX>,<END_INDEX>)}

  • Description: Slices a string based on the provided start and end indices.
  • Parameters:
    • <STRING>: The string to be sliced.
    • <START_INDEX>: The starting index of the slice.
    • <END_INDEX>: The ending index of the slice.
  • Example: {slice("Test String", 0, 4)} returns "Test".

{decimal_to_hex(<DECIMAL>)}

  • Description: Converts a decimal number to a hexadecimal string.
  • Parameters:
    • <DECIMAL>: The decimal number to convert.
  • Example: {decimal_to_hex(255)} returns "FF".

{ascii_to_hex(<ASCII>)}

  • Description: Converts an ASCII string to its hexadecimal representation.
  • Parameters:
    • <ASCII>: The ASCII string to convert.
  • Example: {ascii_to_hex("Test")} returns "54657374".

{hex_to_rhex(<HEX>)}

  • Description: Converts a hexadecimal string to reverse-endian hexadecimal.
  • Parameters:
    • <HEX>: The hexadecimal string to convert.
  • Example: {hex_to_rhex("12345678")} returns "78563412".

{hex_to_decimal(<HEX>)}

  • Description: Converts a hexadecimal string to its decimal representation.
  • Parameters:
    • <HEX>: The hexadecimal string to convert.
  • Example: {hex_to_decimal("FF")} returns "255".

{split(<STRING>,<PATTERN>,<INDEX>)}

  • Description: Splits a string based on a pattern and returns a specific portion.
  • Parameters:
    • <STRING>: The string to split.
    • <PATTERN>: The pattern used to split the string.
    • <INDEX>: The index of the split portion to return.
  • Example: {split("Test - String", " - ", 0)} returns "Test".

{value}

  • Description: Returns the current value of a trackbar or slider.
  • Example: Used in trackbars to display the current selected value.

{index}

  • Description: Returns the current index of a selection or list.
  • Example: Used to indicate the position of an item in a list or dropdown.

{list_source(<INDEX>)}

  • Description: Fetches an item from a list defined earlier using list_source.
  • Parameters:
    • <INDEX>: Index of the item in the list.
  • Example: {list_source(0)} fetches the first item in the list.

{json_source(<KEY>)}

  • Description: Fetches a value from a JSON source based on the provided key.
  • Parameters:
    • <KEY>: The key to look up in the JSON object.
  • Example: {json_source("title")} fetches the value associated with the "title" key in a JSON object.

{ini_file(<SECTION>, <KEY>)}

  • Description: Returns the value of a key in a specific section of an INI file.
  • Parameters:
    • <SECTION>: The section in the INI file.
    • <KEY>: The key within the section.
  • Example: {ini_file("Settings", "Language")} returns the value for the "Language" key under the "Settings" section.

Command Modes

  • Documentation coming soon.

Notice: Advancements are faster than my ability to make clear documentation right now. Once things settle down, I'll work more on this wiki a bit. Lot's of new packages can be created with the improvements that have been added to v1.3.6+.

Clone this wiki locally