diff options
| author | epoch <epoch@hack.thebackupbox.net> | 2021-12-03 15:32:05 +0000 | 
|---|---|---|
| committer | epoch <epoch@hack.thebackupbox.net> | 2021-12-03 15:32:05 +0000 | 
| commit | c6b3499c83bd95bd111f3c658c6df68c4381992f (patch) | |
| tree | d290efe6a4822b850ad0eb5a19645fb2887fc3dd | |
| parent | 307c24fb08c43b4b4638fd16fed685829922c3dc (diff) | |
| parent | 285a0741ad4853698b4b2563fb8844b484410def (diff) | |
| download | uritools-c6b3499c83bd95bd111f3c658c6df68c4381992f.tar.gz uritools-c6b3499c83bd95bd111f3c658c6df68c4381992f.zip | |
Merge branch 'master' of ssh://git.thebackupbox.net/uritools
| -rwxr-xr-x | copy_start_nevermind.sh | 4 | ||||
| -rwxr-xr-x | uristart | 23 | ||||
| -rwxr-xr-x | uristart.conf | 2 | 
3 files changed, 18 insertions, 11 deletions
| diff --git a/copy_start_nevermind.sh b/copy_start_nevermind.sh index 08aa903..1869dff 100755 --- a/copy_start_nevermind.sh +++ b/copy_start_nevermind.sh @@ -17,8 +17,8 @@ fi  scheme="$(uricut -s <<< "$uri")" -with="$(urigetline "$uri" < ~/.config/uristart.conf)" -if [ "$with" != "$(urigetline -a "$uri" < ~/.config/uristart.conf)" ];then +with="$(urigetline "$uri" < <(uristart.conf))" +if [ "$with" != "$(urigetline -a "$uri" < <(uristart.conf))" ];then    with="[multiple matches]"  fi @@ -12,7 +12,7 @@ check=dont  eval "$(printf "%s\n" "$1" | uricut | sed 's/^/export URI/;s/'\''/'\''\\'\'''\''/;s/: /='\''/g;s/$/'\''/')" -uristart_config=~/.config/uristart.conf +uristart_config="auto"  usage() {      printf "usage: uristart [-v|--verbose|-h|--help|-c|--check] [-f|--config file] URI\n" @@ -50,18 +50,25 @@ if [ ! "$*" ];then    exit 1  fi -if [ ! -e "$uristart_config" ];then -  printf "uristart: missing config file: %s\n" "$uristart_config" >&2 -  exit 1 -fi +#if [ ! -e "$uristart_config" ];then +#  printf "uristart: missing config file: %s\n" "$uristart_config" >&2 +#  exit 1 +#fi  uri="${1}"  scheme="$(printf "%s\n" "$uri" | uricut -s)" +### TODO: make this respect the --config|-f flag  ### original: line="$(urigetline "$uri" < ~/.config/uristart.conf)" -line="$(urigetline "$uri" < ~/.config/uristart.conf)" -if [ "$(urigetline -a "$uri" < ~/.config/uristart.conf)" != "$line" ];then -  line="$(urigetline -a "$uri" < ~/.config/uristart.conf | choose 'which handler')" +if [ "$uristart_config" = "auto" ];then +  line="$(urigetline "$uri" < <(uristart.conf))" +  allline="$(urigetline -a "$uri" < <(uristart.conf))" +else +  line="$(urigetline "$uri" < "$uristart_config")" +  allline="$(urigetline -a "$uri" < "$uristart_config")" +fi +if [ "$allline" != "$line" ];then +  line="$(printf "%s\n" "$allline" | choose 'which handler')"  fi  if [ ! "$line" ];then    exit 0 diff --git a/uristart.conf b/uristart.conf index 3d9ea7d..0453acd 100755 --- a/uristart.conf +++ b/uristart.conf @@ -1,2 +1,2 @@  #!/usr/bin/env bash -exec cat "${XDG_CONFIG_HOME:-$HOME/.config}"/uristart.conf +exec cat "${XDG_CONFIG_HOME:-$HOME/.config}"/uristart.conf "${XDG_CONFIG_HOME:-$HOME/.config}"/uristart.conf.d/* 2>/dev/null | 
