Ubuntu Startup Applications
Introduction
When you log into your Ubuntu system, several applications automatically start in the background. These are called startup applications and they can include system services, application launchers, or background processes that enhance your desktop experience. Understanding how to manage these startup applications is an essential skill for customizing your Ubuntu experience and optimizing system performance.
In this guide, we'll explore how to:
- View currently configured startup applications
- Add new applications to your startup sequence
- Remove unnecessary startup applications
- Create custom startup entries
- Delay startup applications for better system performance
Understanding the Startup Applications Manager
Ubuntu provides a built-in tool called the Startup Applications Preferences that allows you to manage which applications launch automatically when you log in.
Accessing the Startup Applications Manager
You can access the Startup Applications manager through:
-
GUI Method:
- Open the Applications menu (or Activities overview)
- Search for "Startup Applications"
- Click on the "Startup Applications Preferences" icon
-
Terminal Method:
- Open a terminal
- Type the following command:
gnome-session-properties
This will open the Startup Applications Preferences window:
Viewing Existing Startup Applications
When you open the Startup Applications Preferences, you'll see a list of all applications currently configured to start automatically. Each entry includes:
- Name: A descriptive name for the startup item
- Command: The actual command that gets executed
- Delay: (If configured) How many seconds to wait before launching
Some default startup applications in Ubuntu include:
- GNOME Settings Daemon
- Network Manager
- Power Manager
- Screen Reader
- Volume Control
Adding New Startup Applications
You can add your favorite applications to the startup sequence so they're ready to use as soon as you log in.
Method 1: Using the Startup Applications Manager
- Open Startup Applications Preferences
- Click the "Add" button
- Fill in the details:
- Name: A descriptive name for the application
- Command: The command to launch the application
- Comment: Optional description
For example, to add Firefox to your startup applications:
- Name: Firefox Web Browser
- Command: firefox
- Comment: Launch Firefox automatically at login
Method 2: Creating .desktop Files Manually
For more advanced configuration, you can create desktop entry files manually:
- Create a new
.desktop
file in~/.config/autostart/
:
touch ~/.config/autostart/myapplication.desktop
- Edit the file with your favorite text editor:
nano ~/.config/autostart/myapplication.desktop
- Add the following content:
[Desktop Entry]
Type=Application
Exec=application-command
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=My Application Name
Name=My Application Name
Comment[en_US]=Description of my application
Comment=Description of my application
Replace application-command
with the actual command to launch your application.
Finding Command Names for Applications
If you're unsure what command launches a specific application, there are several ways to find out:
-
Check the application's menu entry:
- Right-click on the application in the menu
- Select "Properties" or similar option
- Look for the "Command" field
-
Use the which command:
- If you know the approximate name, use:
which application-name
For example:
which firefox
Output:
/usr/bin/firefox
- Check desktop files:
- Look in
/usr/share/applications/
for the application's.desktop
file - Open it with a text editor to find the
Exec=
line
- Look in
Removing Startup Applications
To prevent an application from starting automatically:
- Open Startup Applications Preferences
- Select the application you want to remove
- Click the "Remove" button
Alternatively, you can disable an application without removing it completely:
- Select the application
- Click "Edit"
- Add
sleep 999999999
before the command, which will delay it for an extremely long time
Creating Advanced Startup Entries
Delaying Application Startup
You can delay applications to improve login performance by adding a sleep command:
sleep 10 && application-command
This will wait 10 seconds before launching the application.
Running Applications with Arguments
You can pass additional arguments to applications:
firefox --private-window https://ubuntu.com
This will start Firefox in private browsing mode and open Ubuntu's website.
Running Multiple Commands
To run multiple commands in sequence:
command1 && command2
To run them in parallel:
command1 & command2
Viewing Hidden Startup Applications
By default, Ubuntu hides some system startup applications to prevent accidental modifications. To show all startup applications:
- Open a terminal
- Run the following command:
sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop
- Reopen the Startup Applications Preferences to see all entries
Creating a Startup Script
For more complex startup requirements, you can create a shell script:
- Create a new script file:
touch ~/startup-script.sh
- Make it executable:
chmod +x ~/startup-script.sh
- Edit the file:
#!/bin/bash
# Wait for network connection
sleep 5
# Start applications
firefox &
thunderbird &
# Set screen resolution
xrandr --output HDMI-1 --mode 1920x1080
# Mount network drives
mount -t cifs //server/share /mnt/share -o credentials=/home/user/.smbcredentials
echo "Startup script completed at $(date)" >> ~/startup.log
- Add this script to your startup applications with the command:
/home/yourusername/startup-script.sh
Troubleshooting Startup Applications
If you're experiencing issues with startup applications:
Applications Don't Start
- Verify the command works when run manually in terminal
- Check system logs for errors:
journalctl -b | grep application-name
System Boots Slowly
- Consider using delayed startup for non-essential applications
- Remove unnecessary startup applications
- Use the
htop
command during startup to see which processes are consuming resources:
sudo apt install htop
htop
Startup Applications vs. System Services
It's important to understand the difference between startup applications and system services:
- Startup applications run at the user level when you log in
- System services run at the system level, often before the user interface loads
To manage system services, you would use the systemctl
command:
# Check status of a service
systemctl status service-name
# Enable a service to start on boot
sudo systemctl enable service-name
# Disable a service from starting on boot
sudo systemctl disable service-name
Summary
Managing startup applications in Ubuntu gives you control over your desktop environment and system performance. By carefully selecting which applications start automatically, you can create a customized experience that balances convenience with system resources.
Key takeaways:
- Use the Startup Applications Preferences tool to manage startup applications
- Add applications that you use frequently to save time
- Remove or delay non-essential applications to improve login speed
- Create custom scripts for more complex startup requirements
- Distinguish between user startup applications and system services
Exercises
- Open the Startup Applications Preferences and identify which applications are currently set to start automatically on your system.
- Add your favorite text editor to your startup applications.
- Create a custom startup script that:
- Creates a daily backup of an important folder
- Opens your most commonly used applications
- Displays a welcome message
- Research and list three system services that start automatically on your Ubuntu system.
- Measure your system's boot time before and after optimizing your startup applications.
Additional Resources
- Ubuntu Documentation: Startup Applications
- The Linux Command Line by William Shotts (for advanced scripting)
- ArchWiki: Autostarting (for advanced users)
If you spot any mistakes on this website, please let me know at [email protected]. I’d greatly appreciate your feedback! :)