Shell – Get default ubuntu motd in fish shell

fishmotdshell

I would like to have Ubuntu's MOTD in the fish shell.

Ubuntu's default is as follows:

Default Ubuntu MOTD

That is essentially what I would like to see when open up my terminal (terminator, which loads fishfish)
As far as I can make out (Based on the information here), the default shell executes pam_motd, which in turn executes a bunch of scripts from /etc/update-motd.d

I don't know how to do this in the fish shell with any confidence. I haven't been able to find any information by searching.

Cheers

Best Answer

Put this in your ~/.config/fish/config.fish:

function fish_greeting
  status --is-login
  if [ $status != 0 ] 
    cat /run/motd.dynamic
  end 
end

This will make sure that you don't get the double motd when logging in remotely.

Related Question