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: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Mouse pad option

Post#46 by Ed_P » 05 Mar 2013, 19:31

Code: Select all

root@porteus:~# leafpad /mnt/sda6/dump/touchpad.sh
root@porteus:~# chmod +x /mnt/sda6/dump/touchpad.sh 
root@porteus:~# sh /mnt/sda6/dump/touchpad.sh 
root@porteus:~# cat /tmp/output.tmp
This works!
root@porteus:~# rm /tmp/output.tmp

root@porteus:~# ls /root/.config/autostart/
sysclient.desktop  windowmanager.desktop

root@porteus:~# mkdir /tmp/mymodule
root@porteus:~# cp -a --parents /root/.config/autostart/synclient.desktop /tmp/mymodule/
cp: cannot stat ‘/root/.config/autostart/synclient.desktop’: No such file or directory
Yes, I have an sda6 partition, to which I added a dump folder. Image
Ed

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

Re: Mouse pad option

Post#47 by Ed_P » 05 Mar 2013, 22:55

Rebooted. Found out what cp means/does, Reran the command.

Code: Select all

root@porteus:~# cp -a --parents /root/.config/autostart/synclient.desktop /tmp/mymodule/
cp: with --parents, the destination must be a directory
Try 'cp --help' for more information.
Ok somehow the tmp directory got lost, so tried again.

Code: Select all

root@porteus:~# mkdir /tmp/mymodule
root@porteus:~# cp -a --parents /root/.config/autostart/synclient.desktop /tmp/mymodule/
cp: cannot stat ‘/root/.config/autostart/synclient.desktop’: No such file or directory
No idea what "cannot stat" means. Nor why cp can't find a file that exists.

Used SpaceFM to copy synclient.desktop to /tmp/mymodule/.


BTW & FWIW I see nothing on the desktop named synclient.
Ed

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

Re: Mouse pad option

Post#48 by Ed_P » 05 Mar 2013, 23:07

Continuing on.

Code: Select all

root@porteus:~# dir2xzm /tmp/mymodule/ /tmp/mymodule.xzm && rm -rf /tmp/mymoduleParallel mksquashfs: Using 2 processors
Creating 4.0 filesystem on /tmp/mymodule.xzm, block size 262144.
[===================================================================|] 1/1 100%
Exportable Squashfs 4.0 filesystem, xz compressed, data block size 262144
	compressed data, compressed metadata, compressed fragments, compressed xattrs
	duplicates are removed
Filesystem size 0.54 Kbytes (0.00 Mbytes)
	98.58% of uncompressed filesystem size (0.55 Kbytes)
Inode table size 138 bytes (0.13 Kbytes)
	85.19% of uncompressed inode table size (162 bytes)
Directory table size 107 bytes (0.10 Kbytes)
	100.00% of uncompressed directory table size (107 bytes)
Number of duplicate files found 0
Number of inodes 5
Number of files 1
Number of fragments 1
Number of symbolic links  0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 4
Number of ids (unique uids + gids) 1
Number of uids 1
	root (0)
Number of gids 1
	root (0)
root@porteus:~# mkdir /mnt/sda6/dump/mymodules
root@porteus:~# mv /tmp/mymodule.xzm /mnt/sda6/dump/mymodules
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#49 by brokenman » 05 Mar 2013, 23:09

You are booting from an ISO so think of your system as 'groundhog day'. Every time you boot it is fresh. If you create a file/folder anywhere in the live file system (see below) then after you reboot it will be gone. After a reboot you must run all the commands again. This has advantages and disadvantages. If you want changes you make to be saved then you need to use a savefile.dat to record and save all your changes. Personally i always use fresh mode and anything i want saved i save to /mnt/sda6 (or whatever other storage device).

Live file system is anything in: dev/ etc/ home/ root/ lib/ opt/ proc/ sbin/ srv/ sys/ tmp/ usr/ var/
Your /mnt/sda6/ is not the live file system and so anything you put there will survive a reboot. Anything in /tmp will not.

