# Install Code Server on Artix

Same as installing code-server on Arch, except you need an OpenRC script.
<!--more-->

## Install using yay
`yay` is a convenient AUR helper. 
```bash
yay -S code-server 
```

## Install using makepkg
```bash 
git clone https://aur.archlinux.org/code-server.git
cd code-server
makepkg -si 
```

## Download and configure OpenRC script
The [script](https://gitea.adityakumar.xyz/aditya/code-server-openrc) is pretty generic and should work on most OpenRC-based distributions with minimal tweaks. You just need to download it, make it executable and put your username in line 3.
```bash
cd /etc/init.d/
sudo wget -c https://gitea.adityakumar.xyz/aditya/code-server-openrc/raw/branch/master/code-server 
sudo chmod +x code-server 
```

`code-server` reads configuration from `~/.config/code-server/config.yaml`. It is better than sending arguments directly to `code-server` using the script.

## Usage
Start on boot with default runlevel
```bash
sudo rc-update add code-server default 
```

Start the service immediately
```bash
sudo rc-service code-server start 
```

