LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-30-2015, 12:10 AM   #1
thelynx
Member
 
Registered: Jan 2015
Location: Thailand
Distribution: Fedora 33 / Endeavour OS / Deepin
Posts: 48

Rep: Reputation: Disabled
How to automatically run a script on login


Good day,

I would like the following script to run automatically as soon as I log in:

Code:
#!/bin/bash
synclient TapButton1=1
syndaemon -i 1 -t -d
Is there a way to do this? Would setting up a cron job be the best option?

Any help would be most appreciated.

Thanks.
 
Old 01-30-2015, 12:33 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

if you are using a DE that follows the freedesktop standards you can put a .desktop file in ~/.config/autostart/. Eg make a file like:
Code:
[Desktop Entry]
Type=Application
Name=Synaptics
Comment=Setup and launch Synaptics
Exec=/path/to/myscript.sh
and put it at /.config/autostart/synaptics.desktop

However, you can likely put your synaptics configuration in /usr/share/X11/xorg.conf.d/50-synaptics.conf or similar and your DE may have a built in way of launching syndaemon. What distro and desktop (or window manager) are you using?

Evo2.
 
Old 01-30-2015, 01:59 AM   #3
thelynx
Member
 
Registered: Jan 2015
Location: Thailand
Distribution: Fedora 33 / Endeavour OS / Deepin
Posts: 48

Original Poster
Rep: Reputation: Disabled
Thanks for your reply, evo2. I'm running Sparky Linux 64-bit (Debian Jessie) with E17 desktop.

The "mouse and touchpad" settings, I can check enable tap touchpad for click, but it doesn't work.

I'll try making a .desktop entry and give it a shot. Thanks
 
Old 01-30-2015, 05:09 AM   #4
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
For the tap-to-click setting, I would use a file at /etc/X11/xorg.conf.d/50-synaptics.conf:
Code:
Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
        Option "TapButton1" "1"
        MatchDevicePath "/dev/input/event*"
EndSection
This would also work at the end of a pre-existing xorg.conf file.

However, I don't know if the Enlightenment desktop would over-ride these settings.
 
Old 01-30-2015, 05:58 AM   #5
thelynx
Member
 
Registered: Jan 2015
Location: Thailand
Distribution: Fedora 33 / Endeavour OS / Deepin
Posts: 48

Original Poster
Rep: Reputation: Disabled
Hi H on a S: Thanks. OK I'll put it in xorg.conf.d

Thanks
 
Old 01-30-2015, 06:07 AM   #6
thelynx
Member
 
Registered: Jan 2015
Location: Thailand
Distribution: Fedora 33 / Endeavour OS / Deepin
Posts: 48

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Head_on_a_Stick View Post
For the tap-to-click setting, I would use a file at /etc/X11/xorg.conf.d/50-synaptics.conf:
Code:
Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
        Option "TapButton1" "1"
        MatchDevicePath "/dev/input/event*"
EndSection
This would also work at the end of a pre-existing xorg.conf file.

However, I don't know if the Enlightenment desktop would over-ride these settings.

Worked like a charm, thanks. Would there be something similar for
Code:
syndaemon -i 1 -t -d
?
 
Old 01-30-2015, 09:41 AM   #7
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by thelynx View Post
Would there be something similar for
Code:
syndaemon -i 1 -t -d
?
I would just add that as an autostart program with the flags added.

However, I don't use Enlightenment (I don't trust anything that pulsates), so I'm not sure how you do that...

Something like Settings Panel → Apps → Startup Applications

A quick search suggests you may have to write a .desktop file after all.
http://www.gentoo-wiki.info/HOWTO_Au...ghtenment_DR17
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically run rdesktop on login? MTWiley Linux - Desktop 1 09-20-2011 07:37 PM
Run a script automatically upon user login? FastFeet Linux - General 3 05-21-2009 05:23 AM
Run shell script automatically after Login. hnshashi Linux - Newbie 14 09-26-2008 04:43 AM
how can i run smbmount automatically when a user login rddreamz Linux - Networking 4 02-18-2006 03:10 AM
Where to run scripts automatically on login/logout hilltop*Tech Linux - General 2 02-06-2004 10:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration