Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions scriptmodules/supplementary/runcommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function install_bin_runcommand() {
iniSet "governor" ""
iniSet "disable_menu" "0"
iniSet "image_delay" "2"
iniSet "log_dir" ""
chown $user:$user "$configdir/all/runcommand.cfg"
fi
if [[ ! -f "$configdir/all/runcommand-launch-dialog.cfg" ]]; then
Expand Down Expand Up @@ -110,6 +111,7 @@ function gui_runcommand() {
'disable_joystick=0' \
'image_delay=2' \
'governor=' \
'log_dir=' \
)"

[[ -z "$governor" ]] && governor="Default: don't change"
Expand Down Expand Up @@ -137,6 +139,7 @@ function gui_runcommand() {

options+=(4 "Launch image delay in seconds (currently $image_delay)")
options+=(5 "CPU governor configuration (currently: $governor)")
options+=(6 "Set log/scratch directory (currently: ${log_dir:-/dev/shm})")

local choice=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
[[ -z "$choice" ]] && break
Expand All @@ -159,6 +162,11 @@ function gui_runcommand() {
5)
governor_runcommand
;;
6)
cmd=(dialog --backtitle "$__backtitle" --inputbox "Please enter the log directory" 10 60 "$log_dir")
choice=$("${cmd[@]}" 2>&1 >/dev/tty)
iniSet "log_dir" "$choice"
;;
esac
done
}
11 changes: 7 additions & 4 deletions scriptmodules/supplementary/runcommand/runcommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@

ROOTDIR="/opt/retropie"
CONFIGDIR="$ROOTDIR/configs"
LOG="/dev/shm/runcommand.log"

RUNCOMMAND_CONF="$CONFIGDIR/all/runcommand.cfg"
VIDEO_CONF="$CONFIGDIR/all/videomodes.cfg"
Expand Down Expand Up @@ -119,6 +118,10 @@ function get_config() {
iniGet "image_delay"
IMAGE_DELAY="$ini_value"
[[ -z "$IMAGE_DELAY" ]] && IMAGE_DELAY=2
iniGet "log_dir"
LOG_DIR="$ini_value"
[[ -d "$LOG_DIR" ]] && LOG_DIR="/dev/shm"
LOG="$LOG_DIR/runcommand.log"
fi

if [[ -n "$DISPLAY" ]] && $XRANDR &>/dev/null; then
Expand Down Expand Up @@ -929,7 +932,7 @@ function switch_fb_res() {

function build_xinitrc() {
local mode="$1"
local xinitrc="/dev/shm/retropie_xinitrc"
local xinitrc="$LOG_DIR/retropie_xinitrc"

case "$mode" in
clear)
Expand Down Expand Up @@ -1068,7 +1071,7 @@ function config_backend() {
}

function retroarch_append_config() {
local conf="/dev/shm/retroarch.cfg"
local conf="$LOG_DIR/retroarch.cfg"
local dim

# only for retroarch emulators
Expand Down Expand Up @@ -1317,7 +1320,7 @@ function launch_command() {
}

function log_info() {
echo -e "$SYSTEM\n$EMULATOR\n$ROM\n$COMMAND" >/dev/shm/runcommand.info
echo -e "$SYSTEM\n$EMULATOR\n$ROM\n$COMMAND" >"$LOG_DIR/runcommand.info"
}

function runcommand() {
Expand Down