major springcleaning

This commit is contained in:
2023-10-12 15:12:12 +02:00
parent 648a010f64
commit 98b48cb97b
332 changed files with 6708 additions and 10208 deletions

62
.config/shell/aliasrc Normal file
View File

@ -0,0 +1,62 @@
#!/bin/sh
# Use neovim for vim if present.
[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
# Use $XINITRC variable if file exists.
[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
# Use $MBSYNCRC variable if file exists.
[ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC"
# sudo not required for some system commands
for command in mount umount sv pacman updatedb su shutdown poweroff reboot ; do
alias $command="sudo $command"
done; unset command
# Verbosity and settings that you pretty much just always are going to want.
alias \
cp="cp -iv" \
mv="mv -iv" \
rm="rm -vI" \
bc="bc -ql" \
mkd="mkdir -pv" \
yt="yt-dlp --embed-metadata -i" \
yta="yt -x -f bestaudio/best" \
ffmpeg="ffmpeg -hide_banner"
# Colorize commands when possible.
alias \
ls="ls -hN --color=auto --group-directories-first" \
grep="grep --color=auto" \
diff="diff --color=auto" \
ccat="highlight --out-format=ansi" \
ip="ip -color=auto"
# These common commands are just too long! Abbreviate them.
alias \
ka="killall" \
g="git" \
trem="transmission-remote" \
YT="youtube-viewer" \
sdn="shutdown -h now" \
e="$EDITOR" \
v="$EDITOR" \
p="pacman" \
xi="sudo xbps-install" \
xr="sudo xbps-remove -R" \
xq="xbps-query" \
z="zathura"
alias \
lf="lfub" \
magit="nvim -c MagitOnly" \
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \
weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport"\
glog="git log --all --graph --decorate"\
clog="config log --all --graph --decorate"
# force config location
alias \
config="/usr/bin/git --git-dir=/home/alex/.local/share/git_dotfiles --work-tree=$HOME"\
abook="abook --config $XDG_CONFIG_HOME/abook/abookrc --datafile $XDG_DATA_HOME/abook/addressbook"

14
.config/shell/bm-dirs Normal file
View File

@ -0,0 +1,14 @@
# You can add comments to these files with #
cac ${XDG_CACHE_HOME:-$HOME/.cache}
cf ${XDG_CONFIG_HOME:-$HOME/.config}
D ${XDG_DOWNLOAD_DIR:-$HOME/Downloads}
d ${XDG_DOCUMENTS_DIR:-$HOME/Documents}
dt ${XDG_DATA_HOME:-$HOME/.local/share}
rr $HOME/.local/src
h $HOME
m ${XDG_MUSIC_DIR:-$HOME/Music}
mn /mnt
pp ${XDG_PICTURES_DIR:-$HOME/Pictures}
sc $HOME/.local/bin
src $HOME/.local/src
vv ${XDG_VIDEOS_DIR:-$HOME/Videos}

23
.config/shell/bm-files Normal file
View File

@ -0,0 +1,23 @@
# These files automatically update when edited/saved in vim:
# keys filename description
bf ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files # This file, a list of bookmarked files
bd ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs # A list of bookmarked directories similar to this file
cfx ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources # Colors, themes and variables for X11
cfb ~/.local/src/dwmblocks/config.h # dwmblocks: the status bar for dwm
# These do not update automatically, but on the next new instance of a program:
cfv ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim # vim/neovim config
cfz $ZDOTDIR/.zshrc # zsh (shell) config
cfa ${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc # aliases used by zsh (and potentially other shells)
cfp ${XDG_CONFIG_HOME:-$HOME/.config}/shell/profile # profile file for login settings for zsh
cfm ${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc # mutt (email client) config
cfn ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/config # newsboat (RSS reader)
cfu ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls # RSS urls for newsboat
cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings # ncmpcpp (music player) keybinds file
cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config # ncmpcpp (music player) config
cfl ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc # lf (file browser) config
cfL ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope # lf's scope/preview file
cfX ${XDG_CONFIG_HOME:-$HOME/.config}/nsxiv/exec/key-handler # nsxiv (image viewer) key/script handler

19
.config/shell/inputrc Normal file
View File

@ -0,0 +1,19 @@
$include /etc/inputrc
set editing-mode vi
$if mode=vi
set show-mode-in-prompt on
set vi-ins-mode-string \1\e[6 q\2
set vi-cmd-mode-string \1\e[2 q\2
set keymap vi-command
# these are for vi-command mode
Control-l: clear-screen
Control-a: beginning-of-line
set keymap vi-insert
# these are for vi-insert mode
Control-l: clear-screen
Control-a: beginning-of-line
$endif

117
.config/shell/profile Normal file
View File

@ -0,0 +1,117 @@
#!/bin/zsh
# zsh profile file. Runs on login. Environmental variables are set here.
# If you don't plan on reverting to bash, you can remove the link in ~/.profile
# to clean up.
# Adds `~/.local/bin` to $PATH
export PATH="$PATH:$(du "$HOME/.local/bin" | cut -f2 | tr '\n' ':' | sed 's/:*$//')"
# Default programs:
export EDITOR="nvim"
export PAGER="less"
export TERMINAL="st"
export BROWSER="qutebrowser"
export READER="zathura"
export FILE="ranger"
export PIC="sxiv"
export SHELL="zsh"
# ~/ Clean-up:
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc"
# XDG USER DIRECOTRIES
export XDG_DESKTOP_DIR="$HOME"
export XDG_DOCUMENTS_DIR="$HOME/dox"
export XDG_DOWNLOAD_DIR="$HOME/dls"
export XDG_MUSIC_DIR="$HOME/msc"
export XDG_PICTURES_DIR="$HOME/pics"
export XDG_VIDEOS_DIR="$HOME/vids"
#Various stuff
export BIB="$XDG_DOCUMENTS_DIR/bib.bib"
#export XDG_RUNTIME_DIR="$HOME/.cache/xdg_run" # Messes up Audio for some reason, might be useful to figure out in the future how to fix
#export XAUTHORITY="$HOME/.cache/xdg_run/Xauthority" # This line will break some DMs.
export CHROOT="${HOME}/.local/src/chroot"
export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch-config"
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
export LESSHISTFILE="-"
export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc"
export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/inputrc"
export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh"
export ALSA_CONFIG_PATH="$XDG_CONFIG_HOME/alsa/asoundrc"
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
#export GNUPGHOME="$HOME/.gnupg"
export WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local/share}/wineprefixes/default"
export KODI_DATA="${XDG_DATA_HOME:-$HOME/.local/share}/kodi"
export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store"
export PASSWORD_STORE_GPG_OPTS='--homedir=/home/alex/.local/share/gnupg'
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android"
export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo"
export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go"
export GOMODCACHE="$XDG_CACHE_HOME/go/mod"
export ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg"
export UNISON="$XDG_DATA_HOME/unison"
export HISTFILE="$XDG_DATA_HOME/history"
export MBSYNCRC="$XDG_CONFIG_HOME/mbsync/config"
export ELECTRUMDIR="$XDG_DATA_HOME/electrum"
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc"
export SQLITE_HISTORY="$XDG_DATA_HOME/sqlite_history"
export MAILCAPS="${XDG_CONFIG_HOME:-$HOME/.config}/mutt/mailcap"
export CABAL_CONFIG="$XDG_CONFIG_HOME"/cabal/config
export CABAL_DIR="$XDG_CACHE_HOME"/cabal
export GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle
export IPYTHONDIR="$XDG_CONFIG_HOME"/jupyter
export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME"/jupyter
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java
export JULIA_DEPOT_PATH="$XDG_DATA_HOME/julia:$JULIA_DEPOT_PATH"
export NUGET_PACKAGES="$XDG_CACHE_HOME"/NuGetPackages
export MAXIMA_USERDIR="$XDG_CONFIG_HOME"/maxima
export WEECHAT_HOME="$XDG_CONFIG_HOME"/weechat
export TEXMFHOME=$XDG_DATA_HOME/texmf
export TEXMFVAR=$XDG_CACHE_HOME/texlive/texmf-var
export TEXMFCONFIG=$XDG_CONFIG_HOME/texlive/texmf-config
export R_ENVIRON_USER=$XDG_CONFIG_HOME/R/rEnviron
# Other program settings:
export DICS="/usr/share/stardict/dic/"
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export LESS=-R
export LESS_TERMCAP_mb="$(printf '%b' '')"
export LESS_TERMCAP_md="$(printf '%b' '')"
export LESS_TERMCAP_me="$(printf '%b' '')"
export LESS_TERMCAP_so="$(printf '%b' '')"
export LESS_TERMCAP_se="$(printf '%b' '')"
export LESS_TERMCAP_us="$(printf '%b' '')"
export LESS_TERMCAP_ue="$(printf '%b' '')"
export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null"
export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme.
export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads.
export _JAVA_AWT_WM_NONREPARENTING=1 # Java doesn't understand tiling windows
export AWT_TOOLKIT="MToolkit wmname LG3D" #May have to install wmname
# Settings for Japanese input
#export GTK_IM_MODULE='ibus'
#export QT_IM_MODULE='ibus'
#export XMODIFIERS=@im='ibus'
#GTK_IM_MODULE=fcitx
#QT_IM_MODULE=fcitx
#XMODIFIERS=@im=fcitx
#ibus-daemon -drx #Toolbar for anthy
[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ] && setsid shortcuts >/dev/null 2>&1
# Start graphical server on tty1 if not already running.
[ "$(tty)" = "/dev/tty1" ] && ! ps -e | grep -qw Xorg && exec startx $XINITRC
# Switch escape and caps if tty and no passwd required:
sudo -n loadkeys ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/ttymaps.kmap 2>/dev/null

30
.config/shell/shortcutrc Normal file
View File

@ -0,0 +1,30 @@
# vim: filetype=sh
alias cac="cd /home/alex/.cache && ls -A" \
cf="cd /home/alex/.config && ls -A" \
D="cd /home/alex/Downloads && ls -A" \
d="cd /home/alex/Documents && ls -A" \
dt="cd /home/alex/.local/share && ls -A" \
rr="cd /home/alex/.local/src && ls -A" \
h="cd /home/alex && ls -A" \
m="cd /home/alex/Music && ls -A" \
mn="cd /mnt && ls -A" \
pp="cd /home/alex/Pictures && ls -A" \
sc="cd /home/alex/.local/bin && ls -A" \
src="cd /home/alex/.local/src && ls -A" \
vv="cd /home/alex/Videos && ls -A" \
bf="$EDITOR /home/alex/.config/shell/bm-files" \
bd="$EDITOR /home/alex/.config/shell/bm-dirs" \
cfx="$EDITOR /home/alex/.config/x11/xresources" \
cfb="$EDITOR ~/.local/src/dwmblocks/config.h" \
cfv="$EDITOR /home/alex/.config/nvim/init.vim" \
cfz="$EDITOR /home/alex/.config/zsh/.zshrc" \
cfa="$EDITOR /home/alex/.config/shell/aliasrc" \
cfp="$EDITOR /home/alex/.config/shell/profile" \
cfm="$EDITOR /home/alex/.config/mutt/muttrc" \
cfn="$EDITOR /home/alex/.config/newsboat/config" \
cfu="$EDITOR /home/alex/.config/newsboat/urls" \
cfmb="$EDITOR /home/alex/.config/ncmpcpp/bindings" \
cfmc="$EDITOR /home/alex/.config/ncmpcpp/config" \
cfl="$EDITOR /home/alex/.config/lf/lfrc" \
cfL="$EDITOR /home/alex/.config/lf/scope" \
cfX="$EDITOR /home/alex/.config/nsxiv/exec/key-handler" \

View File

@ -0,0 +1,29 @@
hash -d cac=/home/alex/.cache
hash -d cf=/home/alex/.config
hash -d D=/home/alex/Downloads
hash -d d=/home/alex/Documents
hash -d dt=/home/alex/.local/share
hash -d rr=/home/alex/.local/src
hash -d h=/home/alex
hash -d m=/home/alex/Music
hash -d mn=/mnt
hash -d pp=/home/alex/Pictures
hash -d sc=/home/alex/.local/bin
hash -d src=/home/alex/.local/src
hash -d vv=/home/alex/Videos
hash -d bf=/home/alex/.config/shell/bm-files
hash -d bd=/home/alex/.config/shell/bm-dirs
hash -d cfx=/home/alex/.config/x11/xresources
hash -d cfb=~/.local/src/dwmblocks/config.h
hash -d cfv=/home/alex/.config/nvim/init.vim
hash -d cfz=/home/alex/.config/zsh/.zshrc
hash -d cfa=/home/alex/.config/shell/aliasrc
hash -d cfp=/home/alex/.config/shell/profile
hash -d cfm=/home/alex/.config/mutt/muttrc
hash -d cfn=/home/alex/.config/newsboat/config
hash -d cfu=/home/alex/.config/newsboat/urls
hash -d cfmb=/home/alex/.config/ncmpcpp/bindings
hash -d cfmc=/home/alex/.config/ncmpcpp/config
hash -d cfl=/home/alex/.config/lf/lfrc
hash -d cfL=/home/alex/.config/lf/scope
hash -d cfX=/home/alex/.config/nsxiv/exec/key-handler