got rid of zsh stuff I don't use; i3lock now uses active colorscheme; fixed color7 on halloween theme

This commit is contained in:
Wryn (yage) Wagner 2022-08-23 17:44:56 -06:00
parent 2571cf4fe5
commit caf69459e2
8 changed files with 83 additions and 113 deletions

17
bin/get-colorscheme-hex Executable file
View File

@ -0,0 +1,17 @@
#!/bin/zsh
source $HOME/.config/wryn/env.zsh
#####################################################################
GET_COLORSCHEME_HEX() {
[ $1 ] && [[ $1 -le 15 ]] && [[ $1 -ge 0 ]] \
|| __FAIL 1 'must provide ANSI color number 0-15'
grep "^color$1" "$DOTWRYN/colorschemes/kitty.main" \
| awk '{print $2}' \
| sed 's/ //g; s/#//g' \
| tr '[:lower:]' '[:upper:]'
}
#####################################################################
[ ! $1 ] && return 0
GET_COLORSCHEME_HEX $@

View File

@ -1,34 +1,38 @@
#!/bin/zsh #!/bin/zsh
# note: requires i3lock-color
which i3lock >/dev/null 2>&1 || { which i3lock >/dev/null 2>&1 || {
notify-send 'i3lock-color' 'could not find installation of i3lock' notify-send 'i3lock-color' 'could not find installation of i3lock'
} }
# note: requires i3lock-color source $HOME/.config/wryn/env.zsh
source $DOTWRYN/bin/get-colorscheme-hex
#####################################################################
INSIDE_VER='001020' RADIUS=$(xrandr | grep 'connected primary' | sed 's/.* \([0-9]\+\)x.*/\1/' | awk '{print int($1*0.08)}')
RING_VER='004040'
INSIDE_WRONG='200010' ARGS=(
RING_WRONG='4a0020' --ignore-empty-password
--force-clock
--pass-screen-keys
--pass-media-keys
--pass-volume-keys
--pass-power-keys
--verif-text=''
--wrong-text=''
)
INSIDE='002010' [ $NOBLUR ] && ARGS+=(--color=$(GET_COLORSCHEME_HEX 0)69) || ARGS+=(--blur=11)
RING='103020' [ $RADIUS ] && ARGS+=(--radius=$RADIUS)
LINE='8888ff'
KEYDOWN='44ff44'
KEYREMOVE='4444ff'
TIME='aaaaaa' i3lock ${ARGS[@]} \
DATE='888888' --insidever-color=$(GET_COLORSCHEME_HEX 6) \
--ringver-color=$(GET_COLORSCHEME_HEX 10) \
i3lock \ --insidewrong-color=$(GET_COLORSCHEME_HEX 1) \
-e \ --ringwrong-color=$(GET_COLORSCHEME_HEX 9) \
--pass-screen-keys --pass-media-keys --pass-volume-keys --pass-power-keys \ --inside-color=$(GET_COLORSCHEME_HEX 0) \
-B 6 \ --ring-color=$(GET_COLORSCHEME_HEX 2) \
--force-clock \ --time-color=$(GET_COLORSCHEME_HEX 7) \
--insidever-color=$INSIDE_VER --ringver-color=$RING_VER --verif-color=$INSIDE_VER \ --date-color=$(GET_COLORSCHEME_HEX 15) \
--insidewrong-color=$INSIDE_WRONG --ringwrong-color=$RING_WRONG --wrong-color=$INSIDE_WRONG \ --keyhl-color=$(GET_COLORSCHEME_HEX 11) \
--inside-color=002010 --ring-color=103020 \ --bshl-color=$(GET_COLORSCHEME_HEX 13) \
--line-color=$LINE \
--time-color=$TIME --date-color=$DATE \
--keyhl-color=$KEYDOWN --bshl-color=$KEYREMOVE \
|| notify-send 'i3lock-color' 'something went wrong; unable to lock' \ || notify-send 'i3lock-color' 'something went wrong; unable to lock' \
; ;

View File

@ -5,7 +5,7 @@ selection_foreground #200010
cursor #ff6d00 cursor #ff6d00
color0 #100000 color0 #100000
color8 #3a3a3a color8 #424242
color1 #5fff00 color1 #5fff00
color9 #71fe9a color9 #71fe9a
@ -25,5 +25,5 @@ color13 #8a41d5
color6 #cc4ccc color6 #cc4ccc
color14 #994999 color14 #994999
color5 #696969 color7 #999999
color15 #4c4c4c color15 #696969

View File

@ -9,6 +9,11 @@ export WALLPAPER_PATH="$HOME/Pictures/bg"
export SOURCE_PACKAGES="$HOME/.local/share/source-packages" export SOURCE_PACKAGES="$HOME/.local/share/source-packages"
export DOTWRYN_UTILS="$DOTWRYN/zsh/plugins/scwrypts/zsh/utils/utils.module.zsh"
RELOAD_ZSH_UTILS() { source $DOTWRYN_UTILS; }
[ ! $DOTWRYN_UTILS_LOADED ] && RELOAD_ZSH_UTILS && export DOTWRYN_UTILS_LOADED=1
##################################################################### #####################################################################
### Application Settings ############################################ ### Application Settings ############################################
##################################################################### #####################################################################
@ -27,10 +32,6 @@ WELCOME () {
{ figlet 'Welcome, beautiful'; cowsay -p 'damn u sexy'; } | lolcat { figlet 'Welcome, beautiful'; cowsay -p 'damn u sexy'; } | lolcat
} }
LOAD_ZSH_UTILS() {
source "$DOTWRYN/zsh/plugins/scwrypts/zsh/utils/utils.module.zsh"
}
##################################################################### #####################################################################
### External Plugins / Settings ##################################### ### External Plugins / Settings #####################################
##################################################################### #####################################################################

View File

