A
A
Alexander Semenenko2017-09-04 11:12:33
linux
Alexander Semenenko, 2017-09-04 11:12:33

How to launch a terminal when logging in, in which a certain command will be executed?

Good afternoon!
Is it possible to make it so that when the user logs in (XUbuntu 16.04), the user will open a terminal in which su name_user would immediately be executed and then the user would need to enter his password?
I managed the first part, in the system settings -> Sessions and startup -> Application Autostart. And there he added his application (terminal). This created the xfce4-terminal.desktop file in ~/.config/autostart . Then I placed this file in /etc/skel/.config/autostart/ - now any new user opens a terminal when he logs in.
How can I now execute the su $USER command in this terminal? Should the user enter their password?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Semenenko, 2017-09-04
@semenenko88

I solved the issue like this: I
wrote the following script
/usr/bin/term.sh
#!/bin/bash
xfce4-terminal -e "su $USER"
And placed the term.sh.desktop autorun script in /etc/skel/.config/ autostart/
[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=term.sh
Comment=
Exec=/usr/bin/term.sh
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false
Now my script is triggered for every new user. For users who were already in the system, you need to manually throw the autostart script in ~/.config/autostart/.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question