Merge branch 'master' into laptop

This commit is contained in:
Thomas Avé 2024-04-21 20:02:04 +02:00
commit 594405f7e1
8 changed files with 434 additions and 52 deletions

View File

@ -130,6 +130,7 @@ bind = $mainMod, SPACE, togglesplit, # dwindle
bind = CONTROL_L ALT_L, L, exec, swaylock
bind = $mainMod, C, exec, cliphist list | awk '{print $0, "\0icon\x1fcom.github.davidmhewitt.clipped"}' | rofi -dmenu -display-columns 2 | cliphist decode | wl-copy
bind = $mainMod, Y, exec, /home/user/.config/rofi/rofi-ykman.sh
bind = $mainMod, N, exec, /home/user/.config/rofi/rofi-ssh.sh
bind = $mainMod, Escape, exec, rofi -show power-menu -modi power-menu:$scripts/rofi-power-menu
bind = ,XF86PowerOff, exec, rofi -show power-menu -modi power-menu:$scripts/rofi-power-menu

174
.config/lf/colors Normal file
View File

@ -0,0 +1,174 @@
# vim:ft=dircolors
# (This is not a dircolors file but it helps to highlight colors and comments)
# default values from dircolors
# (entries with a leading # are not implemented in lf)
# #no 00 # NORMAL
# fi 00 # FILE
# #rs 0 # RESET
# di 01;34 # DIR
# ln 01;36 # LINK
# #mh 00 # MULTIHARDLINK
# pi 40;33 # FIFO
# so 01;35 # SOCK
# #do 01;35 # DOOR
# bd 40;33;01 # BLK
# cd 40;33;01 # CHR
# or 40;31;01 # ORPHAN
# #mi 00 # MISSING
# su 37;41 # SETUID
# sg 30;43 # SETGID
# #ca 30;41 # CAPABILITY
# tw 30;42 # STICKY_OTHER_WRITABLE
# ow 34;42 # OTHER_WRITABLE
# st 37;44 # STICKY
# ex 01;32 # EXEC
# default values from lf (with matching order)
# ln 01;36 # LINK
# or 31;01 # ORPHAN
# tw 01;34 # STICKY_OTHER_WRITABLE
# ow 01;34 # OTHER_WRITABLE
# st 01;34 # STICKY
# di 01;34 # DIR
# pi 33 # FIFO
# so 01;35 # SOCK
# bd 33;01 # BLK
# cd 33;01 # CHR
# su 01;32 # SETUID
# sg 01;32 # SETGID
# ex 01;32 # EXEC
# fi 00 # FILE
# file types (with matching order)
ln 01;36 # LINK
or 31;01 # ORPHAN
tw 34 # STICKY_OTHER_WRITABLE
ow 34 # OTHER_WRITABLE
st 01;34 # STICKY
di 01;34 # DIR
pi 33 # FIFO
so 01;35 # SOCK
bd 33;01 # BLK
cd 33;01 # CHR
su 01;32 # SETUID
sg 01;32 # SETGID
ex 01;32 # EXEC
fi 00 # FILE
# archives or compressed (dircolors defaults)
*.tar 01;31
*.tgz 01;31
*.arc 01;31
*.arj 01;31
*.taz 01;31
*.lha 01;31
*.lz4 01;31
*.lzh 01;31
*.lzma 01;31
*.tlz 01;31
*.txz 01;31
*.tzo 01;31
*.t7z 01;31
*.zip 01;31
*.z 01;31
*.dz 01;31
*.gz 01;31
*.lrz 01;31
*.lz 01;31
*.lzo 01;31
*.xz 01;31
*.zst 01;31
*.tzst 01;31
*.bz2 01;31
*.bz 01;31
*.tbz 01;31
*.tbz2 01;31
*.tz 01;31
*.deb 01;31
*.rpm 01;31
*.jar 01;31
*.war 01;31
*.ear 01;31
*.sar 01;31
*.rar 01;31
*.alz 01;31
*.ace 01;31
*.zoo 01;31
*.cpio 01;31
*.7z 01;31
*.rz 01;31
*.cab 01;31
*.wim 01;31
*.swm 01;31
*.dwm 01;31
*.esd 01;31
# image formats (dircolors defaults)
*.jpg 01;35
*.jpeg 01;35
*.mjpg 01;35
*.mjpeg 01;35
*.gif 01;35
*.bmp 01;35
*.pbm 01;35
*.pgm 01;35
*.ppm 01;35
*.tga 01;35
*.xbm 01;35
*.xpm 01;35
*.tif 01;35
*.tiff 01;35
*.png 01;35
*.svg 01;35
*.svgz 01;35
*.mng 01;35
*.pcx 01;35
*.mov 01;35
*.mpg 01;35
*.mpeg 01;35
*.m2v 01;35
*.mkv 01;35
*.webm 01;35
*.ogm 01;35
*.mp4 01;35
*.m4v 01;35
*.mp4v 01;35
*.vob 01;35
*.qt 01;35
*.nuv 01;35
*.wmv 01;35
*.asf 01;35
*.rm 01;35
*.rmvb 01;35
*.flc 01;35
*.avi 01;35
*.fli 01;35
*.flv 01;35
*.gl 01;35
*.dl 01;35
*.xcf 01;35
*.xwd 01;35
*.yuv 01;35
*.cgm 01;35
*.emf 01;35
*.ogv 01;35
*.ogx 01;35
# audio formats (dircolors defaults)
*.aac 00;36
*.au 00;36
*.flac 00;36
*.m4a 00;36
*.mid 00;36
*.midi 00;36
*.mka 00;36
*.mp3 00;36
*.mpc 00;36
*.ogg 00;36
*.ra 00;36
*.wav 00;36
*.oga 00;36
*.opus 00;36
*.spx 00;36
*.xspf 00;36

