First commit

This commit is contained in:
CronyAkatsuki 2023-04-30 17:36:12 +02:00
commit 08c122f3fd
23 changed files with 1960 additions and 0 deletions

14
.config/zsh/.zprofile Executable file
View file

@ -0,0 +1,14 @@
export QT_QPA_PLATFORMTHEME=qt5ct
# Path exprt (.zshenv method doesn't work with gentoo for no real reason)
typeset -U PATH path
path=("$HOME/.local/bin" "$HOME/bin/dmenu/" "$HOME/bin/gaming/" "$HOME/bin/statusbar/" "$HOME/bin/misc/" "$HOME/bin/wayland" "$HOME/bin/fzf" "$HOME/bin/bspwm" "$path[@]")
export PATH
export SXHKD_SHELL='/bin/sh'
[[ $(fgconsole 2>/dev/null) == 1 ]] && exec startx $HOME/.config/X11/xinitrc &> /dev/null
# [[ $(fgconsole 2>/dev/null) == 1 ]] && exec start-river &> /dev/null
# [[ $(fgconsole 2>/dev/null) == 1 ]] && exec start-hyprland &> /dev/null
eval "$(ssh-agent -s)" &> /dev/null

39
.config/zsh/.zshrc Executable file
View file

@ -0,0 +1,39 @@
#!/bin/sh
pfetch
eval "$(starship init zsh)"
[ -f "$HOME/.local/share/zap/zap.zsh" ] && source "$HOME/.local/share/zap/zap.zsh"
zstyle ':completion:*' rehash true
# Plugins
plug "kutsan/zsh-system-clipboard"
plug "hlissner/zsh-autopair"
plug "zap-zsh/supercharge"
plug "zap-zsh/completions"
plug "zap-zsh/vim"
plug "zsh-users/zsh-autosuggestions"
plug "zsh-users/zsh-completions"
plug "zsh-users/zsh-syntax-highlighting"
# Plugin settings
if [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
ZSH_SYSTEM_CLIPBOARD_METHOD="xsc"
else
ZSH_SYSTEM_CLIPBOARD_METHOD="wlc"
fi
# Local source
plug "$XDG_CONFIG_HOME/zsh/aliases.zsh"
plug "$XDG_CONFIG_HOME/zsh/functions.zsh"
# History settings
setopt appendhistory
setopt INC_APPEND_HISTORY
export HISTTIMEFORMAT="[%F %T]"
# HISTSIZE=10000
# SAVEHIST=5000
HISTFILE="$XDG_STATE_HOME"/zsh/history

69
.config/zsh/aliases.zsh Executable file
View file

@ -0,0 +1,69 @@
#!/bin/sh
# Check ssd state
alias ssd-check="sudo smartctl -a /dev/nvme0n1 | grep -E -- 'Data Units Read:|Data Units Written:|Percentage Used:'"
# Adding colours to some of the regulas shit
alias grep='grep --color=auto'
alias ls='/usr/bin/exa -lab --icons --group-directories-first --git --no-time'
alias cp='cp -iv'
alias rm='rm -iv'
alias mkd='mkdir -pv'
alias tree='tree -C'
alias less='less -R'
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
# Git aliases
alias g='git'
alias gst='git status -s'
alias gc='git commit'
alias ga='git add'
alias gpl="git pull"
alias gpom="git pull origin master"
alias gpu="git push"
alias gpuom="git push origin master"
alias gd="git diff"
alias gch="git checkout"
alias gnb="git checkout -b"
alias gac="git add . && git commit"
alias grs="git restore --staged ."
alias gre="git restore"
alias gr="git remote"
alias gcl="git clone"
alias glg="git log --graph --abbrev-commit --decorate --format=format:'%C(bold green)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
alias gt="git ls-tree -r master --name-only"
alias grm="git remote"
alias gb="git branch"
alias gf="git fetch"
# Easier to type
alias vi='nvim'
# Humna readable + better output
alias df='df -h -x devtmpfs -x tmpfs -x usbfs -x loop'
alias free='free -m -h'
# speed up
alias spotdl='spotdl --output-format ogg -p "{artist}/{album}/{artists} - {title}.{ext}" --dt 8 --st 8'
# Just cause I can't remember the command at all
alias update-grub='doas grub-mkconfig -o /boot/grub/grub.cfg'
# Quickly see the hogger in the directory
alias dust='du -hd1 | sort -hr | sed "s/.\///g" | sed "/\.$/d"'
# Who want to remember this long ass commands
alias yta='yt-dlp -x -f bestaudio --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --audio-format vorbis -o "%(title)s.%(ext)s"'
alias ytvb='yt-dlp --merge-output-format mp4 -f "bestvideo+bestaudio[ext=m4a]/best" --embed-thumbnail --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --add-metadata -o "%(title)s.%(ext)s"'
alias ytvf='yt-dlp --merge-output-format mp4 --format best --embed-thumbnail --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --add-metadata -o "%(title)s.%(ext)s"'
# Nice
alias dl='aria2c -j 16 -s 16 -x 16 -k 5M --file-allocation=none'
# ;)
alias lf='lfrun $@'
alias b='buku --suggest'
# cryptography
alias rot13="tr 'A-Za-z' 'N-ZA-Mn-za-m'"

86
.config/zsh/functions.zsh Executable file
View file

@ -0,0 +1,86 @@
#!/bin/sh
# Cd into a directory using fzf
fcd () {
dir=$(fd -a --type d --hidden --exclude ".git|.github" | fzf --prompt "Choose directory: ")
[ -z $dir ] && return 1
cd $dir
}
# Remove choosed stuff
frm () {
remove=$(fd --hidden --maxdepth 1 | fzf -m --prompt "Choose to delete: ")
[ -z $remove ] && return 1
rm -rf $(printf '%s' $remove)
}
# Quicly choose stuff to add using fzf
fga () {
git add $(git status -s | awk '{ print $2 }' | fzf -m)
}
# Open a script in path with vim quicly
vish () {
nvim $(which $1)
}
# Create a directory and change into it
md () {
mkdir -p "$@" && cd "$@"
}
# Move a file and create a link in it's place
mvln () {
from=$(readlink -f $1)
to=$(readlink -f $2)
mv $from $to
ln -s $to $from
}
# Find my script and let me edit them
se() {
fd . ~/bin -L --type f --color=never | fzf --prompt "Choose script to edit: " \
--preview 'bat --color=always --style=plain --pager=never {}' | xargs -r $EDITOR
}
# List my config and open the dir in a editor
ce() {
fd . ~/.config -L --maxdepth 1 --color=never | fzf --prompt \
"Choose config to edit: " --preview 'tree -a -C {}' | xargs -r $EDITOR
}
# List files in a directory and edit choosen one
vf(){
fd -L --maxdepth 1 --type f --color=never --hidden | fzf --prompt "Choose script to edit: " \
--preview 'bat --color=always --style=plain --pager=never {}' | xargs -r $EDITOR
}
# history search
h() {
print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed -E 's/ *[0-9]*\*? *//' | sed -E 's/\\/\\\\/g')
}
# Copy current working directory
cpdir() {
pwd | tr -d "\r\n" | xclip -sel c
}
# Copy content of a file.
cf() {
cat $1 | xclip -sel c
}
# Open a bookmark from buku in browser
fb() {
buku --nostdin -p -f5 | fzf | cut -f1 | xargs -r buku --nostdin -o
}
# Extract all archive in current path and remove the archive
erm() {
for file in *.zip; do
printf '%s\n' "Extracting $file"
unzip $file
rm -f $file
printf '%s\n' ""
done
}