This commit is contained in:
Mira Kristipati 2024-05-17 00:05:29 -04:00
parent 7af2a5e131
commit 29b0de2015
9 changed files with 2328 additions and 88 deletions

View file

@ -1,16 +1,12 @@
#!/bin/zsh #!/bin/zsh
# Runs for interactive shells # Runs for interactive shells
export START="${START:=$(date '+%s.%N')}"
checkCommand(){ checkCommand(){
type "$1" >/dev/null 2>&1 type "$1" >/dev/null 2>&1
} }
# If you have zellij installed, this will auto start it
#if [ -z "$ZELLIJ" ] && checkCommand zellij; then # Set aliases
# #export ZELLIJ_AUTO_ATTACH=true [ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc" # >/dev/null 2>&1 &;
# exec zellij
#fi
# Speed up shell load on WSL # Speed up shell load on WSL
OLDPATH=$PATH OLDPATH=$PATH
@ -24,7 +20,8 @@ PATH=$(echo "$PATH" | sed -e 's/\/mnt\/.*\?://g')
HISTFILE="$XDG_STATE_HOME/zsh/history" HISTFILE="$XDG_STATE_HOME/zsh/history"
[ ! -e $HISTFILE ] && mkdir -p "$XDG_STATE_HOME/zsh" && touch $HISTFILE [ ! -e $HISTFILE ] && mkdir -p "$XDG_STATE_HOME/zsh" && touch $HISTFILE
HISTSIZE=10000 HISTSIZE=10000
SAVEHIST=10000 SAVEHIST=$HISTSIZE
HISTDUP=erase
# disable system beep on error # disable system beep on error
setopt BEEP setopt BEEP
@ -35,14 +32,14 @@ setopt nomatch
# report status of bg jobs immediately # report status of bg jobs immediately
setopt notify setopt notify
#dedupe history, and append to histfile after every command #dedupe history, and append to histfile after every command
setopt histfindnodups histsavenodups incappendhistory setopt hist_find_no_dups hist_save_no_dups hist_ignore_dups appendhistory sharehistory
# correct all arguments in a line
setopt correctall
# vim style line editing # vim style line editing
bindkey -v bindkey -v
# make file name completion case-insensitive # make file name completion case-insensitive
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
zstyle ':completion:*' cache-path $XDG_CACHE_HOME/zsh/zcompcache zstyle ':completion:*' cache-path $XDG_CACHE_HOME/zsh/zcompcache
zstyle 'fzf-tab:complete:cd:*' fzf-preview `ls $realpath`
zstyle 'fzf-tab:complete:__zoxide_z:*' fzf-preview `ls $realpath`
# Move completions to XDG Dir # Move completions to XDG Dir
autoload -Uz compinit autoload -Uz compinit
@ -53,9 +50,6 @@ compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
# Case-sensitive completion must be off. _ and - will be interchangeable. # Case-sensitive completion must be off. _ and - will be interchangeable.
HYPHEN_INSENSITIVE="true" HYPHEN_INSENSITIVE="true"
# Enable command auto-correction.
ENABLE_CORRECTION="true"
# Display red dots whilst waiting for completion. # Display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true" COMPLETION_WAITING_DOTS="true"
@ -103,50 +97,18 @@ if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
fi fi
#bindkey "${terminfo[khome]}" beginning-of-line
#bindkey "${terminfo[kend]}" end-of-line
#bindkey "${terminfo[kdch1]}" delete-char
#if ! checkCommand gum && checkCommand go; then
# # TODO
#fi
#Allows fuzzy-finding #Allows fuzzy-finding
if checkCommand fzf; then if checkCommand fzf; then
export FZF_BASE=$(which fzf) export FZF_BASE=$(which fzf)
else
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf;
~/.fzf/install --bin;
mkdir -p ~/.local/bin;
mv ~/.fzf/bin/* ~/.local/bin/;
rm -rf ~/.fzf;
fi fi
#todo: install if not found #todo: install if not found
# Load plugins # Load plugins
mkdir -p ~/.config/sheldon
touch ~/.config/sheldon/plugins.toml
if checkCommand sheldon; then if checkCommand sheldon; then
mkdir -p ~/.config/sheldon
touch ~/.config/sheldon/plugins.toml
eval "$(sheldon -q source)"; eval "$(sheldon -q source)";
elif checkCommand brew; then
brew install sheldon;
elif checkCommand cargo; then
cargo install sheldon
else
curl --proto '=https' -fLsS https://rossmacarthur.github.io/install/crate.sh \
| bash -s -- --repo rossmacarthur/sheldon --to ~/.local/bin
fi
#zplug "plugins/git", from:oh-my-zsh, lazy:on
#zplug "plugins/vi-mode", from:oh-my-zsh
#zplug "plugins/adb", from:oh-my-zsh, lazy:on
#zplug "plugins/pip", from:oh-my-zsh, lazy:on
# set colors if pywal is installed
if checkCommand wal && [ -z "$SSH_TTY" ]; then
eval 'cat ~/.cache/wal/sequences &'
fi fi
# if ssh-agent isn't running, run it # if ssh-agent isn't running, run it
@ -165,7 +127,6 @@ if [ ! -f "$SSH_AUTH_SOCK" ] && [ -f ~/.ssh-agent.env ]; then
source "$HOME/.ssh-agent.env" >/dev/null source "$HOME/.ssh-agent.env" >/dev/null
fi fi
[[ -f ~/.zsh_history ]] && touch ~/.zsh_history
# Set up mcfly if installed (lets you search through history easily with ctrl+r) # Set up mcfly if installed (lets you search through history easily with ctrl+r)
if checkCommand mcfly; then if checkCommand mcfly; then
@ -178,33 +139,18 @@ fi
if checkCommand zoxide; then if checkCommand zoxide; then
eval "$(zoxide init zsh)" eval "$(zoxide init zsh)"
fi fi
if checkCommand direnv; then # if checkCommand direnv; then
eval "$(direnv hook zsh)" # eval "$(direnv hook zsh)"
fi # fi
#if "$(checkCommand notify-send)"; then
# notify-send() { wsl-notify-send.exe --category $WSL_DISTRO_NAME "${@}"; }
#fi
# Set up broot if installed (a nicer tree, probably has other cool stuff I haven't looked at yet)
# [ -e "$HOME"/.config/broot/launcher/bash/br ] && zsh-defer -t 5 eval "$(broot --print-shell-function zsh)"
# Set aliases
[ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc" # >/dev/null 2>&1 &;
if checkCommand mirafetch; then if checkCommand mirafetch; then
RUST_BACKTRACE=1 mirafetch RUST_BACKTRACE=1 mirafetch
fi fi
END="$(date '+%s.%N')"
PATH=$OLDPATH PATH=$OLDPATH
printf "Startup Time: %.2fms\n" $((1000 * (END - START)))
# todo: install if not found
checkCommand starship && eval "$(starship init zsh)"
unset OLDPATH unset OLDPATH
unset START checkCommand starship && eval "$(starship init zsh)"
unset END
# TODO: move these
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

@ -1 +1 @@
Subproject commit 12ba675a2c1565339bda1422a76fd4c0ad1b3ef4 Subproject commit e3a99eb8f20c358f8376579594c0ebbf62c1db55

View file

@ -4,14 +4,16 @@ name = {{ .name | quote }}
[core] [core]
editor = nvim editor = nvim
pager = delta # pager = delta
difftool = true
# Remove Carriage Returns # Remove Carriage Returns
autocrlf = input autocrlf = input
eol = lf eol = lf
[pager]
difftool = true
[interactive] [interactive]
diffFilter = delta --color-only # diffFilter = delta --color-only
[delta] [delta]
navigate = true # use n and N to move between diff sections navigate = true # use n and N to move between diff sections
@ -20,9 +22,12 @@ light = false # set to true if you're in a terminal w/ a light background colo
[diff] [diff]
tool = difftastic tool = difftastic
[difftool "difftastic"] [difftool]
prompt = false prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[merge] [merge]
# TODO: set this to meld or nvimdiff # TODO: set this to meld or nvimdiff
conflictstyle = zdiff3 conflictstyle = zdiff3

File diff suppressed because it is too large Load diff

View file

@ -49,9 +49,9 @@ apply = ["defer"]
github = 'click-contrib/click-completion' github = 'click-contrib/click-completion'
apply = ["defer"] apply = ["defer"]
#[plugins.zsh-direnv] [plugins.zsh-direnv]
#github = 'ptavares/zsh-direnv' github = 'ptavares/zsh-direnv'
#apply = ["defer"] apply = ["defer"]
[plugins.undollar] [plugins.undollar]
github = 'zpm-zsh/undollar' github = 'zpm-zsh/undollar'

View file

@ -42,14 +42,13 @@ include "keybinds"
default_border normal 1 default_border normal 1
gaps inner 10 gaps inner 10
# polkit # polkit
exec_always --no-startup-id /usr/bin/lxpolkit
exec_always --no-startup-id /usr/bin/lxqt-policykit-agent exec_always --no-startup-id /usr/bin/lxqt-policykit-agent
#notif daemon #notif daemon
exec_always swhks & exec dunst
exec_always pkexec swhkd
exec_always dunst &
exec nm-tray exec nm-tray
exec_always fcitx5 # exec_always fcitx5
exec_always wl-paste --watch cliphist store exec_always wl-paste --watch cliphist store
exec_always gnome-keyring-daemon -r
exec ~/.config/swhkd/hotkeys.sh

View file

@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
killall swhks killall swhks
source ~/.env
SWHKDRC="${XDG_CONFIG_HOME:-$HOME/.config}/swhkd/swhkdrc" SWHKDRC="${XDG_CONFIG_HOME:-$HOME/.config}/swhkd/swhkdrc"
swhks & pkexec swhkd -d -c $SWHKDRC swhks & pkexec swhkd -d -c $SWHKDRC

View file

@ -41,14 +41,14 @@ super + tab
rofi -show window -show-icons -theme lunar-witch rofi -show window -show-icons -theme lunar-witch
print print
flameshot full -c -r -p "$HOME/Pictures/screenshots/" grim - | tee "$XDG_PICTURES_DIR/screenshots/$(date -Is).png" | wl-copy
shift + print shift + print
flameshot gui -c -s -r -p "$HOME/Pictures/screenshots/" grim -g "$(slurp)" - | tee "$XDG_PICTURES_DIR/screenshots/$(date -Is).png" | wl-copy
ctrl + print ctrl + print
flameshot gui -c -r -p "$HOME/Pictures/screenshots/" TEMP=$(mktemp); grim -g "$(slurp)" $TEMP && notify-send "$TEMP" && flatpak run org.gimp.GIMP -- $TEMP
#super + shift + v #super + shift + v

View file

@ -4,7 +4,7 @@ BindsTo=default.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/home/mira/.config/swhkd/hotkeys.sh ExecStart=bash -l $HOME/.config/swhkd/hotkeys.sh
[Install] [Install]
WantedBy=default.target WantedBy=default.target