config/shell: alias tweaks & adjust for debian server
This commit is contained in:
parent
4912f99017
commit
fdeba2e52c
|
@ -35,7 +35,7 @@ yas() {
|
|||
then echo "Installing $pkg..."
|
||||
cmd="yay -S $pkg"
|
||||
print -s "$cmd"
|
||||
eval "$cmd"
|
||||
eval "$cmd" || yay -Sy $pkg
|
||||
rehash
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
if test "$ZSH_NAME" = "zsh"; then
|
||||
alias -g ___='"$(eval "$(fc -ln -1)" | tail -n 1)"'
|
||||
alias -g G="| grp"
|
||||
alias -g X="| xargs"
|
||||
alias -g X1="| xargs -n 1"
|
||||
alias -g X="| xargs -d '\n'"
|
||||
alias -g X1="| xargs -d '\n' -n 1"
|
||||
alias -g XC="| xclip -selection clipboard"
|
||||
alias -g L="--color=always | ${PAGER:-less}"
|
||||
fi
|
||||
|
@ -18,6 +18,7 @@ if test -d "$DATA"; then
|
|||
d2=$(builtin cd $DATA/2* && pwd)
|
||||
d3=$(builtin cd $DATA/3* && pwd)
|
||||
d4=$(builtin cd $DATA/4* && pwd)
|
||||
dd="$d4/downloads"
|
||||
fi 2>/dev/null
|
||||
|
||||
ulimit -c unlimited # Enable core dumps
|
||||
|
@ -72,8 +73,7 @@ edshell() {
|
|||
line="$(echo "$grepfile" | cut -d':' -f2)";;
|
||||
(*) file="$(find $CONFIG_SHELLS -name "$1*" | head -1 | grep . || echo "$CONFIG_SHELLS/$1")";;
|
||||
esac
|
||||
test -f "$file" || return 2
|
||||
checksum="$(md5sum "$file")"
|
||||
test -f "$file" || checksum="$(md5sum "$file")"
|
||||
$EDITOR "$(test "$line" && echo "+normal! ${line}ggzx" || echo "--")" "${file%:*}"
|
||||
test "$checksum" != "$(md5sum $file)" && source "$HOME/.zprofile" && exec $SHELL
|
||||
}
|
||||
|
@ -161,6 +161,7 @@ alias expr='noglob expr'
|
|||
# Shortcuts
|
||||
alias logoff="loginctl terminate-user $USER"
|
||||
alias calc='rlwrap -a bc -l'
|
||||
alias dt='python -c "import time;print(time.asctime(time.localtime()))"'
|
||||
|
||||
# Process
|
||||
alias println='printf "\n"'
|
||||
|
@ -170,7 +171,7 @@ alias lst='( last; last -f /var/log/wtmp.1 ) | grep -v "pts/" | tac | less +G'
|
|||
|
||||
# Remote
|
||||
alias delta="sc restart openvpn-client@deltaPeak.service"
|
||||
alias sshl="lemonade server -allow 127.0.0.1 & ssh -R 2489:127.0.0.1:2489"
|
||||
alias sshl="lemonade server -allow 127.0.0.1 & kitty +kitten ssh -R 2489:127.0.0.1:2489"
|
||||
|
||||
# Listen to loopback of mic
|
||||
alias listen='pactl load-module module-loopback; echo "Press Enter to stop"; read; pactl unload-module module-loopback'
|
||||
|
@ -266,11 +267,14 @@ killJava() {
|
|||
|
||||
alias l="ls -l --almost-all --human-readable --group-directories-first --file-type"
|
||||
|
||||
alias f="noglob fdd"
|
||||
fdd() { $(which fd >/dev/null && echo fd || echo fdfind) --color=always --hidden --no-ignore-vcs --one-file-system "$@" | less -F; }
|
||||
compdef f=fd
|
||||
#alias f='find -not -path "*.sync*" -and -not \( -name daten -prune \)'
|
||||
#alias f1='find -mindepth 1 -maxdepth 1'
|
||||
if which fd >/dev/null
|
||||
then alias f="noglob fdd"
|
||||
fdd() { $(which fd >/dev/null && echo fd || echo fdfind) --color=always --hidden --no-ignore-vcs --one-file-system "$@" | less -F; }
|
||||
compdef f=fd
|
||||
else
|
||||
alias f='find -not -path "*.sync*" -and -not \( -name daten -prune \)'
|
||||
alias f1='find -mindepth 1 -maxdepth 1'
|
||||
fi
|
||||
|
||||
lowercase_transliterate="y/A-Z /a-z-/"
|
||||
which perl-rename >/dev/null &&
|
||||
|
@ -278,9 +282,11 @@ which perl-rename >/dev/null &&
|
|||
alias lowercase="rename -iv '$lowercase_transliterate'"
|
||||
|
||||
# rsync directory properly - suffix both dirs with / to act on contents
|
||||
alias rc='rsync --recursive --info=progress2,remove,symsafe,flist,del --human-readable --links'
|
||||
alias dsync='rc --delete'
|
||||
alias dsynca='rc --specials --times --delete'
|
||||
alias rcn='rsync -v --recursive --human-readable --links --dry-run'
|
||||
alias rc='rcs --links --times'
|
||||
alias rcu='rc --existing --size-only'
|
||||
alias rcs='rsync --recursive --info=progress2,remove,symsafe,flist,del --human-readable'
|
||||
alias dsync='rc --delete --specials'
|
||||
alias move='rc --remove-source-files'
|
||||
alias rdiff='rsync --recursive --progress --delete --links --dry-run'
|
||||
|
||||
|
|
|
@ -8,20 +8,20 @@ section "System"
|
|||
highlight "Default sudoers configuration"
|
||||
echo 'Defaults editor=/usr/bin/nvim
|
||||
Defaults env_keep="EDITOR"' |
|
||||
sudo tee /etc/sudoers.d/editor
|
||||
sudo tee /etc/sudoers.d/editor
|
||||
echo 'Defaults timestamp_timeout=120
|
||||
Defaults passwd_timeout=30' |
|
||||
sudo tee /etc/sudoers.d/timeout
|
||||
sudo tee /etc/sudoers.d/timeout
|
||||
highlight "password-free reboot"
|
||||
echo "$USER ALL = NOPASSWD: /usr/bin/halt, /usr/bin/shutdown, /usr/bin/reboot, /usr/bin/poweroff, /bin/reboot, /bin/shutdown. /usr/bin/umount" |
|
||||
sudo tee /etc/sudoers.d/shutdown
|
||||
sudo tee /etc/sudoers.d/shutdown
|
||||
|
||||
highlight "Default to current user in tty1,2,3"
|
||||
sudo mkdir -p /etc/systemd/system/getty@tty1.service.d /etc/systemd/system/getty@tty2.service.d /etc/systemd/system/getty@tty3.service.d
|
||||
echo "[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/usr/bin/agetty --skip-login --login-options $USER %I" |
|
||||
sudo tee /etc/systemd/system/getty@tty1.service.d/override.conf /etc/systemd/system/getty@tty2.service.d/override.conf /etc/systemd/system/getty@tty3.service.d/override.conf
|
||||
sudo tee /etc/systemd/system/getty@tty1.service.d/override.conf /etc/systemd/system/getty@tty2.service.d/override.conf /etc/systemd/system/getty@tty3.service.d/override.conf
|
||||
|
||||
highlight "Sysyadm setup"
|
||||
test -d "/etc/yadm" || sy clone
|
||||
|
@ -34,8 +34,8 @@ link() {
|
|||
|
||||
mkdir -p .config/audacity
|
||||
find $HOME -maxdepth 1 -type l -exec file {} + |
|
||||
grep '.local/share' | grep broken |
|
||||
sed 's/.* //' | xargs -r mkdir -p
|
||||
grep '.local/share' | grep broken |
|
||||
sed 's/.* //' | xargs -r mkdir -p
|
||||
|
||||
link python /usr/bin/python3
|
||||
link fdfind /usr/bin/fd
|
||||
|
@ -52,15 +52,16 @@ test "$hasService" && sudo service rsyslog restart || sudo systemctl restart rsy
|
|||
test "$hasService" && sudo service cron reload || sudo systemctl reload cronie
|
||||
|
||||
highlight "Zsh"
|
||||
mkdir -p $XDG_STATE_HOME
|
||||
test -n "$ZSH" || export ZSH="${XDG_DATA_HOME:-$HOME/.local/share}/zsh/oh-my-zsh"
|
||||
cloneshallow() {
|
||||
url=https://github.com/$2/$1.git
|
||||
dir="${3:-$ZSH/plugins/$1}"
|
||||
mkdir -p "$(dirname $dir)"
|
||||
if test -d "$dir"
|
||||
then git -C "$dir" remote set-url origin $url
|
||||
else git clone --depth=1 $url "$dir"
|
||||
fi
|
||||
url=https://github.com/$2/$1.git
|
||||
dir="${3:-$ZSH/plugins/$1}"
|
||||
mkdir -p "$(dirname $dir)"
|
||||
if test -d "$dir"
|
||||
then git -C "$dir" remote set-url origin $url
|
||||
else git clone --depth=1 $url "$dir"
|
||||
fi
|
||||
}
|
||||
cloneshallow oh-my-zsh robbyrussell "$ZSH"
|
||||
cloneshallow powerlevel10k romkatv "$ZSH/themes/powerlevel10k"
|
||||
|
@ -70,18 +71,18 @@ cloneshallow zsh-vim-mode softmoth
|
|||
case "$(grep "^$USER" /etc/passwd | sed 's/.*://')" in (*zsh);; (*) chsh -s $(which zsh);; esac
|
||||
|
||||
### Arch
|
||||
highlight "Pacman"
|
||||
if test -f /etc/pacman.conf; then
|
||||
sudo sed -i 's/#Color/Color/' /etc/pacman.conf
|
||||
sudo sed -i "$(grep -n "\[multilib\]" /etc/pacman.conf | cut -d':' -f1),+1 s/# *//" /etc/pacman.conf
|
||||
highlight "Reflector"
|
||||
echo "--save /etc/pacman.d/mirrorlist
|
||||
--protocol https
|
||||
--country Germany
|
||||
--latest 20
|
||||
--sort rate" | sudo tee /etc/xdg/reflector/reflector.conf
|
||||
sudo systemctl start reflector &
|
||||
sudo systemctl enable reflector.timer
|
||||
highlight "Pacman"
|
||||
sudo sed -i 's/#Color/Color/' /etc/pacman.conf
|
||||
sudo sed -i "$(grep -n "\[multilib\]" /etc/pacman.conf | cut -d':' -f1),+1 s/# *//" /etc/pacman.conf
|
||||
highlight "Reflector"
|
||||
echo "--save /etc/pacman.d/mirrorlist
|
||||
--protocol https
|
||||
--country Germany
|
||||
--latest 20
|
||||
--sort rate" | sudo tee /etc/xdg/reflector/reflector.conf
|
||||
sudo systemctl start reflector &
|
||||
sudo systemctl enable reflector.timer
|
||||
fi
|
||||
|
||||
### Applications
|
||||
|
|
|
@ -95,7 +95,7 @@ alt-c:yank
|
|||
alt-w:toggle-preview-wrap
|
||||
alt-j:preview-half-page-down,alt-k:preview-half-page-up
|
||||
shift-down:preview-half-page-down,shift-up:preview-half-page-up
|
||||
$([[ $(fzf --version | cut -d '.' -f-2) > 0.24 ]] && echo "alt-shift-down:preview-down,alt-shift-up:preview-up")
|
||||
$([[ "$(fzf --version 2>/dev/null | cut -d '.' -f-2)" > 0.24 ]] && echo "alt-shift-down:preview-down,alt-shift-up:preview-up")
|
||||
esc:close
|
||||
" | xargs -I% echo -n "%," | head -c-1)
|
||||
#alt-r:preview(bat {}),
|
||||
|
|
39
README.org
39
README.org
|
@ -29,31 +29,30 @@ and configuration for ~less~ and ~fzf~.
|
|||
* Packages
|
||||
: pacman -Qe | cut -d\ -f1 | xclip -selection clipboard
|
||||
# Use org-yank-visible
|
||||
- essentials :: git zsh bat neovim man-db
|
||||
- basic tools :: texinfo fd ripgrep tree jrnl python-pynvim wget zsh-completions unrar mlocate (locate on deb)
|
||||
- common tools :: topgrade ffmpeg imagemagick pandoc [[https://lftp.yar.ru/][lftp]] glances youtube-dl dos2unix zsh-doc pacman-contrib espanso
|
||||
- pass :: pass pass-otp pass-extension-tail pass-clip
|
||||
-> interesting: pass-steam, pass-autotype, pass-file, pass-qr, pass-ssh, pass-rotate
|
||||
- ssh :: openssh sshfs lemonade-git
|
||||
- essentials :: git zsh bat neovim man-db curl
|
||||
- basic tools :: texinfo tree wget locate
|
||||
fd python-pynvim zsh-completions mlocate unrar
|
||||
- dotfiles :: yadm
|
||||
: yadm clone --bootstrap git@git.jfischer.org:xeruf/dotfiles.git
|
||||
: yadm clone --bootstrap https://git.jfischer.org/xeruf/dotfiles.git
|
||||
- aur recommendations :: tldr++ sc-im
|
||||
- git tools :: git-bug git-lfs git-crypt git-remote-gcrypt github-cli
|
||||
- personal aur utils (need configuration) :: [[https://github.com/mookid/diffr][diffr]] bat-extras-git rdictcc-git neovim-symlinks stderred-git
|
||||
: pip install beautifulsoup4
|
||||
- experiments :: kakoune
|
||||
** Applications
|
||||
- productivity :: activitywatch-bin
|
||||
- common tools :: ripgrep topgrade ffmpeg imagemagick pandoc [[https://lftp.yar.ru/][lftp]] glances youtube-dl dos2unix zsh-doc pacman-contrib espanso
|
||||
- git tools :: git-bug git-lfs git-crypt git-remote-gcrypt github-cli
|
||||
- aur recommendations :: tldr++ sc-im
|
||||
- pass :: pass pass-otp pass-extension-tail pass-clip
|
||||
-> interesting: pass-steam, pass-autotype, pass-file, pass-qr, pass-ssh, pass-rotate
|
||||
- ssh :: openssh sshfs lemonade-git
|
||||
- productivity :: activitywatch-bin jrnl
|
||||
- music :: mpd mpc ncmpc mpd-mpris vlc phonon-qt5-vlc sox
|
||||
: mkdir -p ~/.local/state/mpd && systemctl --user enable --now mpd mpd-mpris
|
||||
: sudo npm install -g bpm
|
||||
- bluetooth :: bluez bluez-utils pulseaudio-bluetooth
|
||||
- tagging :: puddletag beets picard ffmpegthumbnailer
|
||||
- music tagging :: puddletag beets picard ffmpegthumbnailer
|
||||
- sync :: syncthing
|
||||
: systemctl enable --now syncthing
|
||||
** Emacs
|
||||
- mail :: offlineimap mu
|
||||
- personal aur utils (need configuration) :: [[https://github.com/mookid/diffr][diffr]] bat-extras-git rdictcc-git neovim-symlinks stderred-git
|
||||
: pip install beautifulsoup4
|
||||
- experiments :: kakoune
|
||||
** Graphical
|
||||
- x :: xorg-xserver xorg-xkill xorg-setxkbmap xorg-xinit xterm xclip xprintidle light
|
||||
- music production :: lilypond lilypond-docs timidity++ chordpro-git musescore mixxx-beta-git
|
||||
|
@ -64,6 +63,8 @@ and configuration for ~less~ and ~fzf~.
|
|||
- health :: stretchly-xeruf-git redshift acpilight light
|
||||
: scu enable --now redshift
|
||||
-> https://www.reddit.com/r/linuxquestions/comments/pm1bxn/setting_brightness_on_amd_ryzen_7_5800h_with
|
||||
*** Emacs
|
||||
- mail :: offlineimap mu
|
||||
*** Firefox Addons
|
||||
**** Password management
|
||||
***** Pass - the unix password manager
|
||||
|
@ -89,9 +90,9 @@ After running android-studio setup, accept licenses:
|
|||
: $ANDROID_SDK_ROOT/tools/bin/sdkmanager --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
|
||||
- tools :: fd-find
|
||||
- rust :: cargo install zoxide diffr
|
||||
: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
*** Funkwhale
|
||||
- ssh (Ubuntu) :: lemonade openssh
|
||||
- webserver :: sudo apt install snapd nginx && snap install certbot
|
||||
- social :: pleroma-bin postgresql caddy
|
||||
|
|
Loading…
Reference in New Issue