2

I am able to login automatically into Debian. I changed the /etc/gdm3daemon.conf file to do so. What I'm having trouble doing now is getting the terminal window to appear after the login. I need to launch a terminal window and run a command to change the directory and then execute a shell file. I have a hacky work around where I save the state of the desktop, and in the /etc/bash.bashrc file, I added cd and ./ commands

I want a cleaner way of doing these operations because next I will need to have a sort of splash screen cover up the GRUB initialization and have my program launch from the CLI as opposed to a GUI.

  • Umm, iwhat terminal window? What desktop environment or window manager? What command do you need to run? What exactly do you want? Simply that a terminal window appears each time you log in? – terdon Jan 4 '14 at 0:14
  • yes, I assumed you're using GNOME - since that's the Debian default - but please correct me if that's wrong – strugee Jan 4 '14 at 0:17
  • yes, gnome is what is being used – fifamaniac04 Jan 4 '14 at 0:20
  • From your question you ask how to get a graphical terminal window, running bash. However you also suggest this is to aid automation. It will not, the terminal is for human interaction. If you just want to run a script then ask for that. If you want to run a script and display the output in a terminal then ask for that. If you want to run a program in a terminal then ask for that. As it is I can not work out which you are asking for. Then there is the bit about grub, I really am lost now. Please explain what you are trying to do. – ctrl-alt-delor Apr 8 '17 at 18:07
  • If you want to not have a GUI, then no amount of configuring the GUI will help. Instead disable the GUI. – ctrl-alt-delor Apr 8 '17 at 18:07
2

So, you need gnome-terminal to run only upon graphical login?

Linux desktop environments like Gnome (2,3) and KDE agreed about a standard way to configure autostart of applications: https://developer.gnome.org/autostart-spec/

Basically, you have to create a .desktop file in one of so-called XDG directories to run your application per-user or per-system. Here's XDG directories specification. For instance, if you want a per-user autostart file, you may create a file /home/fifamaniac04/.config/autostart/terminal.desktop with the following content:

[Desktop Entry]
Type=Application
Name=Terminal
Exec=gnome-terminal
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true

The full specification of .desktop file format and options is here.

Alternatively, you can use GUI program Startup Applications in Gnome menu to create .desktop files automatically. I have it in Applications -> System Tools -> Preferences -> Startup Applications.

Also, see:

1

This is an extension to the excellent directions on this page by Boris Burkov (Jan 4, 2014)

If you are using the latest Kali Linux (Gnome 3.22.2, Kali GNU/Linux Rolling 64-bit) you may find that once you create the autostart folder and place your script there that the script still doesn't start on login, reboot or startup.

I found a simple fix for this that you can use. Select the Tweak Tool, go to the Power tab, and under the setting for "When Laptop Lid is Closed" set "Don't suspend on lid close" to "Enabled" (the default is disabled).

This will place a file in the autostart folder (ignore-lid-switch-tweak.desktop) and it will also enable any other autostart files in this folder. Once you restart your session your terminal session will open automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.