diff options
| author | jstmax! <maxwasmailed@proton.me> | 2025-10-26 12:50:30 +0100 |
|---|---|---|
| committer | jstmax! <maxwasmailed@proton.me> | 2025-10-26 12:50:30 +0100 |
| commit | 75c92bd100a3b6e8c969a15b762f046672e9c644 (patch) | |
| tree | 65fa9b42b6d016084b975a588a90dee6ee9011ab /cfg/fish | |
| parent | 458248dc24c5e1a0bf0ef54b0802635b533cb720 (diff) | |
updated fish functions + doing some ordering und scheisse
Diffstat (limited to 'cfg/fish')
| -rw-r--r-- | cfg/fish/config.fish | 34 | ||||
| -rw-r--r-- | cfg/fish/fish_greeting.fish | 20 | ||||
| -rw-r--r-- | cfg/fish/fish_prompt.fish | 25 | ||||
| -rw-r--r-- | cfg/fish/fish_right_prompt.fish | 28 |
4 files changed, 107 insertions, 0 deletions
diff --git a/cfg/fish/config.fish b/cfg/fish/config.fish new file mode 100644 index 0000000..166ddd4 --- /dev/null +++ b/cfg/fish/config.fish @@ -0,0 +1,34 @@ +# ~/.config/fish/config.fish +if status is-interactive + + # ENVIRONMENT VARIABLES + set -x EDITOR nvim + set -x TERMINAL alacritty + set -x VIMRUNTIME "/usr/share/nvim/runtime" + #set -x WINEPREFIX ~/winestuff/ps2018 + set -x WINEARCH win64 + + # ALIASES + alias v nvim + alias ff fastfetch + alias nf nfetch + alias src "source ~/.config/fish/config.fish" + alias vimrc "nvim ~/.vimrc" + alias fishrc "nvim ~/.config/fish/config.fish" + alias neofishrc "nvim ~/.config/fish/config.fish" + alias nvimrc "nvim ~/.config/nvim/init.vim" + alias ":q" exit + alias replasma "killall plasmashell && kstart5 plasmashell" + alias i3rc "nvim ~/.config/i3/config" + alias kurobarc "nvim ~/.config/i3/kurobar.sh" + alias jmdmenurc "sudo -E nvim /usr/bin/jmdmenu" + alias ghosttyrc "nvim ~/.config/ghostty/config" + alias alattyrc "nvim ~/.config/alacritty/alacritty.toml" + alias suv "sudo -E nvim" + alias ffrc "nvim ~/.config/fastfetch/config.jsonc" + alias cfr "java -jar /usr/bin/cfr.jar" + alias py "python" + alias drumz "drumseq ch ch h ch s ch h s -x -bpm=360" + alias dashbd-clock "tty-clock -s -c -C 1" + alias trexa "exa --tree --level=2 --icons" +end diff --git a/cfg/fish/fish_greeting.fish b/cfg/fish/fish_greeting.fish new file mode 100644 index 0000000..e25c117 --- /dev/null +++ b/cfg/fish/fish_greeting.fish @@ -0,0 +1,20 @@ +function fish_greeting + if not set -q fish_greeting + set -l line1 (printf (_ 'well-cum to %sfiš%s, the %sevil%s šell!') (set_color red) (set_color normal) (set_color red) (set_color normal)) + set -l line2 \n(printf (_ 'type %snvim%s to use a good text editor.') (set_color red) (set_color normal)) + set -g fish_greeting "$line1$line2" + end + + if set -q fish_private_mode + set -l line (_ "fiš is running in private mode, historia will perish upon closure.") + if set -q fish_greeting[1] + set -g fish_greeting $fish_greeting\n$line + else + set -g fish_greeting $line + end + end + + test -n "$fish_greeting" + and echo $fish_greeting + task # show tasks +end diff --git a/cfg/fish/fish_prompt.fish b/cfg/fish/fish_prompt.fish new file mode 100644 index 0000000..916e276 --- /dev/null +++ b/cfg/fish/fish_prompt.fish @@ -0,0 +1,25 @@ +function fish_prompt + set -l user $USER + set -l cwd $PWD + set -l home $HOME + + if test "$cwd" = "$home" + # if in ~ + echo -e (set_color white)"╭"(set_color red)"("(set_color white)"$user" \ + (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \ + (set_color white)"~"(set_color red)")"(set_color red)"\n╰"(set_color normal)"⮞ " + # ╭(max⮞⮞⮞~) + # ╰⮞ + else if string match -q "$home/*" $cwd + set -l relative (string replace "$home/" "~/" $cwd) + # if in a ~ subdir + echo -e (set_color white)"╭"(set_color red)"("(set_color white)"$user" \ + (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \ + (set_color white)$relative(set_color red)")"(set_color red)"\n╰"(set_color normal)"⮞ " + else + # if in any other dir + echo -e (set_color white)"╭"(set_color red)"("(set_color white)"$user" \ + (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \ + (set_color white)$cwd(set_color red)")"(set_color red)"\n╰"(set_color normal)"⮞ " + end +end diff --git a/cfg/fish/fish_right_prompt.fish b/cfg/fish/fish_right_prompt.fish new file mode 100644 index 0000000..d9bf744 --- /dev/null +++ b/cfg/fish/fish_right_prompt.fish @@ -0,0 +1,28 @@ +function fish_right_prompt + set last_status $status + + # check for which color to use + if test $last_status -eq 0 + set color white + else + set color red + end + + # set inverse color + if test $color = "white" + set colorInverse red + else + set color white + end + + # set date in dt + set dt $(date '+%Y-%m-%d %H:%M') + + # set battery capacity in bat + set bat $(cat /sys/class/power_supply/BAT0/capacity) + + # print prompt + echo -e (set_color $colorInverse)"( "(set_color $color)"$last_status"(set_color $colorInverse)" | " \ + (set_color $color)"bat.$bat%"(set_color $colorInverse) " | " \ + (set_color $color)"$dt"(set_color $colorInverse)" )" +end |