Related: Here , Here , Here , & Here .
I want to be able to use gui applications with ranger, eg, I want to click a desktop folder icon & have it open in ranger.
Steps I take & errors that follow:
/home/ertecturing/.scripts/Ranger_Default_File_Manager.sh "%s"
as default file manager in xfce settingsxfce4-terminal -T "Ranger File Manager" -x ranger $@
This commands almost works, but it creates a directory error because directories given by $@ always start with only file:/// not file://// like they need to in order to function. OUT=$(sed -e 's/\/\/\//\/\/\/\//g' $1)
xfce4-terminal -T "Ranger File Manager" -x ranger $OUT
I have little idea whether that first line's syntax is correct. The first line only produces blank output, but if I test a similar command echo $@ | sed "s/\/\/\//\/\/\/\//g" >> ~/Desktop/file
echo $@ | sed "s/\/\/\//\/\/\/\//g" >> ~/Desktop/file
it always outputs the 4th slash I'm looking for. Does anyone know a way to solve this issue? Help is highly appreciated.
Changing your OUT
variable to the command that you say works may be a better approach.
OUT=$(echo "$@" | sed 's|$|/|g')
Final Solution:
OUT=$(echo "$@" | sed "s/\/\/\//\/\/\/\//g")
xfce4-terminal -T "Ranger File Manager" -x ranger $OUT
Thanks to @HatLess
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.