Skip to content

Instantly share code, notes, and snippets.

@rgbatty
Created March 22, 2022 05:38
Show Gist options
  • Save rgbatty/789fa006046d8116eb4cbb4c346c58a3 to your computer and use it in GitHub Desktop.
Save rgbatty/789fa006046d8116eb4cbb4c346c58a3 to your computer and use it in GitHub Desktop.
Obsidian WSL Linking
#!/bin/bash
echo "Starting Windows configuration"
WIN_USERPATH=$(wslpath $(wslvar USERPROFILE))
WIN_OBSIDIAN=$WIN_USERPATH/Documents/obsidian
WIN_VAULTSDIR=$WIN_OBSIDIAN/vaults
WSL_OBSIDIAN=~/obsidian
if [ ! -d "$WIN_VAULTSDIR" ]; then
echo "Creating $WIN_VAULTSDIR"
mkdir -p $WIN_VAULTSDIR
fi
if [ ! -L $WSL_OBSIDIAN ]; then
echo "Symlinking $WIN_OBSIDIAN to $WSL_OBSIDIAN"
ln -s "$WIN_OBSIDIAN" "$WSL_OBSIDIAN"
fi
echo "Windows configuration finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment