rc.local / touchpad problem [Solved]

Technical issues/questions of an intermediate or advanced nature.
Post Reply
User avatar
Ed_P
Contributor
Contributor
Posts: 3398
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

rc.local / touchpad problem [Solved]

Post#1 by Ed_P » 25 Nov 2017, 18:17

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??
Last edited by Ed_P on 25 Nov 2017, 23:24, edited 1 time in total.
Reason: Add Solved to topic title. :-)
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 5651
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

rc.local / touchpad problem

Post#2 by brokenman » 25 Nov 2017, 18:59

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.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 3398
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

rc.local / touchpad problem

Post#3 by Ed_P » 25 Nov 2017, 20:52

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 a argument.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 5651
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

rc.local / touchpad problem

Post#4 by brokenman » 25 Nov 2017, 22:13

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.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 3398
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

rc.local / touchpad problem

Post#5 by Ed_P » 25 Nov 2017, 22:53

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. :)
Last edited by Ed_P on 25 Nov 2017, 23:03, edited 1 time in total.
Reason: Found autostart.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 5651
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

rc.local / touchpad problem

Post#6 by brokenman » 25 Nov 2017, 23:01

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
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 3398
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

rc.local / touchpad problem

Post#7 by Ed_P » 25 Nov 2017, 23:14

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.
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 3398
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

rc.local / touchpad problem

Post#8 by Ed_P » 25 Nov 2017, 23:22

:celebrate14:

Thank you :worship: brokenman. :beer:
Ed

Post Reply