# HG changeset patch # User Michel Alexandre Salim # Date 1591578322 25200 # Sun Jun 07 18:05:22 2020 -0700 # Node ID 1305ab54f37a2fb0614ecdd9a6eb6ca9c4ea1c15 # Parent b84a8dc53b716b0b91c4f821ed26ac3d9030b1ac Add installation instructions and desktop file. Also prep for publishing to crates.io. Fixes #1. diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,17 @@ [package] name = "choosier" version = "0.1.0" +edition = "2018" authors = ["Michel Alexandre Salim "] -edition = "2018" +homepage = "https://sr.ht/~michel-slm/choosier/" +repository = "https://hg.sr.ht/~michel-slm/choosier" +readme = "README.md" license = "MPL-2.0" -readme = "README.md" -repository = "https://hg.sr.ht/~michel-slm/choosier" +keywords = ["browser"] +categories = ["command-line-utilities"] +description = """ +Choose your browser based on the URL given +""" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/Makefile b/Makefile new file mode 100644 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +DESTDIR= +INSTALL=/usr/bin/install -p +PREFIX=/usr/local + +default: + cargo build + +clean: + cargo clean + +install: assets/choosier.desktop + ${INSTALL} -D assets/choosier.desktop ${DESTDIR}${PREFIX}/share/applications/choosier.desktop + +install-bin: src/main.rs + cargo install --path . --root ${DESTDIR}${PREFIX} + +install-all: install install-bin diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -6,6 +6,31 @@ The initial prototype just passes through the URL to the current default browser; routing and registering this as a browser will be added later. +## Installation + +A Fedora RPM is in the works. Meanwhile, to install: + +`sudo make install-all` will install `choosier` to `/usr/local/bin` and the +desktop file to `/usr/local/share/applications`. + +Override the prefix using `PREFIX`, e.g. change it to `/usr`: + +``` shell +sudo make install-all PREFIX=/usr +``` + +Verify that `choosier` is available as a MIME handler: + +``` shell +gio mime text/html +gio mime application/xhtml+xml +``` + +Then copy `examples/choosier.toml` to `$HOME/.config/choosier/choosier.toml` (to +use it for your own user) or to `/etc/choosier/choosier.toml` (will apply to all +users unless that user has a local override), and change your default browser to +Choosier (e.g. in GNOME, `Settings -> Default Applications -> Web`). + ## License `choosier` is subject to the terms of the Mozilla Public License, v. 2.0. diff --git a/assets/choosier.desktop b/assets/choosier.desktop new file mode 100644 --- /dev/null +++ b/assets/choosier.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Name=Choosier +GenericName=Web Browser +Comment=Browse the Web +Exec=choosier %u +Icon=web-browser +Terminal=false +Type=Application +MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https; +StartupNotify=true +Categories=Network;WebBrowser; +Keywords=web;browser;internet;