Skip to content

Set hostname according to full name

mawi requested to merge abdurahman.elmawi06/gnome-initial-setup:master into master

Solves #4. This code will set the hostname according the full name of the user. For example, if your name is "John Doe", the hostname will be set to "John's Computer [johns-computer]." The hostname is changed on the user creation screen when the 'next' button is pressed.

Example:

Screenshot_from_2022-06-01_00-54-30

Screenshot_from_2022-06-01_00-54-53

Screenshot_from_2022-06-01_00-55-10

My code may not be great as I am not native in C, so feel free to make improvements as you see fit.

Edit: I basically copied the code responsible for setting the hostname in gnome-control-center and just re-adapted it to fit this codebase. "hostname-helper.c" and "hostname-helper.h" were copied directly from gnome-control-center.

Edited by mawi

Merge request reports