In your case you will have to create the synclient.desktop file by going into the Razor Session Configurator again and telling it to run your script on /mnt/sda6/dump/touchpad.sh. Then recreate the /tmp/mymodule folder an continue on. Hope this makes sense.
How do i become super user?
Wear your underpants on the outside and put on a cape.

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

Re: Mouse pad option

Post#50 by Ed_P » 05 Mar 2013, 23:44

brokenman wrote:No it certainly shouldn't be this difficult. In fact after recreating your same scenario i just can't get it to fail.
No error when doing the cp command like I encountered?
brokenman wrote:After booting i found that the script had run because there was a file at /tmp/output.tmp with the words "This works!" inside.
Me too.
brokenman wrote:So please try EXACTLY as i did above (substituting paths for your own) and let me know how it goes.
I think I have. :)
brokenman wrote:You are booting from an ISO so think of your system as 'groundhog day'. Every time you boot it is fresh.
Yes, the same as booting a Live CD version. I understand that part and my goal.
brokenman wrote: If you want changes you make to be saved then you need to use a savefile.dat to record and save all your changes. Personally i always use fresh mode and anything i want saved i save to /mnt/sda6 (or whatever other storage device).
Basically I'm trying to do both. The savefile.dat concept I like but I don't have a lot of control over what goes into it thus the desire for running files outside the ISO that I have control over.
brokenman wrote:Your /mnt/sda6/ is not the live file system and so anything you put there will survive a reboot. Anything in /tmp will not.
Understood.
brokenman wrote:In your case you will have to create the synclient.desktop file by going into the Razor Session Configurator again and telling it to run your script on /mnt/sda6/dump/touchpad.sh. Then recreate the /tmp/mymodule folder an continue on. Hope this makes sense.
When I have tried that approach the desktop symlink that points to the touchpad.sh file open FireFox with options to save the file or open it with Leafpad. The symlink does not execute the script with bash which I would really like to get resolved.

So, at this point, I need to review what you've had me do, see if I can replicate it to a) execute synclient rather than echo b) see if I can create a script that will do what we just did. :D

Thanks for sticking with me on this brokenman. :beer:
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#51 by brokenman » 06 Mar 2013, 21:08

The savefile.dat concept I like but I don't have a lot of control over what goes into it
There are other options with more control such as the 'magic folders' and 'changes=EXIT' but we can discuss that later.

When I have tried that approach the desktop symlink that points to the touchpad.sh file open FireFox
When you use the Razor Session Configurator it creates a file called synclient.desktop in /home/.config/autostart/synclient.desktop
This file is not a symlink. It is a file that runs at start time and executes the command inside it. In your case 'sh /mnt/sda6/dump/touchpad.sh'

It seems the 'file association' for symlinks is not good in Razor desktop so double clicking the desktop file opens the wrong application. Let's stick to using the synclient.desktop file in autostart to run your script.

If, after a reboot, you are seeing the test file with "This works!" inside then everything is hunky dory and you should swap the echo command with your synclient commands and test that they are working.

Thanks for sticking with me on this brokenman
It's a pleasure. I admire your persistence. It is certainly required when entering the world of linux.

I'll recap everything when i get more time after work.
How do i become super user?
Wear your underpants on the outside and put on a cape.

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

Re: Mouse pad option

Post#52 by Ed_P » 08 Mar 2013, 00:32

Questions, now that I have a chance to think about this.
brokenman wrote: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.
If the above steps create a desktop file that autoruns at boot up why create a module to load at boot? Won't the changes= cheatcode run the desktop file?
EdP wrote:

Code: Select all

