Compare commits

..

No commits in common. "389aed041b575dfc5b1363c9a75e71aff62ae3c5" and "edbb09d339e761249a1a00f86063cd41cd3af2a6" have entirely different histories.

15 changed files with 105 additions and 349 deletions

View File

@ -34,13 +34,6 @@ dotfiles checkout 2>&1 | egrep "\s+" | awk {'print $1'} |
dotfiles checkout
```
When the `fetch` configuration is not set, insert the following line in
`.dotfiles/config`:
```config
fetch = +refs/heads/*:refs/remotes/origin/*
```
## Install into `/etc/skel`
```sh
@ -75,28 +68,10 @@ lazygit --git-dir=$HOME/.dotfiles --work-tree=$HOME
- Note 1: Must be called from $HOME
- Note 2: Do not start <target-folder> with $HOME or ~
# Every-day Tools
Recommended installation order:
- System Config
- [Debian packages](#debian)
- Qubes proxy scripts (TODO)
- dotfiles (see above)
- [ASDF](#asdf) & plugins
- Newer Debian packages: `bin/versions_check`
- [Fonts](#fonts)
- [kitty](#kitty) — `st`?
- [lazygit](#lazygit)
- [nnn](#nnn)
- [neovim](#neovim)
# Install recent versions of applications
## Generic Tips
### Desktop Files
See <https://specifications.freedesktop.org/desktop-entry-spec/latest/>
### Github Patches
From [stackoverflow](https://stackoverflow.com/questions/28484186/apply-github-commit-pull-request-as-a-patch).
@ -106,52 +81,17 @@ wget https://github.com/jesseduffield/lazygit/pull/2604.patch
git apply --stat --apply 2604.patch
```
### Qubes Internet Access
## Fonts
- In _Basic_, connect to `sys-firewall`;
- In _Firewall rules_:
- check _Limit outgoing connections_;
- check _Allow full access for 25 minutes_.
## System Config
- [SysRq](https://www.kicksecure.com/wiki/SysRq)
## Debian Packages {#debian}
```sh
apt install curl fd-find fzf git grc ripgrep wget xdg-utils
dpkg-divert --divert /usr/bin/fd --rename /usr/bin/fdfind
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
```
## ASDF & main plugins {#asdf}
`.zshrc` will install `asdf`.
Make sure you have the required [system dependencies](https://github.com/pyenv/pyenv/wiki#suggested-build-environment)
before installing/compiling Python.
```sh
sudo apt install --no-install-recommends XXX
asdf plugin add direnv
asdf plugin add python
cd ~/bin
asdf current
asdf install
```
## Fonts {#fonts}
- [How to install and manage fonts on Linux](https://linuxconfig.org/how-to-install-and-manage-fonts-on-linux)
- `mv folder ~/.fonts`
- `fc-cache -fv ~/.fonts`
- [JetBrains Mono](https://www.jetbrains.com/lp/mono/)
- Install the files **without** “NL” (No Ligatures) in their names
- Install the files **without “NL”** (i.e No Ligatures) in their names
- [Nerd Fonts](https://www.nerdfonts.com/)
- [Download](https://github.com/ryanoasis/nerd-fonts/tags)
- JetBrainsMono.tar.xz
- NerdFontsSymbolsOnly.tar.xz
- [Cheat Sheet](https://www.nerdfonts.com/cheat-sheet)
- <https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/bin/scripts/test-fonts.sh>
@ -167,66 +107,19 @@ asdf install
</fontconfig>
```
### in $HOME/.fonts
```sh
mv folder ~/.fonts
fc-cache -fv ~/.fonts
```
See also [How to install and manage fonts on Linux](https://linuxconfig.org/how-to-install-and-manage-fonts-on-linux).
### in /opt/fonts
`/etc/fonts/conf.d/00-opt.conf`:
```xml
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>/opt/fonts</dir>
</fontconfig>
```
```sh
sudo mv folder /opt/fonts
fc-cache -fv /opt/fonts
```
## kitty {#kitty}
## kitty
- <https://sw.kovidgoyal.net/kitty/binary/>
### Dependencies
- `JetBrains Mono` (without NL)
- `NerdFontsSymbolsOnly`
- Install `JetBrains Mono` (without NF) & `NerdFontsSymbolsOnly` fonts.
- Note: outside of kitty, it may be interesting to also install
_JetBrains Mono_ **with** _NL_.
- terminfo
_JetBrains Mono_ **with** _NF_.
```sh
sudo apt install kitty-terminfo
# OR:
wget 'https://salsa.debian.org/debian/kitty/-/raw/debian/sid/terminfo/x/xterm-kitty
```
sudo apt-get install kitty-terminfo
### Install
```sh
# Show installed version, debian package & changelog
(ls =kitty;
kitty --version;
apt show kitty;
curl https://sw.kovidgoyal.net/kitty/changelog/ | html2text) | less
# Debian package
sudo apt install kitty
# In $HOME
sh ~/.config/kitty/installer.sh
# In /opt/kitty.app
(kitty --version && curl https://sw.kovidgoyal.net/kitty/changelog/ | html2text) | less
sudo sh ~/.config/kitty/installer.sh launch=n dest=/opt
sudo update-alternatives \
--install /usr/bin/x-terminal-emulator \
x-terminal-emulator /opt/kitty.app/bin/kitty 99
@ -236,30 +129,11 @@ sudo update-alternatives \
Kitty prepends its _bin_ folder to the path.
So it is more coherent/simpler to copy this behaviour into Zsh.
## lazygit {#lazygit}
## lazygit
### Dependencies
- git-delta
- go language (when compiling)
```sh
# debian testing & unstable:
apt install git-delta
```
### From Source
```sh
mkdir -p $HOME/dev_3rd/golang
cd $HOME/dev_3rd/golang
git clone https://github.com/jesseduffield/lazygit.git
cd lazygit
path+=(/usr/lib/go-1.21/bin)
go install
```
### Binary Releases
@ -279,10 +153,9 @@ wget $LOCATION
tar xf *.tar.gz(om[1])
```
### From Go Package
### Go
```sh
go install github.com/jesseduffield/lazygit@latest
export GOPATH=/opt/go && sudo mkdir -p $GOPATH
sudo -E go install github.com/jesseduffield/lazygit@latest
```
@ -294,7 +167,18 @@ $ lazygit --version
commit=, build date=, build source=unknown, version=unversioned, os=linux, arch=amd64, git version=2.43.0
```
## neovim {#neovim}
### 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
### Dependencies
@ -305,9 +189,6 @@ commit=, build date=, build source=unknown, version=unversioned, os=linux, arch=
### Binary Nightly Release
```sh
mkdir -p $HOME/.local/bin
cd $HOME/.local/bin
# ---
mkdir -p /opt/neovim/bin
cd /opt/neovim/bin
@ -321,13 +202,7 @@ nvim --version
vi --version
```
### flatpak
```sh
flatpak install flathub io.neovim.nvim
```
## nnn — n³ {#nnn}
## nnn — n³
### Dependencies
@ -345,33 +220,30 @@ flatpak install flathub io.neovim.nvim
- Trash:
- `trash-cli` is a much better CLI-only solution!
Compare the outputs of `trash-cli` and `gio trash --list`
<https://github.com/andreafrancia/trash-cli>
- For `gio trash`, packages `libglib2.0` & `gvfs` are recommended.
### From source
### Source Code of Latest Release
```sh
# From release
# Download archive & extract files
URI=https://github.com/jarun/nnn
xdg-open $URI/releases/latest
ARCHIVE=$(echo $HOME/Downloads/*.gz(om[1])) && echo $ARCHIVE
tar xf $ARCHIVE
# From repository
git clone https://github.com/jarun/nnn.git
# Compile
cd nnn*(om[1])
make clean
sudo make 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
sudo cp -v misc/auto-completion/zsh/* /usr/local/share/zsh/site-functions
sudo chmod a+r /usr/local/share/zsh/site-functions/*
# Plugins
mv -v ~/.config/nnn/plugins plugins_$(stat -c %Y ~/.config/nnn/plugins)
mkdir -p ~/.config/nnn
cp -av plugins ~/.config/nnn
# Copy plugins
plugins/getplugs master
```
### From repository
```sh
git clone https://github.com/jarun/nnn.git
```
and then, as above…

View File

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

View File

@ -6,4 +6,4 @@ Suites: xenial
Components: main
Architectures: amd64
Trusted: no
Signed-By: /etc/apt/keyrings/signal-desktop-keyring.gpg
Signed-By: /usr/share/keyrings/signal-desktop-keyring.gpg

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

@ -36,13 +36,12 @@ symbol_map U+e0ca Symbols Nerd Font
symbol_map U+e0cc-U+e0d4 Symbols Nerd Font
symbol_map U+e200-U+e2a9 Symbols Nerd Font
symbol_map U+e300-U+e3e3 Symbols Nerd Font
symbol_map U+e5fa-U+e6b1 Symbols Nerd Font
symbol_map U+e5fa-U+e6a6 Symbols Nerd Font
symbol_map U+e700-U+e7c5 Symbols Nerd Font
symbol_map U+ea60-U+ebeb Symbols Nerd Font
symbol_map U+f000-U+f2e0 Symbols Nerd Font
symbol_map U+f300-U+f372 Symbols Nerd Font
symbol_map U+f300-U+f32f Symbols Nerd Font
symbol_map U+f400-U+f532 Symbols Nerd Font
symbol_map U+f500-U+fd46 Symbols Nerd Font
symbol_map U+f0001-U+f1af0 Symbols Nerd Font
#: Cursor customization {{{1
@ -91,7 +90,6 @@ enabled_layouts grid, splits, stack, tall:bias=70;full_size=2
tab_bar_style fade
tab_fade 0.80 0.85 0.90 0.95
tab_bar_min_tabs 1
active_tab_foreground #000
active_tab_background #FAA
active_tab_font_style bold
@ -119,8 +117,6 @@ dynamic_background_opacity yes
#: OS specific tweaks {{{1
editor vi
#: }}}1

View File

@ -1,5 +1,8 @@
# Documentation:
# https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md
#
# To upgrade to latest binary:
# `go install github.com/jesseduffield/lazygit@latest`
customCommands:
@ -68,9 +71,6 @@ keybinding:
notARepository: 'skip'
os:
editPreset: 'nvim'
refresher:
refreshInterval: 30
fetchInterval: 3600

View File

@ -1,2 +0,0 @@
WebBrowser=firefox
TerminalEmulator=kitty

View File

@ -1,3 +1,10 @@
# To update:
# ```
# curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage \
# --output-dir $HOME/bin &&
# chmod u+x $HOME/bin/nvim.appimage
# ```
#
[Desktop Entry]
Name=Neovim ($HOME/bin)
GenericName=Text Editor
@ -10,3 +17,6 @@ Icon=nvim
Categories=Utility;TextEditor;
StartupNotify=false
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
#
# See https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

View File

@ -1,11 +0,0 @@
[Desktop Entry]
NoDisplay=true
Version=1.0
Encoding=UTF-8
Type=X-XFCE-Helper
X-XFCE-Category=WebBrowser
X-XFCE-CommandsWithParameter=flatpak run org.mozilla.firefox -ProfileManager "%s"
Icon=firefox
Name=firefox flatpak
X-XFCE-Commands=flatpak run org.mozilla.firefox -ProfileManager

View File

@ -1,8 +0,0 @@
# https://wiki.debian.org/Xsession
LOG=$HOME/.xsessionrc.log
touch $LOG
export NC_STORAGE=$HOME/NC-Michel/Linux/michdell
export ALT_HISTORY_FILE=$HOME/NC-Michel/Linux/VQubes/history
export >> $LOG

106
.zshrc
View File

@ -1,5 +1,18 @@
#!/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
###
@ -41,13 +54,9 @@ typeset -U path fpath
### Modules
###
### ASDF & direnv
#
# asdf plugin add direnv
# asdf install direnv latest
# asdf direnv setup --version latest
# asdf global direnv latest
### ASDF
#
# Line below from `asdf direnv setup --version latest`
source "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc"
### b4b4r07/enhancd
@ -231,22 +240,23 @@ compdef hg=rg
# To choose an existing instance for nvr, use:
# `export NVIM=$(nvr --serverlist | fzf --exit-0 --select-1) && echo $NVIM`
# nnn - n³
#
local nnn_plug=(
'b:-!bat --paging=always "$nnn"*'
'd:fzcd'
'z:fzopen'
'm:mimelist'
'o:-!mimeopen "$nnn"*'
'O:-!mimeopen --ask "$nnn"*'
'U:umounttree'
';:-!clear*'
# TODO Dump trash
)
# See https://github.com/jarun/nnn/wiki/Usage#configuration
export NNN_ARCHIVE='\.(7z|bz2|cbz|cbr|gz|tar|tbz|tgz|xz|zip|zst)$'
if (( ${+commands[fuse-archive]} )); then
export NNN_ARCHMNT='fuse-archive'
fi
export NNN_BMS="d:~/Downloads;q:~/QubesIncoming"
export NNN_OPENER="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke"
export NNN_OPTS='ABeGo'
export NNN_ORDER="t:$HOME/Downloads"
export NNN_PLUG='d:fzcd;o:-!xdg-open "$nnn"*;z:fzopen'
if (( ${+commands[trash-put]} )); then
export NNN_TRASH=1
elif (( ${+commands[gio]} )); then
export NNN_TRASH=2
fi
n()
{
@ -255,28 +265,9 @@ n()
return
fi
local -x LESS=${LESS/F}
local -x PATH=$HOME/.config/nnn/plugins:$PATH
# See https://github.com/jarun/nnn/wiki/Usage#configuration
local -x GUI=1 # plugins: nuke, xdgdefault
local -x NNN_ARCHIVE='\.(7z|bz2|cbz|cbr|gz|tar|tbz|tgz|xz|zip|zst)$'
local -x NNN_BMS="d:~/Downloads;q:~/QubesIncoming"
local -x NNN_OPENER="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke"
local -x NNN_OPTS='ABeGo'
local -x NNN_ORDER="t:$HOME/Downloads"
local -x NNN_PLUG=${(j:;:)nnn_plug}
local -x NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/cd-on-quit"
if (( ${+commands[fuse-archive]} )); then
local -x NNN_ARCHMNT='fuse-archive'
fi
if (( ${+commands[trash-put]} )); then
local -x NNN_TRASH=1
elif (( ${+commands[gio]} )); then
local -x NNN_TRASH=2
fi
export GUI=1 # plugins: nuke, xdgdefault
export LESS=${LESS/F}
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/cd-on-quit"
command nnn "$@"
if [ -f $NNN_TMPFILE ]; then
@ -288,7 +279,6 @@ n()
dirs -v
fi
}
compdef n=nnn
nnn-file-widget() {
# Extract "shell word" at cursor position (respecting quotes)
@ -333,7 +323,6 @@ zle -N nnn-file-widget
bindkey -M vicmd '\en' nnn-file-widget
bindkey -M viins '\en' nnn-file-widget
# Whiptail helper
#
# see https://stackoverflow.com/questions/1970180/whiptail-how-to-redirect-output-to-environment-variable
@ -397,7 +386,6 @@ whiptail_menu() {
return $res
}
###
### Aliases -- Global & automatic expansion
###
@ -448,7 +436,6 @@ export BROWSER=firefox
export EDITOR=vi
export LESS=-iFRS
export SYSTEMD_LESS='iFRSXMK'
export VISUAL=bat
# KeePassXC SSH Agent
[[ -v SSH_AUTH_SOCK ]] || export SSH_AUTH_SOCK=$(echo /tmp/ssh-*/agent.*(U))
@ -488,24 +475,25 @@ bindkey -M viins "^_" undo
### Zsh Options
###
## Changing Directories
setopt no_auto_cd
## Expansion and Globbing
setopt equals
## Input/Output
setopt no_clobber
setopt correct
setopt interactive_comments
setopt no_print_exit_value
# Disallow `>` to overwrite existing files. Use `>|` or `>!` instead.
setopt no_clobber
## Job control
setopt auto_continue
setopt no_bg_nice
setopt check_jobs
setopt no_hup
# Prevent background jobs being given a lower priority.
setopt no_bg_nice
# Prevent status report of jobs on shell exit.
setopt no_check_jobs
# Prevent SIGHUP to jobs on shell exit.
setopt no_hup
# Remove path duplicates
typeset -U path fpath
@ -515,7 +503,7 @@ typeset -U path fpath
### Completion Late Definitions
###
compdef locate=glocate
compdef bat=batcat
# Hide "parameters" (i.e. environment variables) when looking for a "command"
zstyle ':completion:*:-command-:*' tag-order '!parameters'

