From fea6955b8f1b1a43a72f14e1e78c556103ebb564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 20 Apr 2024 12:44:23 +0200 Subject: [PATCH 01/27] AERC updates --- .config/aerc/aerc.conf | 12 ++++++------ .config/aerc/binds.conf | 10 +++++----- .profile | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.config/aerc/aerc.conf b/.config/aerc/aerc.conf index 22ab43e..46f402e 100644 --- a/.config/aerc/aerc.conf +++ b/.config/aerc/aerc.conf @@ -1,6 +1,3 @@ -# -# aerc main configuration - [general] # # Used as a default path for save operations if no other path is specified. @@ -568,7 +565,7 @@ pager=nvim -u $XDG_CONFIG_HOME/nvim/aerc.lua # ignored. # # This parameter can also be set per account in accounts.conf. -#address-book-cmd= +address-book-cmd='notmuch address "%s"' # Specifies the command to be used to select attachments. Any occurrence of # '%s' in the file-picker-cmd will be replaced with the argument @@ -622,7 +619,9 @@ pager=nvim -u $XDG_CONFIG_HOME/nvim/aerc.lua # # Example (obviously, this requires that you write your main text/plain body # using the markdown syntax): -text/html=pandoc -f markdown -t html --standalone +# text/html=pandoc -f markdown -t html --standalone +# text/html=lynx -dump -force_html -stdin +text/html=w3m -dump -o display_link_number=1 -T text/html [filters] # @@ -662,7 +661,8 @@ text/plain=cat text/calendar=gnome-calendar message/delivery-status=cat message/rfc822=cat -text/html=pandoc -f html -t plain +# text/html=lynx -dump -force_html -stdin +text/html=w3m -dump -o display_link_number=1 -T text/html #text/html=html | colorize text/*=bat -fP --file-name="$AERC_FILENAME" application/x-sh=bat -fP -l sh diff --git a/.config/aerc/binds.conf b/.config/aerc/binds.conf index e7a6ec5..6db5938 100644 --- a/.config/aerc/binds.conf +++ b/.config/aerc/binds.conf @@ -35,8 +35,7 @@ K = :prev-folder v = :mark -t # = :mark -t:next V = :mark -v - = :read - = :unread + = :read -t T = :toggle-threads # zc = :fold @@ -51,6 +50,7 @@ d = :prompt 'Really delete this message?' 'delete-message' D = :delete a = :archive flat A = :unmark -a:mark -T:archive flat +f = :flag -t c = :compose m = :compose @@ -65,8 +65,8 @@ $ = :term ! = :term | = :pipe -/ = :search -\ = :filter +/ = :search -a +\ = :filter -a n = :next-result N = :prev-result = :clear @@ -96,7 +96,7 @@ A = :archive flat = :open-link -f = :forward +f = :flag -t rr = :reply -a rq = :reply -aq Rr = :reply diff --git a/.profile b/.profile index 57b121f..44b0075 100644 --- a/.profile +++ b/.profile @@ -17,3 +17,4 @@ export ZDOTDIR="$XDG_CONFIG_HOME"/zsh export XDG_CURRENT_DESKTOP=GNOME export OPENCV_LOG_LEVEL=ERROR export PATH="$HOME/.local/bin:$PATH" +export COLORTERM=truecolor From bc5fd58ebc84d69e9a15d49de74119d1a479751f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 14:21:48 +0200 Subject: [PATCH 02/27] Better git in home dir --- .config/zsh/.zshrc | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 459a6a7..4db6699 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -243,6 +243,21 @@ 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 command -v fdfind &> /dev/null; then + alias fd="fdfind" +fi function o () { xdg-open "$1" &! } @@ -253,32 +268,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 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 r="cd \"\$(lf -print-selection -print-last-dir)\"" +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'" From 8914ba08e1456f6fb73c439af3fc41616da16fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 14:22:08 +0200 Subject: [PATCH 03/27] Add lf config --- .config/lf/colors | 174 ++++++++++++++++++++++++++++++++++++++++++++++ .config/lf/icons | 77 ++++++++++++++++++++ .config/lf/lfrc | 6 ++ 3 files changed, 257 insertions(+) create mode 100644 .config/lf/colors create mode 100644 .config/lf/icons create mode 100644 .config/lf/lfrc diff --git a/.config/lf/colors b/.config/lf/colors new file mode 100644 index 0000000..b65d3f0 --- /dev/null +++ b/.config/lf/colors @@ -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 diff --git a/.config/lf/icons b/.config/lf/icons new file mode 100644 index 0000000..ae8d86c --- /dev/null +++ b/.config/lf/icons @@ -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 ♨ diff --git a/.config/lf/lfrc b/.config/lf/lfrc new file mode 100644 index 0000000..4be0e82 --- /dev/null +++ b/.config/lf/lfrc @@ -0,0 +1,6 @@ +set icons true +set autoquit true +set mouse true +set number true +set relativenumber true +set cursorpreviewfmt "" From b276a54f9f60ddc7eeca758ab2ba9aa9528b9faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 14:33:55 +0200 Subject: [PATCH 04/27] Add mailcap & notmuch --- .config/zsh/.zshrc | 1 + .mailcap | 1 + .notmuch-config | 83 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 .mailcap create mode 100644 .notmuch-config diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 4db6699..46e8788 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -286,6 +286,7 @@ alias gdb='gdb -q' alias ll='ls -lhat' alias compress="tar --use-compress-program=lbzip2 -cvf" alias vim="nvim" +alias dot='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"' alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts" alias python=python3 alias r="cd \"\$(lf -print-selection -print-last-dir)\"" diff --git a/.mailcap b/.mailcap new file mode 100644 index 0000000..3906763 --- /dev/null +++ b/.mailcap @@ -0,0 +1 @@ +text/html; w3m -dump -o -document_charset=%{charset} %s; nametemplate=%s.html; copiousoutput diff --git a/.notmuch-config b/.notmuch-config new file mode 100644 index 0000000..e2a0c6a --- /dev/null +++ b/.notmuch-config @@ -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 From 02597dde9962a166454689ea356da0f369ae61b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 15:10:34 +0200 Subject: [PATCH 05/27] Add to open a global file --- .config/zsh/.zshrc | 69 ++++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 46e8788..e3d063d 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -111,35 +111,13 @@ function zvm_after_init() { fi fi if [ ! -f $FZY_CACHE ]; then - PATHS="" - 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/ \ + 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/Shared/ \ + /home/server/Storage/Thomas/ \ ) - for i in $search_dirs ; do if [ -d $i ]; then PATHS="$PATHS\n$i" @@ -156,8 +134,40 @@ function zvm_after_init() { cd_to "$(fd . -t d | fzy -l 20)" } + 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 bindkey "^T" find_global_files bindkey -M emacs "^T" find_global_files @@ -169,6 +179,11 @@ 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 + if [ "$SSH_SESSION_ID" != "" ]; then mkdir -p /tmp/ssh_sessions @@ -289,7 +304,7 @@ alias vim="nvim" alias dot='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"' alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts" alias python=python3 -alias r="cd \"\$(lf -print-selection -print-last-dir)\"" +alias lf="cd \"\$(/usr/bin/lf -print-selection -print-last-dir)\"" 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" From bd3fbd2566948e5c9cb31583b3d9e59c41fc3f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 15:47:29 +0200 Subject: [PATCH 06/27] Add local edit --- .config/zsh/.zshrc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index e3d063d..e5c2bef 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -134,6 +134,15 @@ 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 @@ -168,6 +177,7 @@ function zvm_after_init() { 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 @@ -184,6 +194,11 @@ function zvm_after_init() { 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 From 2899c83c2835a56434be50804d14a88f02e2d65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 17:51:34 +0200 Subject: [PATCH 07/27] Better lf on ubuntu --- .config/zsh/.zshrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index e5c2bef..78aa9f4 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -284,6 +284,11 @@ 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" @@ -319,7 +324,6 @@ alias vim="nvim" alias dot='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"' alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts" alias python=python3 -alias lf="cd \"\$(/usr/bin/lf -print-selection -print-last-dir)\"" 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" From 367358c3f45a0a2acdc5a38e928f7eb1e7dd03f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 17:53:30 +0200 Subject: [PATCH 08/27] Remove shared storage from fzy --- .config/zsh/.zshrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 78aa9f4..5832cb1 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -115,7 +115,6 @@ function zvm_after_init() { search_dirs=( \ ~/Workspace/ \ ~/Containers/ \ - /home/server/Storage/Shared/ \ /home/server/Storage/Thomas/ \ ) for i in $search_dirs ; do From 0447f68106f2969ba4489467050e3651ad87a104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 17:56:05 +0200 Subject: [PATCH 09/27] Better expansion on older zsh --- .config/zsh/.zshrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 5832cb1..7f9f1f5 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -153,8 +153,7 @@ function zvm_after_init() { fi if [ ! -f $FZY_CACHE ]; then PATHS="$(/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME ls-files | parallel echo ~/{})" - search_dirs=( \ - ~/Workspace/ \ + search_dirs=(~/Workspace/ \ ~/Containers/ \ ) for i in $search_dirs ; do From d9118de373d0e10004f28bc7274c7bc401ca2a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 18:28:35 +0200 Subject: [PATCH 10/27] add rofi-ssh script --- .config/hypr/hyprland.conf | 1 + .config/rofi/rofi-ssh.sh | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100755 .config/rofi/rofi-ssh.sh diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 8ec08c4..dd3f301 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -140,6 +140,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 diff --git a/.config/rofi/rofi-ssh.sh b/.config/rofi/rofi-ssh.sh new file mode 100755 index 0000000..9f93ef2 --- /dev/null +++ b/.config/rofi/rofi-ssh.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + + +servers=(Mallorea Kell Riva Vault Aloria Arendia) +selected=$(for server in "${servers[@]}"; do printf "%s\0icon\x1fyubioath\n" "$server"; done | rofi -dmenu -i) +if [ -z "$selected" ]; then + exit 1 +fi +alacritty -e zsh -c "source ~/.zshrc && run_waypipe $selected" From 5aec63d242c9dea9a509784f2455ba3b0d96180e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 18:30:13 +0200 Subject: [PATCH 11/27] Change ssh icon --- .config/rofi/rofi-ssh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/rofi/rofi-ssh.sh b/.config/rofi/rofi-ssh.sh index 9f93ef2..6456024 100755 --- a/.config/rofi/rofi-ssh.sh +++ b/.config/rofi/rofi-ssh.sh @@ -2,7 +2,7 @@ servers=(Mallorea Kell Riva Vault Aloria Arendia) -selected=$(for server in "${servers[@]}"; do printf "%s\0icon\x1fyubioath\n" "$server"; done | rofi -dmenu -i) +selected=$(for server in "${servers[@]}"; do printf "%s\0icon\x1fterminal\n" "$server"; done | rofi -dmenu -i) if [ -z "$selected" ]; then exit 1 fi From 6f3c493c7d7ac68956023fe52661222c441326ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 20:28:36 +0200 Subject: [PATCH 12/27] Better highlighting with f and flash.nvim --- .config/nvim/lua/plugins/catppuccin.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/nvim/lua/plugins/catppuccin.lua b/.config/nvim/lua/plugins/catppuccin.lua index c8f163a..7e6dd23 100644 --- a/.config/nvim/lua/plugins/catppuccin.lua +++ b/.config/nvim/lua/plugins/catppuccin.lua @@ -14,6 +14,7 @@ return { TelescopePromptBorder = { bg = "#191926", fg = "#191926" }, TelescopeTitle = { fg = colors.blue }, WinSeparator = { fg = "#023269" }, + FlashCursor = { bg = colors.red }, } end, color_overrides = { From b65e5158a3db84f51d75ac8e2c00f8565563533d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 21:01:06 +0200 Subject: [PATCH 13/27] better lf config --- .config/lf/lfrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 4be0e82..62a5e1d 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -4,3 +4,11 @@ set mouse true set number true set relativenumber true set cursorpreviewfmt "" + +cmd q quit + +map quit +map half-up +map . set hidden! +map o $nvim -c "lua require(\"oil\").open(\"$PWD\")" +map open From bdc85b9ac21c3b608c7847eaf054bc6e9a72e6eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 21:03:12 +0200 Subject: [PATCH 14/27] Don't source containers on laptop --- .config/zsh/.zshrc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 7f9f1f5..36d8ab2 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -153,12 +153,10 @@ function zvm_after_init() { 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/ \ - ) + search_dirs=(~/Workspace/ ) for i in $search_dirs ; do if [ -d $i ]; then - PATHS="$PATHS\n$(fd . $i -t f)" + PATHS="$PATHS\n$(ssh mallorea fdfind . $i -t f)" fi done echo -e $PATHS > $FZY_CACHE From d58be60b821412a2503574fb296e720a991bb2f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 21:03:49 +0200 Subject: [PATCH 15/27] Revert "Don't source containers on laptop" This reverts commit bdc85b9ac21c3b608c7847eaf054bc6e9a72e6eb. --- .config/zsh/.zshrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 36d8ab2..7f9f1f5 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -153,10 +153,12 @@ function zvm_after_init() { fi if [ ! -f $FZY_CACHE ]; then PATHS="$(/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME ls-files | parallel echo ~/{})" - search_dirs=(~/Workspace/ ) + search_dirs=(~/Workspace/ \ + ~/Containers/ \ + ) for i in $search_dirs ; do if [ -d $i ]; then - PATHS="$PATHS\n$(ssh mallorea fdfind . $i -t f)" + PATHS="$PATHS\n$(fd . $i -t f)" fi done echo -e $PATHS > $FZY_CACHE From 7d6a6ae13c143e305e9a7396b555e176555b7740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 21:09:04 +0200 Subject: [PATCH 16/27] Quit vim on backspace in oil --- .config/nvim/lua/plugins/oil.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index 8d8e4ef..d89ea95 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -19,7 +19,7 @@ return { ["v"] = "actions.select_vsplit", ["s"] = "actions.select_split", ["p"] = "actions.preview", - [""] = "actions.close", + [""] = function() vim.cmd("q!") end, ["r"] = "actions.refresh", ["-"] = function() require("oil").open(); save_dir() end, ["_"] = "actions.open_cwd", From 9fe06573092d1d84413dc09757fadf30904f47ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 21:10:45 +0200 Subject: [PATCH 17/27] Sun Apr 21 09:10:45 PM CEST 2024 --- .config/lf/lfrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 62a5e1d..1dce808 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -11,4 +11,5 @@ map quit map half-up map . set hidden! map o $nvim -c "lua require(\"oil\").open(\"$PWD\")" +map - $nvim -c "lua require(\"oil\").open(\"$PWD\")" map open From 5041acdf5c1a1ea509711fb46001e1c5d55edf93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 21:26:38 +0200 Subject: [PATCH 18/27] add fzy files to lf --- .config/lf/lfrc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 1dce808..e4b8403 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -13,3 +13,31 @@ map . set hidden! map o $nvim -c "lua require(\"oil\").open(\"$PWD\")" map - $nvim -c "lua require(\"oil\").open(\"$PWD\")" map open + +cmd jump ${{ + FZY_CACHE=~/.cache/fzy_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 | xargs -n 1 dirname | uniq | grep -v '^\.$' | parallel echo ~/{})" + search_dirs=(~/Workspace/ \ + /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 + done + echo -e $PATHS > $FZY_CACHE + fi + res="$(cat $FZY_CACHE | fzy -l 20)" + res="$(printf '%s' "$res" | sed 's/\\/\\\\/g;s/"/\\"/g')" + lf -remote "send $id cd \"$res\"" +}} + +map :jump From dbd6bbd561cd22888665380a232c4e9a9cbf6620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 21 Apr 2024 21:29:22 +0200 Subject: [PATCH 19/27] check if remote path exists --- .config/zsh/.zshrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 7f9f1f5..afb13ef 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -203,7 +203,9 @@ function zvm_after_init() { echo $$ > /tmp/ssh_sessions/"$SSH_SESSION_ID" fi if [ "$REMOTE_PATH" != "" ]; then - cd "$REMOTE_PATH" + if [ -d "$REMOTE_PATH" ]; then + cd "$REMOTE_PATH" + fi elif [ "$PREVIOUS_SESSION_ID" != "" ]; then cd "$(readlink -e /proc/$(cat /tmp/ssh_sessions/$PREVIOUS_SESSION_ID)/cwd)" fi From fe1730ac4fc211abae6851503e1c6435dd82c187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Mon, 22 Apr 2024 13:34:53 +0200 Subject: [PATCH 20/27] Move to split-monitor-workspaces --- .config/hypr/hyprland.conf | 88 +- .config/hypr/hyprsome/.gitignore | 2 - .config/hypr/hyprsome/Cargo.lock | 1207 ----------------- .config/hypr/hyprsome/Cargo.toml | 17 - .config/hypr/hyprsome/LICENSE.txt | 16 - .config/hypr/hyprsome/README.md | 76 -- .config/hypr/hyprsome/flake.lock | 159 --- .config/hypr/hyprsome/flake.nix | 23 - .../hypr/hyprsome/src/hyprland_ipc/client.rs | 17 - .config/hypr/hyprsome/src/hyprland_ipc/mod.rs | 37 - .../hypr/hyprsome/src/hyprland_ipc/monitor.rs | 43 - .../hypr/hyprsome/src/hyprland_ipc/option.rs | 19 - .../hyprsome/src/hyprland_ipc/workspace.rs | 23 - .config/hypr/hyprsome/src/main.rs | 350 ----- 14 files changed, 25 insertions(+), 2052 deletions(-) delete mode 100644 .config/hypr/hyprsome/.gitignore delete mode 100644 .config/hypr/hyprsome/Cargo.lock delete mode 100644 .config/hypr/hyprsome/Cargo.toml delete mode 100644 .config/hypr/hyprsome/LICENSE.txt delete mode 100644 .config/hypr/hyprsome/README.md delete mode 100644 .config/hypr/hyprsome/flake.lock delete mode 100644 .config/hypr/hyprsome/flake.nix delete mode 100644 .config/hypr/hyprsome/src/hyprland_ipc/client.rs delete mode 100644 .config/hypr/hyprsome/src/hyprland_ipc/mod.rs delete mode 100644 .config/hypr/hyprsome/src/hyprland_ipc/monitor.rs delete mode 100644 .config/hypr/hyprsome/src/hyprland_ipc/option.rs delete mode 100644 .config/hypr/hyprsome/src/hyprland_ipc/workspace.rs delete mode 100644 .config/hypr/hyprsome/src/main.rs diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index dd3f301..22e3c2a 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -1,52 +1,18 @@ -env = WLR_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1 env = WLR_NO_HARDWARE_CURSORS,1 env = TERMINAL,alacritty - $scripts = /home/user/.config/scripts +$mainMod = SUPER monitor=DP-2,preferred,0x550,1 monitor=DP-3,preferred,1920x0,1 monitor=HDMI-A-1,preferred,5760x550,1 + exec-once=hyprpaper exec-once=wl-paste --type text --watch cliphist store exec-once=wl-paste --type image --watch cliphist store exec-once=/usr/lib/mate-polkit/polkit-mate-authentication-agent-1 exec-once=/usr/lib/kdeconnectd -exec-once=sleep 2 && hyprctl dispatch workspace 21 - -workspace=DP-2,11 -workspace=DP-3,21 -workspace=HDMI-A-1,1 - -workspace=21,monitor:HDMI-A-1, default:true -workspace=22,monitor:HDMI-A-1 -workspace=23,monitor:HDMI-A-1 -workspace=24,monitor:HDMI-A-1 -workspace=25,monitor:HDMI-A-1 -workspace=26,monitor:HDMI-A-1 -workspace=27,monitor:HDMI-A-1 -workspace=28,monitor:HDMI-A-1 -workspace=29,monitor:HDMI-A-1 - -workspace=1,monitor:DP-2, default:true -workspace=2,monitor:DP-2 -workspace=3,monitor:DP-2 -workspace=4,monitor:DP-2 -workspace=5,monitor:DP-2 -workspace=6,monitor:DP-2 -workspace=7,monitor:DP-2 -workspace=8,monitor:DP-2 -workspace=9,monitor:DP-2 - -workspace=11,monitor:DP-3, default:true -workspace=12,monitor:DP-3 -workspace=13,monitor:DP-3 -workspace=14,monitor:DP-3 -workspace=15,monitor:DP-3 -workspace=16,monitor:DP-3 -workspace=17,monitor:DP-3 -workspace=18,monitor:DP-3 -workspace=19,monitor:DP-3 +exec-once=waybar # windowrulev2 = tile, class:.* windowrulev2 = float, title:^(rofi)(.*)$ @@ -57,8 +23,6 @@ windowrulev2 = minsize 1 1, title:^()$,class:^(steam)$ windowrulev2 = stayfocused, title:^()$,class:^(steam)$ windowrule = noanim,waybar -exec-once=waybar - binds { scroll_event_delay=1 } @@ -122,9 +86,7 @@ gestures { workspace_swipe_invert = false } -$mainMod = SUPER -# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bindr = $mainMod, SUPER_L, exec, pkill rofi || rofi -show drun bindr = $mainMod, SUPER_R, exec, pkill rofi || rofi -show drun bind = $mainMod, return, exec, $scripts/launch_alacritty.sh $(hyprctl activewindow -j | jq .pid) @@ -177,32 +139,32 @@ binde = $mainMod ALT, H, resizeactive, -20 0 binde = $mainMod ALT, K, resizeactive, 0 -20 binde = $mainMod ALT, J, resizeactive, 0 20 -bind = $mainMod, 1, exec, hyprsome workspace 1 -bind = $mainMod, 2, exec, hyprsome workspace 2 -bind = $mainMod, 3, exec, hyprsome workspace 3 -bind = $mainMod, 4, exec, hyprsome workspace 4 -bind = $mainMod, 5, exec, hyprsome workspace 5 -bind = $mainMod, 6, exec, hyprsome workspace 6 -bind = $mainMod, 7, exec, hyprsome workspace 7 -bind = $mainMod, 8, exec, hyprsome workspace 8 -bind = $mainMod, 9, exec, hyprsome workspace 9 +bind = $mainMod, 1, split-workspace, 1 +bind = $mainMod, 2, split-workspace, 2 +bind = $mainMod, 3, split-workspace, 3 +bind = $mainMod, 4, split-workspace, 4 +bind = $mainMod, 5, split-workspace, 5 +bind = $mainMod, 6, split-workspace, 6 +bind = $mainMod, 7, split-workspace, 7 +bind = $mainMod, 8, split-workspace, 8 +bind = $mainMod, 9, split-workspace, 9 -bind = $mainMod SHIFT, 1, exec, hyprsome movefocus 1 -bind = $mainMod SHIFT, 2, exec, hyprsome movefocus 2 -bind = $mainMod SHIFT, 3, exec, hyprsome movefocus 3 -bind = $mainMod SHIFT, 4, exec, hyprsome movefocus 4 -bind = $mainMod SHIFT, 5, exec, hyprsome movefocus 5 -bind = $mainMod SHIFT, 6, exec, hyprsome movefocus 6 -bind = $mainMod SHIFT, 7, exec, hyprsome movefocus 7 -bind = $mainMod SHIFT, 8, exec, hyprsome movefocus 8 -bind = $mainMod SHIFT, 9, exec, hyprsome movefocus 9 +bind = $mainMod SHIFT, 1, split-movetoworkspace, 1 +bind = $mainMod SHIFT, 2, split-movetoworkspace, 2 +bind = $mainMod SHIFT, 3, split-movetoworkspace, 3 +bind = $mainMod SHIFT, 4, split-movetoworkspace, 4 +bind = $mainMod SHIFT, 5, split-movetoworkspace, 5 +bind = $mainMod SHIFT, 6, split-movetoworkspace, 6 +bind = $mainMod SHIFT, 7, split-movetoworkspace, 7 +bind = $mainMod SHIFT, 8, split-movetoworkspace, 8 +bind = $mainMod SHIFT, 9, split-movetoworkspace, 9 -bind = $mainMod SHIFT, T, exec, hyprsome move-empty -bind = $mainMod, T, exec, hyprsome focus-empty +bind = $mainMod SHIFT, T, split-movetoworkspace, empty +bind = $mainMod, T, split-workspace, empty # Scroll through existing workspaces with mainMod + scroll -bind = $mainMod, TAB, workspace, m+1 -bind = $mainMod SHIFT, TAB, workspace, m-1 +bind = $mainMod, TAB, split-workspace, m+1 +bind = $mainMod SHIFT, TAB, split-workspace, m-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow diff --git a/.config/hypr/hyprsome/.gitignore b/.config/hypr/hyprsome/.gitignore deleted file mode 100644 index d787b70..0000000 --- a/.config/hypr/hyprsome/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/target -/result diff --git a/.config/hypr/hyprsome/Cargo.lock b/.config/hypr/hyprsome/Cargo.lock deleted file mode 100644 index 706551c..0000000 --- a/.config/hypr/hyprsome/Cargo.lock +++ /dev/null @@ -1,1207 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - -[[package]] -name = "async-trait" -version = "0.1.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.102", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bytes" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "4.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf8832993da70a4c6d13c581f4463c2bdda27b9bf1c5498dc4365543abe6d6f" -dependencies = [ - "atty", - "bitflags", - "clap_derive", - "clap_lex", - "once_cell", - "strsim", - "termcolor", -] - -[[package]] -name = "clap_derive" -version = "4.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.102", -] - -[[package]] -name = "clap_lex" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[package]] -name = "crossbeam-channel" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" -dependencies = [ - "crossbeam-utils", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "lazy_static", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", - "syn 1.0.102", -] - -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - -[[package]] -name = "dyn-clone" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" - -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - -[[package]] -name = "futures" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" - -[[package]] -name = "futures-executor" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" - -[[package]] -name = "futures-macro" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.102", -] - -[[package]] -name = "futures-sink" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" - -[[package]] -name = "futures-task" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" - -[[package]] -name = "futures-util" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hyprland" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d341e36a776cd092622daf2439a484247f3dc7d25eab7b286cc88ac85120d3" -dependencies = [ - "async-trait", - "derive_more", - "doc-comment", - "futures", - "hex", - "hyprland-macros", - "lazy_static", - "num-traits", - "paste", - "regex", - "serde", - "serde_json", - "serde_repr", - "strum", - "tokio", -] - -[[package]] -name = "hyprland-macros" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0088021091c08e29e9d1f735142ab811bd4d4d7f82fd4d4673407cb96fffb062" -dependencies = [ - "quote", - "syn 2.0.12", -] - -[[package]] -name = "hyprsome" -version = "0.1.11" -dependencies = [ - "clap", - "hyprland", - "ipc-rpc", - "schemars", - "serde", - "serde_json", - "tokio", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - -[[package]] -name = "ipc-channel" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cb1d9211085f0ea6f1379d944b93c4d07e8207aa3bcf49f37eda12b85081887" -dependencies = [ - "bincode", - "crossbeam-channel", - "fnv", - "lazy_static", - "libc", - "mio 0.6.23", - "rand", - "serde", - "tempfile", - "uuid 0.8.2", - "winapi 0.3.9", -] - -[[package]] -name = "ipc-rpc" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a06b6be6ca53e9aabea482d2cc45d651aecb8bc3515442909fcd73ab11d692" -dependencies = [ - "futures", - "ipc-channel", - "log", - "schemars", - "serde", - "serde_json", - "thiserror", - "tokio", - "uuid 1.2.1", -] - -[[package]] -name = "itoa" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.135" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" - -[[package]] -name = "lock_api" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" -dependencies = [ - "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.36.1", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "net2" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "once_cell" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" - -[[package]] -name = "os_str_bytes" -version = "6.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall", - "smallvec", - "windows-sys 0.45.0", -] - -[[package]] -name = "paste" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "ppv-lite86" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.102", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha", - "rand_core", - "rand_hc", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustversion" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" - -[[package]] -name = "ryu" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" - -[[package]] -name = "schemars" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a5fb6c61f29e723026dc8e923d94c694313212abbecbbe5f55a7748eec5b307" -dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", -] - -[[package]] -name = "schemars_derive" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f188d036977451159430f3b8dc82ec76364a42b7e289c2b18a9a18f4470058e9" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 1.0.102", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "semver" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" - -[[package]] -name = "serde" -version = "1.0.145" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.145" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.102", -] - -[[package]] -name = "serde_derive_internals" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.102", -] - -[[package]] -name = "serde_json" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_repr" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.102", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" -dependencies = [ - "libc", -] - -[[package]] -name = "slab" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "socket2" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" -dependencies = [ - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.102", -] - -[[package]] -name = "syn" -version = "1.0.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79d9531f94112cfc3e4c8f5f02cb2b58f72c97b7efd85f70203cc6d8efda5927" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if 1.0.0", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi 0.3.9", -] - -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.102", -] - -[[package]] -name = "tokio" -version = "1.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" -dependencies = [ - "autocfg", - "bytes", - "libc", - "memchr", - "mio 0.8.4", - "num_cpus", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "winapi 0.3.9", -] - -[[package]] -name = "tokio-macros" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.102", -] - -[[package]] -name = "unicode-ident" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" - -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom 0.2.7", -] - -[[package]] -name = "uuid" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" -dependencies = [ - "getrandom 0.2.7", - "serde", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" - -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" - -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] diff --git a/.config/hypr/hyprsome/Cargo.toml b/.config/hypr/hyprsome/Cargo.toml deleted file mode 100644 index 83a36ba..0000000 --- a/.config/hypr/hyprsome/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "hyprsome" -description = "A small CLI apps that allows to make Hyprland's workspaces work like Awesome in multi-monitor setup" -license = "GPL-3.0" -version = "0.1.11" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -clap = { version = "4.0.15", features = ["derive"] } -ipc-rpc = "1.2.2" -schemars = "0.8.11" -serde = "1.0.145" -serde_json = "1.0.86" -tokio = "1.21.2" -hyprland = "0.3.1" diff --git a/.config/hypr/hyprsome/LICENSE.txt b/.config/hypr/hyprsome/LICENSE.txt deleted file mode 100644 index 736f7b0..0000000 --- a/.config/hypr/hyprsome/LICENSE.txt +++ /dev/null @@ -1,16 +0,0 @@ -The GPLv3 License (GPLv3) - -Copyright (c) 2022 Author - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/.config/hypr/hyprsome/README.md b/.config/hypr/hyprsome/README.md deleted file mode 100644 index 0a26688..0000000 --- a/.config/hypr/hyprsome/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# Hyprsome -Hyprsome is a binary that interacts with Hyprland's Unix socket to make workspaces behave similarly to AwesomeWM in a multi-monitor setup. - -If you're focused on a monitor and press SUPER+[1-9], you'll only switch to the workspaces that are bound to that monitor. - -It is inspired by Swaysome, which does a similar thing for Sway. - -# Installation -` -cargo install hyprsome -` - -# Usage -Once the binary is installed, you can modify your ~/.config/hypr/hyprland.conf to accomodate it. -Here is an example of a dual monitor setup: - -``` -monitor=DP-1,1920x1080@60,0x0,1.33 -monitor=DP-1,transform,1 -workspace=DP-1,1 -monitor=HDMI-A-1,3440x1440@100,813x0,1 -workspace=HDMI-A-1,11 -``` - -Most noteworthy thing here is the 'workspace' keyword that I use to bind a default workspace for each monitor. - - -Then you can bind workspaces to your different monitors. - -It is very important that you bind your workspaces in order. - -Check the results of `hyprctl monitors`. Bind workspaces from 1 to 9 on your monitor that has 0 as an id. - -Then just bind workspaces by prefixing numbers by the id of the monitor they're bound to. - -Here, HDMI-A-1's id is 1, so I bind workspaces from 11 to 19 to it. - -``` - workspace=1,monitor:DP-1 - workspace=2,monitor:DP-1 - workspace=3,monitor:DP-1 - workspace=4,monitor:DP-1 - workspace=5,monitor:DP-1 - - workspace=11,monitor:HDMI-A-1 - workspace=12,monitor:HDMI-A-1 - workspace=13,monitor:HDMI-A-1 - workspace=14,monitor:HDMI-A-1 - workspace=15,monitor:HDMI-A-1 -``` - -Then it's just a matter of making sure your regular workspace keybinds call hyprsome. - -``` -bind=SUPER,1,exec,hyprsome workspace 1 -bind=SUPER,2,exec,hyprsome workspace 2 -bind=SUPER,3,exec,hyprsome workspace 3 -bind=SUPER,4,exec,hyprsome workspace 4 -bind=SUPER,5,exec,hyprsome workspace 5 - -bind=SUPERSHIFT,1,exec,hyprsome move 1 -bind=SUPERSHIFT,2,exec,hyprsome move 2 -bind=SUPERSHIFT,3,exec,hyprsome move 3 -bind=SUPERSHIFT,4,exec,hyprsome move 4 -bind=SUPERSHIFT,5,exec,hyprsome move 5 - -``` - -# Limitations -This is alpha software and my first program in Rust, bugs are bound to happen but nothing that will break your system. - -Some features are most likely missing. - -You can only have 9 workspaces per monitor as of now. - -I haven't worked on supporting monitor hot-plug at all. It may work but it's unlikely. diff --git a/.config/hypr/hyprsome/flake.lock b/.config/hypr/hyprsome/flake.lock deleted file mode 100644 index 51f0f15..0000000 --- a/.config/hypr/hyprsome/flake.lock +++ /dev/null @@ -1,159 +0,0 @@ -{ - "nodes": { - "crane": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "nixpkgs": [ - "nixpkgs" - ], - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1684981077, - "narHash": "sha256-68X9cFm0RTZm8u0rXPbeBzOVUH5OoUGAfeHHVoxGd9o=", - "owner": "ipetkov", - "repo": "crane", - "rev": "35110cccf28823320f4fd697fcafcb5038683982", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1685498995, - "narHash": "sha256-rdyjnkq87tJp+T2Bm1OD/9NXKSsh/vLlPeqCc/mm7qs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9cfaa8a1a00830d17487cb60a19bb86f96f09b27", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "crane": "crane", - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs" - } - }, - "rust-overlay": { - "inputs": { - "flake-utils": [ - "crane", - "flake-utils" - ], - "nixpkgs": [ - "crane", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1683080331, - "narHash": "sha256-nGDvJ1DAxZIwdn6ww8IFwzoHb2rqBP4wv/65Wt5vflk=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "d59c3fa0cba8336e115b376c2d9e91053aa59e56", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/.config/hypr/hyprsome/flake.nix b/.config/hypr/hyprsome/flake.nix deleted file mode 100644 index 31bb13e..0000000 --- a/.config/hypr/hyprsome/flake.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - crane.url = "github:ipetkov/crane"; - crane.inputs.nixpkgs.follows = "nixpkgs"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { self, nixpkgs, crane, flake-utils, ... }: - flake-utils.lib.eachDefaultSystem (system: - let - craneLib = crane.lib.${system}; - in - { - packages.default = craneLib.buildPackage { - src = craneLib.cleanCargoSource (craneLib.path ./.); - # Add extra inputs here or any other derivation settings - # doCheck = true; - # buildInputs = []; - # nativeBuildInputs = []; - }; - }); -} diff --git a/.config/hypr/hyprsome/src/hyprland_ipc/client.rs b/.config/hypr/hyprsome/src/hyprland_ipc/client.rs deleted file mode 100644 index 0821534..0000000 --- a/.config/hypr/hyprsome/src/hyprland_ipc/client.rs +++ /dev/null @@ -1,17 +0,0 @@ -use hyprland::{ - data::{Client, Clients}, - dispatch::{Direction, Dispatch, DispatchType}, - shared::{HyprData, HyprDataActiveOptional}, -}; - -pub fn get_active() -> Option { - Client::get_active().unwrap() -} - -pub fn get() -> Clients { - Clients::get().unwrap() -} - -pub fn focus_by_direction(direction: Direction) { - let _ = Dispatch::call(DispatchType::MoveFocus(direction)); -} diff --git a/.config/hypr/hyprsome/src/hyprland_ipc/mod.rs b/.config/hypr/hyprsome/src/hyprland_ipc/mod.rs deleted file mode 100644 index ff83b2b..0000000 --- a/.config/hypr/hyprsome/src/hyprland_ipc/mod.rs +++ /dev/null @@ -1,37 +0,0 @@ -pub mod client; -pub mod monitor; -pub mod option; -pub mod workspace; - -use std::env; -use std::io::prelude::*; -use std::os::unix::net::UnixStream; - -extern crate serde_json; - -fn send_message(action: &str, args: Vec<&str>) -> String { - let env_var_name = "HYPRLAND_INSTANCE_SIGNATURE"; - - let hyprland_instance_sig = match env::var(env_var_name) { - Ok(v) => v, - Err(e) => panic!("${} is not set ({})", env_var_name, e), - }; - - let socket_path = format!("/tmp/hypr/{}/.socket.sock", hyprland_instance_sig); - let mut stream = match UnixStream::connect(socket_path) { - Err(_) => panic!("server is not running"), - Ok(stream) => stream, - }; - - let mut message = format!("j/{}", action); - args.into_iter() - .for_each(|a| message.push_str(&format!(" {}", a))); - - // TODO: stop being stinky and manage errors - let _ = stream.write_all(message.as_bytes()); - let mut response = String::new(); - - // TODO: stop being stinky and manage errors - let _ = stream.read_to_string(&mut response); - response -} diff --git a/.config/hypr/hyprsome/src/hyprland_ipc/monitor.rs b/.config/hypr/hyprsome/src/hyprland_ipc/monitor.rs deleted file mode 100644 index f08e4e9..0000000 --- a/.config/hypr/hyprsome/src/hyprland_ipc/monitor.rs +++ /dev/null @@ -1,43 +0,0 @@ -use hyprland::data::{Monitor, Monitors}; -use hyprland::dispatch::*; -use hyprland::shared::HyprData; -use serde::{Deserialize, Serialize}; - -#[derive(Serialize, Deserialize, Debug)] -pub struct ActiveWorkspace { - pub id: u64, - pub name: String, -} - -pub fn get_by_id(id: i16) -> Monitor { - let mut monitors = get(); - monitors.find(|m| m.id == id).unwrap() -} - -pub fn get() -> Monitors { - Monitors::get().unwrap() -} - -pub fn focus_left() { - let _ = Dispatch::call(DispatchType::FocusMonitor(MonitorIdentifier::Direction( - Direction::Left, - ))); -} - -pub fn focus_right() { - let _ = Dispatch::call(DispatchType::FocusMonitor(MonitorIdentifier::Direction( - Direction::Right, - ))); -} - -pub fn focus_up() { - let _ = Dispatch::call(DispatchType::FocusMonitor(MonitorIdentifier::Direction( - Direction::Up, - ))); -} - -pub fn focus_down() { - let _ = Dispatch::call(DispatchType::FocusMonitor(MonitorIdentifier::Direction( - Direction::Down, - ))); -} diff --git a/.config/hypr/hyprsome/src/hyprland_ipc/option.rs b/.config/hypr/hyprsome/src/hyprland_ipc/option.rs deleted file mode 100644 index 368403f..0000000 --- a/.config/hypr/hyprsome/src/hyprland_ipc/option.rs +++ /dev/null @@ -1,19 +0,0 @@ -use serde::{Deserialize, Serialize}; - -const GETOPTIONS: &str = "getoptions"; -const GENERAL_GAPS_OUT: &str = "general:gaps_out"; - -#[derive(Serialize, Deserialize, Debug)] -pub struct HyprlandOption { - pub option: String, - pub int: i32, - pub float: f64, - pub str: String, -} - -pub fn get_gaps() -> i16 { - let response = super::send_message(GETOPTIONS, vec![GENERAL_GAPS_OUT]); - let gap_option: HyprlandOption = serde_json::from_str(&response).unwrap(); - - gap_option.int as i16 -} diff --git a/.config/hypr/hyprsome/src/hyprland_ipc/workspace.rs b/.config/hypr/hyprsome/src/hyprland_ipc/workspace.rs deleted file mode 100644 index 82c606c..0000000 --- a/.config/hypr/hyprsome/src/hyprland_ipc/workspace.rs +++ /dev/null @@ -1,23 +0,0 @@ -// TODO: change this file to hyprland-rs -const WORKSPACE: &str = "workspace"; -const DISPATCH: &str = "dispatch"; -const MOVETOWORKSPACESILENT: &str = "movetoworkspacesilent"; -const MOVETOWORKSPACE: &str = "movetoworkspace"; - -pub fn focus(workspace_number: &u64) { - let _ = super::send_message(DISPATCH, vec![WORKSPACE, &workspace_number.to_string()]); -} - -pub fn move_to(workspace_number: &u64) { - super::send_message( - DISPATCH, - vec![MOVETOWORKSPACESILENT, &workspace_number.to_string()], - ); -} - -pub fn move_focus(workspace_number: &u64) { - super::send_message( - DISPATCH, - vec![MOVETOWORKSPACE, &workspace_number.to_string()], - ); -} diff --git a/.config/hypr/hyprsome/src/main.rs b/.config/hypr/hyprsome/src/main.rs deleted file mode 100644 index c8f8854..0000000 --- a/.config/hypr/hyprsome/src/main.rs +++ /dev/null @@ -1,350 +0,0 @@ -use clap::{Parser, Subcommand, ValueEnum}; - -mod hyprland_ipc; -use hyprland::{ - data::{Client, Monitor, Transforms, Workspaces}, - dispatch::Direction, shared::HyprData, -}; -use hyprland_ipc::{client, monitor, option, workspace}; - -#[derive(Parser)] -#[command(name = "hyprsome")] -#[command(author = "sopa0")] -#[command(version = "0.1.11")] -#[command(about = "Makes hyprland workspaces behave like awesome")] -struct Cli { - #[command(subcommand)] - command: Commands, -} - -#[derive(Subcommand)] -enum Commands { - Focus { direction: Directions }, - Workspace { workspace_number: u64 }, - Move { workspace_number: u64 }, - Movefocus { workspace_number: u64 }, - MoveEmpty, - FocusEmpty, -} - -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Debug)] -enum Directions { - L, - R, - U, - D, -} - -pub trait MonitorDimensions { - fn real_width(&self) -> f32; - fn real_height(&self) -> f32; -} - -impl MonitorDimensions for Monitor { - fn real_width(&self) -> f32 { - match self.transform { - Transforms::Normal - | Transforms::Normal180 - | Transforms::Flipped - | Transforms::Flipped180 => self.width as f32 / self.scale, - Transforms::Normal90 | Transforms::Normal270 | Transforms::Flipped90 => { - self.height as f32 / self.scale - } - _ => self.width as f32, - } - } - - fn real_height(&self) -> f32 { - match self.transform { - Transforms::Normal - | Transforms::Flipped - | Transforms::Normal180 - | Transforms::Flipped180 => self.height as f32 / self.scale, - Transforms::Normal90 | Transforms::Normal270 | Transforms::Flipped90 => { - self.width as f32 / self.scale - } - _ => self.height as f32, - } - } -} - -pub fn get_current_monitor() -> Monitor { - monitor::get().find(|m| m.focused).unwrap() -} - -//TODO: refactor this nonsense -pub fn select_workspace(workspace_number: &u64) { - let mon = get_current_monitor(); - match mon.id { - 0 => workspace::focus(workspace_number), - _ => { - workspace::focus( - &format!("{}{}", mon.id, workspace_number) - .parse::() - .unwrap(), - ); - } - } -} - -pub fn get_empty_workspace() -> u64 { - let mon = get_current_monitor(); - let mut found = Vec::new(); - for workspaces in Workspaces::get().iter() { - for workspace in workspaces.iter() { - if workspace.monitor == mon.name { - let mut id = workspace.name.clone(); - if id.len() > 1 { - id = id.chars().nth(1).unwrap().to_string(); - } - found.push(id); - } - } - } - for i in 1..9 { - if !found.contains(&i.to_string()) { - return i; - } - } - return 1; // Send to the first workspace if no others are available -} - -//TODO: refactor this nonsense -pub fn send_to_workspace(workspace_number: &u64) { - let mon = get_current_monitor(); - match mon.id { - 0 => workspace::move_to(workspace_number), - _ => { - workspace::move_to( - &format!("{}{}", mon.id, workspace_number) - .parse::() - .unwrap(), - ); - } - } -} - -//TODO: refactor this nonsense -pub fn movefocus(workspace_number: &u64) { - let mon = get_current_monitor(); - match mon.id { - 0 => workspace::move_focus(workspace_number), - _ => { - workspace::move_focus( - &format!("{}{}", mon.id, workspace_number) - .parse::() - .unwrap(), - ); - } - } -} - -pub fn get_leftmost_client_for_monitor(mon_id: i16) -> Client { - let clients = client::get(); - - clients - .into_iter() - .filter(|c| c.monitor == mon_id) - .min_by_key(|c| c.at.0) - .unwrap() -} - -pub fn focus_left(aw: Client) { - let mon = monitor::get_by_id(aw.monitor); - let is_leftmost_client = is_leftmost_client(&aw, &mon); - - if is_leftmost_monitor(&mon) && is_leftmost_client { - return; - } - - if is_leftmost_client { - monitor::focus_left(); - - return; - } - - client::focus_by_direction(Direction::Left); -} - -pub fn focus_right(aw: Client) { - let mon = monitor::get_by_id(aw.monitor); - - if is_rightmost_monitor(&mon) && is_rightmost_client(&aw, &mon) { - return; - } - - if is_rightmost_client(&aw, &mon) { - monitor::focus_right(); - - return; - } - - client::focus_by_direction(Direction::Right); -} - -pub fn focus_up(aw: Client) { - let mon = monitor::get_by_id(aw.monitor); - let is_top_client = is_top_client(&aw, &mon); - - if is_top_monitor(&mon) && is_top_client { - return; - } - - if is_top_client { - monitor::focus_up(); - - return; - } - - client::focus_by_direction(Direction::Up); -} - -pub fn focus_down(aw: Client) { - let mon = monitor::get_by_id(aw.monitor); - let is_bottom_client = is_bottom_client(&aw, &mon); - - if is_bottom_monitor(&mon) && is_bottom_client { - return; - } - - if is_bottom_client { - monitor::focus_down(); - - return; - } - - client::focus_by_direction(Direction::Down); -} - -pub fn is_leftmost_client(aw: &Client, mon: &Monitor) -> bool { - let gaps = option::get_gaps(); - - if (aw.at.0 - gaps) as i32 == mon.x { - return true; - } - - false -} - -pub fn is_rightmost_client(aw: &Client, mon: &Monitor) -> bool { - let gaps = option::get_gaps(); - - if mon.real_width() + mon.x as f32 - gaps as f32 == aw.size.0 as f32 + aw.at.0 as f32 { - return true; - } - - false -} - -pub fn is_top_client(aw: &Client, mon: &Monitor) -> bool { - let gaps = option::get_gaps(); - - if mon.y + (gaps as i32) + (mon.reserved.1 as i32) == (aw.at.1 as i32) { - return true; - } - - false -} - -pub fn is_bottom_client(aw: &Client, mon: &Monitor) -> bool { - let gaps = option::get_gaps(); - - if mon.real_height() + mon.y as f32 - gaps as f32 - mon.reserved.1 as f32 - == aw.size.1 as f32 + gaps as f32 - { - return true; - } - - false -} - -pub fn is_rightmost_monitor(mon: &Monitor) -> bool { - let monitors = monitor::get(); - let max = monitors.into_iter().max_by_key(|m| m.x).unwrap(); - if max.x == mon.x { - return true; - } - false -} - -pub fn is_leftmost_monitor(mon: &Monitor) -> bool { - let monitors = monitor::get(); - let min = monitors.into_iter().min_by_key(|m| m.x).unwrap(); - if min.x == mon.x { - return true; - } - false -} - -pub fn is_top_monitor(mon: &Monitor) -> bool { - let monitors = monitor::get(); - let min = monitors.into_iter().min_by_key(|m| m.y).unwrap(); - if min.y == mon.y { - return true; - } - false -} - -pub fn is_bottom_monitor(mon: &Monitor) -> bool { - let monitors = monitor::get(); - let max = monitors.into_iter().max_by_key(|m| m.y).unwrap(); - if max.y == mon.y { - return true; - } - false -} - -fn main() { - let cli = Cli::parse(); - match &cli.command { - Commands::Focus { direction } => match direction { - Directions::L => { - let aw = client::get_active(); - - match aw { - Some(aw) => focus_left(aw), - None => monitor::focus_left(), - }; - } - Directions::R => { - let aw = client::get_active(); - - match aw { - Some(aw) => focus_right(aw), - None => monitor::focus_right(), - }; - } - Directions::U => { - let aw = client::get_active(); - - match aw { - Some(aw) => focus_up(aw), - None => monitor::focus_up(), - }; - } - Directions::D => { - let aw = client::get_active(); - - match aw { - Some(aw) => focus_down(aw), - None => monitor::focus_down(), - }; - } - }, - Commands::Workspace { workspace_number } => { - select_workspace(workspace_number); - } - Commands::Move { workspace_number } => { - send_to_workspace(workspace_number); - } - Commands::Movefocus { workspace_number } => { - movefocus(workspace_number); - } - Commands::MoveEmpty => { - movefocus(&get_empty_workspace()); - }, - Commands::FocusEmpty => { - select_workspace(&get_empty_workspace()); - }, - } -} From 02fc2ef1b6a424c64d65a038e056696eb4648f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Tue, 23 Apr 2024 22:58:26 +0200 Subject: [PATCH 21/27] Rename zsh functions --- .config/zsh/.zshrc | 191 ++++++++++++++++++++++----------------------- 1 file changed, 94 insertions(+), 97 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index afb13ef..3c560d0 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -33,6 +33,90 @@ if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop fi +function cd_to() { + setopt localoptions pipefail no_aliases 2> /dev/null + local dir=$1 + if [[ -z "$dir" ]]; then + zle redisplay + return 0 + fi + zle push-line # Clear buffer. Auto-restored on next prompt. + cd $dir + zle accept-line + local ret=$? + unset dir # ensure this doesn't end up appearing in prompt expansion + zle reset-prompt +} + +# Use FZY instead of FZF for ctrl-t +function find_global_directories() { + zle -I + FZY_CACHE=~/.cache/fzy_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 | xargs -n 1 dirname | uniq | grep -v '^\.$' | parallel echo ~/{})" + search_dirs=( \ + ~/Workspace/ \ + /home/server/Storage/Thomas/ \ + ) + for i in $search_dirs ; do + if [ -d $i ]; then + PATHS="$PATHS\n$i" + PATHS="$PATHS\n$(fdfind . $i -t d -d 8)" + fi + done + echo -e $PATHS > $FZY_CACHE + fi + cd_to "$(cat $FZY_CACHE | fzy -l 20)" +} + +function find_local_directories() { + zle -I + 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/ ) + for i in $search_dirs ; do + if [ -d $i ]; then + PATHS="$PATHS\n$(fdfind . $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" + +} + function zvm_after_init() { key[Home]="${terminfo[khome]}" key[End]="${terminfo[kend]}" @@ -85,107 +169,20 @@ function zvm_after_init() { source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh fi - function cd_to() { - setopt localoptions pipefail no_aliases 2> /dev/null - local dir=$1 - if [[ -z "$dir" ]]; then - zle redisplay - return 0 - fi - zle push-line # Clear buffer. Auto-restored on next prompt. - cd $dir - zle accept-line - local ret=$? - unset dir # ensure this doesn't end up appearing in prompt expansion - zle reset-prompt - } - - # Use FZY instead of FZF for ctrl-t - function find_global_files() { - zle -I - FZY_CACHE=~/.cache/fzy_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 | xargs -n 1 dirname | uniq | grep -v '^\.$' | parallel echo ~/{})" - search_dirs=( \ - ~/Workspace/ \ - ~/Containers/ \ - /home/server/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 - cd_to "$(cat $FZY_CACHE | fzy -l 20)" - } - - function find_local_files() { - zle -I - 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 find_global_directories + zle -N find_local_directories zle -N edit_global_files zle -N edit_local_files - bindkey "^T" find_global_files - bindkey -M emacs "^T" find_global_files - bindkey -M vicmd "^T" find_global_files - bindkey -M viins "^T" find_global_files + bindkey "^T" find_global_directories + bindkey -M emacs "^T" find_global_directories + bindkey -M vicmd "^T" find_global_directories + bindkey -M viins "^T" find_global_directories - bindkey "^Y" find_local_files - bindkey -M emacs "^Y" find_local_files - bindkey -M vicmd "^Y" find_local_files - bindkey -M viins "^Y" find_local_files + bindkey "^Y" find_local_directories + bindkey -M emacs "^Y" find_local_directories + bindkey -M vicmd "^Y" find_local_directories + bindkey -M viins "^Y" find_local_directories bindkey "^E" edit_global_files bindkey -M emacs "^E" edit_global_files From 8183bcfa2b004efee08ab93272079bdb92f33fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Tue, 23 Apr 2024 23:02:03 +0200 Subject: [PATCH 22/27] use fd instead of fdfind --- .config/zsh/.zshrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 3c560d0..44869dc 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -67,7 +67,7 @@ function find_global_directories() { for i in $search_dirs ; do if [ -d $i ]; then PATHS="$PATHS\n$i" - PATHS="$PATHS\n$(fdfind . $i -t d -d 8)" + PATHS="$PATHS\n$(fd . $i -t d -d 8)" fi done echo -e $PATHS > $FZY_CACHE @@ -103,7 +103,7 @@ function edit_global_files() { search_dirs=(~/Workspace/ ) for i in $search_dirs ; do if [ -d $i ]; then - PATHS="$PATHS\n$(fdfind . $i -t f)" + PATHS="$PATHS\n$(fd . $i -t f)" fi done echo -e $PATHS > $FZY_CACHE @@ -290,6 +290,7 @@ fi if command -v fdfind &> /dev/null; then alias fd="fdfind" fi + function o () { xdg-open "$1" &! } From 3228a5d2713000acda113c8b09783005fe789be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Wed, 24 Apr 2024 00:00:18 +0200 Subject: [PATCH 23/27] Fix lf + zsh find_global --- .config/lf/lfrc | 27 +++---------------- .config/zsh/.zshrc | 66 ++++++++++++++++++---------------------------- 2 files changed, 28 insertions(+), 65 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index e4b8403..78f34e2 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -15,29 +15,8 @@ map - $nvim -c "lua require(\"oil\").open(\"$PWD\")" map open cmd jump ${{ - FZY_CACHE=~/.cache/fzy_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 | xargs -n 1 dirname | uniq | grep -v '^\.$' | parallel echo ~/{})" - search_dirs=(~/Workspace/ \ - /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 - done - echo -e $PATHS > $FZY_CACHE - fi - res="$(cat $FZY_CACHE | fzy -l 20)" - res="$(printf '%s' "$res" | sed 's/\\/\\\\/g;s/"/\\"/g')" - lf -remote "send $id cd \"$res\"" + res=$(zsh -c "source $HOME/.zshrc && find_global d") + lf -remote "send $id cd \"$res\"" }} -map :jump +map :jump diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 44869dc..de0aa82 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -48,40 +48,11 @@ function cd_to() { zle reset-prompt } -# Use FZY instead of FZF for ctrl-t -function find_global_directories() { - zle -I - FZY_CACHE=~/.cache/fzy_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 | xargs -n 1 dirname | uniq | grep -v '^\.$' | parallel echo ~/{})" - search_dirs=( \ - ~/Workspace/ \ - /home/server/Storage/Thomas/ \ - ) - for i in $search_dirs ; do - if [ -d $i ]; then - PATHS="$PATHS\n$i" - PATHS="$PATHS\n$(fd . $i -t d -d 8)" - fi - done - echo -e $PATHS > $FZY_CACHE - fi - cd_to "$(cat $FZY_CACHE | fzy -l 20)" -} - function find_local_directories() { - zle -I 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 @@ -89,32 +60,45 @@ function edit_local_files() { nvim "$file" } -function edit_global_files() { - zle -I - FZY_CACHE=~/.cache/fzy_file_paths +function find_global() { + file_type=$1 + FZY_CACHE=~/.cache/fzy_paths_$file_type if [ -f $FZY_CACHE ]; then - # Check if cache is older than 1 day - if [ $(($(date +%s) - $(date -r $FZY_CACHE +%s))) -gt 86400 ]; then + if [ $(stat -c %Y $FZY_CACHE) -lt $(date +%s -d '-1 day') ]; 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/ ) - for i in $search_dirs ; do + PATHS="$(/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME ls-files)" + if [ "$file_type" = "d" ]; then + PATHS="$(echo -e $PATHS | xargs -n 1 dirname | uniq | grep -v '^\.$' | parallel echo ~/{})" + else + PATHS="$(echo -e $PATHS | parallel echo ~/{})" + fi + search_dirs=(~/Workspace/ ~/Containers/ /home/server/Storage/Thomas/) + for i in "$search_dirs[@]"; do if [ -d $i ]; then - PATHS="$PATHS\n$(fd . $i -t f)" + PATHS="$PATHS$i\n" + PATHS+="$(fd . $i -t $file_type -d 8)" fi done - echo -e $PATHS > $FZY_CACHE + echo -e "$PATHS" > $FZY_CACHE fi - file=$(cat $FZY_CACHE | fzy -l 20) + file="$(cat $FZY_CACHE | fzy -l 20)" + echo $file +} + +function find_global_directories() { + cd_to "$(find_global d)" +} + +function edit_global_files() { + file="$(find_global f)" if [ -z "$file" ]; then return 0 fi cd_to "$(dirname $file)" nvim "$file" - } function zvm_after_init() { From f8b3a4979e3441371a6fee5d255969851f19588f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Wed, 24 Apr 2024 13:43:27 +0200 Subject: [PATCH 24/27] add push shortcuts --- .config/zsh/.zshrc | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index de0aa82..967e337 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -52,12 +52,11 @@ function find_local_directories() { cd_to "$(fd . -t d | fzy -l 20)" } -function edit_local_files() { - file=$(fd . -t f | fzy -l 20) - if [ -z "$file" ]; then - return 0 - fi - nvim "$file" +function push_local_files() { + emulate -L zsh + zle -I + LBUFFER="${LBUFFER}\"$(fd . -t f | fzy -l 20)\"" + zle reset-prompt } function find_global() { @@ -101,6 +100,13 @@ function edit_global_files() { nvim "$file" } +function push_global_directories() { + emulate -L zsh + zle -I + LBUFFER="${LBUFFER}\"$(find_global d)\"" + zle reset-prompt +} + function zvm_after_init() { key[Home]="${terminfo[khome]}" key[End]="${terminfo[kend]}" @@ -154,15 +160,26 @@ function zvm_after_init() { fi zle -N find_global_directories + zle -N push_global_directories + zle -N push_local_files zle -N find_local_directories zle -N edit_global_files - zle -N edit_local_files bindkey "^T" find_global_directories bindkey -M emacs "^T" find_global_directories bindkey -M vicmd "^T" find_global_directories bindkey -M viins "^T" find_global_directories + bindkey "^U" push_global_directories + bindkey -M emacs "^U" push_global_directories + bindkey -M vicmd "^U" push_global_directories + bindkey -M viins "^U" push_global_directories + + bindkey "^W" push_local_files + bindkey -M emacs "^W" push_local_files + bindkey -M vicmd "^W" push_local_files + bindkey -M viins "^W" push_local_files + bindkey "^Y" find_local_directories bindkey -M emacs "^Y" find_local_directories bindkey -M vicmd "^Y" find_local_directories @@ -173,11 +190,6 @@ function zvm_after_init() { 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 From e3abbe810c5608ea502ae47a77b18c5b30dddfef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Wed, 24 Apr 2024 14:27:44 +0200 Subject: [PATCH 25/27] Append last selection to top of fzy cache --- .config/zsh/.zshrc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 967e337..5c2a21e 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -77,13 +77,14 @@ function find_global() { search_dirs=(~/Workspace/ ~/Containers/ /home/server/Storage/Thomas/) for i in "$search_dirs[@]"; do if [ -d $i ]; then - PATHS="$PATHS$i\n" - PATHS+="$(fd . $i -t $file_type -d 8)" + PATHS="$PATHS\n$i" + PATHS+="\n$(fd . $i -t $file_type -d 8)" fi done echo -e "$PATHS" > $FZY_CACHE fi file="$(cat $FZY_CACHE | fzy -l 20)" + echo $file | cat - $FZY_CACHE | awk '!x[$0]++' > /tmp/fzy_paths_$file_type && mv /tmp/fzy_paths_$file_type $FZY_CACHE echo $file } @@ -246,7 +247,7 @@ export ARCHFLAGS="-arch x86_64" export SSH_KEY_PATH="~/.ssh/rsa_id" export PYTHONDONTWRITEBYTECODE=1 export TERM="screen-256color" -export PATH=$HOME/.local/bin:$PATH +export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$PATH export GOPATH=/tmp/go if command -v micromamba &> /dev/null; then @@ -309,6 +310,7 @@ alias mallorea="run_waypipe mallorea" alias vault="run_waypipe vault" alias riva="run_waypipe riva" alias kell="run_waypipe kell" +alias aloria="run_waypipe aloria" alias ls="ls --color=auto" alias gdb='gdb -q' From 86eadfdc15dc6b3891165254c899bc903ad2e893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Wed, 24 Apr 2024 15:33:53 +0200 Subject: [PATCH 26/27] More zsh improvements --- .config/zsh/.zshrc | 90 +++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 53 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 5c2a21e..1e6e908 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -48,15 +48,8 @@ function cd_to() { zle reset-prompt } -function find_local_directories() { - cd_to "$(fd . -t d | fzy -l 20)" -} - -function push_local_files() { - emulate -L zsh - zle -I - LBUFFER="${LBUFFER}\"$(fd . -t f | fzy -l 20)\"" - zle reset-prompt +function find_local() { + fd . -t $1 | fzy -l 20 } function find_global() { @@ -88,24 +81,28 @@ function find_global() { echo $file } -function find_global_directories() { - cd_to "$(find_global d)" -} - -function edit_global_files() { - file="$(find_global f)" - if [ -z "$file" ]; then - return 0 +function open_path() { + file_type=$1 + search_fn=$2 + selection="$($search_fn $file_type)" + if [ "$selection" = "" ]; then + zle reset-prompt + return + fi + if [ "$LBUFFER" = "" ]; then + if [ "$file_type" = "d" ]; then + cd_to "$selection" + else + selection=$(realpath "$selection") + cd_to "$(dirname $selection)" + nvim "$selection" + fi + else + emulate -L zsh + zle -I + LBUFFER="${LBUFFER}\"$selection\"" + zle reset-prompt fi - cd_to "$(dirname $file)" - nvim "$file" -} - -function push_global_directories() { - emulate -L zsh - zle -I - LBUFFER="${LBUFFER}\"$(find_global d)\"" - zle reset-prompt } function zvm_after_init() { @@ -160,37 +157,24 @@ function zvm_after_init() { source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh fi - zle -N find_global_directories - zle -N push_global_directories + function open_global_path_d() { open_path d find_global } + function open_global_path_f() { open_path f find_global } + function open_local() { open_path f find_local } + zle -N push_local_files zle -N find_local_directories - zle -N edit_global_files - bindkey "^T" find_global_directories - bindkey -M emacs "^T" find_global_directories - bindkey -M vicmd "^T" find_global_directories - bindkey -M viins "^T" find_global_directories - - bindkey "^U" push_global_directories - bindkey -M emacs "^U" push_global_directories - bindkey -M vicmd "^U" push_global_directories - bindkey -M viins "^U" push_global_directories - - bindkey "^W" push_local_files - bindkey -M emacs "^W" push_local_files - bindkey -M vicmd "^W" push_local_files - bindkey -M viins "^W" push_local_files - - bindkey "^Y" find_local_directories - bindkey -M emacs "^Y" find_local_directories - bindkey -M vicmd "^Y" find_local_directories - bindkey -M viins "^Y" find_local_directories - - 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 + function register_key() { + zle -N $2 + bindkey "^$1" $2 + bindkey -M emacs "^$1" $2 + bindkey -M vicmd "^$1" $2 + bindkey -M viins "^$1" $2 + } + register_key "T" open_global_path_d + register_key "E" open_global_path_f + register_key "W" open_local if [ "$SSH_SESSION_ID" != "" ]; then mkdir -p /tmp/ssh_sessions From bf158fb1379535b971eaa967fea502b7425fbab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Wed, 24 Apr 2024 15:41:19 +0200 Subject: [PATCH 27/27] move fdfind alias to the top --- .config/zsh/.zshrc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 1e6e908..862a5f0 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -19,6 +19,11 @@ setopt autocd # to add other keys to this hash, see: man 5 terminfo typeset -g -A key +# We need this here since it's used below +if command -v fdfind &> /dev/null; then + alias fd="fdfind" +fi + # Use vi-mode source ${XDG_CONFIG_HOME}/zsh/zsh-vi-mode/zsh-vi-mode.plugin.zsh ZVM_VI_INSERT_ESCAPE_BINDKEY=jj @@ -268,10 +273,6 @@ 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" &! }