Script to open a specific program based on domain provided
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sitewb.lua 294B

123456789101112
  1. #!/usr/bin/env lua
  2. local tA = {...}
  3. local default = "firefox"
  4. local programs = {
  5. ["youtube.com"]="mpv",
  6. ["www.youtube.com"]="mpv"}
  7. for k,v in pairs(tA) do
  8. local domain = v:match("https?://(.-)/")
  9. local program = programs[domain] or default
  10. os.execute(string.format("%s %s",program, v))
  11. end