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:
@@ -100,6 +100,77 @@ function dump_colors()
|
|||||||
exit 0
|
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[m " ${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[m " ${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[m " ${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()
|
function setup_color_depth()
|
||||||
{
|
{
|
||||||
use_8_bit=0
|
use_8_bit=0
|
||||||
@@ -383,6 +454,7 @@ function build_sgr_code()
|
|||||||
{
|
{
|
||||||
case $1 in
|
case $1 in
|
||||||
dump-colors) dump_colors ;;
|
dump-colors) dump_colors ;;
|
||||||
|
color-chart) color_chart ;;
|
||||||
|
|
||||||
reset) next=0 ;;
|
reset) next=0 ;;
|
||||||
bold) next=1 ;;
|
bold) next=1 ;;
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
DEVICE=$(xinput list --name-only | grep "Touchpad")
|
DEVICE="$(xinput list --name-only | grep "Touchpad$")"
|
||||||
echo Device is ${DEVICE}
|
echo Device is ${DEVICE}
|
||||||
xinput set-prop "${DEVICE}" "libinput Tapping Enabled" 1
|
xinput set-prop "${DEVICE}" "libinput Tapping Enabled" 1
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
Match all
|
||||||
|
include ~/cshenv/ssh/prologue
|
||||||
|
|
||||||
|
# ---- Host specific options go here...
|
||||||
|
|
||||||
|
# Host foo.bar
|
||||||
|
# User quux
|
||||||
|
|
||||||
|
# ---- End of host specific options...
|
||||||
|
|
||||||
|
Match all
|
||||||
|
include ~/cshenv/ssh/epilogue
|
||||||
|
|
||||||
|
# vim: ft=sshconfig
|
||||||
@@ -7,7 +7,7 @@ if( ( $?CSHENV_DEBUG ) || ( $?CSHENV_VERBOSE_STARTUP ) ) then
|
|||||||
echo "Currently running tcshrc script"
|
echo "Currently running tcshrc script"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
set path=( ${CSHENV_DIR}/bin ${path} )
|
set path=( ${CSHENV_DIR}/bin ${HOME}/.local/opt/bin ${path} )
|
||||||
|
|
||||||
setenv CSHENV_MACHINE_SUFFIX
|
setenv CSHENV_MACHINE_SUFFIX
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user