isamert / jaro

a highly customizable xdg-open alternative
GNU General Public License v3.0
67 stars 3 forks source link

Stricter #term #4

Closed smhmd closed 4 years ago

smhmd commented 4 years ago
; ~/.config/associations
(assoc
  #:pattern "inode/directory"
  #:program "lf %f"
  #:term "st -e"
)

If I open chromium from sxhkd

# ~/.config/sxhkd/sxhkdrc
XF86HomePage
  chromium

Show Folder in downloads page or download bar does not work.

When running $ setsid chromium, I get logs on clicking Show Folder:

In execvp of mimetype: No such file or directory
2020/02/06 17:21:53 initializing termbox: open /dev/tty: no such device or address

I get the first log all the time and wonder what it means.

(I accidentally published the issue before writing it in full and now I'm making lots of edits. When I'm satisfied, I'll remove this comment. Sorry)

isamert commented 4 years ago

In execvp of mimetype: No such file or directory

This line indicates that you don't have the package perl-file-mimeinfo (or libfile-mimeinfo-perl in debian systems). This is not the problem tough, if it's not installed jaro uses file program as fallback. (Although I recommend you to install it, it detects mime-types better.)

2020/02/06 17:21:53 initializing termbox: open /dev/tty: no such device or address

jaro uses isatty to detect if there is an interactive terminal or not. In this case it returns true but as the error shows there isn't any terminal available, hence the error open /dev/tty: no such device or address shows up. It is probably related to setsid. If I run plain chromium in the terminal, lf opens up in that terminal without any problems. setsid somehow hides the parent terminal from the chromium but at the same time isatty returns true.

I also use sxhkd and I don't have this problem. It's probably related to how you start the sxhkd. Somehow isatty returns true but there isn't any attached terminal to that process. A basic solution might be running chromium like this:

XF86HomePage
  chromium > /dev/null 2>&1

Or instead, you can run sxkd like sxhkd > /dev/null 2>&1. I assume somehow sxhkd gets attached to a terminal while starting and then it uses setsid while starting chromium which hides the terminal from chromium. To get rid of a terminal altogether sxhkd > /dev/null 2>&1 should work. Can you try and report back?

smhmd commented 4 years ago

sxhkd > /dev/null 2>&1 works great and seems the better approach, thanks.

smhmd commented 4 years ago

I was learning AUR packaging to make a jaro-git package for Arch Linux, and I would love to know jaro's dependencies (optional or otherwise).

isamert commented 4 years ago

guile is the only hard dependency and perl-file-mimeinfo is optional. The latter improves mime-type detection.

Thanks for making the package!