application startup on terminal/shell

Ralf Mardorf kde.lists at yahoo.com
Mon Oct 18 17:15:02 UTC 2021


On Mon, 18 Oct 2021 17:41:49 +0100, Zahid Rahman wrote:
>I want the neofetch app   to run every time I start a new terminal.
>
>I believe I am not supposed to use motd applications to run other
>applications,  motd is just for messages on terminal starting up.
>
>There is much material out there about starting applications on login
>etc. but not finding what I want.
>
>Can you please give me a how-to on what I want to do ?

Hi,

launch the terminal by a wrapper script.

First use dpkg-divert to rename the terminal binary from  terminal-name
to something else, for example rename it to  terminal-name.real .

sudo dpkg-divert --add --rename --divert /usr/bin/terminal-name.real /usr/bin/terminal-name

Then write a wrapper script using the original name, but maybe change
the path to  /usr/local/ , for example  /usr/local/bin/terminal-name .

Make the wrapper scrip executable by running

sudo chmod a+x /usr/local/bin/terminal-name

The wrapper script could be something similar to

#!/bin/bash

terminal-name.real "$@" & neofetch

exit


Regards,
Ralf




More information about the ubuntu-users mailing list