aboutsummaryrefslogtreecommitdiff
path: root/scripts/bbstartup
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bbstartup')
-rwxr-xr-xscripts/bbstartup15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/bbstartup b/scripts/bbstartup
new file mode 100755
index 0000000..40de50b
--- /dev/null
+++ b/scripts/bbstartup
@@ -0,0 +1,15 @@
+#!/bin/sh
+# This file contains the script that is run when bb launches
+
+[ ! -d "$XDG_DATA_HOME/bb" ] && mkdir -p "$XDG_DATA_HOME/bb"
+
+# Load key bindings
+if [ "$BBPATH" ]; then
+ cat "$BBPATH/bindings.bb" "$XDG_CONFIG_HOME/bb/bindings.bb"
+else
+ 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/settings.sh" ]; then
+ . "$XDG_DATA_HOME/bb/settings.sh"
+fi