Merge branch 'master' of https://gitea.nerdland.org/adam/cshenv into master

* 'master' of https://gitea.nerdland.org/adam/cshenv:
  Build a color chart.
  Touchpad helper.
  Document the ssh config hooks, by example.
  Add a local path element.

 Conflicts:
	bin/setup-touch.sh
This commit is contained in:
2026-06-04 03:01:04 -04:00
4 changed files with 88 additions and 2 deletions
+72
View File
@@ -100,6 +100,77 @@ function dump_colors()
exit 0
}
function cube_row()
{
r_base=${1}
g=0
while (( g < 6 ))
do
u=0
while (( u < 3 ))
do
r=$(( r_base + u ))
b=0
while (( b < 6 ))
do
i=$(( 16 + ( r * 36 ) + ( g * 6 ) + ( b ) ))
txt="" && [ ${g} -lt 3 ] && txt=';37;1'
printf "[30${txt}m[48;5;${i}m%3i " ${i}
b=$(( b + 1 ))
done
printf ' '
u=$(( u + 1 ))
done
printf '\n'
g=$(( g + 1 ))
done
printf '\n'
}
function greyscale_chart()
{
[ ${i} -ge 244 ] && txt=";30"
local k=$(( i + 12 ))
while (( i < k ))
do
printf "[48;5;${i};37;1${txt}m%3i " ${i}
i=$(( i + 1 ))
done
printf '\n'
}
function color_chart()
{
i=0
# Base 16
while (( i < 16 ))
do
[ ${i} -gt 0 ] && txt=";30"
printf "[37;1${txt};48;5;${i}m%3i " ${i}
i=$(( i + 1 ))
done
printf '\n\n'
r=0;g=0;b=0
cube_row 0
cube_row 3
i=$(( 6 * 6 * 6 + 16 ))
greyscale_chart
greyscale_chart
}
function setup_color_depth()
{
use_8_bit=0
@@ -383,6 +454,7 @@ function build_sgr_code()
{
case $1 in
dump-colors) dump_colors ;;
color-chart) color_chart ;;
reset) next=0 ;;
bold) next=1 ;;
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
DEVICE=$(xinput list --name-only | grep "Touchpad")
DEVICE="$(xinput list --name-only | grep "Touchpad$")"
echo Device is ${DEVICE}
xinput set-prop "${DEVICE}" "libinput Tapping Enabled" 1