Mouse pad option

Post here if you are a new Porteus member and you're looking for some help.
User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#31 by Ed_P » 04 Mar 2013, 02:16

Ok, got rid of the last error by revisiting the two scripts.

test.sh

Code: Select all

#!/bin/sh
echo -en "Fanthom is master of everything\nPress Enter if you agree\n(if you do not do it then booting won't continue)\n"
read
touchpad.sh

Code: Select all

# /etc/rc.d/rc.local
synclient PalmDetect=1 PalmMinWidth=4
synclient LeftEdge=30 RightEdge=1385 TopEdge=0 BottomEdge=600
synclient FingerLow=30 FingerHigh=45
synclient MinSpeed=.2
# https://stuffivelearned.org/doku.php?id=os:linux:general:synapticstouchtricks#digging_deeper_with_synclient
# http://guides.ianrenton.com/howto-linux-and-synaptics-touchpads-for-little-fingers/
# http://www.yeap.de/blog2.0/archives/84-Configuring-the-Synaptics-Touchpad.html
# http://forum.porteus.org/viewtopic.php?f=81&t=1955&p=13313#p13313
# http://ubuntuforums.org/showthread.php?t=1855689
But touchpad.sh is still not running when booting.

rc.local

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.

sh /mnt/sdb1/test.sh
sh /mnt/sdb1/touchpad.sh
hmmmm Image So the problem is my script!! It works when executed directly, as do the commands, but not when booting. Putting #!/bin/sh at the top, similar to the other two files, results in an error when trying to execute directly. The error being misleading, implying Porteus can't find the script when the problem was something inside the script.

hmmmm Image I have to research meaning/function of #!/bin/sh. I thought # indicated "comment".
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#32 by Ed_P » 04 Mar 2013, 17:35

EdP wrote:hmmmm Image So the problem is my script!!
Not exactly.

Modified test.sh

Code: Select all

#!/bin/sh
echo -en "Fanthom is master of everything\nPress Enter if you agree\n(if you do not do it then booting won't continue)\n"
read
synclient PalmDetect=1 PalmMinWidth=4
echo -en "Did synclient run?
read
And in the boot window I see:

Code: Select all