root@porteus:~# mkdir /tmp/mymodule
root@porteus:~# cp -a --parents /root/.config/autostart/synclient.desktop /tmp/mymodule/
cp: cannot stat ‘/root/.config/autostart/synclient.desktop’: No such file or directory
Did you get this error when you ran the steps? What does "cannot stat" mean? Is "stat" a misspelling for "start"?
brokenman wrote:The savefile.dat concept I like but I don't have a lot of control over what goes into it
There are other options with more control such as the 'magic folders' and 'changes=EXIT' but we can discuss that later.
I currently use 'changes=EXIT'.
brokenman wrote:When I have tried that approach the desktop symlink that points to the touchpad.sh file open FireFox
When you use the Razor Session Configurator it creates a file called synclient.desktop in /home/.config/autostart/synclient.desktop
This file is not a symlink. It is a file that runs at start time and executes the command inside it. In your case 'sh /mnt/sda6/dump/touchpad.sh'

It seems the 'file association' for symlinks is not good in Razor desktop so double clicking the desktop file opens the wrong application. Let's stick to using the synclient.desktop file in autostart to run your script.
Would a desktop icon? pointing to the synclient.desktop file run the script?

My synclient script is not solving the problem of the cursor jumping when I type. I need different/more tweaks to it. A desktop icon, similar to Home and System that will invoke a command/script would help. I'm thinking of one that would run synclient TouchpadOff=1. A concern would be if off how do I get to a different desktop icon to run and reverse it.
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#53 by brokenman » 08 Mar 2013, 01:45

Please see below for a more elegant solution to your problem.

Won't the changes= cheatcode run the desktop file?
Yes correct. The changes cheatcode should save your changes but in your bootcode i didn't see any changes= so i assumed you weren't saving changes. In any case i usually save a module from my changes after i am satisified with them (if working from a savefile) as it is less prone to corruption.

Did you get this error when you ran the steps? What does "cannot stat" mean? Is "stat" a misspelling for "start"?
No. If you run the Razor Session Configurator after logging in as root, then the file is created in /root/.config/autostart/synclient.desktop. Make sure you put 'synclient' in the name section of the configurator. You can check first by listing the directory: ls -a /root/.config/autostart

Cannot stat is machine talk for 'no can do'. Creating desktop shortcuts is a little broken in Razor desktop it seems. This is something i have to report upstream.

#### MORE ELEGANT SOLUTION
For now i have the perfect solutions for you. To test it please open up a console and enter:

Code: Select all

syndaemon -i 1 -d
This should started the syndaemon which waits for keys to be pressed and disables the touchpad. 1 second after you stop typing the touchpad is activated again. If this works then it should be as simple as making the autostart file. This time let's do it manually to make certain the file is created.

Code: Select all

[ ! -d /root/.config/autostart ] && mkdir -p /root/.config/autostart  # If no autostart folder exists then create it
cat > /root/.config/autostart/syndaemon.desktop << EOF
[Desktop Entry]
Exec=syndaemon -i 1 -d
Name=syndaemon
Type=Application
Version=1.0
EOF
That's all. The first line creates the autostart folder if it doesn't already exist.
The second creates the syndaemon.desktop file and adds everything between the EOF (End of file) tag.

For what it's worth i am writing a touchpad/mouse configurator for the next version.
How do i become super user?
Wear your underpants on the outside and put on a cape.

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

Re: Mouse pad option

Post#54 by Ed_P » 08 Mar 2013, 06:30

brokenman wrote:Won't the changes= cheatcode run the desktop file?
Yes correct. The changes cheatcode should save your changes but in your bootcode i didn't see any changes= so i assumed you weren't saving changes.
You "a s s u m e"d!! You do know what "assume"ing does, right? :wink:
brokenman wrote:Did you get this error when you ran the steps? What does "cannot stat" mean? Is "stat" a misspelling for "start"?
No. If you run the Razor Session Configurator after logging in as root, then the file is created in /root/.config/autostart/synclient.desktop.
Really!! You didn't get the error? hmmm I followed your steps to the letter, including drive sda6. I wonder why I did.
brokenman wrote:Please see below for a more elegant solution to your problem.
Looking forward to it. :D
brokenman wrote:#### MORE ELEGANT SOLUTION
For now i have the perfect solutions for you. To test it please open up a console and enter:

Code: Select all

