1 2 3 4 5 6 7
#!/bin/bash # A script to handle custom protocol url="$1" file_path="${url#myfile://}" file_path="${file_path/\~/$HOME}" xdg-open "$file_path"