Compare commits

...

4 Commits

Author SHA1 Message Date
Michel fe6b236571 docs: Qubes-related 2024-04-24 15:09:56 +02:00
Michel f1994772ca fix: zsh: check whether asdf-direnv exists 2024-04-24 15:09:11 +02:00
Michel 8a8f11d07e fix: XDG home globally set 2024-04-24 15:08:40 +02:00
Michel 5a5330760c docs: move subtree section 2024-04-24 15:07:30 +02:00
4 changed files with 52 additions and 26 deletions

View File

@ -23,19 +23,23 @@ automatically to a backup folder:
```sh
git clone --bare <git-repo-url> $HOME/.dotfiles
export ALL_PROXY=127.0.0.1:8082
git clone --bare https://forge.chapril.org/michel_ouba/points.git $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
BRANCH=opt
BKDIR=".dotfiles-backup/";
dotfiles checkout 2>&1 | egrep "\s+" | awk {'print $1'} |
dotfiles checkout ${BRANCH} 2>&1 | egrep "\s+" | awk {'print $1'} |
xargs -I{} sh -c "mkdir -p \$(dirname ${BKDIR}{}); mv -iv {} ${BKDIR}{}";
dotfiles checkout
dotfiles checkout ${BRANCH}
```
When the `fetch` configuration is not set, insert the following line in
`.dotfiles/config`:
When the `fetch` configuration is not set, insert the following line in the
_remote_ section of `.dotfiles/config`:
```config
fetch = +refs/heads/*:refs/remotes/origin/*
@ -65,23 +69,13 @@ skelfiles checkout
lazygit --git-dir=$HOME/.dotfiles --work-tree=$HOME
```
# Install remotes as subtree
- <https://www.atlassian.com/git/tutorials/git-subtree>
- Create an alias for remote repository
- `dotfiles remote add <remote-name> <URL>`
- Import remote as a single commit (squashed)
- `dotfiles subtree add --prefix <target-folder> <remote-name> <branch> --squash
- 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)
- [Qubes proxy scripts](#qubes)
- dotfiles (see above)
- [ASDF](#asdf) & plugins
- Newer Debian packages: `bin/versions_check`
@ -90,6 +84,7 @@ Recommended installation order:
- [lazygit](#lazygit)
- [nnn](#nnn)
- [neovim](#neovim)
- Install into `/etc/skel` (see above)
## Generic Tips
@ -97,6 +92,16 @@ Recommended installation order:
See <https://specifications.freedesktop.org/desktop-entry-spec/latest/>
### GIT remotes as subtree
- <https://www.atlassian.com/git/tutorials/git-subtree>
- Create an alias for remote repository
- `dotfiles remote add <remote-name> <URL>`
- Import remote as a single commit (squashed)
- `dotfiles subtree add --prefix <target-folder> <remote-name> <branch> --squash
- Note 1: Must be called from $HOME
- Note 2: Do not start <target-folder> with $HOME or ~
### Github Patches
From [stackoverflow](https://stackoverflow.com/questions/28484186/apply-github-commit-pull-request-as-a-patch).
@ -127,6 +132,14 @@ dpkg-divert --divert /usr/share/man/man1/fd.1.gz --rename /usr/share/man/man1/fd
dpkg-divert --divert /usr/share/zsh/vendor-completions/_rg --rename /usr/share/zsh/vendor-completions/rg.zsh
```
## Qubes proxy scripts {#qubes}
```sh
chmod +x $HOME/bin/*-proxy
```
TODO: Insert random part in filenames.
## ASDF & main plugins {#asdf}
`.zshrc` will install `asdf`.

31
.zshrc
View File

@ -1,5 +1,13 @@
#!/bin/zsh
###
### Set global variables
###
: ${XDG_CONFIG_HOME:=$HOME/.config}
export XDG_CONFIG_HOME
###
### Zsh Configuration
###
@ -29,8 +37,6 @@ path=(
$path)
setopt nonullglob
#export LD_LIBRARY_PATH=$HOME/dev_local/lib
fpath=($fpath /usr/share/zsh/site-functions)
# Remove duplicates
@ -43,12 +49,15 @@ typeset -U path fpath
### ASDF & direnv
#
# asdf plugin add direnv
# asdf install direnv latest
# asdf direnv setup --version latest
# asdf global direnv latest
#
source "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc"
if [[ -e "${XDG_CONFIG_HOME}/asdf-direnv/zshrc" ]]; then
source "${XDG_CONFIG_HOME}/asdf-direnv/zshrc"
else
echo "asdf: direnv plugin not set!"
# asdf plugin add direnv
# asdf install direnv latest
# asdf direnv setup --version latest
# asdf global direnv latest
fi
### b4b4r07/enhancd
#
@ -213,7 +222,7 @@ alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
lg()
{
export LAZYGIT_NEW_DIR_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/lazygit/cd-on-quit_$$"
export LAZYGIT_NEW_DIR_FILE="${XDG_CONFIG_HOME}/lazygit/cd-on-quit_$$"
lazygit "$@"
if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
@ -262,11 +271,11 @@ n()
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_OPENER="${XDG_CONFIG_HOME}/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"
local -x NNN_TMPFILE="${XDG_CONFIG_HOME}/nnn/cd-on-quit"
if (( ${+commands[fuse-archive]} )); then
local -x NNN_ARCHMNT='fuse-archive'

2
bin/curl-proxy Normal file
View File

@ -0,0 +1,2 @@
#!/bin/env bash
curl --proxy http://127.0.0.1:8082/ --tlsv1.2 --proto =https --max-time 180 "$@"

2
bin/wget-proxy Normal file
View File

@ -0,0 +1,2 @@
#!/bin/env bash
https_proxy=http://127.0.0.1:8082/ http_proxy=http://127.0.0.1:8082/ wget --secure-protocol=TLSv1_2 --timeout=180 "$@"