From fd6b9dfbd3f42942e05cd70d7e74061c376deede Mon Sep 17 00:00:00 2001 From: array-in-a-matrix Date: Mon, 26 Sep 2022 22:25:06 -0400 Subject: [PATCH] split .zshrc file --- private_dot_config/zsh/alias | 16 +++++ private_dot_config/zsh/env | 2 - private_dot_config/zsh/executable_dot_zshrc | 66 ++++----------------- private_dot_config/zsh/func | 23 +++++++ 4 files changed, 49 insertions(+), 58 deletions(-) create mode 100644 private_dot_config/zsh/alias create mode 100644 private_dot_config/zsh/func diff --git a/private_dot_config/zsh/alias b/private_dot_config/zsh/alias new file mode 100644 index 0000000..ba73fa8 --- /dev/null +++ b/private_dot_config/zsh/alias @@ -0,0 +1,16 @@ +alias py="python3" +alias upgrade="sudo aura -Syu && sudo aura -Akuax" +alias micon="pactl load-module module-loopback latency_msec=1" +alias micoff="pactl unload-module module-loopback" +alias vim="nvim" +alias vi="vim" +alias ls="lsd" +alias grep="rg" +alias rm="trash" +alias radeontop="radeontop -c" +alias speedometer="speedometer -l -r wlo1 -t wlo1 -m $(( 1024 * 1024 * 3 / 2 ))" +alias tty-clock="tty-clock -scBxbn" +alias auth="eval $(ssh-agent) ssh-add ~/.ssh/ubuntu@vector" +alias vector="screen -S vector mosh ubuntu@arrayinamatrix.xyz --ssh='ssh -p 6969'" +alias share='f() { curl --progress-bar --upload-file "$1" https://share.arrayinamatrix.xyz/ | tee /dev/null; echo };f' +alias cat="bat --paging=never" \ No newline at end of file diff --git a/private_dot_config/zsh/env b/private_dot_config/zsh/env index a582f76..9d9082e 100644 --- a/private_dot_config/zsh/env +++ b/private_dot_config/zsh/env @@ -1,5 +1,3 @@ -#!/bin/sh - # Move folders from ~ to their XDG location: export ZDOTDIR="$HOME/.config/zsh" #export ZSH="$HOME/.config/omz" diff --git a/private_dot_config/zsh/executable_dot_zshrc b/private_dot_config/zsh/executable_dot_zshrc index 64c53a4..2845483 100644 --- a/private_dot_config/zsh/executable_dot_zshrc +++ b/private_dot_config/zsh/executable_dot_zshrc @@ -11,6 +11,12 @@ if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then export GDK_BACKEND="wayland,x11" fi +# if in tty then exec unimatrix +if [[ -n $(tty | grep tty) ]]; then + source ~/.cache/wal/colors-tty.sh + unimatrix -w -s 95 +fi + # Lines configured by zsh-newuser-install HISTFILE="$XDG_CONFIG_HOME/zsh/histfile" HISTSIZE=1000 @@ -21,7 +27,6 @@ bindkey -v # End of lines configured by zsh-newuser-install # The following lines were added by compinstall zstyle :compinstall filename "$XDG_CONFIG_HOME/zsh/.zshrc" - autoload -Uz compinit compinit # End of lines added by compinstall @@ -36,66 +41,15 @@ emoji zsh-syntax-highlighting ) -newtheme(){ - sh $XDG_CONFIG_HOME/sway/colors.sh $1 -} - -mountdrives(){ - echo "Making directories..." - sudo mkdir -p /run/media/linux/6E5273EB5273B685 - sudo mkdir /run/media/linux/2E56677A56674227 - echo "Mounting drives..." - sudo mount -t ntfs3 /dev/sda3 /run/media/linux/6E5273EB5273B685 - sudo mount -t ntfs3 /dev/nvme0n1p2 /run/media/linux/2E56677A56674227 - echo "Done." -} - source "$XDG_CONFIG_HOME/zsh/icons" +source "$XDG_CONFIG_HOME/zsh/alias" +source "$XDG_CONFIG_HOME/zsh/func" source "$ZSH/oh-my-zsh.sh" -#aliased directories -alias projects="$HOME/Documents/Projects/" - -# aliased commands -alias py="python3" -alias upgrade="sudo aura -Syu && sudo aura -Akuax" -alias micon="pactl load-module module-loopback latency_msec=1" -alias micoff="pactl unload-module module-loopback" -alias vim="nvim" -alias vi="vim" -alias ls="lsd" -alias grep="rg" -alias rm="trash" -alias radeontop="radeontop -c" -alias speedometer="speedometer -l -r wlo1 -t wlo1 -m $(( 1024 * 1024 * 3 / 2 ))" -alias tty-clock="tty-clock -scBxbn" -alias auth="eval $(ssh-agent) ssh-add ~/.ssh/ubuntu@vector" -alias vector="screen -S vector mosh ubuntu@arrayinamatrix.xyz --ssh='ssh -p 6969'" -alias share='f() { curl --progress-bar --upload-file "$1" https://share.arrayinamatrix.xyz/ | tee /dev/null; echo };f' -alias cat="bat --paging=never" -alias cd="z" - -# . torsocks on - - -if [[ -n $(tty | grep tty) ]]; then - source ~/.cache/wal/colors-tty.sh - unimatrix -w -s 95 -fi - -lfcd() { - tmp="$(mktemp)" - lfrun -last-dir-path="$tmp" "$@" - if [ -f "$tmp" ]; then - dir="$(cat "$tmp")" - rm -f "$tmp" - [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" - fi -} bindkey -s '^o' 'lfcd\n' # zoxide -eval "$(zoxide init zsh)" +eval "$(zoxide init zsh --cmd cd)" # bun completions -[ -s "/home/linux/.bun/_bun" ] && source "/home/linux/.bun/_bun" +[ -s "/home/linux/.bun/_bun" ] && source "/home/linux/.bun/_bun" \ No newline at end of file diff --git a/private_dot_config/zsh/func b/private_dot_config/zsh/func new file mode 100644 index 0000000..0d0accf --- /dev/null +++ b/private_dot_config/zsh/func @@ -0,0 +1,23 @@ +newtheme(){ + sh $XDG_CONFIG_HOME/sway/colors.sh $1 +} + +mountdrives(){ + echo "Making directories..." + sudo mkdir -p /run/media/linux/6E5273EB5273B685 + sudo mkdir /run/media/linux/2E56677A56674227 + echo "Mounting drives..." + sudo mount -t ntfs3 /dev/sda3 /run/media/linux/6E5273EB5273B685 + sudo mount -t ntfs3 /dev/nvme0n1p2 /run/media/linux/2E56677A56674227 + echo "Done." +} + +lfcd() { + tmp="$(mktemp)" + lfrun -last-dir-path="$tmp" "$@" + if [ -f "$tmp" ]; then + dir="$(cat "$tmp")" + rm -f "$tmp" + [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" + fi +} \ No newline at end of file