bash: add wsl/*.bashrc

master
Alan Faubert 10 months ago
parent 4d12497a66
commit 409c98a5bf
  1. 4
      bash/README.md
  2. 8
      bash/wsl/load_ssh_key.bashrc
  3. 1
      bash/wsl/no_privileged_ports.bashrc
  4. 1
      bash/wsl/start_cron_service.bashrc
  5. 5
      config.sh

@ -12,6 +12,10 @@ If you create additional `~/.bashrc.d/*` or `~/.profile.d/*` files, they will al
- [`2path.sh`](scripts/2path.sh) - create symlinks to files or directories from `~/.local/bin`, giving unique names to directories
- [`syncfiles.sh`](scripts/syncfiles.sh) - given paths to two or more files, prompt to copy the newest one over each of the ones it differs from
## Optional WSL scripts
- [`wsl/*.bashrc`](wsl) - scripts to be symlinked to from `~/.bashrc.d/*` for optional WSL-specific enhancements
## Adding color to root user shells
Add this to `/etc/bash.bashrc`

@ -0,0 +1,8 @@
ssh-add -l > /dev/null 2> /dev/null
if [ $? = 1 ]; then
read -N 1 -p "Load SSH key from Windows clipboard now? [y/n] " -r r
echo
if [ "$r" = y ]; then
powershell.exe -noprofile -command get-clipboard | tr --delete \\r | ssh-add -
fi
fi

@ -0,0 +1 @@
[ "$(sysctl --values net.ipv4.ip_unprivileged_port_start)" = 0 ] || wsl.exe --distribution $WSL_DISTRO_NAME --user $(id --name --user 0) -- sysctl net.ipv4.ip_unprivileged_port_start=0 > /dev/null

@ -0,0 +1 @@
service cron status > /dev/null || wsl.exe --distribution $WSL_DISTRO_NAME --user $(id --name --user 0) service cron start

@ -6,7 +6,7 @@ root_win="$([[ "$(uname --kernel-release)" =~ [Mm]icrosoft ]] && wslpath -w .)"
while :; do
action="$(whiptail --menu '' $(tput lines) $(tput cols) $(($(tput lines) - 7)) \
wsl- 'WSL' wsl-scripts ' Set up WSL helper scripts' wsl-win ' Create ~/win symlink to %USERPROFILE%' wsl-wsltty ' Create WSLtty config symlinks (Windows)' \
bash- 'Bash' bash ' Create ~/* symlinks to config' bash-scripts ' Set up util scripts' \
bash- 'Bash' bash ' Create ~/* symlinks to config' bash-scripts ' Set up util scripts' bash-wsl-bashrc ' Create WSL-specific ~/.bashrc.d/ symlinks' \
git- 'Git' git ' Create config symlinks (Linux+Windows)' git-delta ' Install Delta' git-filter-repo ' Install git-filter-repo' git-scripts ' Set up various scripts' \
vscode- 'VS Code' vscode-ext ' Install extensions (Linux/Windows)' vscode ' Create config symlinks (Linux+Windows)' \
nodejs- 'Node.js' nodejs-npmrc ' Create ~/.npmrc symlink' nodejs-config ' Create ~/dev/* symlinks to config' nodejs-scripts ' Set up various scripts' \
@ -31,6 +31,9 @@ while :; do
bash-scripts)
2path.sh bash/scripts
;;
bash-wsl-bashrc)
2link.sh ~/.bashrc.d bash/wsl/*.bashrc
;;
git)
2link.sh ~ git/.gitconfig &&
{ [ -z "$root_win" ] || 2link.sh "$(get_var_path USERPROFILE)" git/.gitconfig; }

Loading…
Cancel
Save