syndaemon -i 1 -d
This should started the syndaemon which waits for keys to be pressed and disables the touchpad. 1 second after you stop typing the touchpad is activated again.
Oh, I like the sound of this. Can the 1 second be changed to 2 or 3?
brokenman wrote:If this works then it should be as simple as making the autostart file. This time let's do it manually to make certain the file is created.

Code: Select all

[ ! -d /root/.config/autostart ] && mkdir -p /root/.config/autostart  # If no autostart folder exists then create it
cat > /root/.config/autostart/syndaemon.desktop << EOF
[Desktop Entry]
Exec=syndaemon -i 1 -d
Name=syndaemon
Type=Application
Version=1.0
EOF
That's all. The first line creates the autostart folder if it doesn't already exist. EOF
The second creates the syndaemon.desktop file and adds everything between the EOF (End of file) tag.
Wow!! I like what can be done in terminal mode. But this "command" [ ! -d /root/.config/autostart ] with brackets does what?? I've never encounter a command in brackets.
brokenman wrote:For what it's worth i am writing a touchpad/mouse configurator for the next version.
Many thoughts crossing my mine on that.
> Oh, sure anything to break this cycle with Ed.
> I knew I should have waited till 2.1.
> I will miss this terminal mode exercise. Cool stuff.
not as often.
BTW This new approach seems to have helped but not 100% The cursor still jumps to the pointer regardless of where it is periodically, but definitely

Code: Select all

root@porteus:~# [ ! -d /root/.config/autostart ]
root@porteus:~# mkdir -p /root/.config/autostart
root@porteus:~# cat > /root/.config/autostart/syndaemon.desktop << EOF
> [Desktop Entry]
> Exec=syndaemon -i 1 -d
> Name=syndaemon
> Type=Application
> Version=1.0
> EOF
root@porteus:~# 
Ed

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

Re: Mouse pad option

Post#55 by Ed_P » 08 Mar 2013, 06:47

FYI

Code: Select all

root@porteus:~# syndaemon --help
syndaemon: invalid option -- '-'
Usage: syndaemon [-i idle-time] [-m poll-delay] [-d] [-t] [-k]
  -i How many seconds to wait after the last key press before
     enabling the touchpad. (default is 2.0s)
  -m How many milli-seconds to wait until next poll.
     (default is 200ms)
  -d Start as a daemon, i.e. in the background.
  -p Create a pid file with the specified name.
  -t Only disable tapping and scrolling, not mouse movements.
  -k Ignore modifier keys when monitoring keyboard activity.
  -K Like -k but also ignore Modifier+Key combos.
  -R Use the XRecord extension.
  -v Print diagnostic messages.
So how do I change a desktop file?
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#56 by brokenman » 08 Mar 2013, 18:40

You "a s s u m e"d!! You do know what "assume"ing does, right?
Yes, but i think it made more of an ass of me.

Oh, I like the sound of this. Can the 1 second be changed to 2 or 3?
Yes, but 1 second should be sufficient. For me it is annoying because i hold ctrl while clicking on a link to open in a new tab. Having no touchpad for one second after pressing ctrl slows me down. (-k switch solves this)

But this "command" [ ! -d /root/.config/autostart ] with brackets does what??
! means not
-d means 'directory exists'

So this is the same as:
[ not directory exists /root/.config/autostart ] then mkdir /root/.config/autostart

Code: Select all

syndaemon -i 1 -d
After typing this into a freshly opened terminal, does the mouse still jump when typing? It shouldn't because it is completely disabled until you stop typing. You can modify the synclient.desktop file after creating it by opening it in a text editor. You only need to modify the Exec= line.
How do i become super user?
Wear your underpants on the outside and put on a cape.

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

Re: Mouse pad option

Post#57 by Ed_P » 08 Mar 2013, 19:19

brokenman wrote:But this "command" [ ! -d /root/.config/autostart ] with brackets does what??
! means not
-d means 'directory exists'
But doesn't ! get used with # in #!/bin/sh so there it means "not /bin/sh"??? Aew to me also.s nnd brackets around a command or condition i

Code: Select all

