aboutsummaryrefslogtreecommitdiff
path: root/.config/shell
diff options
context:
space:
mode:
authorawy <awy@awy.one>2025-11-14 23:43:38 +0300
committerawy <awy@awy.one>2025-11-14 23:43:38 +0300
commitc7a88a07b9287db9c129914483f6b3ae1ab5404c (patch)
tree73c227c5e8519eb9135f46984e4fc067b316ed1b /.config/shell
downloadmangoslice-c7a88a07b9287db9c129914483f6b3ae1ab5404c.tar.gz
init
Diffstat (limited to '.config/shell')
-rw-r--r--.config/shell/aliasrc77
-rw-r--r--.config/shell/bm-dirs14
-rw-r--r--.config/shell/bm-files16
-rw-r--r--.config/shell/inputrc19
-rw-r--r--.config/shell/profile113
-rw-r--r--.config/shell/shortcutenvrc24
-rw-r--r--.config/shell/shortcutrc24
-rw-r--r--.config/shell/zshnameddirrc23
8 files changed, 310 insertions, 0 deletions
diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc
new file mode 100644
index 0000000..d05b34a
--- /dev/null
+++ b/.config/shell/aliasrc
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+# Use neovim for vim if present.
+[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
+
+[ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC"
+
+# doas not required for some system commands
+for command in mount umount pacman rc-service rc-update emerge emaint dinitctl updatedb su shutdown poweroff reboot ; do
+ alias $command="doas $command"
+done; unset command
+
+se() {
+ choice="$(fd . --base-directory=$HOME/.local/bin -t f --min-depth=1 | fzf)"
+ [ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice"
+}
+
+# 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" \
+ rsync="rsync -vrPlu" \
+ mkd="mkdir -pv" \
+ yt="yt-dlp --embed-metadata -i" \
+ yta="yt -x -f bestaudio/best" \
+ ytt="yt --skip-download --write-thumbnail" \
+ ffmpeg="ffmpeg -hide_banner"
+
+# Colorize commands when possible.
+alias \
+ ll="eza -lh --group-directories-first --color=auto --color-scale=all --color-scale-mode=fixed --icons --no-quotes --smart-group -s size --total-size --no-user --no-permissions" \
+ ls="eza --group-directories-first --color=auto --icons --no-quotes -s name" \
+ lsf="eza -f --group-directories-first --color=auto --icons --no-quotes -s name" \
+ lsd="eza -D --group-directories-first --color=auto --icons --no-quotes -s name" \
+ lst="eza -lh --group-directories-first --color=auto --color-scale --icons --no-quotes --smart-group -s time --total-size --no-user --no-permissions" \
+ cat="bat -P" \
+ ccat="highlight --out-format=ansi" \
+ ip="ip -color=auto"
+
+# These common commands are just too long! Abbreviate them.
+alias \
+ cl="clear" \
+ ka="killall" \
+ trem="transmission-remote" \
+ YT="youtube-viewer" \
+ sdn="shutdown -h now" \
+ e="emerge" \
+ v="$EDITOR" \
+ p="paru" \
+ z="zathura" \
+ lg="lazygit" \
+ sx="swayimg" \
+ md="monerod --prune-blockchain --fast-block-sync 1 --data-dir /mnt/ssd/monero/bitmonero" \
+ fetch="fastfetch --logo-color-2 default" \
+ de="doasedit" \
+ pu="emerge -avuDN @world" \
+ eq="equery" \
+
+# Git related
+alias \
+ g="git" \
+ gs="git status --short" \
+ gd="git diff" \
+ ga="git add" \
+ gc="git commit" \
+ gp="git push" \
+ gu="git pull" \
+ gl="git log" \
+ gb="git branch" \
+ gi="git init" \
+ gcl="git clone"
+
+alias \
+ magit="nvim -c MagitOnly" \
+ ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
diff --git a/.config/shell/bm-dirs b/.config/shell/bm-dirs
new file mode 100644
index 0000000..3ab0b0d
--- /dev/null
+++ b/.config/shell/bm-dirs
@@ -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 /mnt/ssd/projects
+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}
diff --git a/.config/shell/bm-files b/.config/shell/bm-files
new file mode 100644
index 0000000..7d7ef0d
--- /dev/null
+++ b/.config/shell/bm-files
@@ -0,0 +1,16 @@
+# 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
+
+# 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
+cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/rmpc/config.ron # rmpc (music player) config
diff --git a/.config/shell/inputrc b/.config/shell/inputrc
new file mode 100644
index 0000000..f9b94dd
--- /dev/null
+++ b/.config/shell/inputrc
@@ -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
diff --git a/.config/shell/profile b/.config/shell/profile
new file mode 100644
index 0000000..9f8f252
--- /dev/null
+++ b/.config/shell/profile
@@ -0,0 +1,113 @@
+#!/bin/sh
+# shellcheck disable=SC2155
+
+# Profile file, runs on login. Environmental variables are set here.
+
+# Add all directories in `~/.local/bin` to $PATH
+export PATH="$PATH:$(find ~/.local/bin -type d | paste -sd ':' -)"
+
+unsetopt PROMPT_SP 2>/dev/null
+
+# Default programs:
+export EDITOR="nvim"
+export MANPAGER='nvim +Man!'
+export TERMINAL="footclient"
+export TERMINAL_PROG="footclient"
+export TERMCMD="footclient"
+export BROWSER="icecat"
+
+unset SSH_AGENT_PID
+if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
+ export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
+fi
+
+# Change the default crypto/weather monitor sites.
+# export CRYPTOURL="rate.sx"
+# export WTTRURL="wttr.in"
+
+# ~/ Clean-up:
+export XDG_CONFIG_HOME="$HOME/.config"
+export XDG_DATA_HOME="$HOME/.local/share"
+export XDG_CACHE_HOME="$HOME/.cache"
+export XDG_STATE_HOME="$HOME/.local/state"
+export XDG_MUSIC_DIR="/mnt/ssd/music"
+export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config"
+export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc"
+export INPUTRC="$XDG_CONFIG_HOME/shell/inputrc"
+export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
+#export GNUPGHOME="$XDG_DATA_HOME/gnupg"
+export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default"
+export KODI_DATA="$XDG_DATA_HOME/kodi"
+export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
+export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
+export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android"
+export CARGO_HOME="$XDG_DATA_HOME/cargo"
+export GOPATH="$XDG_DATA_HOME/go"
+export GOMODCACHE="$XDG_CACHE_HOME/go/mod"
+export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/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 NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
+export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"
+export KUBECONFIG="$XDG_CONFIG_HOME/kube/config"
+export KUBECACHEDIR="$XDG_CACHE_HOME/kube"
+export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
+export PASSWORD_STORE_CLIP_TIME=5
+export W3M_DIR="$XDG_STATE_HOME/w3m"
+
+# Other program settings:
+export DICS="/usr/share/stardict/dic/"
+export DOAS_ASKPASS="$HOME/.local/bin/dmenupass"
+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="qt5ct" # Have QT use gtk3 theme.
+export MOZ_USE_XINPUT2=1 # Mozilla smooth scrolling/touchpads.
+export AWT_TOOLKIT="MToolkit wmname LG3D" # May have to install wmname
+export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm
+export LIBVA_DRIVER_NAME=nvidia
+export __GLX_VENDOR_LIBRARY_NAME=nvidia
+export MOZ_DISABLE_RDD_SANDBOX=1 # For HW in Firefox on nvidia gpu
+export ELECTRON_OZONE_PLATFORM_HINT=auto # Electron fix
+export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 # Disables decorations for QT applications
+export __GL_THREADED_OPTIMIZATIONS=0 # fixes minecraft wayland
+export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \
+--color=fg:#e5e9f0,bg:-1,hl:#81a1c1
+--color=fg+:#e5e9f0,bg+:#3b4252,hl+:#81a1c1
+--color=info:#eacb8a,prompt:#bf6069,pointer:#b48dac
+--color=marker:#a3be8b,spinner:#b48dac,header:#a3be8b
+--cycle
+--scroll-off=8
+--tabstop=4
+--preview-window=border-sharp
+--highlight-line
+--no-ansi
+--scrollbar=█
+--wrap-sign=
+--bind=ctrl-u:preview-half-page-up
+--bind=ctrl-d:preview-half-page-down
+--bind=ctrl-l:forward-char
+--bind=ctrl-h:backward-char
+--bind=resize:refresh-preview
+"
+export YT_X_FZF_OPTS="$FZF_DEFAULT_OPTS"
+# export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#767676"
+export BAT_THEME="gruvbox-dark"
+export GTK_USE_PORTAL=1
+export ENABLE_HDR_WSI=1
+export WLR_RENDERER="vulkan"
+
+[ ! -f "$XDG_CONFIG_HOME/shell/shortcutrc" ] && setsid -f shortcuts >/dev/null 2>&1
+
+# Start graphical server on user's current tty if not already running.
+[ "$(tty)" = "/dev/tty1" ] && ! pidof -s mango >/dev/null 2>&1 && exec dbus-run-session mango
diff --git a/.config/shell/shortcutenvrc b/.config/shell/shortcutenvrc
new file mode 100644
index 0000000..2403622
--- /dev/null
+++ b/.config/shell/shortcutenvrc
@@ -0,0 +1,24 @@
+# vim: filetype=sh
+[ -n "cac" ] && export cac="/home/awy/.cache"
+[ -n "cf" ] && export cf="/home/awy/.config"
+[ -n "D" ] && export D="/home/awy/Downloads"
+[ -n "d" ] && export d="/home/awy/Documents"
+[ -n "dt" ] && export dt="/home/awy/.local/share"
+[ -n "rr" ] && export rr="/mnt/ssd/projects"
+[ -n "h" ] && export h="/home/awy"
+[ -n "m" ] && export m="/mnt/ssd/music"
+[ -n "mn" ] && export mn="/mnt"
+[ -n "pp" ] && export pp="/home/awy/Pictures"
+[ -n "sc" ] && export sc="/home/awy/.local/bin"
+[ -n "src" ] && export src="/home/awy/.local/src"
+[ -n "vv" ] && export vv="/home/awy/Videos"
+[ -n "bf" ] && export bf="/home/awy/.config/shell/bm-files"
+[ -n "bd" ] && export bd="/home/awy/.config/shell/bm-dirs"
+[ -n "cfv" ] && export cfv="/home/awy/.config/nvim/init.vim"
+[ -n "cfz" ] && export cfz="/home/awy/.config/zsh/.zshrc"
+[ -n "cfa" ] && export cfa="/home/awy/.config/shell/aliasrc"
+[ -n "cfp" ] && export cfp="/home/awy/.config/shell/profile"
+[ -n "cfm" ] && export cfm="/home/awy/.config/mutt/muttrc"
+[ -n "cfn" ] && export cfn="/home/awy/.config/newsboat/config"
+[ -n "cfu" ] && export cfu="/home/awy/.config/newsboat/urls"
+[ -n "cfmc" ] && export cfmc="/home/awy/.config/rmpc/config.ron"
diff --git a/.config/shell/shortcutrc b/.config/shell/shortcutrc
new file mode 100644
index 0000000..2a9bc3b
--- /dev/null
+++ b/.config/shell/shortcutrc
@@ -0,0 +1,24 @@
+# vim: filetype=sh
+alias cac="cd /home/awy/.cache && ls -A" \
+cf="cd /home/awy/.config && ls -A" \
+D="cd /home/awy/Downloads && ls -A" \
+d="cd /home/awy/Documents && ls -A" \
+dt="cd /home/awy/.local/share && ls -A" \
+rr="cd /mnt/ssd/projects && ls -A" \
+h="cd /home/awy && ls -A" \
+m="cd /mnt/ssd/music && ls -A" \
+mn="cd /mnt && ls -A" \
+pp="cd /home/awy/Pictures && ls -A" \
+sc="cd /home/awy/.local/bin && ls -A" \
+src="cd /home/awy/.local/src && ls -A" \
+vv="cd /home/awy/Videos && ls -A" \
+bf="$EDITOR /home/awy/.config/shell/bm-files" \
+bd="$EDITOR /home/awy/.config/shell/bm-dirs" \
+cfv="$EDITOR /home/awy/.config/nvim/init.vim" \
+cfz="$EDITOR /home/awy/.config/zsh/.zshrc" \
+cfa="$EDITOR /home/awy/.config/shell/aliasrc" \
+cfp="$EDITOR /home/awy/.config/shell/profile" \
+cfm="$EDITOR /home/awy/.config/mutt/muttrc" \
+cfn="$EDITOR /home/awy/.config/newsboat/config" \
+cfu="$EDITOR /home/awy/.config/newsboat/urls" \
+cfmc="$EDITOR /home/awy/.config/rmpc/config.ron" \
diff --git a/.config/shell/zshnameddirrc b/.config/shell/zshnameddirrc
new file mode 100644
index 0000000..0a17475
--- /dev/null
+++ b/.config/shell/zshnameddirrc
@@ -0,0 +1,23 @@
+hash -d cac=/home/awy/.cache
+hash -d cf=/home/awy/.config
+hash -d D=/home/awy/Downloads
+hash -d d=/home/awy/Documents
+hash -d dt=/home/awy/.local/share
+hash -d rr=/mnt/ssd/projects
+hash -d h=/home/awy
+hash -d m=/mnt/ssd/music
+hash -d mn=/mnt
+hash -d pp=/home/awy/Pictures
+hash -d sc=/home/awy/.local/bin
+hash -d src=/home/awy/.local/src
+hash -d vv=/home/awy/Videos
+hash -d bf=/home/awy/.config/shell/bm-files
+hash -d bd=/home/awy/.config/shell/bm-dirs
+hash -d cfv=/home/awy/.config/nvim/init.vim
+hash -d cfz=/home/awy/.config/zsh/.zshrc
+hash -d cfa=/home/awy/.config/shell/aliasrc
+hash -d cfp=/home/awy/.config/shell/profile
+hash -d cfm=/home/awy/.config/mutt/muttrc
+hash -d cfn=/home/awy/.config/newsboat/config
+hash -d cfu=/home/awy/.config/newsboat/urls
+hash -d cfmc=/home/awy/.config/rmpc/config.ron