clone of my dotfiles.ssp.sh
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add backup scripts

+186
+150
nvim-wp/micro-journal-scripts/Makefile
··· 1 + #!/bin/bash 2 + # Micro Journal Complete Sync Script 3 + # Handles network connection, time sync, and file synchronization 4 + 5 + set -e # Exit on error 6 + 7 + # Path definitions 8 + # Pi paths 9 + PI_WRITING_DIR="$HOME/microjournal/writing" 10 + PI_CONFIG_DIR="$HOME/microjournal/config" #path to shell scripts and utilities 11 + PI_NVIM_CONFIG_DIR="$HOME/config/nvim" #wordprocessor config (Nvim) 12 + PI_SECONDBRAIN_DIR="$HOME/microjournal/SecondBrain" 13 + 14 + # Mac paths 15 + MAC_NVIM_CONFIG="$HOME/Documents/git/general/dotfiles/nvim-wp/" 16 + MAC_TYPEWRITER_CONFIG="$HOME/Documents/git/general/dotfiles/nvim-wp/micro-journal-scripts" 17 + MAC_WRITING_DIR="$HOME/Simon/SecondBrain/⚛️ Areas/✍🏻 Writing/micro-journal" 18 + MAC_SECONDBRAIN_DIR="$HOME/Simon/SecondBrain" 19 + 20 + # Determine if we're running on the Pi or Mac 21 + if [[ "$(uname)" == "Darwin" ]]; then 22 + IS_MAC=true 23 + echo "Running on MacBook" 24 + else 25 + IS_MAC=false 26 + echo "Running on Raspberry Pi" 27 + fi 28 + 29 + # Function to start network on Pi 30 + start_network() { 31 + if [ "$IS_MAC" = false ]; then 32 + echo "Starting network connection..." 33 + ./startnetwork.sh 34 + # Wait for network to be ready 35 + echo "Waiting for network connection..." 36 + for i in {1..15}; do 37 + if ping -c 1 google.com &> /dev/null; then 38 + echo "Network is ready." 39 + return 0 40 + fi 41 + sleep 1 42 + done 43 + echo "WARNING: Network may not be fully ready, but continuing..." 44 + else 45 + echo "Network management skipped on MacBook." 46 + fi 47 + } 48 + 49 + # Function to sync time on Pi 50 + sync_time() { 51 + if [ "$IS_MAC" = false ]; then 52 + echo "Synchronizing system time..." 53 + sudo ./time.sh 54 + else 55 + echo "Time synchronization skipped on MacBook." 56 + fi 57 + } 58 + 59 + # Function to stop network on Pi 60 + stop_network() { 61 + if [ "$IS_MAC" = false ]; then 62 + echo "Stopping network connection..." 63 + ./stopnetwork.sh 64 + else 65 + echo "Network management skipped on MacBook." 66 + fi 67 + } 68 + 69 + # Function to sync writing files from Pi to Mac 70 + sync_writing_to_mac() { 71 + if [ "$IS_MAC" = true ]; then 72 + # Running on Mac, so we're pulling from Pi 73 + echo "ERROR: This script should be run on the Pi when syncing to Mac." 74 + exit 1 75 + else 76 + echo "Syncing writing files from Pi to Mac..." 77 + rsync -avz --delete "$PI_WRITING_DIR/" "$MAC_WRITING_DIR/" 78 + echo "Writing files sync completed!" 79 + fi 80 + } 81 + 82 + # Function to sync Neovim config from Mac to Pi 83 + sync_nvim_config() { 84 + if [ "$IS_MAC" = true ]; then 85 + # Running on Mac, so we're pushing to Pi 86 + echo "ERROR: This script should be run on the Pi when syncing Neovim config." 87 + exit 1 88 + else 89 + echo "Syncing Neovim config from Mac to Pi..." 90 + rsync -avz "$MAC_NVIM_CONFIG/" "$PI_NVIM_CONFIG_DIR/" 91 + echo "Neovim config sync completed!" 92 + fi 93 + } 94 + 95 + # Function to sync typewriter utility scripts from Mac to Pi 96 + sync_typewriter_config() { 97 + if [ "$IS_MAC" = true ]; then 98 + # Running on Mac, so we're pushing to Pi 99 + echo "ERROR: This script should be run on the Pi when syncing typewriter configs." 100 + exit 1 101 + else 102 + echo "Syncing typewriter utility scripts from Mac to Pi..." 103 + rsync -avz "$MAC_TYPEWRITER_CONFIG/" "$PI_CONFIG_DIR/" 104 + echo "Typewriter utility scripts sync completed!" 105 + fi 106 + } 107 + 108 + # Function to sync SecondBrain from Mac to Pi 109 + sync_secondbrain_from_mac() { 110 + if [ "$IS_MAC" = true ]; then 111 + # Running on Mac, so we're pushing to Pi 112 + echo "ERROR: This script should be run on the Pi when syncing SecondBrain." 113 + exit 1 114 + else 115 + echo "Syncing SecondBrain from Mac to Pi..." 116 + rsync -avz "$MAC_SECONDBRAIN_DIR/" "$PI_SECONDBRAIN_DIR/" 117 + echo "SecondBrain sync completed!" 118 + fi 119 + } 120 + 121 + # Main function to run everything in sequence 122 + main() { 123 + echo "Starting Micro Journal sync process..." 124 + 125 + # 1. Open network 126 + start_network 127 + 128 + # 2. Sync time 129 + sync_time 130 + 131 + # 3. Sync writing from Pi to Mac 132 + sync_writing_to_mac 133 + 134 + # 4. Sync Neovim config from Mac to Pi 135 + sync_nvim_config 136 + 137 + # 5. Sync typewriter utility scripts from Mac to Pi 138 + sync_typewriter_config 139 + 140 + # 6. Sync SecondBrain from Mac to Pi 141 + sync_secondbrain_from_mac 142 + 143 + # 7. Close network 144 + stop_network 145 + 146 + echo "Micro Journal sync process completed successfully!" 147 + } 148 + 149 + # Run the main function 150 + main
+21
nvim-wp/micro-journal-scripts/install/install-wp.sh
··· 1 + #!/bin/bash 2 + 3 + # Simple installation script for Pi Pico typewriter setup 4 + # Usage: ./install-wp.sh 5 + 6 + # Install all packages listed in wp-packages.txt 7 + echo "Installing packages..." 8 + cat wp-packages.txt | grep -v "^#" | xargs sudo apt install -y 9 + 10 + # Create symlink for fd (Debian packages fd as fdfind) 11 + if [ -f "/usr/bin/fdfind" ] && [ ! -f "/usr/local/bin/fd" ]; then 12 + sudo ln -s $(which fdfind) /usr/local/bin/fd 13 + fi 14 + 15 + # Configure zoxide (better cd command) 16 + if ! grep -q "zoxide init" ~/.bashrc; then 17 + echo 'eval "$(zoxide init bash)"' >> ~/.bashrc 18 + echo "Added zoxide to bashrc" 19 + fi 20 + 21 + echo "Installation complete!"
+12
nvim-wp/micro-journal-scripts/install/wp-packages.txt
··· 1 + neovim 2 + yazi 3 + ripgrep 4 + fd-find 5 + fzf 6 + zoxide 7 + jq 8 + poppler-utils 9 + # Heavier packages - uncomment if needed 10 + # imagemagick 11 + # p7zip-full 12 + # ffmpeg
+3
nvim-wp/micro-journal-scripts/startnetwork.sh
··· 3 3 #Start NetworkManager 4 4 5 5 sudo systemctl start NetworkManager 6 + 7 + 8 + # connect to wifi with: `nmcli` device wifi connect "YourNetworkName" password "YourPassword"