syndaemon -i 1 -d
After typing this into a freshly opened terminal, does the mouse still jump when typing? It shouldn't because it is completely disabled until you stop typing. ________ I boot but if it is it's not working.
I'm assuming it's getting run when
You can modify the synclient.desktop file after creating it by opening it in a text editor.
Really!! That I can handle.

Is there a command I can run that shows if the syndaemon has run? I'm thinking of readding the synclient commands also.

Interesting, I just manually executed the syndaemon command and typing seems less jumpy. The problem with the cursor when typing is it jumps sporadically to where the pointer is if it's in text or to the end of the line that the pointer is to the right of.
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#58 by brokenman » 08 Mar 2013, 20:02

https://wiki.archlinux.org/index.php/Touchpad_Synaptics

But doesn't ! get used with # in #!/bin/sh so there it means "not /bin/sh"???
No. The shebang is an exception.

Is there a command I can run that shows if the syndaemon has run?

Code: Select all

ps aux|grep '[0-9] syndaemon'
ps aux # lists all the running processes
| # (the pipe) Passes results to the next command
grep '[0-9] syndaemon' # Searches for a line containing a number from 0-9 followed by a space and then the word syndaemon.

The square brackets are essentially used to 'test conditions'.

Code: Select all

x=2
if [ $x -eq 2 ]; then
  echo "Yes, x equals 2"
    else
  echo "No, x is not 2"
fi
How do i become super user?
Wear your underpants on the outside and put on a cape.

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

Re: Mouse pad option

Post#59 by Ed_P » 08 Mar 2013, 20:33

Nice!! Porteus doesn't have xinput! :Search:
Is there a command I can run that shows if the syndaemon has run?

Code: Select all

ps aux|grep '[0-9] syndaemon'
ps aux # lists all the running processes
| # (the pipe) Passes results to the next command
grep '[0-9] syndaemon' # Searches for a line containing a number from 0-9 followed by a space and then the word syndaemon.
Excellent!! Both the command and the explanation. :good:
The square brackets are essentially used to 'test conditions'.
Interesting. In Windows we use parens.

if x equ 2 (
echo Equal
) else (
echo Not Equal
)

Code: Select all

x=2
if [ $x -eq 2 ]; then
  echo "Yes, x equals 2"
    else
  echo "No, x is not 2"
fi
Ok, where do I put this? Do I create a script with it?

BTW Without your explanation I would have interpetted the -eq as meaning "not equal".
Ed

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

Re: Mouse pad option

Post#60 by Ed_P » 08 Mar 2013, 20:56

1. When shutting down there was a msg while saving porteussave.dat to run with the fsck cheatcode next boot. !!

2. The desktop autoruns aren't autorunning. The synclient PalmDetect is still 0 and your syndaemon command returns nothing.

Code: Select all

    PalmDetect              = 0
    PalmMinWidth            = 10
    PalmMinZ                = 200
    CoastingSpeed           = 20
    CoastingFriction        = 50
    PressureMotionMinZ      = 30
    PressureMotionMaxZ      = 160
    PressureMotionMinFactor = 1
    PressureMotionMaxFactor = 1
    GrabEventDevice         = 1
    TapAndDragGesture       = 1
    AreaLeftEdge            = 0
    AreaRightEdge           = 0
    AreaTopEdge             = 0
    AreaBottomEdge          = 0
    HorizHysteresis         = 7
    VertHysteresis          = 7
    ClickPad                = 0
root@porteus:~# ps aux|grep '[0-9] syndaemon'
root@porteus:~# 

Code: Select all

root@porteus:~# ls /root/.config/autostart
syndaemon.desktop  sysclient.desktop  windowmanager.desktop
syndaemon.desktop

Code: Select all

[Desktop Entry]
Exec=syndaemon -i 2 -d
Name=syndaemon
Type=Application
Version=1.0
synclient.desktop

Code: Select all

[Desktop Entry]
Exec=/mnt/sdb1/touchpad.sh
Name=sysclient
Type=Application
Version=1.0
X-Razor-Need-Tray=true
Ed

Post Reply