rewrite and refactor a lot, delete redundant configs

This commit is contained in:
Schrottkatze 2023-11-14 12:22:19 +01:00
parent ca61775d84
commit c191adcc99
44 changed files with 334 additions and 1607 deletions

View file

@ -133,9 +133,9 @@ let light_theme = {
}
# External completer example
let carapace_completer = {|spans|
carapace $spans.0 nushell $spans | from json
}
# let carapace_completer = {|spans|
# carapace $spans.0 nushell $spans | from json
# }
# The default config record. This is where much of your global configuration is setup.
$env.config = {
@ -218,7 +218,7 @@ $env.config = {
external: {
enable: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up may be very slow
max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options
completer: $carapace_completer # check 'carapace_completer' above as an example
# completer: $carapace_completer # check 'carapace_completer' above as an example
}
}
@ -245,23 +245,6 @@ $env.config = {
render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt.
hooks: {
pre_prompt: [{ ||
let direnv = (direnv export json | from json | default {})
if ($direnv | is-empty) {
return
}
$direnv
| items {|key, value|
{
key: $key
value: (if $key in $env.ENV_CONVERSIONS {
do ($env.ENV_CONVERSIONS | get $key | get from_string) $value
} else {
$value
})
}
} | transpose -ird | load-env
}] # run before the prompt is shown
pre_execution: [{ null }] # run before the repl input is run
env_change: {
PWD: [{|before, after| null }] # run if the PWD environment is different since the last repl input
@ -816,3 +799,4 @@ def lcr [
alias gnix = cd ~/nix-configs;
alias grepo = cd ~/Documents/repos;
alias wh = wormhole-rs;
alias gst = git status;

View file

@ -1,15 +0,0 @@
# create ~/permaclip if it doesnt exist already
mkdir -p $HOME/permaclip
tr_name=$(echo ${@% (*} | xargs)
if [ x"$tr_name" != x"" ]; then
nohup bash -c "xclip -selection c -i $HOME/permaclip/${tr_name% (*}" > /dev/null
exit 0
fi
echo -e "\0markup-rows\x1ftrue"
for reg in $(ls ~/permaclip); do
content=$(cat ~/permaclip/$reg)
echo -e "$reg (<i>${content:0:50}...</i>)"
done

View file

@ -1,16 +0,0 @@
# create ~/permaclip if it doesnt exist already
mkdir -p $HOME/permaclip
tr_name=$(echo $@ | xargs)
if [ x"$tr_name" != x"" ]; then
tr_name="${tr_name% (*}"
clipdata=$(xclip -selection c -o)
echo "$clipdata" > $HOME/permaclip/$tr_name
fi
echo -e "\0markup-rows\x1ftrue"
for reg in $(ls ~/permaclip); do
content=$(cat ~/permaclip/$reg)
echo -e "$reg (<i>${content:0:30}</i>)"
done

View file

@ -1,2 +0,0 @@
{ pkgs, ... }:
pkgs.writeShellScriptBin "searchwolf" (builtins.readFile ./searchwolf.sh)

View file

@ -1,25 +0,0 @@
if [ x"$@" = x"exit" ]; then
exit 0
fi
case $ROFI_RETV in
0)
;;
1)
val=${@%%.*}
res=$(echo $ROFI_DATA | jq -r ".[$val]" )
coproc ( librewolf --new-tab $res > /dev/null 2>&1 )
exit 0
;;
2)
ddgrout=$(ddgr --json --num=25 "$@" --url-handler 'librewolf')
for i in $(echo $ddgrout | jq -r 'keys | @sh'); do
title=$(echo $ddgrout | jq -r .[$i].title)
url=$(echo $ddgrout | jq -r .[$i].url)
echo "$i. $title ($url)"
done
echo -e "\0data\x1f$(echo $ddgrout | jq -r .[].url | jq -sRc '. | split("\n") | [ .[] | select(length > 0) ]')"
;;
esac