Page 1 of 1

rc.local / touchpad problem [Solved]

Posted: 25 Nov 2017, 18:17
by Ed_P
For some reason rc.local isn't working for me.
My rc.local file:

Code: Select all

#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.
/home/guest/touchpad.sh
My touchpad.sh script:

Code: Select all

#!/bin/sh
# To auto run at startup 1. Add to /etc/rc.d/rc.local.  2. And make rc.local executable.

if [ ! -z "$1" ]; then
  synclient -l | grep -i Palm
  echo
  synclient -l | grep -i Edge 
  echo
  synclient -l | grep -i RightButtonArea
  echo
  synclient -l | grep -i Tap
  exit
fi

# https://forum.porteus.org/viewtopic.php?f=81&t=1955
synclient PalmDetect=1 PalmMinWidth=4
#synclient LeftEdge=30   RightEdge=1385 TopEdge=0    BottomEdge=600

# Acer 722
#synclient  LeftEdge=0   RightEdge=1408 TopEdge=0    BottomEdge=640
#synclient MinSpeed=.2

# Acer Aspire One
#synclient LeftEdge=1472 RightEdge=5888 TopEdge=1408 BottomEdge=5218
#synclient MinSpeed=.2

# Dell Inspiron 13     http://forum.porteus.org/viewtopic.php?f=81&t=5096&p=37761#p37761
#synclient RightButtonAreaLeft=3914 RightButtonAreaTop=3918 
synclient RightButtonAreaLeft=3471 RightButtonAreaTop=4062 
synclient  LeftEdge=30   RightEdge=6942 TopEdge=0    BottomEdge=5218
synclient MinSpeed=.2
#synclient HorizEdgeScroll=1  RTCornerButton=0  RBCornerButton=9  LBCornerButton=8
#synclient TapButton2=2 TapButton3=3 MaxDoubleTapTime=180
synclient MaxDoubleTapTime=180 
Both files are executable. And run fine via the command line once I've booted.
My systems are netbooks/notebooks with touchpads and without running my script certain aspects of my touchpad don't work. The right button, scrolling, whatever.

BTW This problem exists on my 3.2.2 system also.


-update-

The script is executed when booting. :o It executes right before the Welcome to Porteus line.

Code: Select all

INIT: Entering runlevel: 4
Failed to connect to X Server
Failed to connect to X Server
Failed to connect to X Server
Failed to connect to X Server

>> rc.local executes the touchpad.sh script here  <<<


***************************
Welcome to Porteus
So why aren't my touchpad changes taking??

Is there another auto start option??

rc.local / touchpad problem

Posted: 25 Nov 2017, 18:59
by brokenman

Code: Select all

if [ ! -z "$1" ]; then
This reads in broken english: If NOT empty 1st argument then do the following, else skip everything.
! means NOT and -z means empty,zero,nada.

In your rc.local file you have this:

Code: Select all

/home/guest/touchpad.sh
No arguments are passed. Zero.

Fix your if clause.

rc.local / touchpad problem

Posted: 25 Nov 2017, 20:52
by Ed_P
The if clause ends with the fi after the exit and the code to change the touchpad settings follows. I don't think you scrolled the code. And the code works when run from a terminal without an argument.

rc.local / touchpad problem

Posted: 25 Nov 2017, 22:13
by brokenman
Yes sorry, you're right. :oops: I didn't scroll and it appeared to me as though you wanted to run the code in this if clause.
Can you run them later in the boot process, say from an autostart folder? You need to run them after X starts and rc.local is run before.

I also need some touchpad tweaks but I run mine as an guiexec cheatcode pointing to my script.

rc.local / touchpad problem

Posted: 25 Nov 2017, 22:53
by Ed_P
brokenman wrote:
25 Nov 2017, 22:13
Can you run them later in the boot process, say from an autostart folder?
:o autostart folder! In /home/guest/? Ok in /etc/xdg/. Looks to be perfect. :good:
I also need some touchpad tweaks but I run mine as an guiexec cheatcode pointing to my script.
:hmmm: An interesting thought. Thanks. :)

rc.local / touchpad problem

Posted: 25 Nov 2017, 23:01
by brokenman
It will vary depending on your DE. In any case you should run synclient after X has loaded.

If you are using cinnamon you could even do it in the Porteus Settings panel/boot screen/startup applications. It essentially creates this file in /home/guest/.config/autostart/myname.desktop

Code: Select all

[Desktop Entry]
Type=Application
Exec=synclient -l
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name[en_US]=synclient
Comment[en_US]=huh
X-GNOME-Autostart-Delay=2

rc.local / touchpad problem

Posted: 25 Nov 2017, 23:14
by Ed_P
brokenman wrote:
25 Nov 2017, 23:01
/home/guest/.config/autostart/myname.desktop
I don't have that folder but I do have /etc/xdg/autostart and the Touchpad.desktop entry I currently use is:

Code: Select all

[Desktop Entry]
Name=Touchpad
Exec=sh /home/guest/touchpad.sh
Icon=/usr/share/pixmaps/porteus/tools.png
Terminal=false
Type=Application
Name[en_US]=Touchpad
StartupNotify=false
I will copy that to the /etc/xdg/ folder and reboot.

rc.local / touchpad problem

Posted: 25 Nov 2017, 23:22
by Ed_P
:celebrate14:

Thank you :worship: brokenman. :beer: