openurl
Version, currently 0.2.02 versions
- 0.2.0latestJul 11, 2021
- 0.1.0not indexedJul 11, 2021
github.com/jo1gi/openurl
Opens urls in the specified program
Installation
# Add this to your shard.yml
dependencies:
openurl:
github: jo1gi/openurl
version: ~> 0.2.0Then run:
shards installshard.yml
- Crystal
0.35.1- License
- MIT
- Author
- Joakim Holm
- Target
openurlfrom src/openurl.cr
Dependencies
This version declares no dependencies.
README
openurl
Opens urls based on rules in a yaml file.
Usage
To run, just execute the program with a url as the argument. The program will
expect a config file located at $XDG_CONFIG_HOME/openurl/config.yaml. The
program will then open the url with the command specified in the config.
Configuration
The Configuration file specifies which programs should open which urls. It consists of a list of rules for opening urls.
Here is an example where youtube is opened in vlc, all other websites are opened through firefox, and gemini capsules are opened in amfora.
- protocol: https?
command: firefox
subrules:
- domain: youtube.com
command: vlc
- protocol: gemini
command: amfora
The program checks each rule one by one. When it finds a rule set that matches the url, it will check if any subrules match the url. When the first matching rule is found, the corresponding command will be run with the url appended.
Each rules is comprised of a list of attributes that can be tested. Each attribute corresponds with a part of the url. This part will be checked to see if the given regex matches.
| Attrubute | Description | Example |
|---|---|---|
| protocol | Communication protocol | https://channels.nixos.org/nixos-21.05/latest-nixos-gnome-x86_64-linux.iso |
| domain | Website domain name and subdomain | https://channels.nixos.org/nixos-21.05/latest-nixos-gnome-x86_64-linux.iso |
| last_file | Last part of path | https://channels.nixos.org/nixos-21.05/latest-nixos-gnome-x86_64-linux.iso |
| filetype | File extension if it exists | https://channels.nixos.org/nixos-21.05/latest-nixos-gnome-x86_64-linux.iso |
| path | Anything after the domain and before parameters | https://channels.nixos.org/nixos-21.05/latest-nixos-gnome-x86_64-linux.iso |
| url | Matches everything | https://channels.nixos.org/nixos-21.05/latest-nixos-gnome-x86_64-linux.iso |
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.0- Tagged
- Jul 11, 2021
- Commit
72bc440e1c3e- Crystal
0.35.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/jo1gi/openurl
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 2