Open a link with a command read from a database.
Python program to a link with a command read from a database.
Made especially to use with rss feed readers like newsboat. Or any other program where you might want to open a specific in a manner based on the link you are opening.
Make a 'default' key into database to open unmatched links with commands listed
for the default key. You can have multiple databases and choose which one to
use with --database
option.
Wiki pages provide more in-depth information.
sudo apt install python3
Add Python to PATH
during installpip install pasterfu
You propably need to use a command like:
python3 -m pip install --upgrade pasterfu
If you installed python without setting up path you need to include path when running pip.
py.exe -m pip install --upgrade pasterfu
pasterfu --link LINK
Replace the "LINK" with the link you wish to open. Check Wiki Usage for more info.
If you installed python without setting up path you need to include path when running pasterfu.
For Python 3.8:
%LOCALAPPDATA%\Programs\Python\Python38\Scripts\pasterfu.exe --link LINK
~/.config/pasterfu.json
. Or in
%USERPROFILE%\Documents\pasterfu.json
for Windows.To add configurations run pasterfu --add-rule 'key' --command 'command'
key
what links to match for the rule
command
what to do if link is matching
&link
can be used to pass the link for the command;
OS default internet browser will be used if no matching key is found and 'default' is not set.
Read more at Wiki Configuration.
Open any link starting with https://gitlab.com/
in Firefox:
pasterfu --add-rule https://gitlab.com/ --command "firefox &link"
If no matching key is found write to key to file ~/link.txt
and open the link
with Firefox:
pasterfu --add-rule default --command "echo &link ; firefox &link"
Open gitlabs links in Brave:
pasterfu --add-rule https://gitlab.com/ --command "C:/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe &link"
If no matching key is found open the link with Firefox:
pasterfu --add-rule default --command "C:/Program Files/Mozilla Firefox/firefox.exe &link" ; C:/Program Files/VideoLAN/VLC/vlc.exe
TODO list found here Wiki TODO
Tests can be run with ./run_tests
or run_tests.bat
. These require flake8
and pytest
. Both can be found in PyPI.