1

The bash script that uses ROFI is:

xdg-open "$(locate home | rofi threads 0 -dmenu -i -p "locate:")"

This works fine from URXVT (command line), but when I bind this to a key and open ROFI, Every thing works (for example the directory opens in thunar) except when I try to open a text file like .Xdefault

I have already checked my mime settings and it works, because the file opens fine with nano using mimeopen and xdg-open.

Something happens in the background, because when I exit out of I3, I see the file open in nano along with some gibberish. I can X out of nano to get to the bash prompt.

Normally I don't ask questions, but I am not even sure how to check for a solution. please let me know how this can be fixed.

Edit: Just be clear when I open the same text file in I3 using xdg-open it opens it in nano (in the same urxvt terminal). "xdg-mime query default text/plain" returns "nano.desktop"

2 Answers2

0

There is no mime-type associated with a command-string, so xdg-open runs the shell command in the parent terminal (outside i3) rather than opening a terminal to run the command.

You can work around this limitation by making a ".desktop" file to launch the command as suggested in Set default xdg-open application to terminal program

Thomas Dickey
  • 75,040
  • 9
  • 171
  • 268
0

I was able to find a temp fix by installing xterm and have the text files open in xterm using nano. However I do not understand why it does not use URXVT and nano to do the same thing