Expanded zsh configuration

This commit is contained in:
opalvault
2022-01-04 23:40:32 -08:00
parent fcdd49684b
commit fcb08caae1
11 changed files with 174 additions and 74 deletions

View File

@@ -24,7 +24,7 @@ exec_always --no-startup-id dunst
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
# exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
@@ -47,7 +47,7 @@ font pango:Fira Code Regular 12
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# font pango:DejaVu Sans Mono 8
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
@@ -224,10 +224,10 @@ order += "load"
order += "cpu_temperature 0"
order += "disk /"
order += "disk /home"
order += "ethernet enp1s0"
order += "wireless wlp2s0"
order += "ethernet enp0s13f0u2u1"
order += "wireless wlp0s20f3"
order += "volume master"
order += "battery 1"
order += "battery 0"
order += "tztime local"
load {
@@ -247,7 +247,7 @@ disk "/home" {
format = "<span background='#a1d569'>  %free Free </span>"
}
ethernet enp0s13f0u2u3 {
ethernet enp0s13f0u2u1 {
format_up = "<span background='#88c0d0'>  %ip </span>"
format_down = "<span background='#88c0d0'>  Disconnected </span>"
}
@@ -265,7 +265,7 @@ volume master {
mixer_idx = 0
}
battery 1 {
battery 0 {
last_full_capacity = true
format = "<span background='#a3be8c'>  %status %percentage </span>"
format_down = "No Battery"
@@ -273,7 +273,7 @@ battery 1 {
status_bat = "Battery"
status_unk = "Unknown"
status_full = "Charged"
path = "/sys/class/power_supply/BAT%d/uevent"
path = "/sys/class/power_supply/BAT0/uevent"
low_threshold = 10
}
@@ -804,36 +804,39 @@ wintypes:
Aside from using e-shell for quick command line usage, I mainly use vterm with Zsh. It's a bit of a complicated setup but allows for the maximum number of files possible to live in .config instead of littering my home directory.
** zshrc
#+begin_src shell :tangle ~/dotfiles/guix/home/files/zsh/zshrc :mkdirp yes
# Sometimes SSH'ing with Emacs is ungraceful.
# To remedy this I disable the zsh line editor.
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
# --- zsh config --- #
#### ~~~~ General ~~~~ #####
export ZSH="$XDG_CONFIG_HOME/oh-my-zsh"
HISTFILE=$XDG_CONFIG_HOME/zsh/.history
ZSH_THEME="mrtazz"
DISABLE_AUTO_UPDATE="true"
ENABLE_CORRECTION="true"
plugins=(git)
source $ZSH/oh-my-zsh.sh # This has to stay below plugins.
# This has to stay below plugins.
source $ZSH/oh-my-zsh.sh
# --- user paths --- #
# Scripts
export PATH=/home/opal/bin:$PATH
# --- locale --- #
export LANG=en_US.UTF-8
# --- autostart --- #
#### ~~~~ Autostart ~~~~ #####
pfetch
# --- Functions --- #
# Move files to trash folder instead.
del () { mv "$@" $HOME/.local/share/Trash/files/.; }
# Make directory and CD into it.
mkcd () { mkdir -p -- "$1" && cd -P -- "$1" }
#### ~~~~ Path Additions ~~~~ #####
export PATH=/home/opal/scripts:$PATH # Scripts
# --- Aliases --- #
#### ~~~~ Locale ~~~~ #####
export LANG=en_US.UTF-8
#### ~~~~ Import ~~~~ #####
ALIAS_LOCATION="$XDG_CONFIG_HOME/zsh/zsh_aliases"
FUNCTION_LOCATION="$XDG_CONFIG_HOME/zsh/zsh_functions"
source $ALIAS_LOCATION
source $FUNCTION_LOCATION
#+end_src
** zsh_aliases
#+begin_src shell :tangle ~/dotfiles/guix/home/files/zsh/zsh_aliases
# ~ Guix #
alias install="guix install"
alias remove="guix remove"
alias search="guix search"
@@ -841,12 +844,36 @@ alias pull="guix pull"
alias upgrade="guix package -u"
alias hreconfig="guix home reconfigure ~/dotfiles/guix/home/guix-home.scm"
# qol
alias unmount="umount"
# ~ Search history with up and down arrows ~ #
# Up Arrow
bind '"\e[A": history-search-backward'
# Down Arrow
bind '"\e[B": history-search-forward'
# config
# ~ Commands ~ #
alias ip="ip -c"
alias rm="rm -i"
alias ols="ls-with-file-mode-bits.sh"
# ~ Derp ~ #
alias unmount="umount"
alias please="sudo"
alias yeet="rm -rf"
alias :q='echo This aint a file, dingus.'
alias :wq='echo This aint a file, dingus.'
# ~ Source Zsh Configuration ~ #
alias zshrcsource="source ~/dotfiles/guix/home/files/zsh/zshrc"
#+end_src
** zsh_functions
#+begin_src shell :tangle ~/dotfiles/guix/home/files/zsh/zsh_functions
# ~ Move files to trash folder instead ~ #
del () { mv "$@" $HOME/.local/share/trash/files/.; }
# Make directory and CD into it.
mk () { mkdir -p -- "$1" && cd -P -- "$1" }
#+end_src
** zprofile
#+begin_src shell :tangle ~/dotfiles/guix/home/files/zsh/zprofile :mkdirp yes
# Each new shell auto-imports all environment variables.
@@ -865,7 +892,7 @@ export EDITOR=nvim
export VISUAL=nvim
GUIX_PROFILE="$HOME/.config/guix/current" . "$GUIX_PROFILE/etc/profile"
xmodmap ~/.config/xmodmap/xmodmap
#+end_src
#+end_src
** zshenv
#+begin_src shell :tangle ~/dotfiles/guix/home/files/zsh/zshenv :mkdirp yes
if [[ -z "$XDG_CONFIG_HOME" ]]