Post by gamoI want that after every reboot and login,
the system excute 3 times
gnome-shell-terminal to the max size
and in one of them cd to a directory
Could I automate this?
Sounds easy enough. I do not have a ubuntu install to test actual commands.
Basically all you need to do is create a desktop file in your autostart
directory. The desktop file has the script you wish to have executed.
Your script can then use nohup to launch whatever command desired.
I am running xfce as my Desktop Environment, therefore I have a
$HOME/.config/autostart directory. In there I have a link to my desktop
file.
$ ls -l $HOME/.config/autostart/*start*
lrwxrwxrwx 1 bittwister bittwister 47 Jun 27 2020 start/xfce_startup.desktop -> /home/bittwister/local/bin/xfce_startup.desktop
$ cat /home/bittwister/local/bin/xfce_startup.desktop
[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Xfce_startup
Comment=Local xfce_startup
Exec=/home/bittwister/local/bin/xfce_startup.sh
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false
The point of interest is the shell script
Exec=/home/bittwister/local/bin/xfce_startup.sh
Other than .desktop you get to name the files whatever you like.
For example, your script could be launch_3_terms. With the following:
----8<----8<----8<----8<- cut below this line ---8<----8<----8<
#!/bin/bash
#******************************************************
#* launch_3_terms - launch 3 terminals
#* usually called from autostart directory upon login
#******************************************************
nohup gnome-shell-terminal > /dev/null 2>&1 &
nohup "gnome-shell-terminal -geom 80x50" > /dev/null 2>&1 &
nohup "cd /#HOME/some/where ; gnome-shell-terminal " > /dev/null 2>&1 &
#**************** end launch_3_terms ******************
You save launch_3_terms, set the execute bit
chmod +x launch_3_terms
Test that it works as desired.
./launch_3_terms
If works as desired create your launch_3_terms.desktop file, either
copy or link in your autostart directory, and next login should create
your 3 terminals.