@ -1,5 +1,5 @@
#!/bin/zsh #!/bin/zsh
source "$HOME/.config/wryn/env.zsh" && LOAD_ZSH_UTILS source "$HOME/.config/wryn/env.zsh"
##################################################################### #####################################################################
UPDATE() { UPDATE() {

View File

@ -1,75 +1,22 @@
#!/bin/zsh #!/bin/zsh
# --------------------------------------------------------------------- #####################################################################
alias restart='clear; source ~/.zshrc; echo'
alias pd='pushd'; alias pd='pushd'
alias qd='popd'; alias qd='popd'
alias lspd='dirs'; alias lsd='dirs'
alias bp='bpython'; alias pdo='pwd | xclip' # [p]aste [d]irectory [o]n clipboard
alias cdo='cd $(xclip -o)' # [c]hange to [d]irectory [o]n clipboard
alias pdo='pwd | xclip'; # [p]aste current [d]irectory [o]n clipboard alias restart='clear; source ~/.zshrc'
alias cdo='cd $(xclip -o)'; # [cd] to directory [o]n clipboard
alias readable-date='date +"%A %B %d, %Y"'
alias fix='vim $(git diff --name-only | uniq) -p' alias fix='vim $(git diff --name-only | uniq) -p'
alias i3-config-update="$DOTWRYN/bin/i3/update-local-config" #####################################################################
command -v bat >/dev/null 2>&1 && alias cat='bat --style="plain"' command -v bat >/dev/null 2>&1 && alias cat='bat --style="plain"'
# ---------------------------------------------------------------------
alias erg='EDIT_RIP_GREP_FILE_MATCHES'; #####################################################################
EDIT_RIP_GREP_FILE_MATCHES() {
[ $EDITOR = "vim" ] \
&& $EDITOR -p $(rg --color=never -l $1 ) \
|| $EDITOR $(rg --color=never -l $1) ;
}
# --------------------------------------------------------------------- alias erg='EDIT_RIPGREP_FILE_MATCHES'
EDIT_RIPGREP_FILE_MATCHES() { $EDITOR $(rg --color=never -l $@); }
alias -s mp4=google-chrome-stable
alias -s pdf=google-chrome-stable
# ---------------------------------------------------------------------
alias gdrive="RCLONE_GOOGLE_DRIVE_MOUNT"
alias gphotos="RCLONE_GOOGLE_PHOTOS_MOUNT"
RCLONE_GOOGLE_DRIVE_MOUNT() {
local REMOTE_NAME='google-drive';
local MOUNT_POINT="$HOME/GoogleDrive";
local TITLE="GOOGLE DRIVE CONNECTION";
local MOUNT_FOLDER_EXTENSION="$1";
RCLONE_GOOGLE_MOUNT "$REMOTE_NAME" "$MOUNT_POINT" "$TITLE" "$MOUNT_FOLDER_EXTENSION";
}
RCLONE_GOOGLE_PHOTOS_MOUNT() {
local REMOTE_NAME='google-photos';
local MOUNT_POINT="$HOME/GooglePhotos";
local TITLE="GOOGLE PHOTOS CONNECTION";
RCLONE_GOOGLE_MOUNT "$REMOTE_NAME" "$MOUNT_POINT" "$TITLE";
}
RCLONE_GOOGLE_MOUNT() {
local REMOTE_NAME="$1";
local MOUNT_POINT="$2";
local TITLE="$3";
local MOUNT_FOLDER_EXTENSION="$4";
[ -d $MOUNT_POINT ] && [[ $(ls $MOUNT_POINT | wc -l) -gt 0 ]] \
&& { echo "connection already active at '$MOUNT_POINT'"; return 1; }
clear;
figlet -w $(tput cols) "$TITLE"| lolcat;
echo -e "\e[3m(C-c to close)\e[0m";
mkdir $MOUNT_POINT >/dev/null 2>&1;
rclone mount "$REMOTE_NAME:$MOUNT_FOLDER_EXTENSION" "$MOUNT_POINT"
rmdir $MOUNT_POINT >/dev/null 2>&1;
}

View File

@ -1,5 +1,5 @@
#!/bin/zsh #!/bin/zsh
# --------------------------------------------------------------------- #####################################################################
HISTFILE=~/.histfile HISTFILE=~/.histfile
HISTSIZE=1000 HISTSIZE=1000
@ -13,20 +13,20 @@ bindkey -v
bindkey '^R' history-incremental-search-backward bindkey '^R' history-incremental-search-backward
autoload edit-command-line autoload edit-command-line
zle -N edit-command-line; zle -N edit-command-line
bindkey -M vicmd v edit-command-line; bindkey -M vicmd v edit-command-line
# --------------------------------------------------------------------- #####################################################################
zmodload -i zsh/complist; zmodload -i zsh/complist
zstyle ':completion:*' completer _complete _ignored _approximate zstyle ':completion:*' completer _complete _ignored _approximate
zstyle ':completion:*' max-errors 1 zstyle ':completion:*' max-errors 1
zstyle ':completion:*' menu select; zstyle ':completion:*' menu select
bindkey -M menuselect '^M' .accept-line; # don't require 'return' to select menu item bindkey -M menuselect '^M' .accept-line
autoload -Uz compinit autoload -Uz compinit
compinit compinit
# --------------------------------------------------------------------- #####################################################################
which kitty >/dev/null && kitty + complete setup zsh | source /dev/stdin which kitty >/dev/null && kitty + complete setup zsh | source /dev/stdin

17
zsh/rc
View File

@ -1,11 +1,12 @@
#!/bin/zsh #!/bin/zsh
source "$HOME/.config/wryn/env.zsh" source "$HOME/.config/wryn/env.zsh"
# --------------------------------------------------------------------- #####################################################################
INTERNAL_PLUGINS=( INTERNAL_PLUGINS=(
"$DOTWRYN/zsh/config" # must load first "$DOTWRYN/zsh/config" # must load first
$(find "$DOTWRYN/zsh" -maxdepth 1 -type f \ $(find "$DOTWRYN/zsh" -mindepth 1 -maxdepth 1 -type f \
! -name 'rc' \ | grep -v '/rc$' \
! -name 'config' \ | grep -v '/config$' \
| grep -v '/\.[^/]\+$' \
) )
) )
@ -29,13 +30,13 @@ SET_PREFERRED_EDITOR() {
&& break && break
done done
export EDITOR="$AVAILABLE_EDITOR"; export EDITOR="$AVAILABLE_EDITOR"
export VISUAL="$AVAILABLE_EDITOR"; export VISUAL="$AVAILABLE_EDITOR"
} }
# --------------------------------------------------------------------- #####################################################################
for p in $INTERNAL_PLUGINS; do source $p; done for p in $INTERNAL_PLUGINS; do source $p; done
for p in $EXTERNAL_PLUGINS; do [ -f $p ] && source $p; done for p in $EXTERNAL_PLUGINS; do [ -f $p ] && source $p; done
SET_PREFERRED_EDITOR SET_PREFERRED_EDITOR
WELCOME WELCOME
# --------------------------------------------------------------------- #####################################################################
true true