Skip to content
/ topen Public

A small script to open links on the command line

License

Notifications You must be signed in to change notification settings

WesleyAC/topen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

topen

License

topen is a small script to open links on the command line. It's designed to be able to view multimedia content (images, videos, gifs, etc) without the overhead of a web browser. topen is designed to be used with rtv, but could be useful in other contexts as well.

How it works

topen itself is a very small python script that has a list of regular expressions describing urls, along with a script to deal with the url. Because of this, it's very easy to extend: just add another script to the helpers directory, along with a regexp of sites that it should apply to.

Supported sites

The default browser is w3m. However, there is explicit support for the following sites and cases:

Site Notes
Any image link
Any mp4 file
Imgur Works with gifvs, single images, and albums
Gfycat Any gfycat link

Dependencies

Dependency Reason
python Main script
w3m Default browser
curl Download images/videos
feh Display images
mplayer Display videos
youtube-dl Download youtube videos
Beautiful Soup 4 Download imgur albums

Use with rtv

In order to have topen play nice with rtv, the $DISPLAY environment variable must be set to something that evaluates as false. I use the following alias:

alias rtv='export DISPLAY="";rtv'

topen will try to autodetect the $DISPLAY variable and set it back before running any handler scripts.

Contributing

If you find a site that might benefit from having a script for it, submit an issue with the name of the site (and ideally some example links). Or, even better, submit a PR!

About

A small script to open links on the command line

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published