sábado, 16 de abril de 2016

How to start application after user login


This configuration can be applied to all Linux distributions, for this we must edit .profile file that is in the user's home.
Before make the backup the file .profile, we do not want accident, ok!
cp ~/.profile  .profile.bkp

Case need to restore.

cp ~/.profile.bkp .profile

Open and edit the file .profile on home directory the user.
I will use vi for this example, ok?
Example:
user@mypc:~$ vi .profile

well, now insert the name for application, for example Thunderbird the email client native for ubuntu and other distribuition.

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
 

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

thunderbid & #here is aplication for startup
 # if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi



Now save the file.
Okay, now when the user logs into the system, the thunderbird will start.

Nenhum comentário:

Postar um comentário