Merge tag 'epoch-1.7.0' into local/yoda-main
Epoch 1.7.0
This commit is contained in:
commit
e1d2eb535b
1 changed files with 17 additions and 21 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
@ -23,8 +23,8 @@ fi
|
||||||
if [ -n "${SHELL}" ]; then
|
if [ -n "${SHELL}" ]; then
|
||||||
# --in-login-shell: our flag to indicate that we don't need to recurse any further
|
# --in-login-shell: our flag to indicate that we don't need to recurse any further
|
||||||
if [ "${1}" != "--in-login-shell" ]; then
|
if [ "${1}" != "--in-login-shell" ]; then
|
||||||
# `exec -l`: like `login`, prefixes $SHELL with a hyphen to start a login shell
|
# `-l`: start $SHELL as a login shell so it sources the user's profile.
|
||||||
exec bash -c "exec -l '${SHELL}' -c '${0} --in-login-shell'"
|
exec "${SHELL}" -l -c "'${0}' --in-login-shell"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@ export DCONF_PROFILE=cosmic
|
||||||
# Set the QT platform theme to CuteCosmic. Fallback to qt6ct if CuteCosmic is not installed.
|
# Set the QT platform theme to CuteCosmic. Fallback to qt6ct if CuteCosmic is not installed.
|
||||||
if [ -z "$QT_QPA_PLATFORMTHEME" ]; then
|
if [ -z "$QT_QPA_PLATFORMTHEME" ]; then
|
||||||
export QT_QPA_PLATFORMTHEME=cosmic
|
export QT_QPA_PLATFORMTHEME=cosmic
|
||||||
for QT_PLUGIN_PATH in /usr/lib{*,/*}/qt6/plugins; do
|
for QT_PLUGIN_PATH in /usr/lib*/qt6/plugins /usr/lib/*/qt6/plugins; do
|
||||||
if [ -f "${QT_PLUGIN_PATH}/platformthemes/libcutecosmictheme.so" ]; then
|
if [ -f "${QT_PLUGIN_PATH}/platformthemes/libcutecosmictheme.so" ]; then
|
||||||
# CuteCosmic found, no need for a fallback.
|
# CuteCosmic found, no need for a fallback.
|
||||||
export QT_QPA_PLATFORMTHEME=cosmic
|
export QT_QPA_PLATFORMTHEME=cosmic
|
||||||
|
|
@ -56,8 +56,8 @@ if [ -z "$QT_QPA_PLATFORMTHEME" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start gnome keyring components if the daemon is active
|
# Start gnome keyring components if the daemon is active
|
||||||
# -> check if /run/user/$UID/keyring exists
|
# -> check if $XDG_RUNTIME_DIR/keyring exists
|
||||||
if [ -d "/run/user/$(id -u)/keyring" ]; then
|
if [ -d "$XDG_RUNTIME_DIR/keyring" ]; then
|
||||||
|
|
||||||
# Use PATH lookup instead of hardcoding /usr/bin
|
# Use PATH lookup instead of hardcoding /usr/bin
|
||||||
if command -v gnome-keyring-daemon >/dev/null 2>&1; then
|
if command -v gnome-keyring-daemon >/dev/null 2>&1; then
|
||||||
|
|
@ -69,10 +69,10 @@ if [ -d "/run/user/$(id -u)/keyring" ]; then
|
||||||
# Only set SSH_AUTH_SOCK if the socket actually exists. Either
|
# Only set SSH_AUTH_SOCK if the socket actually exists. Either
|
||||||
# set the correct one, or don't set one at all. Don't set the
|
# set the correct one, or don't set one at all. Don't set the
|
||||||
# wrong value.
|
# wrong value.
|
||||||
if [ -S "/run/user/$(id -u)/gcr/ssh" ]; then
|
if [ -S "$XDG_RUNTIME_DIR/gcr/ssh" ]; then
|
||||||
export SSH_AUTH_SOCK="/run/user/$(id -u)/gcr/ssh"
|
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
|
||||||
elif [ -S "/run/user/$(id -u)/keyring/ssh" ]; then
|
elif [ -S "$XDG_RUNTIME_DIR/keyring/ssh" ]; then
|
||||||
export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh"
|
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/keyring/ssh"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -84,30 +84,26 @@ if command -v systemctl >/dev/null; then
|
||||||
# For environment variables already imported into the user's
|
# For environment variables already imported into the user's
|
||||||
# session, if the value imported differs from the value in this
|
# session, if the value imported differs from the value in this
|
||||||
# environment, update it.
|
# environment, update it.
|
||||||
mapfile -t existing_env_vars < <(systemctl --user show-environment)
|
systemctl --user show-environment | while IFS= read -r env_var; do
|
||||||
for env_var in "${existing_env_vars[@]}"; do
|
|
||||||
env_var_name="${env_var%%=*}"
|
env_var_name="${env_var%%=*}"
|
||||||
env_var_value=${!env_var_name:-}
|
env_var_value="$(printenv "${env_var_name}" || true)"
|
||||||
|
|
||||||
# Skip current iteration if the environment variable's value
|
# Skip current iteration if the environment variable's value
|
||||||
# in the current envionment is unset.
|
# in the current envionment is unset.
|
||||||
if [[ -z "${env_var_value}" ]]; then
|
if [ -z "${env_var_value}" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
env_var_val_str_to_compare="${env_var_name}=${env_var_value}"
|
# Skip updating variables where systemd already holds this exact value.
|
||||||
env_var_val_str_to_compare_ansi_c_quoted="${env_var_name}=\$'$(printf '%q' "${env_var_value}")'"
|
if [ "${env_var}" = "${env_var_name}=${env_var_value}" ]; then
|
||||||
if [[ "${env_var}" == "${env_var_val_str_to_compare}" ]]; then
|
|
||||||
continue
|
|
||||||
elif [[ "${env_var}" == "${env_var_val_str_to_compare_ansi_c_quoted}" ]]; then
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
systemctl --user import-environment "${env_var_name}" ||:
|
systemctl --user import-environment "${env_var_name}" || true
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run cosmic-session
|
# Run cosmic-session
|
||||||
if [[ -z "${DBUS_SESSION_BUS_ADDRESS}" ]]; then
|
if [ -z "${DBUS_SESSION_BUS_ADDRESS}" ]; then
|
||||||
exec /usr/bin/dbus-run-session -- /usr/bin/cosmic-session
|
exec /usr/bin/dbus-run-session -- /usr/bin/cosmic-session
|
||||||
else
|
else
|
||||||
exec /usr/bin/cosmic-session
|
exec /usr/bin/cosmic-session
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue