From 7888574b1c18c77b75e5c6c5930cd0709f16898a Mon Sep 17 00:00:00 2001 From: Jackson Taylor Date: Thu, 3 Feb 2022 22:22:11 -0500 Subject: Catching up --- .config/shell/aliasrc | 50 ++++++++++++++++++++++++++++++ .config/shell/bm-dirs | 14 +++++++++ .config/shell/bm-files | 23 ++++++++++++++ .config/shell/inputrc | 19 ++++++++++++ .config/shell/profile | 75 +++++++++++++++++++++++++++++++++++++++++++++ .config/shell/shortcutrc | 30 ++++++++++++++++++ .config/shell/zshnameddirrc | 29 ++++++++++++++++++ 7 files changed, 240 insertions(+) create mode 100644 .config/shell/aliasrc create mode 100644 .config/shell/bm-dirs create mode 100644 .config/shell/bm-files create mode 100644 .config/shell/inputrc create mode 100755 .config/shell/profile create mode 100644 .config/shell/shortcutrc create mode 100644 .config/shell/zshnameddirrc (limited to '.config/shell') diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc new file mode 100644 index 0000000..ad71695 --- /dev/null +++ b/.config/shell/aliasrc @@ -0,0 +1,50 @@ +#!/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" + +# 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="youtube-dl --add-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" + +# 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 \ + 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" \ diff --git a/.config/shell/bm-dirs b/.config/shell/bm-dirs new file mode 100644 index 0000000..9d212ec --- /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 $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} diff --git a/.config/shell/bm-files b/.config/shell/bm-files new file mode 100644 index 0000000..7acbb66 --- /dev/null +++ b/.config/shell/bm-files @@ -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}/sxiv/exec/key-handler # sxiv (image viewer) key/script handler 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 100755 index 0000000..54082b9 --- /dev/null +++ b/.config/shell/profile @@ -0,0 +1,75 @@ +# Runs on login and sets some environment variables and stuff + +# set local bin folder and sub folders in PATH +export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" + +# Set Golang paths and add to PATH +export GOPATH=$HOME/code/go +export GOBIN=$HOME/code/go/bin +export PATH=$PATH:$GOBIN + +# Set wallpaper to use +export WALLPAPER="$HOME/Pictures/wallpapers/weird_i_guess.jpg" + +# Set default programs +export BROWSER="brave" +export EDITOR="nvim" +export FILE="ranger" +export READER="zathura" +export TERMINAL="st" + +# Used in weather scripts +export LOCATION="Vass" + +# Home dir cleanup +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CACHE_HOME="$HOME/.cache" +export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc" +#export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs. +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}/shell/inputrc" +export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" +#export ALSA_CONFIG_PATH="$XDG_CONFIG_HOME/alsa/asoundrc" +export GNUPGHOME="${XDG_DATA_HOME:-$HOME/.local/share}/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 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 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 WEECHAT_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/weechat" +export MBSYNCRC="${XDG_CONFIG_HOME:-$HOME/.config}/mbsync/config" +export ELECTRUMDIR="${XDG_DATA_HOME:-$HOME/.local/share}/electrum" + +export SUDO_ASKPASS="$HOME/.local/bin/dmenupass" + +# ctrl-r vim mode +export MCFLY_KEY_SCHEME=vim +export MCFLY_DBDIR="$HOME/.cache/mcfly/" + +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 _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm + +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + +if pacman -Qs libxft-bgra >/dev/null 2>&1; then + # Start graphical server on user's current tty if not already running. + [ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC" +fi diff --git a/.config/shell/shortcutrc b/.config/shell/shortcutrc new file mode 100644 index 0000000..d647a63 --- /dev/null +++ b/.config/shell/shortcutrc @@ -0,0 +1,30 @@ +# vim: filetype=sh +alias cac="cd /home/jackson/.cache && ls -a" \ +cf="cd /home/jackson/.config && ls -a" \ +D="cd /home/jackson/Downloads && ls -a" \ +d="cd /home/jackson/Documents && ls -a" \ +dt="cd /home/jackson/.local/share && ls -a" \ +rr="cd /home/jackson/.local/src && ls -a" \ +h="cd /home/jackson && ls -a" \ +m="cd /home/jackson/Music && ls -a" \ +mn="cd /mnt && ls -a" \ +pp="cd /home/jackson/Pictures && ls -a" \ +sc="cd /home/jackson/.local/bin && ls -a" \ +src="cd /home/jackson/.local/src && ls -a" \ +vv="cd /home/jackson/Videos && ls -a" \ +bf="$EDITOR /home/jackson/.config/shell/bm-files" \ +bd="$EDITOR /home/jackson/.config/shell/bm-dirs" \ +cfx="$EDITOR /home/jackson/.config/x11/xresources" \ +cfb="$EDITOR ~/.local/src/dwmblocks/config.h" \ +cfv="$EDITOR /home/jackson/.config/nvim/init.vim" \ +cfz="$EDITOR /home/jackson/.config/zsh/.zshrc" \ +cfa="$EDITOR /home/jackson/.config/shell/aliasrc" \ +cfp="$EDITOR /home/jackson/.config/shell/profile" \ +cfm="$EDITOR /home/jackson/.config/mutt/muttrc" \ +cfn="$EDITOR /home/jackson/.config/newsboat/config" \ +cfu="$EDITOR /home/jackson/.config/newsboat/urls" \ +cfmb="$EDITOR /home/jackson/.config/ncmpcpp/bindings" \ +cfmc="$EDITOR /home/jackson/.config/ncmpcpp/config" \ +cfl="$EDITOR /home/jackson/.config/lf/lfrc" \ +cfL="$EDITOR /home/jackson/.config/lf/scope" \ +cfX="$EDITOR /home/jackson/.config/sxiv/exec/key-handler" \ diff --git a/.config/shell/zshnameddirrc b/.config/shell/zshnameddirrc new file mode 100644 index 0000000..806433c --- /dev/null +++ b/.config/shell/zshnameddirrc @@ -0,0 +1,29 @@ +hash -d cac=/home/jackson/.cache +hash -d cf=/home/jackson/.config +hash -d D=/home/jackson/Downloads +hash -d d=/home/jackson/Documents +hash -d dt=/home/jackson/.local/share +hash -d rr=/home/jackson/.local/src +hash -d h=/home/jackson +hash -d m=/home/jackson/Music +hash -d mn=/mnt +hash -d pp=/home/jackson/Pictures +hash -d sc=/home/jackson/.local/bin +hash -d src=/home/jackson/.local/src +hash -d vv=/home/jackson/Videos +hash -d bf=/home/jackson/.config/shell/bm-files +hash -d bd=/home/jackson/.config/shell/bm-dirs +hash -d cfx=/home/jackson/.config/x11/xresources +hash -d cfb=~/.local/src/dwmblocks/config.h +hash -d cfv=/home/jackson/.config/nvim/init.vim +hash -d cfz=/home/jackson/.config/zsh/.zshrc +hash -d cfa=/home/jackson/.config/shell/aliasrc +hash -d cfp=/home/jackson/.config/shell/profile +hash -d cfm=/home/jackson/.config/mutt/muttrc +hash -d cfn=/home/jackson/.config/newsboat/config +hash -d cfu=/home/jackson/.config/newsboat/urls +hash -d cfmb=/home/jackson/.config/ncmpcpp/bindings +hash -d cfmc=/home/jackson/.config/ncmpcpp/config +hash -d cfl=/home/jackson/.config/lf/lfrc +hash -d cfL=/home/jackson/.config/lf/scope +hash -d cfX=/home/jackson/.config/sxiv/exec/key-handler -- cgit v1.2.3