Results 1 to 3 of 3

Thread: How to get commands to run at startup

  1. #1
    Join Date
    Mar 2008
    Beans
    98

    How to get commands to run at startup

    I have needed to disable 2 finger scrolling and tap-to-click and managed to do this with some "xinput set-prop" commands. This works, but currently I have to use the up arrow in a terminal each time I boot and go back through .bash_history until I get those commands and redo them. Each time. Is there a good way to make this happen automatically when I boot?

    Also, can I turn off Bluetooth at boot? I almost never use it and am sure that it being on drains some battery on my laptop. I tried looking for a Bluetooth manager in Preferences or System, but didn't find anything that seemed to fit the bill.

    I am using Lubuntu 18.04LTS on a Dell Inspiron 3184. Any help would be welcome.

  2. #2
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,289

    Re: How to get commands to run at startup

    Commands to run at login can be in a bash script. I put such a script into ~/bin. To get a script to run at login:

    Go to: Preferences > Default Applications for LXSession > Autostart Tab
    Put the full path to script filename in the box next to 'Add', then click 'Add'.
    And be sure script is executable or it won't launch.

  3. #3
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: How to get commands to run at startup

    Quote Originally Posted by goemonburo View Post
    I have needed to disable 2 finger scrolling and tap-to-click and managed to do this with some "xinput set-prop" commands. This works, but currently I have to use the up arrow in a terminal each time I boot and go back through .bash_history until I get those commands and redo them. Each time. Is there a good way to make this happen automatically when I boot?
    There is a ~/.config/openbox/autostart file that will be run immediately after login if openbox is running as the Window Manager. That is the default for LXDE. That is where you should place any commands you want run at login. If the file doesn't exist, create it and make it have executable permissions for your userid.

    Linux is multi-user. GUI related commands cannot be run "at boot", they can only be run at login. I have mouse settings in that autostart file. Works well and only for GUI logins. Most of the time, I don't login with a GUI, choosing to remote into systems using ssh, so having GUI programs run at inappropriate times is a bad thing.

    Quote Originally Posted by goemonburo View Post
    Also, can I turn off Bluetooth at boot? I almost never use it and am sure that it being on drains some battery on my laptop. I tried looking for a Bluetooth manager in Preferences or System, but didn't find anything that seemed to fit the bill.
    You can disable bluetooth a few different ways.
    * in the BIOS (must be re-enabled in the BIOS)
    * with "systemctl mask" - must be reenabled using "unmask", then enable and start
    * rfkill - Hard or Soft Block the specific device. The name/number to block is dependent on rfkill list On my laptop, the bluetooth is "3", but sometimes it is 2. I softblock mine after being hacked through bluetooth on a fresh Ubuntu install with all patches applied the day before the hack. I haven't noticed any power impact, but generally only use my laptop about 5 hrs at a time on battery and I think it would easily get to 8 hrs for my typical uses. It is an 8th generation Core i5.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •