major ui improvements

This commit is contained in:
kp2pml30 2025-03-20 13:21:56 +04:00
parent 8ef03fdd80
commit 3fc17746d0
14 changed files with 143 additions and 9488 deletions

View file

@ -1,30 +1,6 @@
function read_confirm
while true
read -l -P "$argv [y/N] " confirm
switch $confirm
case Y y
return 0
case '' N n
return 1
end
end
end
function fish_greeting
if status is-interactive && ! test -f /encrypt/.exists && test -f ~/encrypted.vhdx
if test -f /tmp/.skip-encrypt
echo "Encrypted drive not installed"
return
end
touch /tmp/.skip-encrypt
if read_confirm "Setup encrypted drive?"
set home "$HOME"
printf "su "
sudo bash -c "losetup /dev/loop0 '$HOME/encrypted.vhdx' && cryptsetup open /dev/loop0 loop0 && mount /dev/mapper/loop0 /encrypt"
echo "success: $status"
end
end
alias clear="printf '\033[2J\033[3J\033[1;1H'"
if test -f ~/.bashrc
bass source ~/.bashrc
end
if status is-interactive
@ -32,18 +8,3 @@ if status is-interactive
zoxide init fish | source
end
end
#if test -f ~/.ghcup/env
# bass source ~/.ghcup/env
#end
#if test -x ~/.rbenv/bin/rbenv
# ~/.rbenv/bin/rbenv init - fish | source
#end
#if test -f ~/.opam/opam-init/init.fish
# source ~/.opam/opam-init/init.fish
#end
alias clear="printf '\033[2J\033[3J\033[1;1H'"
export PATH="$PATH:$KP2PATH"
if set -uq KP2COMPLETIONS
eval "$KP2COMPLETIONS"
end
bass source ~/.bashrc

View file

@ -1,43 +0,0 @@
function __scrap_select
for cmd in $argv
if command -v "$cmd" 2> /dev/null > /dev/null
command -v "$cmd"
return
end
end
end
function 'scrap-default-tool-paths'
env > /tmp/env-before
set -Ux PYENV_ROOT $HOME/.pyenv
set -le NP
for dir in "$HOME/.cargo/bin" "$HOME/.local/bin" "$HOME/.bin" "$HOME/.ghcup/bin" "$HOME/.cabal/bin" "$HOME/go/bin" "$HOME/.pyenv/bin"
if test -d "$dir"
echo "$dir exists"
if test -n "$NP"
set NP "$NP:$dir"
else
set NP "$dir"
end
end
end
echo "found path is $NP"
set -U KP2PATH "$NP"
set -l OLDP "$PATH"
set PATH "$NP:$PATH"
set -le COMPLETIONS
if command -v poetry > /dev/null
IFS='' set -l out (poetry completions fish)
set COMPLETIONS "$COMPLETIONS"\n"$out"
end
IFS='' set -U KP2COMPLETIONS "$COMPLETIONS"
set -Ux EDITOR (__scrap_select nvim vim vi)
set -Ux PAGER (__scrap_select less more)
set -Ux GIT_EDITOR "$EDITOR"
set PATH "$OLDP"
env > /tmp/env-after
diff /tmp/env-before /tmp/env-after
rm /tmp/env-after /tmp/env-before
end

View file

@ -1,2 +0,0 @@
alias clear="printf '\033[2J\033[3J\033[1;1H'"
bass source ~/.bashrc