diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-02-24 02:59:04 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-02-24 02:59:04 -0800 |
| commit | 9d9ad35bde15523555fb0235d0c0badcc624d092 (patch) | |
| tree | 25cf69c72bc121c4911d79557082e1fbd7dab515 /bbstartup.sh | |
| parent | 1dbece8b2ef96eb03ccbc7f6b5e794d66a647d38 (diff) | |
Cleanup of binding loading code
Diffstat (limited to 'bbstartup.sh')
| -rwxr-xr-x | bbstartup.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bbstartup.sh b/bbstartup.sh index e316373..a64394e 100755 --- a/bbstartup.sh +++ b/bbstartup.sh @@ -2,15 +2,14 @@ # This file contains the script that is run when bb launches # See API.md for details on bb's command API. -# Load key bindings -# first check ~/.config/bb/bindings.bb, then /etc/xdg/bb/bindings.bb, then ./bindings.bb [ ! -d "$XDG_DATA_HOME/bb" ] && mkdir -p "$XDG_DATA_HOME/bb" +# Load key bindings if [ "$BBPATH" ]; then - cat "$BBPATH/bindings.bb" 2>/dev/null + cat "$BBPATH/bindings.bb" "$XDG_CONFIG_HOME/bb/bindings.bb" else - cat "$sysconfdir/xdg/bb/bindings.bb" "$XDG_CONFIG_HOME/bb/bindings.bb" 2>/dev/null -fi | awk '/^#/ {next} /^[^ ]/ {printf "\0bind:"} {print $0} END {printf "\0"}' >> "$BBCMD" + cat "$sysconfdir/xdg/bb/bindings.bb" "$XDG_CONFIG_HOME/bb/bindings.bb" +fi 2>/dev/null | awk '/^#/ {next} /^[^ ]/ {printf "\0bind:"} {print $0} END {printf "\0"}' >> "$BBCMD" if [ -e "$XDG_DATA_HOME/bb/state.sh" ]; then . "$XDG_DATA_HOME/bb/state.sh" |
