sskras / .files

Personal attempt at automating setup of a new home dir / managing dot-files in a cross-platform way.
Other
1 stars 0 forks source link

Use a prettier, more accurate OS name for directory to store a stock homedir files that are in conflict with us #7

Open sskras opened 3 months ago

sskras commented 3 months ago

Eg. on Void Linux the current solution generates:

root@void-g:~# echo `uname -o | sed 's|/|-|'`-`uname -r | sed 's|/|-|g'`
GNU-Linux-6.6.37_1

Using /etc/os-release might improve things nowadays:

root@void-g:~# lsb_release -d
Description:    Void Linux

root@void-g:~# lsb_release -a
LSB Version:    1.0
Distributor ID: VoidLinux
Description:    Void Linux
Release:        rolling
Codename:       void

root@void-g:~# . /etc/os-release 2>/dev/null && echo "$PRETTY_NAME"
Void Linux

root@void-g:~# cat /etc/os-release
NAME="Void"
ID="void"
PRETTY_NAME="Void Linux"
HOME_URL="https://voidlinux.org/"
DOCUMENTATION_URL="https://docs.voidlinux.org/"
LOGO="void-logo"
ANSI_COLOR="0;38;2;71;128;97"

DISTRIB_ID="void"
sskras commented 3 months ago

This might help too: https://stackoverflow.com/questions/394230/how-to-detect-the-os-from-a-bash-script

sskras commented 3 months ago

Documented in https://github.com/sskras/.files/compare/d8b8678...34923c1.