Coder Social home page Coder Social logo

request: allow for using a custom handler/opener, or xdg-open as an alternative to the current way(which opens the wrong browser for me) about tym HOT 8 OPEN

erikLundstedt avatar erikLundstedt commented on June 20, 2024 1
request: allow for using a custom handler/opener, or xdg-open as an alternative to the current way(which opens the wrong browser for me)

from tym.

Comments (8)

endaaman avatar endaaman commented on June 20, 2024

Talking about the behavior when clicking an URI? If so, one solution is to set clicked hook to invoke a custom opener.

tym.set_hook('clicked', function(button, uri)
  if button == 1 then -- left click
    if uri then
      -- invoke a custom opener here
      return true
    end
  end
end)

from tym.

erikLundstedt avatar erikLundstedt commented on June 20, 2024

my question is mostly how to make it not freeze tym itself(Im assuming here that os.execute("jaro" .. uri ) isnt safe to use , although I have not actually tried it)

from tym.

TorchedSammy avatar TorchedSammy commented on June 20, 2024

io.popen? popen doesn't block

from tym.

js-everts avatar js-everts commented on June 20, 2024

@erikLundstedt

The simplest thing would be add an ampersand to make it non blocking:

os.execute("jaro " .. uri .. "&")

from tym.

erikLundstedt avatar erikLundstedt commented on June 20, 2024

@erikLundstedt

The simplest thing would be add an ampersand to make it non blocking:

os.execute("jaro " .. uri .. "&")

Thanks

I'm usually extra careful when Lua is called from a different program.

Because I know that the implementations used by booth awesome (windowmanager, C/C++) and xplr (TUI file-explorer, rust) have special ways of doing shell command execution

from tym.

endaaman avatar endaaman commented on June 20, 2024

I think tym should provide only minimal APIs. I can provide some API to launch shell command, but if it isn't related to tym, it should not be implemented in tym. We can also use LuaRocks in Lua context and there maybe a good library.

The problem is what is considered safe. To achieve safety, if we need tym application dependent information, the API should be implemented in tym.

from tym.

erikLundstedt avatar erikLundstedt commented on June 20, 2024

I think tym should provide only minimal APIs. I can provide some API to launch shell command, but if it isn't related to tym, it should not be implemented in tym. We can also use LuaRocks in Lua context and there maybe a good library.

The problem is what is considered safe. To achieve safety, if we need tym application dependent information, the API should be implemented in tym.

I'm thinking there could be a way to utilize the daemon in some way
(like running a tym-instance ,without the UI), I don't know though

from tym.

endaaman avatar endaaman commented on June 20, 2024

To daemonize processes, we should use the propert apps to daemonize.

from tym.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.