Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: Run terminal command at startup?

  1. #1
    Join Date
    Oct 2010
    Location
    Cork City, IMF, EU
    Beans
    25
    Distro
    Ubuntu Development Release

    Run terminal command at startup?

    Well, I want to run a terminal command at startup. I Google searched, but all the threads were ~5 years old.
    The command I want to run is
    Code:
    synclient TapButton2=2
    synclient TapButton3=3
    Thanks!
    Lenovo G560 running Natty Narwhal and Windows 7
    Sign up for Dropbox, and earn us both 250MB EXTRA Free Online Storage on top of 2GB you get already
    Dropbox lets you easily sync files between your OS's (including Ubuntu & Android!)

  2. #2
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Run terminal command at startup?

    If you want to run this for all users, then add it to /etc/rc.local prior to the exit 0 command.

    If you want to run this for just your login, have a look at the following instructions for running a program at login: http://techotopia.com/index.php/Ubun...tions_on_Login

    To execute both of those commands on one command line entry, use the following command:
    Code:
    synclient TapButton2=2 && synclient TapButton3=3

  3. #3
    Join Date
    Oct 2010
    Location
    Cork City, IMF, EU
    Beans
    25
    Distro
    Ubuntu Development Release

    Re: Run terminal command at startup?

    Thanks for your help!
    Lenovo G560 running Natty Narwhal and Windows 7
    Sign up for Dropbox, and earn us both 250MB EXTRA Free Online Storage on top of 2GB you get already
    Dropbox lets you easily sync files between your OS's (including Ubuntu & Android!)

  4. #4
    Join Date
    Oct 2010
    Location
    Cork City, IMF, EU
    Beans
    25
    Distro
    Ubuntu Development Release

    Re: Run terminal command at startup?

    Didnt work
    Lenovo G560 running Natty Narwhal and Windows 7
    Sign up for Dropbox, and earn us both 250MB EXTRA Free Online Storage on top of 2GB you get already
    Dropbox lets you easily sync files between your OS's (including Ubuntu & Android!)

  5. #5
    Join Date
    Jul 2009
    Beans
    255
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Run terminal command at startup?

    What did you do? You were offered more than one option.

  6. #6
    Join Date
    Oct 2010
    Location
    Cork City, IMF, EU
    Beans
    25
    Distro
    Ubuntu Development Release

    Re: Run terminal command at startup?

    Quote Originally Posted by veggen View Post
    What did you do? You were offered more than one option.
    The first option

    my rc.local
    Code:
    amb'#!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    
    synclient TapButton2=2 && synclient TapButton3=3
    synclient VertTwoFingerScroll=1 && synclient HorizTwoFingerScroll=1
    synclient EmulateTwoFingerMinW=5 && synclient EmulateTwoFingerMinZ=48
    
    exit 0
    Last edited by shadowninty; June 21st, 2011 at 11:39 AM.
    Lenovo G560 running Natty Narwhal and Windows 7
    Sign up for Dropbox, and earn us both 250MB EXTRA Free Online Storage on top of 2GB you get already
    Dropbox lets you easily sync files between your OS's (including Ubuntu & Android!)

  7. #7
    prodigy_ is offline May the Ubuntu Be With You!
    Join Date
    Mar 2008
    Beans
    1,219

    Re: Run terminal command at startup?

    Won't work from rc.local because synclient tries to connect to X Server and rc.local is executed before X Server starts.

  8. #8
    Join Date
    Oct 2010
    Location
    Cork City, IMF, EU
    Beans
    25
    Distro
    Ubuntu Development Release

    Re: Run terminal command at startup?

    I added this command to startup applications - no luck
    Code:
    synclient TapButton2=2 && synclient TapButton3=3
    Thanks for your help guys, shame there is not a Thanks button :L
    Last edited by shadowninty; June 21st, 2011 at 11:51 AM.
    Lenovo G560 running Natty Narwhal and Windows 7
    Sign up for Dropbox, and earn us both 250MB EXTRA Free Online Storage on top of 2GB you get already
    Dropbox lets you easily sync files between your OS's (including Ubuntu & Android!)

  9. #9
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Run terminal command at startup?

    @prodigy - nice catch.

    OP: try adding the commands to the .xprofile file in your home directory (creating if necessary):
    Code:
    gedit ~/.xprofile
    With contents:
    synclient TapButton2=2
    synclient TapButton3=3
    And make the file executable:
    Code:
    chmod +x ~/.xprofile

  10. #10
    Join Date
    Oct 2010
    Location
    Cork City, IMF, EU
    Beans
    25
    Distro
    Ubuntu Development Release

    Re: Run terminal command at startup?

    Thank you. Will test out when I'm finished compiling CyanogenMod7

    EDIT: Not working Sorry
    Last edited by shadowninty; June 21st, 2011 at 05:16 PM.
    Lenovo G560 running Natty Narwhal and Windows 7
    Sign up for Dropbox, and earn us both 250MB EXTRA Free Online Storage on top of 2GB you get already
    Dropbox lets you easily sync files between your OS's (including Ubuntu & Android!)

Page 1 of 4 123 ... LastLast

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
  •