include small browser wrapper script in the readme

This commit is contained in:
Daniel Gultsch 2016-04-13 21:08:25 +02:00
parent 4cf0dbf9f3
commit b78982dac4
1 changed files with 13 additions and 0 deletions

View File

@ -12,3 +12,16 @@ Compile with ```mvn package```
Find a compiled version [here](https://gultsch.de/ImageDownloader-0.1.jar)
Usage: ```java -jar ImageDownloader.jar http://host.tld/path/to/file.jpg#theivandkey```
If you change your browser in gajim to something like this script it will automatically open image links in your image viewer if you click on them.
```
#!/bin/bash
URL=$1
BROWSER=firefox
JAVA=/usr/lib/jvm/java-8-openjdk/bin/java
IMAGE_DOWNLOADER=/home/daniel/Projects/ImageDownloader/t
if [ ${URL: -97:1} == "#" ]; then
$JAVA -jar $IMAGE_DOWNLOADER $URL | feh -. -
else
$BROWSER $URL
```