Merge branch 'main' into opt

This commit is contained in:
Michel 2024-02-12 15:03:52 +01:00
commit af856c45af
8 changed files with 86 additions and 45 deletions

View File

@ -1,11 +1,12 @@
<!-- markdownlint-disable line-length no-inline-html no-duplicate-heading -->
# Bare Git Repository # Bare Git Repository
- https://www.atlassian.com/git/tutorials/dotfiles - <https://www.atlassian.com/git/tutorials/dotfiles>
- StreakyCobra - StreakyCobra
## Starting from scratch ## Starting from scratch
``` ```sh
git init --bare $HOME/.dotfiles git init --bare $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME' alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no dotfiles config --local status.showUntrackedFiles no
@ -19,7 +20,7 @@ files which would be overwritten by Git.
The “BKDIR” part is a rough shortcut to move all the offending files The “BKDIR” part is a rough shortcut to move all the offending files
automatically to a backup folder: automatically to a backup folder:
``` ```sh
git clone --bare <git-repo-url> $HOME/.dotfiles git clone --bare <git-repo-url> $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME' alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
@ -35,7 +36,7 @@ dotfiles checkout
## Install into `/etc/skel` ## Install into `/etc/skel`
``` ```sh
sudo mkdir -p /etc/skel/.dotfiles sudo mkdir -p /etc/skel/.dotfiles
sudo chown $(whoami) /etc/skel sudo chown $(whoami) /etc/skel
@ -53,13 +54,13 @@ skelfiles checkout
## Other Tools ## Other Tools
``` ```sh
lazygit --git-dir=$HOME/.dotfiles --work-tree=$HOME lazygit --git-dir=$HOME/.dotfiles --work-tree=$HOME
``` ```
# Install remotes as subtree # Install remotes as subtree
- https://www.atlassian.com/git/tutorials/git-subtree - <https://www.atlassian.com/git/tutorials/git-subtree>
- Create an alias for remote repository - Create an alias for remote repository
- `dotfiles remote add <remote-name> <URL>` - `dotfiles remote add <remote-name> <URL>`
- Import remote as a single commit (squashed) - Import remote as a single commit (squashed)
@ -75,12 +76,11 @@ lazygit --git-dir=$HOME/.dotfiles --work-tree=$HOME
From [stackoverflow](https://stackoverflow.com/questions/28484186/apply-github-commit-pull-request-as-a-patch). From [stackoverflow](https://stackoverflow.com/questions/28484186/apply-github-commit-pull-request-as-a-patch).
``` ```sh
wget https://github.com/jesseduffield/lazygit/pull/2604.patch wget https://github.com/jesseduffield/lazygit/pull/2604.patch
git apply --stat --apply 2604.patch git apply --stat --apply 2604.patch
``` ```
## Fonts ## Fonts
- [How to install and manage fonts on Linux](https://linuxconfig.org/how-to-install-and-manage-fonts-on-linux) - [How to install and manage fonts on Linux](https://linuxconfig.org/how-to-install-and-manage-fonts-on-linux)
@ -94,28 +94,27 @@ git apply --stat --apply 2604.patch
- [Download](https://github.com/ryanoasis/nerd-fonts/tags) - [Download](https://github.com/ryanoasis/nerd-fonts/tags)
- NerdFontsSymbolsOnly.tar.xz - NerdFontsSymbolsOnly.tar.xz
- [Cheat Sheet](https://www.nerdfonts.com/cheat-sheet) - [Cheat Sheet](https://www.nerdfonts.com/cheat-sheet)
- https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/bin/scripts/test-fonts.sh - <https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/bin/scripts/test-fonts.sh>
### in /opt/fonts ### in /opt/fonts
`/etc/fonts/conf.d/00-opt.conf`: `/etc/fonts/conf.d/00-opt.conf`:
``` ```xml
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig> <fontconfig>
<dir>/opt/fonts</dir> <dir>/opt/fonts</dir>
</fontconfig> </fontconfig>
``` ```
## kitty ## kitty
- https://sw.kovidgoyal.net/kitty/binary/ - <https://sw.kovidgoyal.net/kitty/binary/>
- Install `JetBrains Mono` (without NF) & `NerdFontsSymbolsOnly` fonts. - Install `JetBrains Mono` (without NF) & `NerdFontsSymbolsOnly` fonts.
- Note: outside of kitty, it may be interesting to also install - Note: outside of kitty, it may be interesting to also install
_JetBrains Mono_ *with* _NF_. _JetBrains Mono_ **with** _NF_.
``` ```sh
sudo apt-get install kitty-terminfo sudo apt-get install kitty-terminfo
(kitty --version && curl https://sw.kovidgoyal.net/kitty/changelog/ | html2text) | less (kitty --version && curl https://sw.kovidgoyal.net/kitty/changelog/ | html2text) | less
@ -130,7 +129,6 @@ sudo update-alternatives \
Kitty prepends its _bin_ folder to the path. Kitty prepends its _bin_ folder to the path.
So it is more coherent/simpler to copy this behaviour into Zsh. So it is more coherent/simpler to copy this behaviour into Zsh.
## lazygit ## lazygit
### Dependencies ### Dependencies
@ -139,7 +137,7 @@ So it is more coherent/simpler to copy this behaviour into Zsh.
### Binary Releases ### Binary Releases
``` ```sh
mkdir -p /opt/lazygit/bin mkdir -p /opt/lazygit/bin
cd /opt/lazygit/bin cd /opt/lazygit/bin
@ -155,6 +153,22 @@ wget $LOCATION
tar xf *.tar.gz(om[1]) tar xf *.tar.gz(om[1])
``` ```
### Go
```sh
go install github.com/jesseduffield/lazygit@latest
```
### Manual
```sh
mkdir -p $HOME/dev_3rd/golang
cd $HOME/dev_3rd/golang
git clone https://github.com/jesseduffield/lazygit.git
cd lazygit
go install
```
## neovim ## neovim
@ -166,7 +180,7 @@ tar xf *.tar.gz(om[1])
### Binary Nightly Release ### Binary Nightly Release
``` ```sh
mkdir -p /opt/neovim/bin mkdir -p /opt/neovim/bin
cd /opt/neovim/bin cd /opt/neovim/bin
@ -190,10 +204,10 @@ vi --version
- bsdtar (`libarchive-tools`) supports _Zstd_ - bsdtar (`libarchive-tools`) supports _Zstd_
- [fuse-archive](https://github.com/google/fuse-archive) - [fuse-archive](https://github.com/google/fuse-archive)
- `atool`: last release is from 2012 - `atool`: last release is from 2012
- https://github.com/solsticedhiver/atool2 - <https://github.com/solsticedhiver/atool2>
- https://github.com/wummel/patool - <https://github.com/wummel/patool>
- Drag&Drop: URI=https://github.com/mwh/dragon - Drag&Drop: <https://github.com/mwh/dragon>
- Trash: - Trash:
- `trash-cli` is a much better CLI-only solution! - `trash-cli` is a much better CLI-only solution!
@ -202,7 +216,7 @@ vi --version
### Source Code of Latest Release ### Source Code of Latest Release
``` ```sh
# Download archive & extract files # Download archive & extract files
URI=https://github.com/jarun/nnn URI=https://github.com/jarun/nnn
xdg-open $URI/releases/latest xdg-open $URI/releases/latest
@ -215,5 +229,13 @@ make clean
sudo make PREFIX=/opt/nnn O_GITSTATUS=1 O_NAMEFIRST=1 O_NERD=1 install sudo make PREFIX=/opt/nnn O_GITSTATUS=1 O_NAMEFIRST=1 O_NERD=1 install
# Copy plugins # Copy plugins
plugins/getplugs plugins/getplugs master
``` ```
### From repository
```sh
git clone https://github.com/jarun/nnn.git
```
and then, as above…

View File

@ -0,0 +1,6 @@
[Desktop Entry]
Exec=/home/michel/bin/once-connected.zsh
Icon=user
Name=once-connected.zsh
Terminal=false
Type=Application

View File

@ -0,0 +1,2 @@
NC_STORAGE=$HOME/NC-Michel/Linux/folder
ALT_HISTORY_FILE=$HOME/NC-Michel/Linux/another-folder/history

View File

@ -1,2 +0,0 @@
export NC_STORAGE="$HOME/NC-Michel/Linux/folder"
export ALT_HISTORY_FILE="$HOME/NC-Michel/Linux/another-folder/history"

12
.zimrc
View File

@ -2,11 +2,7 @@
### Zim Modules ### Zim Modules
### ###
# apt install bat curl fd-find fzf lsd ripgrep ### Completion
# dpkg-divert --divert /usr/bin/bat --rename /usr/bin/batcat
# dpkg-divert --divert /usr/bin/fd --rename /usr/bin/fdfind
### Behaviour
# Additional completion definitions for Zsh. # Additional completion definitions for Zsh.
zmodule zsh-users/zsh-completions zmodule zsh-users/zsh-completions
@ -15,9 +11,6 @@ zmodule zsh-users/zsh-completions
# completion must be sourced after zsh-users/zsh-completions # completion must be sourced after zsh-users/zsh-completions
zmodule completion zmodule completion
# Figures out where to get the best help, and gets it.
zmodule run-help
### Productivity ### Productivity
@ -47,6 +40,9 @@ zmodule b4b4r07/enhancd
# ZVM — Zsh Vi Mode # ZVM — Zsh Vi Mode
zmodule jeffreytse/zsh-vi-mode zmodule jeffreytse/zsh-vi-mode
# Loads the "inner function" & binds alt-H key
zmodule run-help
# Fast Syntax Highlighting # Fast Syntax Highlighting
# #
# `fast-theme --list` to list available themes -> "free" # `fast-theme --list` to list available themes -> "free"

32
.zshrc
View File

@ -1,5 +1,18 @@
#!/bin/zsh #!/bin/zsh
###
### Debian Settings
###
# apt install bat curl fd-find fzf lsd ripgrep
# dpkg-divert --divert /usr/bin/bat --rename /usr/bin/batcat
# dpkg-divert --divert /usr/bin/fd --rename /usr/bin/fdfind
# dpkg-divert --divert /usr/share/man/man1/bat.1.gz --rename /usr/share/man/man1/batcat.1.gz
# dpkg-divert --divert /usr/share/man/man1/fd.1.gz --rename /usr/share/man/man1/fdfind.1.gz
# dpkg-divert --divert /usr/share/zsh/vendor-completions/_rg --rename /usr/share/zsh/vendor-completions/rg.zsh
### ###
### Zsh Configuration ### Zsh Configuration
### ###
@ -10,6 +23,9 @@ SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? '
# Characters considered part of a word by the line editor # Characters considered part of a word by the line editor
WORDCHARS="*?_-.~$" WORDCHARS="*?_-.~$"
# Set the "main" keyboard so `bindkey` without `-M` will change the expected map
bindkey -A viins main
### ###
### Path ### Path
@ -55,6 +71,12 @@ ENHANCD_ARG_DOUBLE_DOT='.'
ENHANCD_ENABLE_SINGLE_DOT=false ENHANCD_ENABLE_SINGLE_DOT=false
### fzf ### fzf
#
# Scripts sourced by zvm_after_init()
#
# - https://github.com/junegunn/fzf#key-bindings-for-command-line
# - https://github.com/junegunn/fzf#fuzzy-completion-for-bash-and-zsh
# #
# Adapted from https://github.com/zimfw/fzf # Adapted from https://github.com/zimfw/fzf
# #
@ -92,14 +114,6 @@ if (( ${+FZF_DEFAULT_COMMAND} )) export FZF_CTRL_T_COMMAND=${FZF_DEFAULT_COMMAND
# #
FZF_CTRL_R_OPTS="--no-sort --exact" FZF_CTRL_R_OPTS="--no-sort --exact"
# Scripts sourced by zvm_after_init()
#
# - source /usr/share/doc/fzf/examples/key-bindings.zsh
# https://github.com/junegunn/fzf#key-bindings-for-command-line
#
# - source /usr/share/doc/fzf/examples/completion.zsh
# https://github.com/junegunn/fzf#fuzzy-completion-for-bash-and-zsh
# fzf: Alternate history (Ctrl-Win-R) # fzf: Alternate history (Ctrl-Win-R)
# #
if [[ -f $ALT_HISTORY_FILE ]]; then if [[ -f $ALT_HISTORY_FILE ]]; then
@ -489,7 +503,7 @@ typeset -U path fpath
### Completion Late Definitions ### Completion Late Definitions
### ###
compdef bat=cat compdef bat=batcat
# Hide "parameters" (i.e. environment variables) when looking for a "command" # Hide "parameters" (i.e. environment variables) when looking for a "command"
zstyle ':completion:*:-command-:*' tag-order '!parameters' zstyle ':completion:*:-command-:*' tag-order '!parameters'

View File

@ -7,12 +7,14 @@ alias xterm='xterm -bg black -fg white -fa Hack -fs 10'
## Cloud folder must exist ## Cloud folder must exist
# #
if [ -z "$NC_STORAGE" ]; then if [ -z "$NC_STORAGE" ]; then
echo "${fg[red]}NC_STORAGE environment variable not set." autoload colors && colors
echo "${fg[cyan]}NC_STORAGE${fg[red]} environment variable not set."
exit 1 exit 1
fi fi
if [ ! -d $NC_STORAGE ]; then if [ ! -d $NC_STORAGE ]; then
echo "${fg[cyan]}$NC_STORAGE ${fg[red]}is not a folder (in \$NC_STORAGE)." autoload colors && colors
echo "${fg[cyan]}\$NC_STORAGE (=$NC_STORAGE)${fg[red]} is not a folder."
exit 2 exit 2
fi fi

View File

@ -14,7 +14,8 @@ xterm -geometry 120x40 -title "Mount devices" -hold -e $HOME/bin/mount_dev.zsh
## Start periodic actions ## Start periodic actions
# #
$HOME/bin/every-hour.zsh
eval xterm -hold -e env $(cat ~/.config/environment.d/variables.conf) $HOME/bin/every-hour.zsh
## Wait for an Internet connection ## Wait for an Internet connection