Fanthom is master of everything
Press Enter if you agree
(if you do not do it then booting won't continue)

Failed to connect to X Server
Did sysclient run?

Failed to connect to X Server
Failed to connect to X Server
Failed to connect to X Server
Failed to connect to X Server
The problem hasn't been the path to the script rather the path to the synclient app in the script. :wall:

You were right brokenman. I'll just put the commands in the rc.local file. rc.local is a text file and I can keep a backup copy on the USB drive to restore to new releases.

Thanks guys.
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#33 by Ed_P » 04 Mar 2013, 17:49

OMG!!!

rc.local

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.
#
synclient PalmDetect=1 PalmMinWidth=4
synclient LeftEdge=30 RightEdge=1385 TopEdge=0 BottomEdge=600
synclient FingerLow=30 FingerHigh=45
synclient MinSpeed=.2
# https://stuffivelearned.org/doku.php?id=os:linux:general:synapticstouchtricks#digging_deeper_with_synclient
# http://guides.ianrenton.com/howto-linux-and-synaptics-touchpads-for-little-fingers/
# http://www.yeap.de/blog2.0/archives/84-Configuring-the-Synaptics-Touchpad.html
# http://forum.porteus.org/viewtopic.php?f=81&t=1955&p=13313#p13313
# http://ubuntuforums.org/showthread.php?t=1855689
And in the boot window I still see:

Code: Select all

Failed to connect to X Server
Failed to connect to X Server
Failed to connect to X Server
Failed to connect to X Server
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#34 by Ed_P » 04 Mar 2013, 18:15

brokenman wrote:You can place a link (commonly called symlink) on your desktop by doing the following.

Open a console (also called terminal) and enter:

Code: Select all

chmod +x  /path/to/my/script.sh
ln -s /path/to/my/script.sh /home/guest/Desktop/Myshortcut.sh
The first line makes sure the script is executable.
The second creates a link to the script that will be executed when clicking on the shortcut.
Since the automatic approach has failed I've tried this approach. But I'm confused a bit by the result of these commands:

Code: Select all

root@porteus:~# cat /home/quest/Desktop/
cat: /home/quest/Desktop/: No such file or directory
root@porteus:~# cat /home/root/Desktop/
cat: /home/root/Desktop/: No such file or directory
My Razor desktop currently shows two shortcuts/symlinks, one for Home and one for System but neither show in the cat commands. In fact the Desktop folder doesn't exist for either root or guest. So where am I suppose to put my symlink?? :unknown:

BTW The chmod command didn't return any error msgs.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Mouse pad option

Post#35 by brokenman » 04 Mar 2013, 19:53

#!/bin/bash
This is the 'shebang' identifier and tells the system which shell to use for the script. You are correct in assuming that the '#' is a comment in a script; however in the first line of a script it is the identifier. In Porteus /bin/sh is symlinked to /bin/bash

The failed to connect to X server could be due to synclient needing access to your X session which isn't up and running at the time rc.local is run. This leaves you with the option of using the 'autostart' folder. This folder is designed for the stuff you want to run after the desktop loads. If you are in Razor then here is what you should do.

In the menu click on Preferences/Razorqt settings/Session configurator
Click on the autostart button.
Click 'add' and then choose the script that you want to start. Tick the 'wait for panel' checkbox. In the name section write synclient.
This will add a file called /home/guest/.config/autostart/synclient.desktop which will run your chosen script at boot AFTER the desktop loads.
This method will make sure of two essential things:
1. guest is running the script you want
2. synclient has the required access to the xsession. (xsession is the graphics and pretty stuff as opposed to text mode)

Your script needs to be run as guest user so i suggest giving it the correct permissions for guest to execute. Do this as root.

Code: Select all

chmod 777 /path/to/touchpad.sh # 777 is read and execute permissions for everyone
chmod +x /path/to/touchpad.sh # This amkes it executable
So about your strange Desktop dilemma.

Code: Select all

cat /home/quest/Desktop/
Is 'quest' a new user you created and forgot to give a home directory or is it a typo and you mean 'guest'?
If it is 'guest' then please try:

Code: Select all

ls /home/guest/Desktop
The 'cat' command (concatenate) reads and adds to text files. In this case you are trying to 'cat' a directory which won't work. If your user is called 'quest' then simply create the Desktop folder:

Code: Select all

mkdir /home/quest/Desktop
PS: You can see who you really are by opening a fresh console and typing: whoami
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#36 by Ed_P » 04 Mar 2013, 22:30

brokenman wrote:PS: You can see who you really are by opening a fresh console and typing: whoami

Code: Select all

root@porteus:~# whoami
root
brokenman wrote:So about your strange Desktop dilemma.

Code: Select all

cat /home/quest/Desktop/
Is 'quest' a new user you created and forgot to give a home directory or is it a typo and you mean 'guest'?
If it is 'guest' then please try:

Code: Select all

ls /home/guest/Desktop
g q LXTerminal should be smart enough to know how to handle typos. :oops: Yes, I meant guest.

Code: Select all

root@porteus:~# ls /home/guest/Desktop
Home.desktop  System.desktop
Interesting, I thought LS was for only LiSting files.
brokenman wrote:In the menu click on Preferences/Razorqt settings/Session configurator
Click on the autostart button.
Click 'add' and then choose the script that you want to start. Tick the 'wait for panel' checkbox. In the name section write synclient.
This will add a file called /home/guest/.config/autostart/synclient.desktop which will run your chosen script at boot AFTER the desktop loads.
Even if I'm logged on as root?
brokenman wrote:The failed to connect to X server could be due to synclient needing access to your X session which isn't up and running at the time rc.local is run.
Adding /usr/bin/ to the commands didn't help either. ie /usr/bin/synclient etc. I assumed X server was referring to a remote connection.
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#37 by Ed_P » 04 Mar 2013, 22:39

brokenman wrote:In the menu click on Preferences/Razorqt settings/Session configurator
Click on the autostart button.
Click 'add' and then choose the script that you want to start. Tick the 'wait for panel' checkbox. In the name section write synclient.
This will add a file called /home/guest/.config/autostart/synclient.desktop which will run your chosen script at boot AFTER the desktop loads.
Now what????

Code: Select all

root@porteus:~# ls /home/guest/.config/autostart/synclient.desktop
/bin/ls: cannot access /home/guest/.config/autostart/synclient.desktop: No such file or directory
root@porteus:~# ls /home/root/.config/autostart/synclient.desktop
/bin/ls: cannot access /home/root/.config/autostart/synclient.desktop: No such file or directory
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#38 by Ed_P » 04 Mar 2013, 23:11

Did the two chmod commands, rebooted, nothing has changed. No folder, no execution of the script.
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#39 by Ed_P » 04 Mar 2013, 23:19

Ran these commands:

Code: Select all

root@porteus:~# chmod +x /mnt/sdb1/touchpad.sh
root@porteus:~# ln -s /mnt/sdb1/touchpad.sh /home/guest/Desktop/Touchpad.sh
root@porteus:~# ls /mnt/sdb1/touchpad.sh /home/guest/Desktop/Touchpad.sh
/home/guest/Desktop/Touchpad.sh@  /mnt/sdb1/touchpad.sh*
root@porteus:~# 
but I don't see any symlink on the desktop.
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#40 by Ed_P » 04 Mar 2013, 23:24

Rebooted. Still no symlink on the desktop, still no autorun of the script, still no ....
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Mouse pad option

Post#41 by brokenman » 05 Mar 2013, 00:53

When you boot the computer are you logging in as 'guest'? The default Porteus-v2.0 will automatically log you in as guest and you will be looking at the guest desktop. The only way to log in as root is by stopping at the GDM login screen and entering root details.

Perhaps the problem is you are logged in as root, and creating symlinks on the guest desktop. After you reboot (back into root i assume) you will not see any symlinks because you have not logged into the 'guest' account. Root has his own desktop and guest has his own desktop. You only see the desktop for the account you are logged into.

If you are wanting all this to work for root user then you need to exchange /home/guest/Desktop for /root/Desktop.

Perhaps there is some confusion by the term 'run this as root'. This doesn't mean you have to 'login' as root. It means you should login as guest and after open a console (which should say guest@portues) then you enter:

Code: Select all

su
toor
And now you have a root console (root@porteus) which means you will have no restrictions.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#42 by Ed_P » 05 Mar 2013, 02:12

brokenman wrote:When you boot the computer are you logging in as 'guest'? The default Porteus-v2.0 will automatically log you in as guest and you will be looking at the guest desktop. The only way to log in as root is by stopping at the GDM login screen and entering root details.
There is no logging in, the 2.0 ISO boots directly to root.

Code: Select all

kernel /boot/syslinux/vmlinuz from=/ISOs/Porteus-v2.0-i486.iso vga=791 autoexec=startx changes=EXIT:/porteussave.dat  
initrd /boot/syslinux/initrd.xz
Perhaps the problem is you are logged in as root, and creating symlinks on the guest desktop.
I'm a Linux/Porteus novice following the code suggested to me.
then you enter:

Code: Select all

su
toor
And now you have a root console (root@porteus) which means you will have no restrictions.
Nice to know. I wasn't aware of that capability.

What about the
In the menu click on Preferences/Razorqt settings/Session configurator
suggestion. Didn't that create a file called /home/root/.config/autostart/synclient.desktop which was supppose to run my script at boot AFTER the desktop loads. Any idea why it isn't it working?
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#43 by Ed_P » 05 Mar 2013, 02:28

Of course.

Code: Select all

root@porteus:~# ln -s /mnt/sdb1/touchpad.sh /home/root/Desktop/Touchpad.sh
ln: failed to create symbolic link ‘/home/root/Desktop/Touchpad.sh’: No such file or directory

root@porteus:~# ls /home/root/Desktop/
/bin/ls: cannot access /home/root/Desktop/: No such file or directory
 
root@porteus:~# ls /home/root/.config/autostart/synclient.desktop
/bin/ls: cannot access /home/root/.config/autostart/synclient.desktop: No such file or directory
root@porteus:~#  
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#44 by Ed_P » 05 Mar 2013, 05:00

OMG!! I can't win.

Dbl click the Desktop's Home icon > opens SpaceFM . click on File > File Search. Enter Desktop. It finds a single Desktop entry, in /root!! Highlight Desktop, RIGHT click on it and click on Open. In the right pane with the Home and System icons RIGHT click then click on New then click on Link. Voila!! I create a link on the /root desktop for the touchpad.sh script. :Yahoo!:

Wow, finally progress. :D

I dbl click on the new Desktop symlink, expecting it to finally run my script. Instead I get a FireFox window asking me if it should open the file with Leafpad or Save it. :wall:

Is this just my inexperience or are all versions of Linux this convoluted? I have maintained mainframe operating systems (DOS, OS, VS1, VM, MVS, MVS/XA), DOS pc systems (IBM DOS, Compaq DOS, DR DOS, MS DOS) and Windows pc systems (Windows 3.1, 98, XP, 7 and now 8 ) and I don't recall any being this difficult.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Mouse pad option

Post#45 by brokenman » 05 Mar 2013, 14:41

No it certainly shouldn't be this difficult. In fact after recreating your same scenario i just can't get it to fail. Your bootline has autoexec=startx which is booting you directly into root. I suggest removing this but in any case i just recreated you situation annd it worked fine. Here is exactly what i did.

At the Porteus boot menu i pressed TAB and my boot line has the following:
quiet rw from=/mnt/sda4/porteus.iso autoexec=startx

This logs me in as root and i did the following in a console.

Code: Select all

root@porteus:~# leafpad /mnt/sda6/dump/touchpad.sh
In this script i put one single line (after the #!/bin/bash)
echo "This works!" > /tmp/output.tmp
I then saved the file and closed it. Then continued.

Code: Select all

root@porteus:~# chmod +x /mnt/sda6/dump/touchpad.sh 
root@porteus:~# sh /mnt/sda6/dump/touchpad.sh 
I tested to make sure the script runs

Code: Select all

root@porteus:~# cat /tmp/output.tmp
This works
root@porteus:~# rm /tmp/output.tmp 
Now i go to the menu click on Preferences/Razor-qt settings/Razor Session configurator.
Click 'autostart' then click 'add'.
In the name i put 'synclient'
In the command i put 'sh /mnt/sda6/dump/touchpad.sh'
I checked the box to wait for the system tray then clicked ok. This created the file /root/.config/autostart/synclient.desktop
Now i want to make a module that will load at boot.

Code: Select all

root@porteus:~# mkdir /tmp/mymodule
root@porteus:~# cp -a --parents /root/.config/autostart/synclient.desktop /tmp/mymodule/
root@porteus:~# dir2xzm /tmp/mymodule/ /tmp/mymodule.xzm && rm -rf /tmp/mymodule
Now i create a folder that i can put all the modules i want to load at boot.

Code: Select all

root@porteus:~# mkdir /mnt/sda6/dump/mymodules
root@porteus:~# mv /tmp/mymodule.xzm /mnt/sda6/dump/mymodules
Now on the next boot i added one more thing to my boot line. Press TAB during boot and then my boot line is the same as before except i added:

Code: Select all

extramod=/mnt/sda6/dump/mymodules
After booting i found that the script had run because there was a file at /tmp/output.tmp with the words "This works!" inside.

------------

So please try EXACTLY as i did above (substituting paths for your own) and let me know how it goes.

PS: Today i learned that 32bit can boot directly to root if you add autoexec=startx. I don't recommend this, i think you should be removing this line and booting directly into guest ... or even better ... create a porteus USB drive to test all this stuff.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply