Mehdi Kabab's dotfiles
Manage backup, restore, and installation of my environments since 2011. Based on the XDG Base Directory Specification and uses GNU Stow to maintain symlinks to my home directory. Mainly to reduce the mess in my $HOME
πΊ
Preview of my Neovim interface
As Front-end developer, I am using CLI in my day-to-day workflow. The tools I use most frequently have their configuration versioned in this repository:
- Kitty as terminal emulator.
- Zsh as main shell with zim to manage shell plugins and Starship prompt.
- Neovim as main editor and visual editor.
- fzf as command-line fuzzy finder πΈ
- ripgrep as search and replace tool.
- fd as fast and user-friendly alternative to find.
- Lazygit as git Terminal UI (TUI).
I use Fedora with Wayland, switching between GNOME Desktop Environment and the Sway compositor. These dotfiles help me:
- configure packages repos
- install essential packages
- setup multimedia capabilities
- setup GNOME
- setup Sway
- backup configurations
I also use macOS in my daily life. Homebrew is my packages manager.
Warning
This repository covers my personal needs. I do not recommend that you run the setup or installation tasks without reviewing the code and understanding its impact. Use at your own risk!
You can start by cloning the repository.
$ git clone --depth 1 https://github.com/piouPiouM/dotfiles.git ~/.dotfiles
$ cd ~/.dotfiles
Note
I use~/.dotfiles
as the destination directory because an alias allows me to directly edit the folder from any location:dotfiles
.
The best option for controlling your environment: install only what you need. However, 3 tasks will be required to ensure that the other automated tasks run smoothly:
$ make install-dirs install-stow install-links
Now you can browse the available tasks using the make help
command.
These instructions are for setting up new macOS or Fedora operating system.
$ make setup
Warning
It's a WIP target knowing that I'm adding cross-platform support and that I don't reinstall my OS every day π
$ make install
I use my dotfiles for personal and professional purposes, on distinct devices. Some information such as my git email address or business scripts, are stored specifically on each machine. To help me, some non-versioned configuration files can be loaded:
- Shell environment:
~/.local/share/zsh/exports.zsh
. - Git:
~/.local/share/git/config
(copy local-config.sample).
App | Config file |
---|---|
Zsh environment | ~/.local/share/zsh/exports.zsh |
Git | ~/.local/share/git/config (see local-config.sample) |
I heavily use Make to automatize my maintenance tasks.
Why Make? Because it's commonly shipped with *nix OS. I can directly launch the setup process without installing anything else.
Note
The accessible targets are dynamically created to be conform with the current OS. See include/make/ directory.
$ make help
Output of make help
Targets: apps-install-difftastic Install Difftastic, a structural diff tool. apps-install-fzf Install fzf (Fuzzy finder) from sources. apps-install-go Install Go applications. apps-install-lua Install Lua packages. apps-install-rust Install Rust applications. apps-install-starship Install Starship shell prompt. apps-uninstall-fzf Uninstall fzf (Fuzzy finder). apps-update-fzf Update fzf (Fuzzy finder). apps-update-go Update Go applications. apps-update-rust Update Rust applications. backup Backup all settings. backup-brew Backup Homebrew packages. backup-npm Backup list of global npm packages. cleanup Clean all cache systems. help Print usage and this help message. icon-kitty-dark Apply a fancy dark icon to Kitty. icon-kitty-light Apply a fancy light icon to Kitty. install Install all the prerequisites. install-fonts Download and install fonts. install-fonts-codicon Download and install Codicon font. install-fonts-ibm-plex Download and install IBM Plex. install-fonts-nerd Download and install Nerd Fonts. install-fonts-nerd-symbols-only Download and install Nerd Fonts Symbols only. install-neovim Install or update Neovim nightly. install-neovim-dependencies Install or update Neovim dependencies. install-packages-homebrew Install Homebrew packages. install-themes Install themes for various tools. link-bin Link personnal binaries. link-home Generates only symlinks for the $HOME directory. restore-npm Install globaly npm packages. setup Perform setup of the device. setup-brew Install Homebrew and your packages. setup-dirs Creates the dotfiles tree structure. setup-links Generates all the symlinks. setup-neovim Setup Neovim environment. setup-npm Setup npm environment. theme-catppuccin Download Catppuccin theme. theme-github Download Github Contrib themes. theme-nightfox Download Nightfox theme. theme-rose-pine Download RosΓ© Pine theme. unlink-all Deletes all the symlinks. unlink-bin Delete symlink of custom binaries. unlink-home Deletes symlinks in the Home directory. update-packages-homebrew Update Homebrew packages. update-packages-npm Update globaly all npm packages. versions Print the version number of main programs.Symlink targets: [un]link-bash [un]link-bat [un]link-btop [un]link-clifm [un]link-environment [un]link-fd [un]link-fzf [un]link-git [un]link-go [un]link-kitty [un]link-lazygit [un]link-nvim [un]link-ranger [un]link-ripgrep [un]link-tmux [un]link-zsh
$ make backup
Saves manually changed or added items in the setup
directory:
What? | Linux | Fedora | macOS |
---|---|---|---|
DNF & Corp Repo | β | ||
Flatpak apps | β | β | |
GNOME extensions | β | β | |
GNOME settings | β | β | |
Homebrew packages | β | ||
NPM global packages | β | β | β |
My Neovim configuration is the one that evolves most frequently. The plugins I use are no exception, as the Neovim ecosystem is so rich and constantly evolving. Please refer to the dedicated documentation for details of my configuration.
$ make setup-neovim
The task will install Neovim Nightly (which follows the HEAD of the git master branch) with the needed dependencies and providers.
$ make install-fonts
Launch installation of used font-faces, mainly:
- JetBrains Mono as monospace font.
- IBM Plex for Obsidian.
- Nerd Fonts to enhance my TUI.
Note
Symbols of Nerd Fonts are installed by theinstall-fonts-nerd-symbols-only
target, which also updates the list of symbols in Kitty's configuration and fzf-lua dedicated picker in order to always be up to date πͺ
After years of using the Iceberg theme for Vim and Neovim, I've decided to opt for these 3 themes, which also offer satisfactory light variations: Catppuccin, RosΓ© Pine and NightFox.
$ make install-themes
Where available, themes for these tools are also downloaded:
App | Catppuccin | RosΓ© Pine | NightFox |
---|---|---|---|
bat | β | β | |
btop | β | ||
fzf | β | β | |
kitty | β | β | β |
lazygit | β | ||
neovim | β | β | β |
rofi (linux) | β | β |
Each theme can be individually installed or updated with the tasks theme-catppuccin
, theme-rose-pine
or theme-nightfox
.
Each tool requires its own method for using a theme. This is automated with the colorscheme dark|light|soft-dark|soft-light
shell command. The preference is saved in the ~/.theme
file (home/dot-theme).
$ colorscheme light
β» Theme applied for Kitty
β» Theme applied for Bat
β» Theme applied for btop
β» Theme applied for fzf
β» Theme applied for Lazygit
Note
Neovim does not yet benefit from this automation.
The way Make works means that some tasks will have no effect because the files downloaded or created already exist on disk. Use the -B
flag to force execution of the task:
$ make theme-rose-pine # Do nothing
$ make -B theme-rose-pine # Force
β’ Download rose-pine.sh for fzf
β’ Download rose-pine-dawn.sh for fzf
β’ Download rose-pine-moon.sh for fzf
β’ Download rose-pine.rasi theme for Rofi
β’ Download rose-pine-dawn.rasi theme for Rofi
β’ Download rose-pine-moon.rasi theme for Rofi
This error may occur when opening a new shell. The following command will certainly solve the problem:
$ compaudit | xargs chmod g-w
If you get this error when using Kitty, you need to reset the Finder access permissions using the following command. A
confirmation prompt will be displayed the next time you run the trash
command.
$ tccutil reset AppleEvents net.kovidgoyal.kitty
Thx to @gsbabil for the tip!