Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| usage_of_batocera-settings [2023/10/06 12:08] – [Older versions (Batocera 30, 5.27.2 and earlier)] crcerror | usage_of_batocera-settings [2023/10/09 18:41] (current) – python example works now crcerror | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| <WRAP center round info> | <WRAP center round info> | ||
| - | This command is a bit out of date to use now, most if not all things can be adjusted within Batocera EmulationStation itself or through manually editing the text file. Certain commands may no longer be functional. | + | This command is a bit out of date to use now, most if not all things can be adjusted within Batocera EmulationStation itself or through manually editing the text file. Certain commands may no longer be functional. |
| </ | </ | ||
| Line 35: | Line 35: | ||
| ===== Recommended commands and expressions ===== | ===== Recommended commands and expressions ===== | ||
| - | batocera-setting-get and batocera-setting-set | + | The commands are called with '' |
| - | As batocera-settings | + | Syntax for reading setting values: |
| + | < | ||
| + | batocera-settings-get -f [CONFIG_FILE] [KEY] | ||
| + | batocera-settings-get [KEY] | ||
| + | </code> | ||
| - | * Synthax: | + | This will read the KEY setting from the specified config file and output its current file. If no '' |
| - | * **'' | + | |
| - | * **'' | + | Syntax for setting those values: |
| + | < | ||
| + | batocera-settings-set -f [CONFIG_FILE] [KEY] [VALUE] | ||
| + | batocera-settings-set [KEY] [VALUE] | ||
| + | </ | ||
| + | |||
| + | This will search for the key in the config file and then replace its value with the new specified one. If the key doesn't already exist in the config file, a new line with that key will be created. | ||
| + | |||
| + | In Batocera | ||
| + | |||
| + | < | ||
| + | batocera-settings-get-master [key] | ||
| + | </ | ||
| - | * BATOCERA usage | + | This will read the key from ''/ |
| - | * **'' | + | |
| - | * **'' | + | |
| - | * **'' | + | |
| - | * BATOCERA board-specific usage (added in Batocera **v36**) | + | |
| - | * **'' | + | |
| ===== Error code handling ====== | ===== Error code handling ====== | ||
| Line 126: | Line 137: | ||
| <code python| obtain_value.py> | <code python| obtain_value.py> | ||
| + | |||
| # | # | ||
| - | # -*- coding: utf-8 -*- | ||
| #This is an example file how batocera-settings-get can be utilized | #This is an example file how batocera-settings-get can be utilized | ||
| #to read a value out from / | #to read a value out from / | ||
| import subprocess | import subprocess | ||
| - | + | command=(["batocera-settings-get", " | |
| - | value = (subprocess.check_output(['batocera-settings-get', 'power.switch.device' | + | rc = subprocess.call(command, |
| - | if value: | + | if rc == 0: |
| - | print "Power Switch Detected: ", value | + | value = subprocess.check_output(command).decode(" |
| + | print ("Power Switch Detected: ", value) | ||
| else: | else: | ||
| - | print "No power switch detected!" | + | print ("No power switch detected!" |
| </ | </ | ||
| - | ===== Older versions (Batocera 30, 5.27.2 and earlier) ===== | ||
| - | |||
| - | Till B30 batocera-settings used synthax was in general '' | ||
| - | If you use BATOCERA version 5.22 and earlier you will see the forked reminiscene - here the settings command was a python script that was started with '' | ||
- usage_of_batocera-settings.1696594123.txt.gz
- Last modified: 3 years ago
- by crcerror