Choose style:

Author Topic: Run commands at startup  (Read 97 times)

0 Members and 1 Guest are viewing this topic.

Offline irv

  • nOOb
  • *
  • Posts: 1
  • Karma: 0
  • New Forum User old Ubuntu user.
    • View Profile
    • Hiawatha Bible Chapel
  • Peppermint version(s): 9
Run commands at startup
« on: May 05, 2019, 04:32:14 pm »
I have been running  Ubuntu for many years now, and have moved on to Peppermint.
Ubuntu has a program to enter commands to start when the computer starts up Does Peppermint have such a program.
The commands I want to run are

Code: [Select]
xinput set prop 16 "Device Disable" 0[ 
and
Code: [Select]
xinput set prop 13 "Device Disable" 0[

These commands turn off my touchpad and touch screen which I do not use.
I can do this in a terminal but I want it to happen automaticly when I reboot
Information on my Main laptop. Information on my small laptop Dell 11 3000
Using a Asus 3632QM laptop with 8gig RAM, 250 SSD.
Machine Registered 366271, 366273, 366275.
Registered Ubuntu user number 18630. Registered Linux user number 458093.

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 24510
  • Karma: 2698
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Run commands at startup
« Reply #1 on: May 05, 2019, 05:58:12 pm »
Hi irv, and welcome to the forum :)

[EDIT]

WARNING - Only carry on below if you're 100% sure the device ID's are correct IN PEPPERMINT, they may have changed if you're just copying these from a different install, and if you disable the wrong device ID's you may end up disabling your keyboard..
(in fact it'd still probably be best to disable by deviceNAME rather than deviceID .. so probably safest to post the output from the below command firsts)

If unsure, post the output from
Code: [Select]
xinput --list
and I'll amend the commands in the script below.

[END EDIT]

If you KNOW those 2 commands work, place them in a script, then autostart the script

Run:
Code: [Select]
xed ~/.disable-input-devices
make it read
Code: [Select]
#!/bin/bash
xinput set prop 16 "Device Disable" 0[
xinput set prop 13 "Device Disable" 0[
SAVE the file and exit the text editor.

Back in the terminal, make that script executable
Code: [Select]
chmod +x ~/.disable-input-devices
ok now go to:-

Menu > Settings > Default Applications for LXSession > Autostart (tab)

In the box just to the right of the [+ Add] button, enter:
Code: [Select]
/home/<username>/.disable-input-devices
(replacing <username> with your actual username)

and click the [+Add] button.

Log off/on to test.



Personally I thing the script should probably read
Code: [Select]
#!/bin/bash
xinput disable 16
xinput disable 13
or at least
Code: [Select]
#!/bin/bash
xinput set-prop 16 "Device Enabled" 0
xinput set-prop 13 "Device Enabled" 0
but you're the one that's saying those commands work ???
« Last Edit: May 05, 2019, 06:16:50 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline az2020

  • nOOb
  • *
  • Posts: 20
  • Karma: 3
  • New Forum User
    • View Profile
Re: Run commands at startup
« Reply #2 on: May 05, 2019, 06:00:57 pm »
Code: [Select]
xinput set prop 16 "Device Disable" 0[ 
and
Code: [Select]
xinput set prop 13 "Device Disable" 0[

These commands turn off my touchpad and touch screen which I do not use.
I can do this in a terminal but I want it to happen automaticly when I reboot

You should be able to put that in your ~/.profile

I have a script that determines the current state of my touchpad, and will toggle it to the opposite state. I ran that from my .profile when I was using Lubuntu, and added it as a keyboard shortcut so I can toggle the touchpad on/off with windows-key+space bar.

There is a package you can install (touchpad-indicator) which gives you a nice interface to do this stuff. It will sit in you taskbar. (I haven't installed it in Peppermint. But, I would expect that it works.).

EDIT: PcNetSpec's solution may be better. The above is how I did it on a different distro. (I'm not currently on Peppermint.).
« Last Edit: May 05, 2019, 06:05:05 pm by az2020 »

Offline az2020

  • nOOb
  • *
  • Posts: 20
  • Karma: 3
  • New Forum User
    • View Profile
Re: Run commands at startup
« Reply #3 on: May 05, 2019, 08:53:25 pm »

WARNING - Only carry on below if you're 100% sure the device ID's are correct ..


I saw your warning. I should have posted my script:

        https://pastebin.com/a31rc3SF

It doesn't use a hardcorded device ID. (It discovers it). You can pass (0 or 1) to disable/enable the touchpad. Or, pass nothing (toggles the current state). That last part is handy to assign to a keyboard shortcut. Then you can toggle it on or off from the keyboard (those unexpected events when you say "that touchpad would be handy right now."

I used the windows-key + space-bar in Lubuntu. (I haven't set that part up yet where I'm at.). It has to be something you'll remember. I chose those keys because anything that's a pain in the *** makes me think of Microsoft. And, the space bar is the closest key to the touchpad. Natural combination for me.

The script has some debugging lines. A person can create the file, paste that script into it, make the file executable, and run it from the terminal command line. They can expand upon the debugging, or comment those lines out. It's nothing fancy. It should be a good starting point.

BTW: another command called "synclient" does the same thing, and looks easier to use. I did my thing before I knew of synclient.

Code: [Select]
synclient touchpadoff=1 [or 0 for off]

« Last Edit: May 05, 2019, 09:01:39 pm by az2020 »