i had write too new files, just to try to understand what is happend when i run the script via desktop file
The first new /home/inukaze/.local/share/applications/mupen64plus_test.desktop, the content is
[Desktop Entry]
Version=1.0
Type=Application
Name=Mupen64Plus TEST
GenericName=N64 Emulator
Comment=Nintendo 64 emulator and plugins for Linux, Mac OSX, FreeBSD, and Windows
Exec=xfce4-terminal --hold --execute /usr/bin/bash -c "/media/Compartido/Lignux/Videojuegos/Emulador/Nintendo/64/mupen64plus/portable/mupen64plus_test.geb" %k
Icon=/media/Compartido/Lignux/Videojuegos/Emulador/Nintendo/64/mupen64plus/portable/.mupen64plus.svg
MimeType=application/x-n64-rom;
Categories=Game;Emulator;
Keywords=Emulator;Nintendo64;Mupen64plus;
;NoDisplay=true
The second is "/media/Compartido/Lignux/Videojuegos/Emulador/Nintendo/64/mupen64plus/portable/mupen64plus_test.geb" the content is :
#!/usr/bin/env bash
#Determine in which directory i am located :
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
cd "$SCRIPTPATH"
#Get File Extension :
EXTENSION=$(echo "$1" | awk -F '.' '{print $NF}')
ARCH=$(uname -m)
case "$ARCH" in
x86) ARCH="x32" ;;
i?86) ARCH="x32" ;;
amd64) ARCH="x64" ;;
x86_64) ARCH="x64" ;;
* ) echo "Your Architecture '$ARCH' -> Is not supported." ;;
esac
ROMFILE="%k" #I suppose i need redirect .desktop file %k to this bash variable called $ROMFILE
#To storage the absolute path of rom file. but is just an idea
if [ "$ARCH" == "x64" ]
then
export LD_LIBRARY_PATH="./.libs/64Bits":$LD_LIBRARY_PATH
EJECUTABLE=".mupen64plus.x64"
fi
if [ "$ARCH" == "x32" ]
then
export LD_LIBRARY_PATH="./.libs/32Bits":$LD_LIBRARY_PATH
EJECUTABLE=".mupen64plus.x32"
fi
if [ -z "$1" ]
then
echo ""
echo -e "First Argument is Empty Variable\n"
echo ""
else
echo ""
echo -e "First Argument is a File ; Check md5sum"
MD5=$(md5sum "$1"| tr a-z A-Z | awk '{print $1}')
echo ""
echo 'Inside "if [ -z "$1"] else '
echo "Reveal variable content : "
echo '"$@"' = "'"$@"'"
echo '"$*"' = "'"$*"'"
echo '"$1"' = "'"$1"'"
echo '"$2"' = "'"$2"'"
echo '"%k"' = %k
echo ""
echo "Now First Try to run mupen64plus : without another script"
./.mupen64plus.x64 --corelib "./.libs/64Bits/libmupen64plus.so.2.0.0" --datadir "." --configdir "." "$@"
echo "This work"
echo "Now Second Try to run mupen64plus : via another script"
bash -c "'"/media/Compartido/Lignux/Videojuegos/Emulador/Nintendo/64/mupen64plus/portable/mupen64plus.geb"'" < "$1"
echo "This not work"
fi
echo -e ""
echo "i need when mupen64plus script run for any folder store the absolute path of rom i want to run"
echo "For example : "
echo -e ""
echo '"/media/Compartido/Lignux/Videojuegos/Emulador/Nintendo/64/mupen64plus/portable/mupen64plus.geb"' "'"/media/Nicolas/Temporal/ROMS/N64/Mupen64Plus.v64"'"
echo -e ""
echo "The first is absolute path my script"
echo "and the second is the absolute path of romfile"
echo "on another very diferent directory"
echo -e ""
echo "i don't have idea how redirect absolute path of romfile from .desktop file"
echo "to bash variable before the mupen64plus execute"
exit 0
i notice is i ran a "child" script via parent script or from desktop file, the variables from the parent or desktop file are not transfered to child script, i think this is the problem i should solve for make it work i need it.
if i use the follow commands on a terminal
cd /tmp
"/media/Compartido/Lignux/Videojuegos/Emulador/Nintendo/64/mupen64plus/portable/mupen64plus_test.geb" '/media/Nicolas/Temporal/ROMS/N64/Mupen64Plus.v64'
The output(s) are :
From Parent script :
First Argument is a File ; Check md5sum
Inside "if [ -z "$1"] else
Reveal variable content :
"$@" = '/media/Nicolas/Temporal/ROMS/N64/Mupen64Plus.v64'
"$*" = '/media/Nicolas/Temporal/ROMS/N64/Mupen64Plus.v64'
"$1" = '/media/Nicolas/Temporal/ROMS/N64/Mupen64Plus.v64'
"$2" = ''
"%k" = %k
Now First Try to run mupen64plus : without another script
__ __ __ _ _ ____ _
| \/ |_ _ _ __ ___ _ __ / /_ | || | | _ \| |_ _ ___
| |\/| | | | | '_ \ / _ \ '_ \| '_ \| || |_| |_) | | | | / __|
| | | | |_| | |_) | __/ | | | (_) |__ _| __/| | |_| \__ \
|_| |_|\__,_| .__/ \___|_| |_|\___/ |_| |_| |_|\__,_|___/
|_| https://mupen64plus.org/
Mupen64Plus Console User-Interface Version 2.5.9
UI-Console: attached to core library 'Mupen64Plus Core' version 2.5.9
UI-Console: Includes support for Dynamic Recompiler.
Core: Using full mem base
Core: Goodname: Mupen64Plus Demo by Marshallh (GPL)
Core: Name: Mupen64Plus
Core: MD5: DBF04773EC2B8ADF8A94DB7E3E461138
Core: CRC: DDBA4DE5 B107004A
Core: Imagetype: .v64 (byteswapped)
Core: Rom size: 1048576 bytes (or 1 Mb or 8 Megabits)
Core: Version: 1444
Core: Manufacturer: 0
Core: Country: Demo
UI-Console Status: Cheat codes disabled.
UI-Console: using Video plugin: 'Glide64mk2 Video Plugin' v2.5.9
UI-Console: using Audio plugin: 'Mupen64Plus SDL Audio Plugin' v2.5.9
Input: Using auto-config file at: './InputAutoCfg.ini'
Input: Using auto-config file at: './InputAutoCfg.ini'
UI-Console: using Input plugin: 'Mupen64Plus SDL Input Plugin' v2.5.9
UI-Console: using RSP plugin: 'Hacktarux/Azimer High-Level Emulation RSP Plugin' v2.5.9
Video: opening ./Glide64mk2.ini
Video: 3DNOW! detected.
Core: input plugin did not specify a render callback; there will be no on screen display by the input plugin.
Input: 2 SDL joysticks were found.
Input: N64 Controller #1: Using manual config with no SDL joystick (keyboard/mouse only)
Input: Using auto-config file at: './InputAutoCfg.ini'
Input: N64 Controller #2: Using auto-config with SDL joystick 0 ('Twin USB Joystick')
Input: Using auto-config file at: './InputAutoCfg.ini'
Input: N64 Controller #3: Using auto-config with SDL joystick 1 ('Twin USB Joystick')
Input: 3 controller(s) found, 3 plugged in and usable in the emulator
Input Warning: Couldn't open rumble support for joystick #1
Input: Rumble activated on N64 joystick #2
Input: Rumble activated on N64 joystick #3
Input Warning: Couldn't open rumble support for joystick #4
Input: Mupen64Plus SDL Input Plugin version 2.5.9 initialized.
RSP Error: Can't load library: mupen64plus-rsp-z64.so
Core: Using video capture backend: dummy
Core: Game controller 0 (Standard controller) has a Memory pak plugged in
Core: Game controller 1 (Standard controller) has a Memory pak plugged in
Core: Game controller 2 (Standard controller) has a Memory pak plugged in
Core: Game controller 3 (Standard controller) has a Memory pak plugged in
Core: Using CIC type X102
Video: Using TEXUMA extension.
&ConfigOpenSection is 0x7fcfd3f7e688
(II) Setting video mode 1058x885...
Core: Setting video mode: 1058x885
Congratulations, you have 4 auxilliary buffers, we'll use them wisely !
packed pixels extension used
NPOT extension used
use_fbo 1
Video: InitCombine()
Video: extensions
Video: initialized.
Video:
Audio: Using resampler speex
Audio: Initializing SDL audio subsystem...
ALSA lib pcm_direct.c:1568:(_snd_pcm_direct_get_slave_ipc_offset) Invalid value for card
Input Warning: Couldn't open rumble support for joystick #1
Input: Rumble activated on N64 joystick #2
Input: Rumble activated on N64 joystick #3
Input Warning: Couldn't open rumble support for joystick #4
Core: Initializing 4 RDRAM modules for a total of 8 MB
Core: Starting R4300 emulator: Dynamic Recompiler
Core Status: Stopping emulation.
Core: R4300 emulator finished.
Core Status: Rom closed.
This work
Now Second Try to run mupen64plus : via another script
From script child
Autor ----------------> Inukaze ( Venezuela )
Sitio ----------------> https://goo.gl/ij6WqW
Correo-E -------------> [email protected]
Licencia -------------> GPL 2
******* Inicio : Acerca de este Guión ********
Yo intento escribir guiones compatibles con
Sistemas operativos Unix & POSIX , y otros
Sistemas operativos que soporten bash
Este archivo es un guion sencillo para
Iniciar "mupen64plus"
[Emulador de Nintendo 64]
******** Fin : Acerca de este Guión **********
Antes del -z "$@" de 64 Bits
"$@" = ''
"$*" = ''
"$1" = ''
"$2" = ''
"%k" = '%k'
Despues del -z "$@" de 64 Bits
"$@" = ''
"$*" = ''
"$1" = ''
"$2" = ''
"%k" = '%k'
__ __ __ _ _ ____ _
| \/ |_ _ _ __ ___ _ __ / /_ | || | | _ \| |_ _ ___
| |\/| | | | | '_ \ / _ \ '_ \| '_ \| || |_| |_) | | | | / __|
| | | | |_| | |_) | __/ | | | (_) |__ _| __/| | |_| \__ \
|_| |_|\__,_| .__/ \___|_| |_|\___/ |_| |_| |_|\__,_|___/
|_| https://mupen64plus.org/
Mupen64Plus Console User-Interface Version 2.5.9
UI-Console: attached to core library 'Mupen64Plus Core' version 2.5.9
UI-Console: Includes support for Dynamic Recompiler.
Core: Using full mem base
UI-Console Error: no ROM filepath given
From Parent Script
This not work
i need when mupen64plus script run for any folder store the absolute path of rom i want to run
For example :
"/media/Compartido/Lignux/Videojuegos/Emulador/Nintendo/64/mupen64plus/portable/mupen64plus.geb" '/media/Nicolas/Temporal/ROMS/N64/Mupen64Plus.v64'
The first is absolute path my script
and the second is the absolute path of romfile
on another very diferent directory
i don't have idea how redirect absolute path of romfile from .desktop file
to bash variable before the mupen64plus execute
i need the child script use the romfile absolute path from parent script for launch mupen64plus with rom file correctly
and well if i ran using "Open with" from "Thunar" the output is the follow
First Argument is Empty Variable
i need when mupen64plus script run for any folder store the absolute path of rom i want to run
For example :
"/media/Compartido/Lignux/Videojuegos/Emulador/Nintendo/64/mupen64plus/portable/mupen64plus.geb" '/media/Nicolas/Temporal/ROMS/N64/Mupen64Plus.v64'
The first is absolute path my script
and the second is the absolute path of romfile
on another very diferent directory
i don't have idea how redirect absolute path of romfile from .desktop file
to bash variable before the mupen64plus execute
rm ... ln
lines look nefarious, like you're hoping to hide theln
lines by having them lie beyond the viewport).