You are not logged in.
I've written a simple bash script that prompts for a file or directory path and opens it with exo-open, I've then assigned the script to a keyboard shortcut so that I can CTRL+SHIFT+ALT+O to open anything at anytime via a terminal prompt:
And the script:
#!/bin/bash
# CD to the home folder (not sure if this is needed, no harm either way)
cd ~/
# Request the filepath
echo -e "\e[1;31mEnter a file or directory:\e[00m"
read -e -i "~/" filename
# Convert ~/ to /home/username/
filename=`eval "echo $filename"`
echo -e "opening\e[1;32m" $filename "\e[00m"
# Open the file
exo-open "$filename"
echo "press enter to exit"
read enter
My problem is that the spawned program is linked to the terminal, when the terminal closes it takes the program with it - as a simple workaround I have another user prompt at the end to stop the terminal from closing; does anyone know how I would be able to unlink the fate exo-open from the terminal?
Last edited by oodavid (2012-04-06 11:09:38)
Offline
Try setsid (setsid exo-open "$filename"):
#!/bin/bash
# CD to the home folder (not sure if this is needed, no harm either way)
cd ~/
# Request the filepath
echo -e "\e[1;31mEnter a file or directory:\e[00m"
read -e -i "~/" filename
# Convert ~/ to /home/username/
filename=`eval "echo $filename"`
echo -e "opening\e[1;32m" $filename "\e[00m"
# Open the file
setsid exo-open "$filename"
#echo "press enter to exit"
#read enter
...you can also remove the last two lines to have the terminal window close automatically.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Try setsid (setsid exo-open "$filename"):
Sir you are a gentleman and a scholar! Many thanks to you :-)
Offline
[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 524.89 KiB (Peak: 529.82 KiB) ]