You are not logged in.

#1 2015-06-25 10:12:13

campo85
Member
Registered: 2012-09-05
Posts: 32

Run script after automatic login

Hi all,

I need to run a script after the automatic text login. I tried to append the script at the end of my /etc/profile with no luck, it remains stuck. Is there a sure way to run a script for embedded purpose ?

Offline

#2 2015-06-25 10:25:58

tommykr
Member
From: Poland
Registered: 2009-03-15
Posts: 51

Re: Run script after automatic login

Try ~/.bash_profile or ~/.zprofile if you use shell bash or zsh.

Offline

#3 2015-06-25 10:49:45

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Run script after automatic login

Post the script in question.

Offline

#4 2015-06-25 10:51:26

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,896
Website

Re: Run script after automatic login

Not an installation issue, moving to Newbie Corner.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2015-06-25 11:15:54

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: Run script after automatic login

I think a systemd user service is what you want: https://wiki.archlinux.org/index.php/Systemd/User


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2015-06-25 11:55:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,555
Website

Re: Run script after automatic login

bash_profile:

if [[ $TERM == "linux" ]]; then
...
fi

Or if you need even more specificity have your autologin command in your modified tty service give the terminal a more specific name, like "linux_auto" then use that in the conditional.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB