Describe setup of shell and vscode on client

This commit is contained in:
Marcel Straub
2022-01-16 19:25:16 +01:00
parent 7ac95bf32c
commit 80d61f167b
3 changed files with 120 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
---
title: Client
descriptions: Short documentation about my client setup
summary: empty summary
weight: 1
categories:
- network
---
# Operating system
I'm currently using Kubuntu 20.10 as my workstation operating system.
How I configured particular parts of it can be found in the subsections.

View File

@@ -0,0 +1,52 @@
---
title: Visual Studio Code
#descriptions: empty description
#summary: empty summary
#weight: 2
categories:
- IDE
tags:
- vscode
- vscodium
- VisualStudio Code
---
# VisualStudio Code
I really like Visual Studio code (VSCode) because of its versatile plugins for nearly everything. VSCode is open-source. The version published by Microsoft is not open-source and include tracking telemetry. That's why I prefere to use [VSCodium](https://vscodium.com/).
## Installation
- Add GPG key of @paulcarotty
```shell
wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg \
| gpg --dearmor \
| sudo dd of=/usr/share/keyrings/vscodium-archive-keyring.gpg
```
- Add the repository
```shell
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg ] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs vscodium main' \
| sudo tee /etc/apt/sources.list.d/vscodium.list
```
- Install vscodium
```shell
sudo apt update
sudo apt install codium
```
Now, you can start vscodium by executing ``codium``.
## Marketplace
Everything comes at a price. In case of VSCodium, it is that deployed ``product.json`` does not include the appropriate configuration to use the VS Code Marketplace but [open-vsx.org](https://open-vsx.org). To change the marketplace to the one used by Visual Studio Code published by Microsoft, you need to edit or create your ``~/.config/VSCodium/product.json`` and add the following
```json
{
"extensionsGallery": {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
"itemUrl": "https://marketplace.visualstudio.com/items",
"controlUrl": "",
"recommendationsUrl": ""
}
}
```
## Further limitations
According to [official documentation](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#proprietary-debugging-tools), there exist more limitations. Until now, these did not pose an issue for me. But it is better to be aware of it then debugging later for some hours or even days.

View File

@@ -0,0 +1,56 @@
---
title: Shell configuration
descriptions: empty description
summary: empty summary
#weight: 2
categories:
- Shell
- zsh
tags:
- .zshrc
- oh-my-zsh
- powerlevelk9
- nerdfont
---
# ZSH
I prefer to use ZSH because of its advanced features mainly the easy file name globbing. With [oh my zsh](https://ohmyz.sh/) a good framework for extensions to ZSH exist. The documentation can be found at [GitHub](https://github.com/ohmyzsh/ohmyzsh/wiki). However, the installation practice with directly executing a shell script from GitHub is quite dangerous, as you do not have a trustworthy anchor like signed Linux distribution packages. Hence, I suggest to **review** the [installation script](https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh) at least prior to installing. At the very end, the install script asks for changing your users default shell to zsh.
```shell
apt-get install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
## Configuring oh my zsh
Oh my zsh, is mainly configured through your ``.zshrc`` file.
### Theme and Fonts
I like the [powerlevel9k](https://github.com/Powerlevel9k/powerlevel9k/wiki) theme. It is installed by cloning its GitHub repository into the theme directory
```zsh
$ git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
```
and selecting it as the theme in your ``.zshrc``:
```zsh
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(history)
POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
POWERLEVEL9K_MODE='nerdfont-complete'
```
As you can see, a particular font, i.e. ``nerdfont-complete`` is required. It gives you these nice symbols in shell
![zsh_theme_demo](/client/ohmyzsh_theme_demoprompt.png)
Ther nedfonts can be downloaded from [Nerdfonts.com](https://nerdfonts.com), [GitHub](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/Hack/Regular/complete) or directly [here](client/nerdfont.zip). The fonts are under MIT license.
To use these fonts, copy the ``*.ttf`` files into ``~/.fonts``. Alternatively, you can install them system-wide by copying them over to ``/usr/loca/share/fonts``. Aferwards, the font can be directly used from any program. You need to configure your terminal GUI, to use that fonts too.
### Keychain
As I often use SSH or GPG from shell and want to have some comfort too, I use [``keychain``](https://github.com/funtoo/keychain). It ensures that your SSH keys are available through ``ssh-agent``. Hence, you must install it before configuring through
```zsh
$ apt install keychain
```
Afterwards, adapt your ``.zshrc`` to include the usage of the keychain plugin and load your SSH private key stored in the file ``id_rsa`` in your main SSH directory, i.e. usually ``~/.ssh/``.
```zsh
plugins=(... keychain ...)
zstyle :omz:plugins:keychain agents gpg,ssh
zstyle :omz:pluginz:keychain identities id_rsa
```