77
.config/lf/icons Normal file
View File

@ -0,0 +1,77 @@
di 
fi 📃
tw 🤝
ow 📂
ln ⛓
or ❌
ex 🎯
*.txt ✍
*.mom ✍
*.me ✍
*.ms ✍
*.avif 🖼
*.png 🖼
*.webp 🖼
*.ico 🖼
*.jpg 📸
*.jpe 📸
*.jpeg 📸
*.gif 🖼
*.svg 🗺
*.tif 🖼
*.tiff 🖼
*.xcf 🖌
*.html 🌎
*.xml 📰
*.gpg 🔒
*.css 🎨
*.pdf 📚
*.djvu 📚
*.epub 📚
*.csv 📓
*.xlsx 📓
*.tex 📜
*.md 📘
*.r 📊
*.R 📊
*.rmd 📊
*.Rmd 📊
*.m 📊
*.mp3 🎵
*.opus 🎵
*.ogg 🎵
*.m4a 🎵
*.flac 🎼
*.wav 🎼
*.mkv 🎥
*.mp4 🎥
*.webm 🎥
*.mpeg 🎥
*.avi 🎥
*.mov 🎥
*.mpg 🎥
*.wmv 🎥
*.m4b 🎥
*.flv 🎥
*.zip 📦
*.rar 📦
*.7z 📦
*.tar 📦
*.z64 🎮
*.v64 🎮
*.n64 🎮
*.gba 🎮
*.nes 🎮
*.gdi 🎮
*.1
*.nfo
*.info
*.log 📙
*.iso 📀
*.img 📀
*.bib 🎓
*.ged 👪
*.part 💔
*.torrent 🔽
*.jar ♨
*.java ♨

6
.config/lf/lfrc Normal file
View File

@ -0,0 +1,6 @@
set icons true
set autoquit true
set mouse true
set number true
set relativenumber true
set cursorpreviewfmt ""

9
.config/rofi/rofi-ssh.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
servers=(Mallorea Kell Riva Vault Aloria Arendia)
selected=$(for server in "${servers[@]}"; do printf "%s\0icon\x1fterminal\n" "$server"; done | rofi -dmenu -i)
if [ -z "$selected" ]; then
exit 1
fi
alacritty -e zsh -c "source ~/.zshrc && run_waypipe $selected"

View File

