Search This Blog

2024-06-14

trim in pure dash

SPACES=$(printf ' \n\t')  # '\n' must not be last

trim () {

  local trim="${1#*[^$SPACES]}"

  local head=${1%?$trim}

  trim="${1%[^$SPACES]*}"

  local tail=${1#$trim?}

  # trim

  trim="${1#$head}"

  echo -n "${trim%$tail}"
}

# Test

trim '

hello

world

'

2024-06-11

paprefs @ bookworm

cd /usr/lib

sudo ln -s pulse-16.1+dfsg1 pulse-16.1



... still does not work... :(

uau ::: hundreds of programming languages... :(

 O.o ... "ridiculous!... we need to develop one universal standard" language "that covers everyone's" syntax "use cases"... o.O?... and can unify all languages... :) ... and still have hundreds of languages... o.O?... +1 ... :D

https://xkcd.com/927/ )



2024-05-05

Portrait touchscreen

xrandr -o right

xinput set-prop 'pointer:Goodix Capacitive TouchScreen' --type=float \
'Coordinate Transformation Matrix' 0 1 0  -1 0 1  0 0 1.43

# And back to landscape

xrandr -o normal

xinput set-prop 'pointer:Goodix Capacitive TouchScreen' --type=float \
'Coordinate Transformation Matrix' 0 0 0  0 0 0  0 0 0