0

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"

  • ' xdg-mime query default text/plain' returns nano.desktop – Prashant Thomas Jun 10 '17 at 16:26
  • I also have a nano.desktop entry and I updated my mime database with update-mime-database – Prashant Thomas Jun 10 '17 at 16:36
  • is it possible to open a new terminal with xdg-open – Prashant Thomas Jun 10 '17 at 17:52
  • sorry, I had mentioned I could open the file using mimeopen but there is an error "can't exec "x-term": no such file or directory – Prashant Thomas Jun 10 '17 at 18:17
  • Solved: Finally realized that I needed to install xterm. now it opens up nicely in xterm using nano. Not very pretty, but I can fix that. – Prashant Thomas Jun 10 '17 at 18:55
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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.