How can I use "pretty hostname" from hostnamctl in my prompt?

I just changed my router, and I have now my router’s name as hostname. After a reboot, still there, and I don’t know how to change it.
Here is my prompt:

cat /etc/HOSTNAME

I don’t understand why the hostname command don’t print the value who is in the /etc/hostname file.

I’ve add a pretty hostname to test, like that:

hostnamectl set-hostname --pretty linux
hostnamectl status
Static hostname:
Transient hostname: Centro_grande
Pretty hostname: linux
Icon name: computer-desktop
echo $PS1

If I read the man page for hostnamectl, I found that:

This tool distinguishes three different host names: the high-level "pretty" hostname which might include all kinds of special characters (e.g. "Lennart's Laptop"), the static hostname which is used to initialize the kernel hostname at boot (e.g. "lennarts-laptop"), and the transient hostname which might be assigned temporarily due to network configuration and might revert back to the static hostname if network connectivity is lost and is only temporarily written to the kernel hostname (e.g. "dhcp-47-11").

So my hostname may change if my router is on or off. This is why I don’t want to change static and transient hostname. I just want to use the pretty one in my prompt.
If someone knows, I’ll be happy! If not, I’ll just change the PS1 value.
Thank you.

YaST > Network Devices > Network Settings.

There is the tab Hostname/DNS. There there is setting “Change Hostname through DHCP” (or similar wording). Is it off?

In yast, hostname is “linux-e0xk”, and “Change Hostname through DHCP” is selected as usual.
Thank you.

Well, and did you unselect it to see if it helps? Or are yo now just sitting staring at it? :wink:

Oops, I had misunderstood!
If I unselect it, no more trace of router’s name. :slight_smile:
Now I can choose a better hostname.
Thank you!

You are welcome.