From 2202078d321f4c80d7ef5e5c12692674e299ed38 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Tue, 17 Jun 2025 22:42:10 +0200 Subject: Initial minimalistic version --- .gitignore | 2 ++ README.md | 5 +++++ conf.d/c_star.fish | 33 +++++++++++++++++++++++++++++++++ functions/fish_prompt.fish | 3 +++ functions/fish_right_prompt.fish | 3 +++ 5 files changed, 46 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 conf.d/c_star.fish create mode 100644 functions/fish_prompt.fish create mode 100644 functions/fish_right_prompt.fish diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..87a0fea --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +config.fish +fish_variables diff --git a/README.md b/README.md new file mode 100644 index 0000000..88b87f7 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# C-Star - A fish theme + +Star because it's with bling? Not really. + +This is an opinionted theme. \ No newline at end of file diff --git a/conf.d/c_star.fish b/conf.d/c_star.fish new file mode 100644 index 0000000..1bcedb1 --- /dev/null +++ b/conf.d/c_star.fish @@ -0,0 +1,33 @@ +set -q c_star_prompt_symbol || set -g c_star_prompt_symbol ">" +set -q c_star_date_format || set -g c_star_date_format "%Y-%m-%dT%H:%M:%S%z" + +function c_star_datetime --on-event fish_prompt --on-event fish_postexec --on-variable c_star_date_format + set -g c_star_datetime (date "+$c_star_date_format") +end + +function c_star_git --on-variable PWD + set -g c_star_git "$(fish_git_prompt)" +end + +function c_star_user --on-event fish_prompt + set -g c_star_user "$(whoami)" +end + +function c_star_host --on-event fish_prompt + if test -n "$SSH_CONNECTION" + set -g c_star_host "@$(hostname)" + end +end + +function c_star_user_marker --on-event fish_prompt + switch (whoami) + case "root" + set -g c_star_user_marker "$(set_color red)#$(set_color normal)" + case '*' + set -g c_star_user_marker "\$" + end +end + +function c_star_pwd --on-variable PWD --on-event fish_prompt + set -g c_star_pwd "$(prompt_pwd)" +end \ No newline at end of file diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish new file mode 100644 index 0000000..4d29852 --- /dev/null +++ b/functions/fish_prompt.fish @@ -0,0 +1,3 @@ +function fish_prompt --description "The left side of the C-Star prompt" + echo -e "$c_star_user$c_star_host $c_star_pwd $c_star_git\n$c_star_user_marker$c_star_prompt_symbol " +end \ No newline at end of file diff --git a/functions/fish_right_prompt.fish b/functions/fish_right_prompt.fish new file mode 100644 index 0000000..079a655 --- /dev/null +++ b/functions/fish_right_prompt.fish @@ -0,0 +1,3 @@ +function fish_right_prompt --description "The right side of the C-Star prompt" + echo -e "$c_star_datetime" +end \ No newline at end of file -- cgit v1.2.3