From 75c92bd100a3b6e8c969a15b762f046672e9c644 Mon Sep 17 00:00:00 2001 From: jstmax! Date: Sun, 26 Oct 2025 12:50:30 +0100 Subject: updated fish functions + doing some ordering und scheisse --- cfg/config.fish | 34 ---------------------------------- cfg/fish/config.fish | 34 ++++++++++++++++++++++++++++++++++ cfg/fish/fish_greeting.fish | 20 ++++++++++++++++++++ cfg/fish/fish_prompt.fish | 25 +++++++++++++++++++++++++ cfg/fish/fish_right_prompt.fish | 28 ++++++++++++++++++++++++++++ cfg/fish_greeting.fish | 20 -------------------- cfg/fish_prompt[s].fish | 25 ------------------------- 7 files changed, 107 insertions(+), 79 deletions(-) delete mode 100644 cfg/config.fish create mode 100644 cfg/fish/config.fish create mode 100644 cfg/fish/fish_greeting.fish create mode 100644 cfg/fish/fish_prompt.fish create mode 100644 cfg/fish/fish_right_prompt.fish delete mode 100644 cfg/fish_greeting.fish delete mode 100644 cfg/fish_prompt[s].fish diff --git a/cfg/config.fish b/cfg/config.fish deleted file mode 100644 index 166ddd4..0000000 --- a/cfg/config.fish +++ /dev/null @@ -1,34 +0,0 @@ -# ~/.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/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 diff --git a/cfg/fish_greeting.fish b/cfg/fish_greeting.fish deleted file mode 100644 index e25c117..0000000 --- a/cfg/fish_greeting.fish +++ /dev/null @@ -1,20 +0,0 @@ -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_prompt[s].fish b/cfg/fish_prompt[s].fish deleted file mode 100644 index 06d5c6c..0000000 --- a/cfg/fish_prompt[s].fish +++ /dev/null @@ -1,25 +0,0 @@ -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 -- cgit v1.3.1