@ -111,51 +111,15 @@ function zvm_after_init() {
fi
fi
if [ ! -f $FZY_CACHE ]; then
PATHS=""
PATHS="$(/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME ls-files | xargs -n 1 dirname | uniq | grep -v '^\.$' | parallel echo ~/{})"
search_dirs=(~/Workspace/ \
~/Containers/ \
~/Storage/Shared/ \
~/Storage/Thomas/ \
/home/server/Storage/Thomas/ \
)
for i in $search_dirs ; do
if [ -d $i ]; then
PATHS="$PATHS\n$i"
PATHS="$PATHS\n$(ssh mallorea fdfind . $i -t d -d 8)"
fi
rone
search_dirs=(~/.config/waybar/ \
~/.config/xmodmap/ \
~/.config/zsh/ \
~/.config/tmux/ \
~/.config/vim/ \
~/.config/qtile/ \
~/.config/rofi/ \
~/.config/scripts/ \
~/.config/nvim/ \
~/.config/picom/ \
~/.config/polybar/ \
~/.config/awesome/ \
~/.config/dunst/ \
~/.config/firefox/ \
~/.config/git/ \
~/.config/gitui/ \
~/.config/helix/ \
~/.config/hypr/ \
~/.config/i3/ \
~/.config/kitty/ \
~/.config/mpv/ \
~/.config/alacritty/ \
~/Containers/ \
~/Storage/Shared/ \
~/Storage/Thomas/ \
)
for i in $search_dirs ; do
if [ -d $i ]; then
PATHS="$PATHS\n$i"
PATHS="$PATHS\n$(fd . $i -t d -d 5)"
fi
done
echo -e $PATHS > $FZY_CACHE
fi
@ -167,8 +131,49 @@ function zvm_after_init() {
cd_to "$(fd . -t d | fzy -l 20)"
}
function edit_local_files() {
zle -I
file=$(fd . -t f | fzy -l 20)
if [ -z "$file" ]; then
return 0
fi
nvim "$file"
}
function edit_global_files() {
zle -I
FZY_CACHE=~/.cache/fzy_file_paths
if [ -f $FZY_CACHE ]; then
# Check if cache is older than 1 day
if [ $(($(date +%s) - $(date -r $FZY_CACHE +%s))) -gt 86400 ]; then
rm $FZY_CACHE
fi
fi
if [ ! -f $FZY_CACHE ]; then
PATHS="$(/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME ls-files | parallel echo ~/{})"
search_dirs=(~/Workspace/ \
~/Containers/ \
)
for i in $search_dirs ; do
if [ -d $i ]; then
PATHS="$PATHS\n$(fd . $i -t f)"
fi
done
echo -e $PATHS > $FZY_CACHE
fi
file=$(cat $FZY_CACHE | fzy -l 20)
if [ -z "$file" ]; then
return 0
fi
cd_to "$(dirname $file)"
nvim "$file"
}
zle -N find_global_files
zle -N find_local_files
zle -N edit_global_files
zle -N edit_local_files
bindkey "^T" find_global_files
bindkey -M emacs "^T" find_global_files
@ -180,6 +185,16 @@ function zvm_after_init() {
bindkey -M vicmd "^Y" find_local_files
bindkey -M viins "^Y" find_local_files
bindkey "^E" edit_global_files
bindkey -M emacs "^E" edit_global_files
bindkey -M vicmd "^E" edit_global_files
bindkey -M viins "^E" edit_global_files
bindkey "^W" edit_global_files
bindkey -M emacs "^W" edit_local_files
bindkey -M vicmd "^W" edit_local_files
bindkey -M viins "^W" edit_local_files
if [ "$SSH_SESSION_ID" != "" ]; then
mkdir -p /tmp/ssh_sessions
@ -254,6 +269,26 @@ function xterm_title_preexec () {
print -Pn -- '\e]2;' && print -n -- "${(q)1}\a"
}
if [[ "$TERM" == (Eterm*|alacritty*|aterm*|gnome*|konsole*|kterm*|putty*|rxvt*|screen*|tmux*|xterm*) ]]; then
add-zsh-hook -Uz precmd xterm_title_precmd
add-zsh-hook -Uz preexec xterm_title_preexec
fi
###########################################
# Aliases
###########################################
if [[ "$(hostname)" == "mallorea" ]]; then
alias lf="/usr/bin/lf -last-dir-path /tmp/lf_dir && cd \"\$(cat /tmp/lf_dir 2> /dev/null || pwd)\""
else
alias lf="cd \"\$(/usr/bin/lf -print-selection -print-last-dir)\""
fi
if command -v fdfind &> /dev/null; then
alias fd="fdfind"
fi
function o () {
xdg-open "$1" &!
}
@ -264,32 +299,28 @@ function run_waypipe() {
SSH_SESSION_ID=$SSH_SESSION_ID waypipe ssh -t $1 env REMOTE_PATH=\"$REMOTE_PATH\" SSH_SESSION_ID=$SSH_SESSION_ID "zsh --login"
}
function git() {
if [ "$HOME" = "$(pwd)" ]; then
/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"
else
/usr/bin/git "$@"
fi
}
alias mallorea="run_waypipe mallorea"
alias vault="run_waypipe vault"
alias riva="run_waypipe riva"
alias kell="run_waypipe kell"
if [[ "$TERM" == (Eterm*|alacritty*|aterm*|gnome*|konsole*|kterm*|putty*|rxvt*|screen*|tmux*|xterm*) ]]; then
add-zsh-hook -Uz precmd xterm_title_precmd
add-zsh-hook -Uz preexec xterm_title_preexec
fi
# Aliases
if command -v fdfind &> /dev/null; then
alias fd="fdfind"
fi
alias ls="ls --color=auto"
alias gdb='gdb -q'
alias ll='ls -lhat'
alias clip="xsel --clipboard"
alias compress="tar --use-compress-program=lbzip2 -cvf"
alias vim="nvim"
alias dot='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"'
alias dot='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"'
alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts"
alias xbindkeys="xbindkeys -f $XDG_CONFIG_HOME/xbindkeys/config"
alias python=python3
alias r=". ranger"
alias v="vim . && cd \"\$(cat /tmp/oil_dir 2> /dev/null || pwd)\""
alias v="nvim -c ':lua require(\"oil\").open()' && cd \"\$(cat /tmp/oil_dir 2> /dev/null || pwd)\""
alias cpr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1"
alias mvr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files"
alias rg="rg -i --colors 'match:bg:yellow' --colors 'match:fg:black' --colors 'match:style:nobold' --colors 'path:fg:green' --colors 'path:style:bold' --colors 'line:fg:yellow' --colors 'line:style:bold'"

1
.mailcap Normal file
View File

@ -0,0 +1 @@
text/html; w3m -dump -o -document_charset=%{charset} %s; nametemplate=%s.html; copiousoutput

83
.notmuch-config Normal file
View File

@ -0,0 +1,83 @@
# .notmuch-config - Configuration file for the notmuch mail system
#
# For more information about notmuch, see https://notmuchmail.org
# Database configuration
#
# The only value supported here is 'path' which should be the top-level
# directory where your mail currently exists and to where mail will be
# delivered in the future. Files should be individual email messages.
# Notmuch will store its database within a sub-directory of the path
# configured here named ".notmuch".
#
[database]
path=/home/user/.config/aerc/mail
# User configuration
#
# Here is where you can let notmuch know how you would like to be
# addressed. Valid settings are
#
# name Your full name.
# primary_email Your primary email address.
# other_email A list (separated by ';') of other email addresses
# at which you receive email.
#
# Notmuch will use the various email addresses configured here when
# formatting replies. It will avoid including your own addresses in the
# recipient list of replies, and will set the From address based on the
# address to which the original email was addressed.
#
[user]
name=Thomas Avé
primary_email=email@thomasave.be
other_email=Thomas.Ave@uantwerpen.be;Thomas.Ave@imec.be;
# Configuration for "notmuch new"
#
# The following options are supported here:
#
# tags A list (separated by ';') of the tags that will be
# added to all messages incorporated by "notmuch new".
#
# ignore A list (separated by ';') of file and directory names
# that will not be searched for messages by "notmuch new".
#
# NOTE: *Every* file/directory that goes by one of those
# names will be ignored, independent of its depth/location
# in the mail store.
#
[new]
# Search configuration
#
# The following option is supported here:
#
# exclude_tags
# A ;-separated list of tags that will be excluded from
# search results by default. Using an excluded tag in a
# query will override that exclusion.
#
[search]
# Maildir compatibility configuration
#
# The following option is supported here:
#
# synchronize_flags Valid values are true and false.
#
# If true, then the following maildir flags (in message filenames)
# will be synchronized with the corresponding notmuch tags:
#
# Flag Tag
# ---- -------
# D draft
# F flagged
# P passed
# R replied
# S unread (added when 'S' flag is not present)
#
# The "notmuch new" command will notice flag changes in filenames
# and update tags, while the "notmuch tag" and "notmuch restore"
# commands will notice tag changes and update flags in filenames
exclude_tags=deleted;spam;
[maildir]
synchronize_flags=true