Created
July 4, 2023 15:11
-
-
Save mladenp/02527a2704a816e00b411ba122f1b0dc to your computer and use it in GitHub Desktop.
Revisions
-
mladenp created this gist
Jul 4, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ precmd() { # sets the tab title to current dir echo -ne "\e]1;${PWD##*/}\a" } PRELINE="\r\033[A" function random { echo -e "\033]6;1;bg;red;brightness;$((1 + $RANDOM % 255))\a"$PRELINE echo -e "\033]6;1;bg;green;brightness;$((1 + $RANDOM % 255))\a"$PRELINE echo -e "\033]6;1;bg;blue;brightness;$((1 + $RANDOM % 255))\a"$PRELINE } function color { case $1 in green) echo -e "\033]6;1;bg;red;brightness;57\a"$PRELINE echo -e "\033]6;1;bg;green;brightness;197\a"$PRELINE echo -e "\033]6;1;bg;blue;brightness;77\a"$PRELINE ;; red) echo -e "\033]6;1;bg;red;brightness;270\a"$PRELINE echo -e "\033]6;1;bg;green;brightness;60\a"$PRELINE echo -e "\033]6;1;bg;blue;brightness;83\a"$PRELINE ;; orange) echo -e "\033]6;1;bg;red;brightness;227\a"$PRELINE echo -e "\033]6;1;bg;green;brightness;143\a"$PRELINE echo -e "\033]6;1;bg;blue;brightness;10\a"$PRELINE ;; *) random esac } color