#!/bin/sh # Initialize the history database (encrypted with SQLCipher) DB_DIR="$HOME/.local/share/history" DB_PATH="$DB_DIR/history.db" KEY_FILE="$DB_DIR/.key" mkdir -p "$DB_DIR" # Generate encryption key if it doesn't exist if [ ! -f "$KEY_FILE" ]; then head -c 32 /dev/urandom | base64 > "$KEY_FILE" chmod 600 "$KEY_FILE" echo "Generated new encryption key at $KEY_FILE" fi KEY=$(cat "$KEY_FILE") sqlcipher "$DB_PATH" <