View File

@ -1,10 +0,0 @@
# See `direnv stdlib` for special functions provided by _direnv_.
use asdf
# Python virtual env
layout python3
if (($(echo $(direnv_layout_dir)/python* | wc --words) > 1)); then
log_error "Found several python environments"
du -sh .direnv/*
fi

View File

@ -1,2 +0,0 @@
python 3.11.8
direnv 2.33.0

View File

@ -1,21 +0,0 @@
lastversion==3.5.0
appdirs==1.4.4
beautifulsoup4==4.12.3
CacheControl==0.12.11
certifi==2024.2.2
charset-normalizer==3.3.2
distro==1.9.0
feedparser==6.0.11
idna==3.6
lockfile==0.12.2
msgpack==1.0.7
packaging==23.2
python-dateutil==2.8.2
PyYAML==6.0.1
requests==2.31.0
sgmllib3k==1.0.0
six==1.16.0
soupsieve==2.5
tqdm==4.66.2
urllib3==1.26.18

View File

@ -1,58 +0,0 @@
#!/bin/zsh
#
# asdf, direnv, python & lastversion
#
# - https://github.com/dvershinin/lastversion
#
cd $(dirname $0)
eval $(asdf exec direnv export zsh)
# zsh colors
#
autoload colors && colors
machine=amd64
function debian
{
program=$1
repository=$2
echo -n "${bg[green]}${fg[black]}\n>>>> ${program}${reset_color}\n\n"
# TODO debian package
if (( ${+commands[$program]} )); then
${program} --version
\ls -lh =${program}
current_version=$(lastversion format "$(${program} --version)")
last_version=$(lastversion ${repository} --newer-than ${current_version})
if [[ $? -eq 0 ]]; then
echo -n ${repository}/releases
echo "${fg[cyan]}"
lastversion ${repository} --filter="${machine}\.deb" --assets
else
echo "\n${fg[green]}up to date."
fi
else
echo "${fg[yellow]}...not found.\n"
echo -n "${fg[cyan]}"
lastversion ${repository} --filter="${machine}\.deb" --assets
fi
echo -n ${reset_color}
}
###
debian bat "https://github.com/sharkdp/bat"
debian delta "https://github.com/dandavison/delta"
debian lsd "https://github.com/lsd-rs/lsd"