Add Clear Linux support

This commit is contained in:
Muhammad Rivan 2021-06-08 15:36:57 +07:00
parent fcf6495849
commit 34f55e206a
No known key found for this signature in database
GPG Key ID: C56A200FD936FAAA
2 changed files with 35 additions and 23 deletions

View File

@ -291,7 +291,18 @@ userify() {
write_as_root() {
trap true SIGINT
if ! echo "${1}" | sudo tee "${2}" > /dev/null; then
if ! echo -e "${1}" | sudo tee "${2}" > /dev/null; then
error_snippet="${*}"
operation_aborted
fi
trap signal_exit SIGINT
}
write_as_user() {
trap true SIGINT
if ! echo -e "${1}" | sudo -u "${MY_USERNAME}" tee "${2}" > /dev/null; then
error_snippet="${*}"
operation_aborted
fi

View File

@ -22,20 +22,20 @@ prepare_swupd() {
# for installing a util, e.g. 'sassc' (from 'desktop-dev' bundle, or
# 'os-utils-gui-dev' bundle, or any other 'sassc' provider bundle)
local repo="
[clearlinux]
name=clearlinux
baseurl=https://download.clearlinux.org/current/x86_64/os/
gpgcheck=0"
local repo="[clearlinux]\nname=Clear Linux\nbaseurl=https://download.clearlinux.org/current/x86_64/os/\ngpgcheck=0"
rootify swupd update && rootify swupd bundle-add dnf
rootify swupd update && rootify swupd bundle-add -y dnf
if [[ ! -d "/etc/yum.repos.d" ]]; then
rootify mkdir -p "/etc/yum.repos.d"
write_as_root "${repo}" "/etc/yum.repos.d/clearlinux.repo"
fi
rootify dnf upgrade
backup_file "/etc/os-release" "rootify"; rootify dnf upgrade
}
finalize_swupd() {
restore_file "/etc/os-release" "rootify"
}
prepare_xbps() {
@ -66,7 +66,7 @@ install_theme_deps() {
rootify zypper in -y sassc glib2-devel gtk2-engine-murrine libxml2-tools
elif has_command swupd; then
# Rolling release
prepare_swupd && rootify dnf install -y sassc glib-bin libxml2-bin
prepare_swupd && rootify dnf install -y sassc glib-bin libxml2-bin && finalize_swupd
elif has_command apt; then
rootify apt install -y sassc libglib2.0-dev-bin gtk2-engines-murrine libxml2-utils
elif has_command dnf; then
@ -98,7 +98,7 @@ install_beggy_deps() {
rootify zypper in -y ImageMagick
elif has_command swupd; then
# Rolling release
prepare_swupd && rootify dnf install -y ImageMagick
prepare_swupd && rootify dnf install -y ImageMagick && finalize_swupd
elif has_command apt; then
rootify apt install -y imagemagick
elif has_command dnf; then
@ -128,7 +128,7 @@ install_dialog_deps() {
rootify zypper in -y dialog
elif has_command swupd; then
# Rolling release
prepare_swupd && rootify dnf install -y dialog
prepare_swupd && rootify dnf install -y dialog && finalize_swupd
elif has_command apt; then
rootify apt install -y dialog
elif has_command dnf; then
@ -278,19 +278,20 @@ install_theemy() {
local TMP_DIR_F="${WHITESUR_TMP_DIR}/gtk-4.0${color}${opacity}${alt}${theme}"
mkdir -p "${TARGET_DIR}"
local desktop_entry="
[Desktop Entry]
Type=X-GNOME-Metatheme
Name=${name}${color}${opacity}${alt}${theme}
Comment=A MacOS BigSur like Gtk+ theme based on Elegant Design
Encoding=UTF-8
[X-GNOME-Metatheme]
GtkTheme=${name}${color}${opacity}${alt}${theme}
MetacityTheme=${name}${color}${opacity}${alt}${theme}
IconTheme=${name}${iconcolor}
CursorTheme=WhiteSur-cursors
ButtonLayout=close,minimize,maximize:menu"
local desktop_entry="[Desktop Entry]\n"
desktop_entry+="Type=X-GNOME-Metatheme\n"
desktop_entry+="Name=${name}${color}${opacity}${alt}${theme}\n"
desktop_entry+="Comment=A MacOS BigSur like Gtk+ theme based on Elegant Design\n"
desktop_entry+="Encoding=UTF-8\n\n"
desktop_entry+="[X-GNOME-Metatheme]\n"
desktop_entry+="GtkTheme=${name}${color}${opacity}${alt}${theme}\n"
desktop_entry+="MetacityTheme=${name}${color}${opacity}${alt}${theme}\n"
desktop_entry+="IconTheme=${name}${iconcolor}\n"
desktop_entry+="CursorTheme=WhiteSur-cursors\n"
desktop_entry+="ButtonLayout=close,minimize,maximize:menu\n"
echo "${desktop_entry}" > "${TARGET_DIR}/index.theme"
#--------------------GTK-3.0--------------------#