From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- ...t_calibrator_pointercal.sh-to-be-run-as-n.patch | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch (limited to 'meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch') diff --git a/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch new file mode 100644 index 0000000000..86982924a8 --- /dev/null +++ b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch @@ -0,0 +1,66 @@ +Upstream-Status: Pending + +From 14734a93bd3fc323325459e24b04795422e395e6 Mon Sep 17 00:00:00 2001 +From: Laurentiu Palcu +Date: Mon, 1 Jul 2013 15:38:02 +0300 +Subject: [PATCH] Allow xinput_calibrator_pointercal.sh to be run as normal + user + +Allow normal user to create their own pointercal.xinput files that +override the system pointercal file in /etc. + +Signed-off-by: Laurentiu Palcu +--- + scripts/xinput_calibrator_pointercal.sh | 33 +++++++++++++++++++++---------- + 1 file changed, 23 insertions(+), 10 deletions(-) + +diff --git a/scripts/xinput_calibrator_pointercal.sh b/scripts/xinput_calibrator_pointercal.sh +index fccb197..0ada7da 100755 +--- a/scripts/xinput_calibrator_pointercal.sh ++++ b/scripts/xinput_calibrator_pointercal.sh +@@ -11,19 +11,32 @@ + PATH="/usr/bin:$PATH" + + BINARY="xinput_calibrator" +-CALFILE="/etc/pointercal.xinput" +-LOGFILE="/var/log/xinput_calibrator.pointercal.log" ++SYS_CALFILE="/etc/pointercal.xinput" ++USER_CALFILE="$HOME/.pointercal/pointercal.xinput" + +-if [ -e $CALFILE ] ; then +- if grep replace $CALFILE ; then +- echo "Empty calibration file found, removing it" +- rm $CALFILE +- else +- echo "Using calibration data stored in $CALFILE" +- . $CALFILE && exit 0 +- fi ++if [ "$USER" = "root" ]; then ++ LOGFILE="/var/log/xinput_calibrator.pointercal.log" ++ CALFILES="$SYS_CALFILE" ++else ++ LOGFILE="$HOME/.pointercal/xinput_calibrator.pointercal.log" ++ CALFILES="$USER_CALFILE $SYS_CALFILE" ++ mkdir -p "$HOME/.pointercal" + fi + ++for CALFILE in $CALFILES; do ++ if [ -e $CALFILE ]; then ++ if grep replace $CALFILE ; then ++ echo "Empty calibration file found, removing it" ++ rm $CALFILE 2>/dev/null || true ++ else ++ echo "Using calibration data stored in $CALFILE" ++ . $CALFILE && exit 0 ++ fi ++ fi ++done ++ ++[ "$USER" != "root" ] && CALFILE=$USER_CALFILE ++ + CALDATA=`$BINARY --output-type xinput -v | tee $LOGFILE | grep ' xinput set' | sed 's/^ //g; s/$/;/g'` + if [ ! -z "$CALDATA" ] ; then + echo $CALDATA > $CALFILE +-- +1.7.9.5 + -- cgit v1.2.3-54-g00ecf