diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-29 10:42:29 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-29 10:42:29 +0200 |
| commit | 4645998b64815d15aef6efe00dcbdfc4a045359e (patch) | |
| tree | 89665a54e8afcfc63c6ec4749c041d440432eaa6 /install.sh | |
| parent | dab41433688ff2247020d7a6fe12ac2140a75fb5 (diff) | |
| download | unified-desktop-theme-4645998b64815d15aef6efe00dcbdfc4a045359e.tar.gz unified-desktop-theme-4645998b64815d15aef6efe00dcbdfc4a045359e.zip | |
feat(bin): udt-machine-name writes PRETTY_HOSTNAME to /etc/machine-info
The GRUB theme titles its panel with the machine's pretty name, and on
Slackware nothing writes /etc/machine-info: hostnamectl is systemd's. This
sets the one key, keeping any others, and with no argument prints it.
The value is double-quoted with only \ and " escaped, the escapes systemd's
reader and the GRUB build's shlex agree on; control characters are refused.
It needs root and is never run by install.sh, which only suggests it in the
GRUB output while no name is set. tests/machine-name.sh checks the quoting
round-trip against shlex.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'install.sh')
| -rwxr-xr-x | install.sh | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -104,7 +104,7 @@ ln -sfn "$HOME/.cache/udt/colors.json" "$HOME/.cache/wal/colors.json" # The rofi menus are bound by name in hypr-theme's keybindings, so they keep # the names they had when they lived loose in ~/bin. -for f in udt-accent udt-palette udt-powermenu.sh udt-launcher.sh qar-scrotmenu.sh; do +for f in udt-accent udt-palette udt-machine-name udt-powermenu.sh udt-launcher.sh qar-scrotmenu.sh; do ln -sfn "$repo/bin/$f" "$HOME/bin/$f" done @@ -352,6 +352,9 @@ if [ -x "$grub_repo/build" ]; then echo " rm -rf /boot/grub/themes/udt && cp -r \"$grub_repo/dist/udt\" /boot/grub/themes/" echo " # once: GRUB_THEME=\"/boot/grub/themes/udt/theme.txt\" in /etc/default/grub, then" echo " grub-mkconfig -o /boot/grub/grub.cfg" + # The panel title falls back to the OS name until one is set. + [ -n "$("$repo/bin/udt-machine-name")" ] || \ + echo " # optional, the panel title: sudo \"$repo/bin/udt-machine-name\" \"My Machine\"" else echo "grub: its build failed, theme not refreshed" >&2 fi |
