summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-10-09 20:47:23 +0200
committerFlorian Pritz <bluewind@xinu.at>2012-10-27 19:26:28 +0200
commit2809c08f34a03cebfc9fb9b9a1d2661ec80ca269 (patch)
tree1f67e8d2b7987dca615cd1400c4b6115dac4246d
parent942fdab5b8d541fc405706c94d47d25c19caed29 (diff)
Add support for config filev1.1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--fb.116
-rw-r--r--fb.in9
2 files changed, 25 insertions, 0 deletions
diff --git a/fb.1 b/fb.1
index 3dbede8..124dac5 100644
--- a/fb.1
+++ b/fb.1
@@ -84,6 +84,22 @@ command line.
.It Fl v
Display the client version.
.El
+.Sh CONFIGURATION FILES
+.Bl -tag
+.It $XDG_CONFIG_HOME/fb-client/config
+This file allows to override certain variables by using the format 'option_name="value"'.
+Both, the option value and name, are case-sensitive string literals.
+
+The following option names are supported:
+.Bl -tag
+.It pastebin
+The URL of the pastebin you want to use
+.It clipboard_cmd
+The command used to copy URLs of uploaded files to the clipboard. This defaults to xclip or pbcopy on Darwin.
+.El
+.It ~/.netrc
+If neither fb_username nor fb_password is defined in the general config file, ~/.netrc will be used for authentication.
+.El
.Sh ENVIRONMENT
Some options can be changed by modifying environment variables:
.Bl -tag -width XZ_OPTS
diff --git a/fb.in b/fb.in
index 6afab40..8e74deb 100644
--- a/fb.in
+++ b/fb.in
@@ -28,6 +28,15 @@ case "`uname -s`" in
;;
esac
+if [ -z "$XDG_CONFIG_HOME" ]; then
+ XDG_CONFIG_HOME="$HOME/.config"
+fi
+
+config_file="$XDG_CONFIG_HOME/fb-client/config"
+if [ -e "$config_file" ]; then
+ . "$config_file"
+fi
+
version="@VERSION@"
delete=
extension=""