Toggle Touchpad Enable & Disable

Here is my simple script to help me toggle touchpad enable & disable in NixOS running on Thinkpad R61.

~/bin/toggleTouchpadEnableDisable

# Try disabling the libinput device.

d=`xinput list | grep -i touchpad | awk '{for(i=1;i<=NF;i++){ tmp=match($i, /id=[0-9]/); if(tmp){print $i} } }' | awk --field-separator== '{ print $2 }'`
echo 'xinput list'
echo " SynPS/2 Synaptics TouchPad device ID: $d"

# Find the touchpad, in my case it's called "SynPS/2 Synaptics TouchPad", with ID 11.
echo "xinput list-props $d"
de=`xinput list-props $d | grep 'Device Enabled' | awk '{ print $3}' | awk --field-separator=\( '{print $2}' | awk --field-separator=\) '{print $1}'`
ds=`xinput list-props $d | grep 'Device Enabled' | awk '{ print $4}'`
echo " Device Enabled setting ID: $de, Device Enabled status: $ds"

newStatus=0
if [ $ds == 0 ]; then
 #echo "Set new status to: $newStatus"
 newStatus=1
elif [ $ds == 1 ]; then
 #echo "Set new status to: $newStatus"
 newStatus=0
fi

# There should be one called 'Device Enabled'; at least mine has.
echo "xinput set-prop $d $de $newStatus"
xinput set-prop $d $de $newStatus

ds2=`xinput list-props $d | grep 'Device Enabled' | awk '{ print $4}'`
echo " Device Enabled setting ID: $de, Device Enabled status: $ds2"

 

Advertisements

Chocolatey: Package Manager for Windows

While preparing Cikgu JN’s new laptop (refurbish Thinkpad T400), I have amazed that there is opensource package manager and some automation for Windows. The laptop come with Windows 7 Professional.

“Chocolatey is a package manager for Windows (like apt-get or yum but for Windows).”https://chocolatey.org

Main application interface is command line, but also Chocolatey provide option to install nice graphical tool.

Below is some summary command:

choco install -y vlc
choco install -y firefox libreoffice gimp mame telegram sumatra-pdf chocolateygui
choco upgrade -y firefox
choco upgrade -y all

 

Cheap Stereo Sound Amplifier for Audiophile

This are the tip for cheap audio system. I am using this system for my computer.

I bought cheap China made mini stereo amplifier to power-up my cheap used 4″ speaker.

By using this stereo amplifier, the sound is amplified. But there is a problem that really disturb me, I lost the stereo quality. I did test with one channel only, for example play audio source left channel only, I have the sound output to my left speaker, but plus I also hear the sound in my right speaker. This is very bad to me 😦

Then here I come with solution. The key of this tip are ‘two’ cheap mini stereo amplifier. Yes, I am using two mini stereo amplifier. One amplifier will be use to amplify left channel for output to left speaker, and another one amplifier will be use for output to right speaker.

two_cheap_mini_stereo_amplifier

Connection from audio input, to two separate amplifier, and then to speakers.

The output sound now really separate left and right channel. Stereo output very nice, like using ear/headphone.

Below are some pictures of my setup… very messy.

The two cheap stereo mini amplifier

The two cheap stereo mini amplifier

Cheap used 2.0 speaker

Cheap used stereo speaker

 

docker


docker search django
docker search centos
docker ps
docker ps -a
docker rm 6be0e1ca672d
docker attach 00499976bc4f
docker attach stoic_stallman
docker images
docker run -i -t centos:latest /bin/bash
docker pause 00499976bc4f
docker diff 00499976bc4f
docker commit 00499976bc4f najib/centos
docker unpause 00499976bc4f
docker stop 00499976bc4f
docker restart 00499976bc4f
docker run -d
docker logs 00499976bc4f