summaryrefslogtreecommitdiff
path: root/raveos-gnome-theme/raveos-gnome-apply.sh
diff options
context:
space:
mode:
Diffstat (limited to 'raveos-gnome-theme/raveos-gnome-apply.sh')
-rwxr-xr-xraveos-gnome-theme/raveos-gnome-apply.sh223
1 files changed, 58 insertions, 165 deletions
diff --git a/raveos-gnome-theme/raveos-gnome-apply.sh b/raveos-gnome-theme/raveos-gnome-apply.sh
index 324e988..31b3896 100755
--- a/raveos-gnome-theme/raveos-gnome-apply.sh
+++ b/raveos-gnome-theme/raveos-gnome-apply.sh
@@ -1,20 +1,9 @@
#!/usr/bin/env bash
-# raveos-gnome-apply.sh
-# ---------------------
-# Telepíti a GNOME téma payloadját:
-# - /etc/skel alá (új usereknek)
-# - minden meglévő, bejelentkező user home-jába
-#
-# Root jogosultság szükséges. A raveos-gnome-theme.install post_install
-# hook-ja hívja közvetlenül.
set -euo pipefail
PAYLOAD="/usr/share/raveos/gnome-theme/theme-data"
wallpaper_dst="/usr/share/backgrounds/raveos/raveos-main-bg.jpeg"
-dconf_profile_dir="/etc/dconf/profile"
-dconf_db_dir="/etc/dconf/db/local.d"
-dconf_default_file="${dconf_db_dir}/00-raveos"
if [[ ! -d "$PAYLOAD" ]]; then
echo "Hiba: hiányzó payload: $PAYLOAD" >&2
@@ -26,10 +15,6 @@ if [[ ${EUID} -ne 0 ]]; then
exit 1
fi
-# ---------------------------------------------------------------------------
-# SEGÉDFÜGGVÉNYEK
-# ---------------------------------------------------------------------------
-
ensure_bashrc_hook() {
local bashrc_path="$1"
local hook_line='[[ -f /etc/profile.d/raveos-fastfetch.sh ]] && source /etc/profile.d/raveos-fastfetch.sh'
@@ -42,7 +27,7 @@ ensure_bashrc_hook() {
write_mimeapps_defaults() {
local mimeapps_path="$1"
mkdir -p "$(dirname "$mimeapps_path")"
- cat > "$mimeapps_path" <<'EOF'
+ cat > "$mimeapps_path" <<'MIMEOF'
[Default Applications]
image/jpeg=org.gnome.eog.desktop
image/png=org.gnome.eog.desktop
@@ -53,180 +38,88 @@ image/tiff=org.gnome.eog.desktop
image/avif=org.gnome.eog.desktop
image/heif=org.gnome.eog.desktop
image/heic=org.gnome.eog.desktop
-EOF
-}
-
-build_system_dconf_defaults() {
- sed -e "s|file:///home/{HOME}/.config/background|file://${wallpaper_dst}|g" \
- "${PAYLOAD}/dconf/full-system-dump.ini" > "$dconf_default_file"
-}
-
-build_user_dconf_dump() {
- local target_home="$1"
- local output_path="$2"
- sed \
- -e "s|file:///home/{HOME}/.config/background|file://${target_home}/.config/background|g" \
- -e "s|{HOME}|${target_home}|g" \
- "${PAYLOAD}/dconf/full-system-dump.ini" > "$output_path"
+MIMEOF
}
-# ---------------------------------------------------------------------------
-# RENDSZERSZINTŰ TELEPÍTÉS
-# ---------------------------------------------------------------------------
-
-# Háttérkép rendszerkönyvtárba
-install -Dm644 "${PAYLOAD}/background" "$wallpaper_dst"
-
-# App grid ikon és rendszer logo
-[[ -f "${PAYLOAD}/icons/view-app-grid-symbolic.svg" ]] && \
- install -Dm644 "${PAYLOAD}/icons/view-app-grid-symbolic.svg" \
- /usr/share/icons/Adwaita/symbolic/actions/view-app-grid-symbolic.svg
-[[ -f "${PAYLOAD}/system/raveos-logo.svg" ]] && \
- install -Dm644 "${PAYLOAD}/system/raveos-logo.svg" /usr/share/pixmaps/raveos-logo.svg && \
- install -Dm644 "${PAYLOAD}/system/raveos-logo.svg" /usr/share/icons/hicolor/scalable/apps/raveos-logo.svg
-
-# Elrejtett alkalmazások (NoDisplay=true .desktop felülírással)
mkdir -p /usr/local/share/applications
for desktop_id in avahi-discover.desktop bssh.desktop bvnc.desktop qv4l2.desktop qvidcap.desktop vim.desktop; do
- cat > "/usr/local/share/applications/${desktop_id}" <<'EOF'
+ cat > "/usr/local/share/applications/${desktop_id}" <<'DESKEOF'
[Desktop Entry]
NoDisplay=true
-EOF
+DESKEOF
done
-# dconf rendszerprofil és alapértelmezések
-mkdir -p "$dconf_profile_dir" "$dconf_db_dir"
-cat > "${dconf_profile_dir}/user" <<'EOF'
-user-db:user
-system-db:local
-EOF
-build_system_dconf_defaults
+if [[ -f "${PAYLOAD}/icons/view-app-grid-symbolic.svg" ]]; then
+ install -Dm644 "${PAYLOAD}/icons/view-app-grid-symbolic.svg" \
+ /usr/share/icons/Adwaita/symbolic/actions/view-app-grid-symbolic.svg
+fi
+
command -v dconf &>/dev/null && dconf update || true
+command -v glib-compile-schemas &>/dev/null && glib-compile-schemas /usr/share/glib-2.0/schemas || true
-# SDDM: a téma és konfig a PKGBUILD + .install hook által van telepítve, itt nincs teendő
+mkdir -p \
+ /etc/skel/.config/kitty \
+ /etc/skel/.config/fastfetch \
+ /etc/skel/.config/burn-my-windows/profiles \
+ /etc/skel/.config/raveos
-# ---------------------------------------------------------------------------
-# MEGLÉVŐ USEREK FRISSÍTÉSE
-# /etc/passwd alapján minden UID >= 1000 bejelentkező user home-ja
-# ---------------------------------------------------------------------------
+[[ -f "${PAYLOAD}/kitty/kitty.conf" ]] && \
+ install -Dm644 "${PAYLOAD}/kitty/kitty.conf" /etc/skel/.config/kitty/kitty.conf
-install_user() {
- local target_user="$1"
- local passwd_line target_uid target_gid target_home tmpdir
+for f in config.jsonc config-kitty.jsonc raveos-logo.png raveos-logo.txt; do
+ [[ -f "${PAYLOAD}/fastfetch/${f}" ]] && \
+ install -Dm644 "${PAYLOAD}/fastfetch/${f}" "/etc/skel/.config/fastfetch/${f}"
+done
- passwd_line="$(getent passwd "$target_user" || true)"
- [[ -n "$passwd_line" ]] || return 0
- IFS=: read -r _ _ target_uid target_gid _ target_home _ <<<"$passwd_line"
- [[ -d "$target_home" ]] || return 0
+[[ -f "${PAYLOAD}/burn-my-windows/burn-my-windows.conf" ]] && \
+ install -Dm644 "${PAYLOAD}/burn-my-windows/burn-my-windows.conf" \
+ /etc/skel/.config/burn-my-windows/profiles/burn-my-windows.conf
- mkdir -p \
- "${target_home}/.config/kitty" \
- "${target_home}/.config/fastfetch" \
- "${target_home}/.config/burn-my-windows/profiles" \
- "${target_home}/.config" \
- "${target_home}/.themes" \
- "${target_home}/.icons" \
- "${target_home}/.local/share/gnome-shell/extensions"
+write_mimeapps_defaults /etc/skel/.config/mimeapps.list
+ensure_bashrc_hook /etc/skel/.bashrc
+echo "1" > /etc/skel/.config/raveos/gnome-migrated
- install -Dm644 "$wallpaper_dst" "${target_home}/.config/background"
- cp -r --no-preserve=ownership "${PAYLOAD}/user-themes/." "${target_home}/.themes/"
- cp -r --no-preserve=ownership "${PAYLOAD}/user-icons/." "${target_home}/.icons/"
- cp -r --no-preserve=ownership "${PAYLOAD}/extensions/installed/." \
- "${target_home}/.local/share/gnome-shell/extensions/"
+while IFS=: read -r user _ uid gid _ home shell; do
+ [[ "$uid" -ge 1000 ]] || continue
+ [[ -d "$home" ]] || continue
+ [[ "$shell" != "/usr/bin/nologin" && "$shell" != "/bin/false" ]] || continue
- [[ -f "${PAYLOAD}/kitty/kitty.conf" ]] && \
- install -Dm644 "${PAYLOAD}/kitty/kitty.conf" "${target_home}/.config/kitty/kitty.conf"
- for f in config.jsonc config-kitty.jsonc raveos-logo.png raveos-logo.txt; do
- [[ -f "${PAYLOAD}/fastfetch/${f}" ]] && \
- install -Dm644 "${PAYLOAD}/fastfetch/${f}" "${target_home}/.config/fastfetch/${f}"
- done
- [[ -f "${PAYLOAD}/burn-my-windows/burn-my-windows.conf" ]] && \
- install -Dm644 "${PAYLOAD}/burn-my-windows/burn-my-windows.conf" \
- "${target_home}/.config/burn-my-windows/profiles/burn-my-windows.conf"
- write_mimeapps_defaults "${target_home}/.config/mimeapps.list"
- ensure_bashrc_hook "${target_home}/.bashrc"
+ mkdir -p \
+ "${home}/.config/kitty" \
+ "${home}/.config/fastfetch" \
+ "${home}/.config/burn-my-windows/profiles" \
+ "${home}/.config/raveos"
- if command -v glib-compile-schemas &>/dev/null; then
- find "${target_home}/.local/share/gnome-shell/extensions" -type d -name schemas -print0 | \
- while IFS= read -r -d '' schema_dir; do
- glib-compile-schemas "$schema_dir"
- done
+ if [[ ! -f "${home}/.config/kitty/kitty.conf" && -f "${PAYLOAD}/kitty/kitty.conf" ]]; then
+ install -Dm644 "${PAYLOAD}/kitty/kitty.conf" "${home}/.config/kitty/kitty.conf"
fi
- tmpdir="$(mktemp -d)"
- chmod 755 "$tmpdir"
- build_user_dconf_dump "${target_home}" "${tmpdir}/full-system-dump.ini"
- chmod 644 "${tmpdir}/full-system-dump.ini"
+ for f in config.jsonc config-kitty.jsonc raveos-logo.png raveos-logo.txt; do
+ if [[ ! -f "${home}/.config/fastfetch/${f}" && -f "${PAYLOAD}/fastfetch/${f}" ]]; then
+ install -Dm644 "${PAYLOAD}/fastfetch/${f}" "${home}/.config/fastfetch/${f}"
+ fi
+ done
- # A Calamares keyboard modul altal beallitott kiosztas kiolvasasa
- # (a rendszerszintu konfig /etc/default/keyboard-ba kerult, de a GNOME
- # Wayland a sajat org.gnome.desktop.input-sources-t hasznalja).
- local kb_layout="hu"
- if [[ -f /etc/default/keyboard ]]; then
- local kb_tmp
- kb_tmp="$(awk -F'"' '/^XKBLAYOUT=/{print $2; exit}' /etc/default/keyboard 2>/dev/null)"
- [[ -n "$kb_tmp" ]] && kb_layout="${kb_tmp%%,*}"
+ if [[ ! -f "${home}/.config/burn-my-windows/profiles/burn-my-windows.conf" && -f "${PAYLOAD}/burn-my-windows/burn-my-windows.conf" ]]; then
+ install -Dm644 "${PAYLOAD}/burn-my-windows/burn-my-windows.conf" \
+ "${home}/.config/burn-my-windows/profiles/burn-my-windows.conf"
fi
- if command -v dconf &>/dev/null && command -v dbus-run-session &>/dev/null; then
- runuser -u "$target_user" -- env \
- HOME="${target_home}" USER="${target_user}" LOGNAME="${target_user}" \
- XDG_CONFIG_HOME="${target_home}/.config" XDG_DATA_HOME="${target_home}/.local/share" \
- dbus-run-session /bin/bash -lc "
- dconf load / < '${tmpdir}/full-system-dump.ini' || true
- gsettings set org.gnome.desktop.interface gtk-theme 'Yaru-olive-dark' || true
- gsettings set org.gnome.desktop.interface icon-theme 'Adwaitaru-olive' || true
- gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' || true
- gsettings set org.gnome.desktop.background picture-uri 'file://${target_home}/.config/background' || true
- gsettings set org.gnome.desktop.background picture-uri-dark 'file://${target_home}/.config/background' || true
- gsettings set org.gnome.shell.extensions.user-theme name 'Yaru-olive-dark' || true
- gsettings set org.gnome.desktop.input-sources sources \"[('xkb', '${kb_layout}')]\" || true
- " </dev/null >/dev/null 2>&1 || true
+ if [[ ! -f "${home}/.config/mimeapps.list" ]]; then
+ write_mimeapps_defaults "${home}/.config/mimeapps.list"
fi
- rm -rf "$tmpdir"
+ ensure_bashrc_hook "${home}/.bashrc"
+ echo "1" > "${home}/.config/raveos/gnome-migrated"
- chown -R "${target_uid}:${target_gid}" \
- "${target_home}/.config" "${target_home}/.local" \
- "${target_home}/.themes" "${target_home}/.icons" "${target_home}/.bashrc"
-}
+ chown "${uid}:${gid}" "${home}/.config" "${home}/.config/mimeapps.list" 2>/dev/null || true
+ chown -R "${uid}:${gid}" \
+ "${home}/.config/kitty" \
+ "${home}/.config/fastfetch" \
+ "${home}/.config/burn-my-windows" \
+ "${home}/.config/raveos" \
+ "${home}/.bashrc" 2>/dev/null || true
-while IFS=: read -r user _ uid _ _ home shell; do
- [[ "$uid" -ge 1000 ]] || continue
- [[ -d "$home" ]] || continue
- [[ "$shell" != "/usr/bin/nologin" && "$shell" != "/bin/false" ]] || continue
- install_user "$user"
done < /etc/passwd
-# ---------------------------------------------------------------------------
-# SKEL TELEPÍTÉS
-# Új usereknek (useradd által másolt /etc/skel tartalom)
-# ---------------------------------------------------------------------------
-
-mkdir -p \
- /etc/skel/.config/kitty \
- /etc/skel/.config/fastfetch \
- /etc/skel/.config/burn-my-windows/profiles \
- /etc/skel/.themes \
- /etc/skel/.icons \
- /etc/skel/.local/share/gnome-shell/extensions
-
-cp -r --no-preserve=ownership "${PAYLOAD}/user-themes/." /etc/skel/.themes/
-cp -r --no-preserve=ownership "${PAYLOAD}/user-icons/." /etc/skel/.icons/
-cp -r --no-preserve=ownership "${PAYLOAD}/extensions/installed/." /etc/skel/.local/share/gnome-shell/extensions/
-install -Dm644 "$wallpaper_dst" /etc/skel/.config/background
-[[ -f "${PAYLOAD}/kitty/kitty.conf" ]] && \
- install -Dm644 "${PAYLOAD}/kitty/kitty.conf" /etc/skel/.config/kitty/kitty.conf
-for f in config.jsonc config-kitty.jsonc raveos-logo.png raveos-logo.txt; do
- [[ -f "${PAYLOAD}/fastfetch/${f}" ]] && \
- install -Dm644 "${PAYLOAD}/fastfetch/${f}" "/etc/skel/.config/fastfetch/${f}"
-done
-[[ -f "${PAYLOAD}/profile.d/raveos-fastfetch.sh" ]] && \
- install -Dm755 "${PAYLOAD}/profile.d/raveos-fastfetch.sh" /etc/profile.d/raveos-fastfetch.sh
-[[ -f "${PAYLOAD}/burn-my-windows/burn-my-windows.conf" ]] && \
- install -Dm644 "${PAYLOAD}/burn-my-windows/burn-my-windows.conf" \
- /etc/skel/.config/burn-my-windows/profiles/burn-my-windows.conf
-write_mimeapps_defaults /etc/skel/.config/mimeapps.list
-ensure_bashrc_hook /etc/skel/.bashrc
-
-echo "Telepítés kész."
+echo "RaveOS GNOME beállítás sikeresen alkalmazva."