diff --git a/.config/git/config b/.config/git/config new file mode 100644 index 000000000..ad8417a0a --- /dev/null +++ b/.config/git/config @@ -0,0 +1,2 @@ +[init] + defaultBranch = main diff --git a/.config/npm/npmrc b/.config/npm/npmrc new file mode 100644 index 000000000..184ef8040 --- /dev/null +++ b/.config/npm/npmrc @@ -0,0 +1,4 @@ +prefix=${XDG_DATA_HOME}/npm +cache=${XDG_CACHE_HOME}/npm +tmp=${XDG_RUNTIME_DIR}/npm +init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 00f3a5889..1e90641ce 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -1,61 +1,62 @@ #!/bin/sh # sudo not required for some system commands -for command in mount umount sv pacman apt updatedb su shutdown poweroff reboot ; do - alias $command="sudo $command" -done; unset command +for command in mount umount sv pacman apt updatedb su shutdown poweroff reboot; do + command -v $command 1>/dev/null 2>&1 && 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" \ - ffmpeg="ffmpeg -hide_banner" \ - exa="exa -abghHliS" \ - duf="duf -all" \ - ls="ls -hN --color=auto --group-directories-first" \ - grep="grep --color=auto" \ - diff="diff --color=auto" \ - + cp="cp -iv" \ + mv="mv -iv" \ + rm="rm -vI" \ + bc="bc -ql" \ + mkd="mkdir -pv" \ + ffmpeg="ffmpeg -hide_banner" \ + exa="exa -abghHliS" \ + duf="duf -all" \ + ls="ls -hN --color=auto --group-directories-first" \ + grep="grep --color=auto" \ + diff="diff --color=auto" \ + nvidia-settings="nvidia-settings --config=$XDG_CONFIG_HOME/nvidia/settings" # 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" + 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" \ - e="$EDITOR" \ - z="zathura" \ - p="pacman" \ - ar="apt remove" \ - are="apt reinstall" \ - ai="apt install" \ - aur="apt autoremove" \ - au="apt upgrade" \ - kssh="kitty +kitten ssh" + ka="killall" \ + e="$EDITOR" \ + z="zathura" \ + p="pacman" \ + ar="apt remove" \ + are="apt reinstall" \ + ai="apt install" \ + aur="apt autoremove" \ + au="apt upgrade" \ + kssh="kitty +kitten ssh" # Misc. alias \ - ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \ - weath="less -S ${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" \ - remvirt="virt-manager -c 'qemu+ssh://luca@192.168.178.200/system'" \ - vim="nvim" \ - wikidown='rclone sync cloud:files/luca/Notes ~/Documents/vimwiki' \ - wikiup='rclone sync ~/Documents/vimwiki cloud:files/luca/Notes' \ - cam="mpv --untimed --no-cache --no-osc --no-input-default-bindings --profile=low-latency --input-conf=/dev/null --title=webcam $(ls /dev/video[0,2,4,6,8] | tail -n 1)" \ - ahv="export ANSIBLE_VAULT_PASSWORD_FILE=~/.ansible/secrets/ansible-homelab && ansible-vault" \ - xpick=" xprop | awk ' + ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \ + weath="less -S ${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" \ + remvirt="virt-manager -c 'qemu+ssh://luca@192.168.178.200/system'" \ + vim="nvim" \ + wikidown='rclone sync cloud:files/luca/Notes ~/Documents/vimwiki' \ + wikiup='rclone sync ~/Documents/vimwiki cloud:files/luca/Notes' \ + cam="mpv --untimed --no-cache --no-osc --no-input-default-bindings --profile=low-latency --input-conf=/dev/null --title=webcam $(ls /dev/video[0,2,4,6,8] | tail -n 1)" \ + ahv="export ANSIBLE_VAULT_PASSWORD_FILE=~/.ansible/secrets/ansible-homelab && ansible-vault" \ + xpick=" xprop | awk ' /^WM_CLASS/{sub(/.* =/, \"instance:\"); sub(/,/, \"\nclass:\"); print} /^WM_NAME/{sub(/.* =/, \"title:\"); print}'" # Functions -whed () { - $EDITOR "$(which "$1")" +whed() { + $EDITOR "$(which "$1")" } diff --git a/.config/shell/profile b/.config/shell/profile index 4c2288112..eaa57bdd3 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -15,26 +15,28 @@ export BROWSER="librewolf" export XDG_CONFIG_HOME="$HOME/.config" export XDG_DATA_HOME="$HOME/.local/share" export XDG_CACHE_HOME="$HOME/.cache" -export PYENVS_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/virtualenv" +export PYENVS_DIR="$XDG_DATA_HOME/virtualenv" export KEYMAPS_DIR="$HOME/.local/bin/keymaps" -export ZSH_COMPDUMP="${XDG_CACHE_HOME:-$HOME/.cache}/zcompdump" -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 ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump" +export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config" +export GTK2_RC_FILES="$XDG_CONFIG_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}/shell/inputrc" -export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" -export GNUPGHOME="${XDG_CONFIG_HOME:-$HOME/.config}/gnupg" -export WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local/share}/wineprefixes/default" +export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" +export INPUTRC="$XDG_CONFIG_HOME/shell/inputrc" +export ZDOTDIR="$XDG_CONFIG_HOME/zsh" +export GNUPGHOME="$XDG_CONFIG_HOME/gnupg" +export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default" 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 ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg" -export UNISON="${XDG_DATA_HOME:-$HOME/.local/share}/unison" -export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/history" -export GRADLE_USER_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/gradle" +export ANDROID_HOME="$XDG_DATA_HOME/android" +export CARGO_HOME="$XDG_DATA_HOME/cargo" +export GOPATH="$XDG_DATA_HOME/go" +export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible/ansible.cfg" +export ANSIBLE_HOME="$XDG_DATA_HOME/ansible" +export UNISON="$XDG_DATA_HOME/unison" +export HISTFILE="$XDG_DATA_HOME/history" +export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle" export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # WARN: This line can break some display managers +export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc # Other program settings: export FZF_DEFAULT_OPTS="--layout=reverse --height 40%" @@ -49,6 +51,4 @@ export LESS_TERMCAP_ue="$(printf '%b' '')" export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null" export ANSIBLE_NOCOWS=1 # Stop those fucking cows in Ansible -[ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && shortcuts >/dev/null 2>&1 & - [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startgraphical