Skip to content

Commit

Permalink
✨ Add command to enable/disable user symbol on prompt for human theme
Browse files Browse the repository at this point in the history
New commands:
- fancygit --enable-user-symbol
- fancygit --disable-user-symbol
  • Loading branch information
diogocavilha committed Apr 11, 2023
1 parent 825ac43 commit 06c3d7e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ Type `fancygit -h` to see all available feature switchers on **"FEATURE SWITCHER
| fancygit --disable-bold-prompt | Show regular prompt font.
| fancygit --enable-host-name | Show host name.
| fancygit --disable-host-name | Hide host name.
| fancygit --enable-user-symbol | Show user symbol.
| fancygit --disable-user-symbol | Hide user symbol.
| fancygit --set-user-name {name} | Set the user name.
| fancygit --unset-user-name | Restore the user name to default.
| fancygit --set-host-name {name} | Set the host name.
Expand Down
1 change: 1 addition & 0 deletions app_config_sample
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ user_name:
host_name:
bold_prompt:false
show_host_prompt:false
show_user_symbol_prompt:false
fresh_file
2 changes: 2 additions & 0 deletions commands-handler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ case "$1" in
"--disable-bold-prompt") fancygit_config_save "bold_prompt" "false";;
"--enable-host-name") fancygit_config_save "show_host_prompt" "true";;
"--disable-host-name") fancygit_config_save "show_host_prompt" "false";;
"--enable-user-symbol") fancygit_config_save "show_user_symbol_prompt" "true";;
"--disable-user-symbol") fancygit_config_save "show_user_symbol_prompt" "false";;

# Set Name and Host.
"--set-user-name") fancygit_config_save "user_name" "$2";;
Expand Down
2 changes: 2 additions & 0 deletions fancygit-completion
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ _fancygit() {
--disable-bold-prompt \
--enable-host-name \
--disable-host-name \
--enable-user-symbol \
--disable-user-symbol \
--set-user-name \
--unset-user-name \
--set-host-name \
Expand Down
5 changes: 5 additions & 0 deletions themes/human.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ fancygit_theme_builder() {
prompt_symbol="${user_symbol}\$${user_symbol_end}"
prompt_path="${path}${path_sign}${path_end}${color_reset}"

if fancygit_config_is "show_user_symbol_prompt" "false"
then
prompt_symbol=""
fi

if [ "$branch_status" != "" ]
then
branch="${branch_color_changed_files_font_tag}"
Expand Down

0 comments on commit 06c3d7e

Please sign in to comment.