Merge branch 'master' into laptop
This commit is contained in:
		
						commit
						295d469407
					
				| 
						 | 
					@ -8,13 +8,14 @@ exec-once=sudo wg-quick up wg0
 | 
				
			||||||
exec-once=sleep 0.7 && swaylock
 | 
					exec-once=sleep 0.7 && swaylock
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$scripts = /home/user/.config/scripts
 | 
					$scripts = /home/user/.config/scripts
 | 
				
			||||||
 | 
					$mainMod = SUPER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exec-once=hyprpaper
 | 
					exec-once=hyprpaper
 | 
				
			||||||
exec-once=wl-paste --type text --watch cliphist store
 | 
					exec-once=wl-paste --type text --watch cliphist store
 | 
				
			||||||
exec-once=wl-paste --type image --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/mate-polkit/polkit-mate-authentication-agent-1
 | 
				
			||||||
exec-once=/usr/lib/kdeconnectd
 | 
					exec-once=/usr/lib/kdeconnectd
 | 
				
			||||||
exec-once=sleep 2
 | 
					exec-once=waybar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# windowrulev2 = tile, class:.*
 | 
					# windowrulev2 = tile, class:.*
 | 
				
			||||||
windowrulev2 = float, title:^(rofi)(.*)$
 | 
					windowrulev2 = float, title:^(rofi)(.*)$
 | 
				
			||||||
| 
						 | 
					@ -25,8 +26,6 @@ windowrulev2 = minsize 1 1, title:^()$,class:^(steam)$
 | 
				
			||||||
windowrulev2 = stayfocused, title:^()$,class:^(steam)$
 | 
					windowrulev2 = stayfocused, title:^()$,class:^(steam)$
 | 
				
			||||||
windowrule = noanim,waybar
 | 
					windowrule = noanim,waybar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exec-once=waybar
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
binds {
 | 
					binds {
 | 
				
			||||||
    scroll_event_delay=1
 | 
					    scroll_event_delay=1
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -90,9 +89,7 @@ gestures {
 | 
				
			||||||
    workspace_swipe_invert = false
 | 
					    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_L, exec, pkill rofi || rofi -show drun
 | 
				
			||||||
bindr = $mainMod, SUPER_R, 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)
 | 
					bind = $mainMod, return, exec, $scripts/launch_alacritty.sh $(hyprctl activewindow -j | jq .pid)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,29 +15,8 @@ map - $nvim -c "lua require(\"oil\").open(\"$PWD\")"
 | 
				
			||||||
map <enter> open
 | 
					map <enter> open
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cmd jump ${{
 | 
					cmd jump ${{
 | 
				
			||||||
        FZY_CACHE=~/.cache/fzy_paths
 | 
					    res=$(zsh -c "source $HOME/.zshrc && find_global d")
 | 
				
			||||||
        if [ -f $FZY_CACHE ]; then
 | 
					    lf -remote "send $id cd \"$res\""
 | 
				
			||||||
            # 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 <c-t> :jump
 | 
					map <c-t> :jump <enter>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,40 +48,11 @@ function cd_to() {
 | 
				
			||||||
    zle reset-prompt
 | 
					    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$(ssh mallorea 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() {
 | 
					function find_local_directories() {
 | 
				
			||||||
    zle -I
 | 
					 | 
				
			||||||
    cd_to "$(fd . -t d | fzy -l 20)"
 | 
					    cd_to "$(fd . -t d | fzy -l 20)"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function edit_local_files() {
 | 
					function edit_local_files() {
 | 
				
			||||||
    zle -I
 | 
					 | 
				
			||||||
    file=$(fd . -t f | fzy -l 20)
 | 
					    file=$(fd . -t f | fzy -l 20)
 | 
				
			||||||
    if [ -z "$file" ]; then
 | 
					    if [ -z "$file" ]; then
 | 
				
			||||||
        return 0
 | 
					        return 0
 | 
				
			||||||
| 
						 | 
					@ -89,32 +60,45 @@ function edit_local_files() {
 | 
				
			||||||
    nvim "$file"
 | 
					    nvim "$file"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function edit_global_files() {
 | 
					function find_global() {
 | 
				
			||||||
    zle -I
 | 
					    file_type=$1
 | 
				
			||||||
    FZY_CACHE=~/.cache/fzy_file_paths
 | 
					    FZY_CACHE=~/.cache/fzy_paths_$file_type
 | 
				
			||||||
    if [ -f $FZY_CACHE ]; then
 | 
					    if [ -f $FZY_CACHE ]; then
 | 
				
			||||||
        # Check if cache is older than 1 day
 | 
					        if [ $(stat -c %Y $FZY_CACHE) -lt $(date +%s -d '-1 day') ]; then
 | 
				
			||||||
        if [ $(($(date +%s) - $(date -r $FZY_CACHE +%s))) -gt 86400 ]; then
 | 
					 | 
				
			||||||
            rm $FZY_CACHE
 | 
					            rm $FZY_CACHE
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
    if [ ! -f $FZY_CACHE ]; then
 | 
					    if [ ! -f $FZY_CACHE ]; then
 | 
				
			||||||
        PATHS="$(/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME ls-files | parallel echo ~/{})"
 | 
					        PATHS="$(/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME ls-files)"
 | 
				
			||||||
        search_dirs=(~/Workspace/ )
 | 
					        if [ "$file_type" = "d" ]; then
 | 
				
			||||||
        for i in $search_dirs ; do
 | 
					            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
 | 
					            if [ -d $i ]; then
 | 
				
			||||||
                PATHS="$PATHS\n$(ssh mallorea fdfind . $i -t f)"
 | 
					                PATHS="$PATHS$i\n"
 | 
				
			||||||
 | 
					                PATHS+="$(fd . $i -t $file_type -d 8)"
 | 
				
			||||||
            fi
 | 
					            fi
 | 
				
			||||||
        done
 | 
					        done
 | 
				
			||||||
        echo -e $PATHS > $FZY_CACHE
 | 
					        echo -e "$PATHS" > $FZY_CACHE
 | 
				
			||||||
    fi
 | 
					    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
 | 
					    if [ -z "$file" ]; then
 | 
				
			||||||
        return 0
 | 
					        return 0
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
    cd_to "$(dirname $file)"
 | 
					    cd_to "$(dirname $file)"
 | 
				
			||||||
    nvim "$file"
 | 
					    nvim "$file"
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function zvm_after_init() {
 | 
					function zvm_after_init() {
 | 
				
			||||||
| 
						 | 
					@ -200,7 +184,9 @@ function zvm_after_init() {
 | 
				
			||||||
        echo $$ > /tmp/ssh_sessions/"$SSH_SESSION_ID"
 | 
					        echo $$ > /tmp/ssh_sessions/"$SSH_SESSION_ID"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
    if [ "$REMOTE_PATH" != "" ]; then
 | 
					    if [ "$REMOTE_PATH" != "" ]; then
 | 
				
			||||||
        cd "$REMOTE_PATH"
 | 
					        if [ -d "$REMOTE_PATH" ]; then
 | 
				
			||||||
 | 
					            cd "$REMOTE_PATH"
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
    elif [ "$PREVIOUS_SESSION_ID" != "" ]; then
 | 
					    elif [ "$PREVIOUS_SESSION_ID" != "" ]; then
 | 
				
			||||||
        cd "$(readlink -e /proc/$(cat /tmp/ssh_sessions/$PREVIOUS_SESSION_ID)/cwd)"
 | 
					        cd "$(readlink -e /proc/$(cat /tmp/ssh_sessions/$PREVIOUS_SESSION_ID)/cwd)"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
| 
						 | 
					@ -288,6 +274,7 @@ fi
 | 
				
			||||||
if command -v fdfind &> /dev/null; then
 | 
					if command -v fdfind &> /dev/null; then
 | 
				
			||||||
    alias fd="fdfind"
 | 
					    alias fd="fdfind"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function o () {
 | 
					function o () {
 | 
				
			||||||
	xdg-open "$1" &!
 | 
						xdg-open "$1" &!
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue