Usually, before beginning my coding duty I open the following:
- google-chrome
- nautilus
- terminal
- system monitor
- gedit
Is there a way to open all of them with a single terminal command?
I use Ubuntu 18.04.
Usually, before beginning my coding duty I open the following:
Is there a way to open all of them with a single terminal command?
I use Ubuntu 18.04.
Here's what I'd do:
for i in google-chrome nautilus gnome-terminal gedit ; do
setsid "$i" > /dev/null 2>&1
done
setsid
or nohup
can be used to daemonize a process, with setsid
being preferred because it starts each process as new session leader, effectively disconnecting it from terminal. See also, Difference between nohup, disown and &.
As for > /dev/null 2>&1
that just sends both normal and error streams from each program into /dev/null
so that you can still use terminal normally. See also What does & mean exactly in output redirection? and What is the differences between &> and 2>&1
I don't remember command for system monitor off the top of my head, so I'll leave that up to you.
Feel free to turn this loop into either a function that can live in your ~/.bashrc
or make a full-blown scripts. Up to you.
Simplest way is to make a bash script with all the needed commands to start those programs.
You could even put that script in Startup Applications so it gets run on every bootup.
&
to the end.
– Sergiy Kolodyazhnyy
May 30 '18 at 03:53
#
in front, which tells me it's commented out. Your script only runs firefox
. What should be done is firefox &
. Then on next line mate-terminal &
. And so on and so forth.
– Sergiy Kolodyazhnyy
May 30 '18 at 04:04
mate-terminal
launches itself in background. In general however thia shouldn't happen. As I said, scripts are sequential, and each program blocks execution.
– Sergiy Kolodyazhnyy
May 30 '18 at 04:10
To open all of the above applications at one, you could execute something like this:
chromium ; nautilus ; gnome-terminal ; gnome-system-monitor ; gedit
To make this startup every time you Log In, you could put this command into a .desktop file on the Exec=
line.
Place this file into /usr/share/applications
and open gnome-session-properties
. Simply add your new application to the current list of startup applications. This should do the trick.