Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uhop/dotfiles

My dotfiles managed by ChezMoi
https://github.com/uhop/dotfiles

Last synced: 1 day ago
JSON representation

My dotfiles managed by ChezMoi

Awesome Lists containing this project

README

        

# dotfiles

It all started as a gist to keep track of my dotfiles: https://gist.github.com/uhop/f11632fa81bff6fa4c25300656dce6e7

Now I decided to use [chezmoi](https://www.chezmoi.io/) to manage them across computers.

# Installation

Generic instructions (see platform-specific notes below):

- Install [brew](https://brew.sh/) on MacOS or Linux.
- Install `chezmoi`:
```bash
brew install chezmoi
```
- Initialize dotfiles:
```bash
chezmoi init --apply uhop
```
- Reboot.

**Important!** If you are not me, change your name and email in the global `git` config:

```bash
git config --global user.name "Your Name"
```

```bash
git config --global user.email "[email protected]"
```

And update your GitHub user name in `.chezmoi.toml.tmpl` and at the bottom of `.bashrc`.

## Installed tools

The choice of tools and aliases is influenced by:

- https://www.askapache.com/linux/bash_profile-functions-advanced-shell/
- https://dev.to/flrnd/must-have-command-line-tools-109f
- https://remysharp.com/2018/08/23/cli-improved
- https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html
- https://opensource.com/article/22/11/modern-linux-commands
- https://github.com/ibraheemdev/modern-unix
- VIM:
- https://github.com/amix/vimrc

The following tools are installed and aliased:

- `wget`, `httpie` — like `curl`.
- `age`, `gpg` — encryption utilities.
- `meld` — a visual diff/merge utility.
- `diff-so-fancy` — a nice `diff` pager.
- `tealdeer`, `cheat` — a `man` replacement. Alternatives: `tldr`.
- `exa` — better `ls`.
- `bat` — better `cat`.
- `fd` — better `find`.
- `ncdu`, `dust` — better `du`.
- `ag`, `ripgrep` — better `ack`.
- `tig`, `lazygit` — text interface for `git`.
- `broot` — better `tree`.
- `prettyping`, `gping` — better `ping`.
- `htop` — better `top`.
- `btop` — better `top`.
- `awscli`, `aws-iam-authenticator`, `kubernetes-cli`, `helm`, `gh`, `hub`, `nginx`, `net-tools`, `xh` — useful utilities for web development.
- `parallel` — shell parallelization.
- `fzf` — a command-line fuzzy finder.
- `micro` — an editor. Alternatives: `nano`.
- `jq` — JSON manipulations.
- `tmux` — the venerable terminal multiplexor.
- `golang`, `python3`, `pyenv`, `rustc`, `wabt`, `zig` — language environments we use and love.
- `brotli` — better than `gzip`, used by HTTP.
- `mc` — Midnight Commander for file manipulations.
- `yazi` — Yet Another terminal file manager
- `alacritty` — no-nonsense terminal.
- `kitty` — no-nonsense terminal.
- `duf` — a disk utility.
- `hyperfine` — benchmarking better than `time`.
- `zoxide` — better `cd`.
- `bottom` — a system monitor.
- `node`, `nvm`, `deno`, `bun` — JavaScript environments.
- `helix` — a modal text editor.
- `whalebrew` — like `brew` but for Docker images.
- `xc` — a task runner.
- `mosh` — a mobile shell.
- `lnav` — a log navigator
- `sd` — better `sed`.

Check `.bash_aliases` for a list of aliases.

# Platform-specific notes

## Ubuntu (Debian)

### Installation

These instructions assume a newly installed OS. Otherwise, adjust accordingly.

- Install prerequisites:
```bash
sudo apt install build-essential curl git git-gui gitk micro
```
- Install `brew`:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
- The exact installation instructions can change from time to time. Check https://brew.sh/ if you encounter any problems.
- Restart the session or initialize `brew`:
```bash
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
```
- Install `chezmoi`:
```bash
brew install chezmoi
```
- Initialize dotfiles:
```bash
chezmoi init --apply uhop
```
- The initial script installs various utilities using `apt`. Thus it requires a `sudo` password. Don't be alarmed.
Inspect `run_onchange_before_install-packages.sh.tmpl` for more details.
- Reboot.

### Fonts

Fonts on Linux (Ubuntu): see https://askubuntu.com/questions/3697/how-do-i-install-fonts

- Download font, e.g., Hack Nerd Font and/or FiraCode Nerd Font from https://www.nerdfonts.com/font-downloads
- Unzip its archive to `~/.local/share/fonts/`.
- Run:
```bash
fc-cache -fv
```

FiraCode Nerd Font is used for `code` (Visual Studio Code). It supports common programming ligatures.
Hack Nerd Font is used as a monospaced font for terminals (e.g., `gnome-terminal`) and similar programs (`git-gui`, `gitk`, …).

These dotfiles assume that these fonts are preinstalled and use them as appropriate.

### Video

Restricted soft on Ubuntu to play videos:

```bash
sudo apt install ubuntu-restricted-extras vlc libdvd-pkg
```

```bash
sudo dpkg-reconfigure libdvd-pkg
```

More on videos: https://www.omgubuntu.co.uk/2022/08/watch-bluray-discs-in-vlc-on-ubuntu-with-makemkv

### Cut-and-paste

To support cut-and-paste in the micro editor:

- Use the default (`"external"`) for the clipboard option.
- Install a proper command-line clipboard tool:
- For Wayland:
```bash
sudo apt install wl-clipboard
```
- For X11 (realistically only one could be installed):
```bash
sudo apt install xclip xsel
```
- You may install all of them for a good measure:
```bash
sudo apt install wl-clipboard xclip xsel
```

### Keyboard shortcuts

F10 doesn't work in a terminal: https://superuser.com/questions/1543538/f10-key-not-working-in-terminal-mc-ubuntu-19-10

### Titan security key

See: https://support.google.com/titansecuritykey/answer/9148044?hl=en

A key should be registered only once. When I attempted to do so, I was misleadingly informed that
"this device cannot be used to create passkeys". When it happened, press "Use other device",
which will switch from the current computer to the key and now everything will go smoothly.

### Ubuntu on Mac

Enabling Fn keys:

- https://help.ubuntu.com/community/AppleKeyboard
- https://askubuntu.com/questions/33514/use-function-keys-without-pressing-the-fn-button-in-the-mac-keyboard

Video driver:

- https://askubuntu.com/questions/1295423/ubuntu-20-04-on-imac-mid-2011-cant-adjust-brightness
- This answer worked for my MacBook Air: https://askubuntu.com/a/1478635

## GUI

### Package managers

I use `apt`, `snap`, `flatpak`, `brew` and `AppImageLauncher`. Most GUI apps are installed with `flatpak`.
They are installed manually using Win-A (Cmd-A) from Gnome.

- `flatpak`
- `flatseal` — `flatpak` permission editor.
- `calibre` — an e-book manager.
- Web browsers (used for testing):
- Brave
- Chromium
- Google Chrome
- Microsoft Edge
- Communications:
- Skype
- Slack
- Zoom
- `steam` — the game launcher from Valve.
- `wezterm` — a modern terminal.
- `snap`
- `code` — Visual Studio Code.
- `firefox` — a web browser (it comes preinstalled).
- `postman` — a tool for debugging network services.
- It is available as a flatpak, but apparently it is completely unusable.
- `AppImageLauncher`
- It is installed using the official `.deb` file or the PPA: https://github.com/TheAssassin/AppImageLauncher/wiki/Install-on-Ubuntu-or-Debian

# Application-specific notes

## tmux

The alias to invoke `ssh` with `tmux` is `ssht`: `ssht srv`..

When running locally `tmux` uses
the standard prefix: Ctrl+b. When invoked remotely through `ssht` it uses
the prefix: Ctrl+a. This way you can use different prefixes for local and
remote sessions.

When running `tmux` for the first time, install plugins by pressing Prefix+I.
To update plugins, press Prefix+U. Note that `I` and `U` are uppercase.

## Micro

The `prettier` plugin is installed manually: https://github.com/claromes/micro-prettier

Consider its cousin for Python: https://github.com/claromes/micro-yapf

The rest of plugins (excluding default plugins) are installed using:

```bash
mic -plugin install fzf
```

The list of recommended plugins can be found here: `~/.config/micro/plugins.txt`.

Links on customization:

- https://claromes.com/blog/customizing-my-micro-editor.html

## Kitty terminal

See for details on installing: https://sw.kovidgoyal.net/kitty/binary/