WSL2 - Work Setup
=================

All the PCs in the company where I work comes with Windows installed. So I 
spend my working day in Windows and I constantly use Windows Terminal with a 
WSL2 session in it. I recently switched from Debian 12 to AlmaLinux 9 in WSL2.

AlmaLinux 9's default `.bashrc` includes everey file in `~/.bashrc.d` directory,
so I put all of my configurations there.


SSH Client
----------

- File: `~/.bashrc.d/ssh-wsl2`

```
# Support for USB Tokens/Fido2
export SSH_SK_HELPER="/mnt/c/Program Files (x86)/OpenSSH/ssh-sk-helper.exe"

# ssh-agent workaround for WSL2
ssh_pid=$(pidof ssh-agent)
if [ "$ssh_pid" = "" ]; then
        ssh_env="$(ssh-agent -s)"
        echo "$ssh_env" | head -n 2 | tee ~/.ssh_agent_env > /dev/null
fi
if [ -f ~/.ssh_agent_env ]; then
        eval "$(cat ~/.ssh_agent_env)"
fi
```

- File: `~/.ssh/config`

```
Include conf.d/*

Host *
	AddKeysToAgent 3h
```


LYNX Browser
------------

- File: `~/.bashrc.d/lynx`

```
export LYNX_CFG=~/.config/lynx/lynx.cfg
```

- File: `~/.config/lynx/lynx.cfg`

```
INCLUDE:/etc/lynx.cfg
XLOADIMAGE_COMMAND:explorer.exe $(wslpath -w "%s") & 
VIEWER:image/*:explorer.exe $(wslpath -w "%s") &
```

Prompt PS1 and PS2
------------------

- File: `~/.bashrc.d/prompt`

```
# Color list
Black='\[\e[0;90m\]'
Red='\[\e[0;91m\]'
Green='\[\e[0;92m\]'
Yellow='\[\e[0;93m\]'
Blue='\[\e[0;94m\]'
Purple='\[\e[0;95m\]'
Cyan='\[\e[0;96m\]'
White='\[\e[0;97m\]'
Reset='\[\033[m\]'

# Preview:
# username@hostname > directory > $ 
# →
PS1="$Green\u$Black@$Blue\h $Black>$Yellow \w $Black> $Reset\$ \n$Black→ $Reset"
PS2="$Black·$Reset \[\e[m\] "
```