diff --git a/.config/shell/browse b/.config/shell/browse index 31921e8..dca7bf4 100644 --- a/.config/shell/browse +++ b/.config/shell/browse @@ -54,5 +54,5 @@ d() { } di() { test $# -eq 1 && test "$1" = "-" -o -d "$1" || local dir=$({ zf "$@"; locz "$@" } | zfz) - cd "${dir:-1}" + cd "${dir:-$1}" } diff --git a/.config/shell/functions b/.config/shell/functions index 33bcc45..794011b 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -25,7 +25,7 @@ which lsb_release >/dev/null && export DIST=$(lsb_release --id | cut -d' ' -f2) unalias rd 2>/dev/null -# Basic aliases {{{1 +# System helpers {{{1 alias h='help' compdef help=man @@ -131,6 +131,7 @@ alias jcj='jcl -o json-pretty -u' # Applications {{{1 alias u='topgrade' +alias st='synct' alias expr='noglob expr' alias lst='( last; last -f /var/log/wtmp.1 ) | grep -v "pts/" | tac | less +G' diff --git a/.local/bin/scripts/focus b/.local/bin/scripts/focus index 6123c12..2f7119a 100755 --- a/.local/bin/scripts/focus +++ b/.local/bin/scripts/focus @@ -1,7 +1,7 @@ # launch my focus playlist playlistPath="$MUSIC/Playlists" -test -z "$1" && vp "$MUSIC/focus.m3u" || -(find -L $MUSIC -iname "focus-$1.m3u" -print0 | grep --null-data . || +test -z "$1" && vp "$playlistPath/focus.m3u" || +(find -L $playlistPath -iname "focus-$1.m3u" -print0 | grep --null-data . || find -L $playlistPath -iname "$1.m3u*" -print0 | grep --null-data . || find -L $MUSIC -iname "*$1*" -prune -exec find {} -size +2M -type f -not -iregex ".*.\(jpe?g\|png\)" -print0 \;) | xargs -0 vp diff --git a/.local/bin/scripts/genssh b/.local/bin/scripts/genssh index 9ce1ca3..90a110b 100755 --- a/.local/bin/scripts/genssh +++ b/.local/bin/scripts/genssh @@ -1,4 +1,10 @@ #!/bin/sh +# Generate a key if it does not exist +# Print and copy its public part +# ARGS +# - key filename +# - encryption method (default ed25519) +# - further args for ssh-keygen keys="$HOME/.ssh/keys" name="${1:-id_ed25519}" mkdir -p "$keys" diff --git a/.local/bin/scripts/git-fork b/.local/bin/scripts/git-fork index 42872bd..7c2edb3 100755 --- a/.local/bin/scripts/git-fork +++ b/.local/bin/scripts/git-fork @@ -1,11 +1,13 @@ #!/bin/sh # Clones a fork and sets a corresponding upstream -# Args: +# ARGS # - repo name # - upstream user # - local user +# - url # - target directory name (and further arguments to clone) set -e -git-get github.com "$1" "$3" "${@:4}" -test "$2" && git remote add upstream "$(git-repo github.com "$1" "$2")" +git-get "${4:-github.com}" "$1" "$3" "${@:5}" +cd $(expr "$5" \| "$1") +test "$2" && git remote add upstream "$(git-repo "${4:-github.com}" "$1" "$2")" git remote -v diff --git a/.local/bin/scripts/git-get b/.local/bin/scripts/git-get index 11565dd..c2ffeb9 100755 --- a/.local/bin/scripts/git-get +++ b/.local/bin/scripts/git-get @@ -4,4 +4,5 @@ set -e remote=$(git-repo "$@") echo "Cloning $remote" git clone $remote ${@:4} --recurse-submodules -cd "$(test $4 && echo $4 || basename ${remote%.git})" +cd "$(expr "$1" || basename ${remote%.git})" +exec "$SHELL" diff --git a/README.org b/README.org index caddee3..d56e4d8 100644 --- a/README.org +++ b/README.org @@ -31,12 +31,12 @@ and configuration for ~less~ and ~fzf~. # Use org-yank-visible - essentials :: git zsh bat neovim man-db texinfo - basic tools :: fd ripgrep tree jrnl python-pynvim wget zsh-completions mlocate -- common tools :: ffmpeg imagemagick pandoc [[https://lftp.yar.ru/][lftp]] zsh-doc glances pacman-contrib pass +- common tools :: ffmpeg imagemagick pandoc [[https://lftp.yar.ru/][lftp]] zsh-doc glances pacman-contrib pass youtube-dl - ssh :: openssh sshfs lemonade-git - dotfiles :: yadm : yadm clone --bootstrap git.jfischer.org:xeruf/dotfiles.git - aur recommendations :: tldr++ sc-im -- personal aur utils :: diffr bat-extras-git rdictcc-git +- personal aur utils :: [[https://github.com/mookid/diffr][diffr]] bat-extras-git rdictcc-git - experiments :: kakoune ** Applications - productivity :: activitywatch-bin @@ -77,4 +77,8 @@ After running android-studio setup, accept licenses: ** Server Setup systemd-resolved and systemd-networkd - ssh :: lemonade openssh +- webserver :: sudo apt install snapd nginx && snap install certbot - social :: pleroma-bin postgresql caddy +- rust :: cargo install zoxide diffr + : curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +*** Funkwhale