2022-06-14 00:34:22 +09:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
cd -- "$(dirname -- "$0")"
|
|
|
|
. ../mod.bash
|
2022-06-15 00:15:50 +09:00
|
|
|
|
|
|
|
function install_gsettings() {
|
|
|
|
local uid
|
|
|
|
local gsettings_file
|
|
|
|
local gsettings_dir
|
|
|
|
uid=${SUDO_UID:-$(id -u)}
|
|
|
|
gsettings_file=$1
|
|
|
|
gsettings_dir=$2
|
2023-12-29 23:51:50 +09:00
|
|
|
sudo <"$gsettings_file" --user="#$uid" \
|
2022-06-15 00:15:50 +09:00
|
|
|
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$uid/bus" \
|
|
|
|
dconf load "$gsettings_dir"
|
|
|
|
}
|
|
|
|
|
2024-08-30 20:27:28 +09:00
|
|
|
function install_fonts() {
|
2022-06-15 19:26:32 +09:00
|
|
|
local uid
|
|
|
|
local home
|
|
|
|
local fontconfig_dir
|
|
|
|
uid=${SUDO_UID:-$(id -u)}
|
|
|
|
home=$(eval "echo ~${SUDO_USER:-}")
|
|
|
|
fontconfig_dir="$home/.config/fontconfig/conf.d"
|
2024-08-30 20:27:28 +09:00
|
|
|
sudo --user="#$uid" mkdir -p "$fontconfig_dir"
|
2022-06-15 19:26:32 +09:00
|
|
|
sudo --user="#$uid" \
|
|
|
|
rsync -rv fontconfig/ "$fontconfig_dir/"
|
|
|
|
fc-cache
|
|
|
|
}
|
|
|
|
|
2023-12-29 23:57:15 +09:00
|
|
|
function install_environment_d() {
|
|
|
|
local home
|
|
|
|
local environment_d
|
|
|
|
home=$(eval "echo ~${SUDO_USER:-}")
|
|
|
|
environment_d=$(realpath environment.d)
|
|
|
|
(
|
|
|
|
cd -- "${home}/.config" || exit 1
|
|
|
|
ln -svf "$environment_d" .
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2023-12-29 23:51:50 +09:00
|
|
|
(($(id -u) == 0)) &&
|
|
|
|
[[ -f /etc/debian_version ]] &&
|
|
|
|
install_apt_packages
|
2022-06-14 23:09:44 +09:00
|
|
|
install_gsettings settings.ini /
|
|
|
|
install_gsettings terminal-settings.ini "/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')/"
|
2024-08-30 20:27:28 +09:00
|
|
|
install_fonts
|
2023-12-29 23:57:15 +09:00
|
|
|
install_environment_d
|