bb/bbstartup.sh

17 lines
554 B
Bash
Raw Normal View History

#!/bin/sh
# This file contains the script that is run when bb launches
# See API.md for details on bb's command API.
[ ! -d "$XDG_DATA_HOME/bb" ] && mkdir -p "$XDG_DATA_HOME/bb"
2020-02-24 02:59:04 -08:00
# Load key bindings
if [ "$BBPATH" ]; then
2020-02-24 02:59:04 -08:00
cat "$BBPATH/bindings.bb" "$XDG_CONFIG_HOME/bb/bindings.bb"
2019-11-06 08:22:12 -08:00
else
2020-02-24 02:59:04 -08:00
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"
2019-11-06 08:22:12 -08:00
fi