From 098ffd6c345a8bab1ad0c5c5d368e99b3d177256 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sun, 15 Feb 2026 18:06:00 -0500 Subject: [PATCH] Added a whole dynamic prompt tuning command --- bin/setup-touch.sh | 4 +++ tcshrc.aliases | 2 ++ tcshrc.prompt.clear_colors | 20 ++++++++++++++ tcshrc.prompt.command | 53 ++++++++++++++++++++++++++++++++++++++ tcshrc.prompt.final | 37 +++++++++++++++++++++++--- 5 files changed, 113 insertions(+), 3 deletions(-) create mode 100755 bin/setup-touch.sh create mode 100644 tcshrc.prompt.clear_colors create mode 100644 tcshrc.prompt.command diff --git a/bin/setup-touch.sh b/bin/setup-touch.sh new file mode 100755 index 0000000..b4db5d4 --- /dev/null +++ b/bin/setup-touch.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +DEVICE=$(xinput list --name-only | grep "Touchpad") +echo Device is ${DEVICE} +xinput set-prop "${DEVICE}" "libinput Tapping Enabled" 1 diff --git a/tcshrc.aliases b/tcshrc.aliases index 517909a..6e2cb0a 100644 --- a/tcshrc.aliases +++ b/tcshrc.aliases @@ -170,6 +170,8 @@ else alias p echo "Password store not found!" endif +alias prompt source ${CSHENV_DIR}/tcshrc.prompt.command + safe_source ${CSHENV_DIR}/tcshrc.aliases.${CSHENV_SYSTEM} safe_source ${CSHENV_DIR}/tcshrc.aliases.${CSHENV_HOSTNAME} safe_source ${CSHENV_DIR}/tcshrc.aliases.user diff --git a/tcshrc.prompt.clear_colors b/tcshrc.prompt.clear_colors new file mode 100644 index 0000000..c25d0d3 --- /dev/null +++ b/tcshrc.prompt.clear_colors @@ -0,0 +1,20 @@ + +set date_color="" +set time_color="" +set text_color="reset" +set brace_color="" +set host_color="" +set user_color="" +set at_color="" +set path_color="" +set line_color="" +set prompt_color="reset" +set depth_color="" +set percent_color="" + +set dirs_color="" + +#${csi}3;4;38;2;255;192;192;58;2;255;255;255m%} +set branch_color="" +set ahead_tracking_color="" +set behind_tracking_color="" diff --git a/tcshrc.prompt.command b/tcshrc.prompt.command new file mode 100644 index 0000000..68d7c59 --- /dev/null +++ b/tcshrc.prompt.command @@ -0,0 +1,53 @@ +set prompt_elements="time date user host line git battery nesting path tty sigil" + +if ( "" == "${1}" ) then + echo "ERROR: prompt change with no parameters" +endif + +while ( "" != "${1}" ) + switch ( ${1} ) + case 'enable': + shift + if( $?CSHENV_DEBUG ) then + echo unsetenv CSHENV_DISABLE_PROMPT_`echo ${1} | tr '[[:lower:]]' '[[:upper:]]'` + endif + eval unsetenv CSHENV_DISABLE_PROMPT_`echo ${1} | tr '[[:lower:]]' '[[:upper:]]'` + breaksw + + case 'disable': + shift + if( $?CSHENV_DEBUG ) then + echo setenv CSHENV_DISABLE_PROMPT_`echo ${1} | tr '[[:lower:]]' '[[:upper:]]'` + endif + eval setenv CSHENV_DISABLE_PROMPT_`echo ${1} | tr '[[:lower:]]' '[[:upper:]]'` + breaksw + + case 'full': + foreach element ( ${prompt_elements} ) + prompt enable ${element} + end + breaksw + + case 'nothing': + foreach element ( ${prompt_elements} ) + prompt disable ${element} + end + breaksw + + case 'monochrome': + source ${CSHENV_DIR}/tcshrc.prompt.clear_colors + breaksw + + case 'colors': + source ${CSHENV_DIR}/tcshrc.prompt.colors + breaksw + + default: + echo 'ERROR: Prompt setting command requires either `enable` or `disable`, you passed `'${1}'`' + breaksw + endsw + shift +end + + +# vim: ft=tcsh diff --git a/tcshrc.prompt.final b/tcshrc.prompt.final index 26b4223..b6f65a0 100644 --- a/tcshrc.prompt.final +++ b/tcshrc.prompt.final @@ -103,7 +103,6 @@ endif if( "${curr_date_color}" != "${date_color}" ) then set curr_date_color="${date_color}" set date_color_seq="[`__build_sgr_code no-csi reset ${curr_date_color}`m" - set date_prompt_view="%{${date_color_seq}%}${date_prompt}%{${sgr_reset}%}" endif if( ! $?curr_time_color ) then @@ -112,7 +111,6 @@ endif if( "${curr_time_color}" != "${time_color}" ) then set curr_time_color="${time_color}" set time_color_seq="[`__build_sgr_code no-csi reset ${curr_time_color}`m" - set time_prompt_view="%{${time_color_seq}%}${time_prompt}%{${sgr_reset}%}" endif if( ! $?curr_text_color ) then @@ -322,6 +320,14 @@ set git_prompt_view="" set path_prompt_view="" set line_spacer_view="" set dirs_prompt_view="" +set time_prompt_view="" +set date_prompt_view="" +set battery_prompt_view="" +set internal_bracket_view="" + +if( $?CSHENV_DEBUG ) then + echo "About to setup prompt members, with disable checks" +endif if( ! $?CSHENV_DISABLE_PROMPT_SIGIL ) then set prompt_reference_view="${prompt_reference}" @@ -343,6 +349,9 @@ if( ! $?CSHENV_DISABLE_PROMPT_NESTING ) then endif endif +if( $?CSHENV_DEBUG ) then + echo "Up to the user and host checks..." +endif set host_prompt_tail=": " if( ! $?CSHENV_DISABLE_PROMPT_USER ) then set user_prompt_view="${user_color_seq}${user_prompt}%{${sgr_reset}%}" @@ -372,8 +381,30 @@ if( ! $?CSHENV_DISABLE_PROMPT_DIRS ) then endif endif -set prompt_cool="%{\n%}${align_prefix}${battery_prefix}${battery_prompt}${date_prompt_view}%{ %}${time_prompt_view}${align_suffix}${brace_color_seq}\[${prompt_reference_view}${line_prompt_view}${depth_prompt_view}${line_spacer_view}${user_prompt_view}${at_view}${host_prompt_view}${git_prompt_view}${path_prompt_view}${dirs_prompt_view}${brace_color_seq}\]${prompt_color_seq}${end_prompt}%{${text_color_seq}%} " +if( $?CSHENV_DEBUG ) then + echo "Up to the time, date, and battery checks..." +endif +if( ! $?CSHENV_DISABLE_PROMPT_TIME ) then + set time_prompt_view="%{${time_color_seq}%}${time_prompt}%{${sgr_reset}%}" +endif +if( ! $?CSHENV_DISABLE_PROMPT_DATE ) then + set date_prompt_view="%{${date_color_seq}%}${date_prompt}%{${sgr_reset}%}" +endif +if( ! $?CSHENV_DISABLE_PROMPT_BATTERY ) then + set battery_prompt_view="${battery_prefix}${battery_prompt}" +endif +if( $?CSHENV_DEBUG ) then + echo "Doing the internal bracket setup..." +endif +set internal_bracket_prompt="${prompt_reference_view}${line_prompt_view}${depth_prompt_view}${line_spacer_view}${user_prompt_view}${at_view}${host_prompt_view}${git_prompt_view}${path_prompt_view}${dirs_prompt_view}" +if( "" != "${internal_bracket_prompt}" ) then + #echo "I see scratch -${prompt_reference_view}${line_prompt_view}${depth_prompt_view}${line_spacer_view}${user_prompt_view}${at_view}${host_prompt_view}${git_prompt_view}${path_prompt_view}${dirs_prompt_view}-" + #echo -n "${prompt_reference_view}${line_prompt_view}${depth_prompt_view}${line_spacer_view}${user_prompt_view}${at_view}${host_prompt_view}${git_prompt_view}${path_prompt_view}${dirs_prompt_view}" | dd of=/home/adam/scratch + set internal_bracket_view="${brace_color_seq}\[${internal_bracket_prompt}${brace_color_seq}\]" +endif + +set prompt_cool="%{\n%}${align_prefix}${battery_prompt_view}${date_prompt_view}%{ %}${time_prompt_view}${align_suffix}${internal_bracket_view}${prompt_color_seq}${end_prompt}%{${text_color_seq}%} " if( ! ${?cshenv_user_prompt_override} ) then