Update 3 files
- /home/.chezmoiscripts/universal/run_onchange_after_70-misc-bug-fixes.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_25-gnome-extension-settings.tmpl - /software.yml
This commit is contained in:
parent
bbea4437bc
commit
2bdaa2f077
3 changed files with 34 additions and 17 deletions
|
@ -11,16 +11,25 @@ if [ -f /tmp/install-gnome-extensions.txt ]; then
|
||||||
rm -f /tmp/install-gnome-extensions.txt
|
rm -f /tmp/install-gnome-extensions.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
### Register temporary file for gnome.yml JSON
|
||||||
|
if [ -f "$HOME/.config/desktop/gnome.yml" ]; then
|
||||||
|
TMP_YQ="$(mktemp)"
|
||||||
|
cat "$HOME/.config/desktop/gnome.yml" | yq e -o=j '.' > "$TMP_YQ"
|
||||||
|
fi
|
||||||
|
|
||||||
### Populate /tmp/install-gnome-extensions.txt with GNOME extensions that need to be installed
|
### Populate /tmp/install-gnome-extensions.txt with GNOME extensions that need to be installed
|
||||||
if [ -f "$HOME/.config/desktop/gnome.yml" ]; then
|
if [ -f "$HOME/.config/desktop/gnome.yml" ]; then
|
||||||
cat "$HOME/.config/desktop/gnome.yml" | yq e -o=j '.' | jq -cr '.default_gnome_extensions[] | tojson' | while read EXT; do
|
cat "$TMP_YQ" | jq -c '.default_gnome_extensions[] | tojson' | while read EXT; do
|
||||||
EXT_URL="$(echo "$EXT" | jq -r '.url')"
|
TMP="$(mktemp)"
|
||||||
EXT_ID="$(echo "$EXT" | jq -r '.regex')"
|
echo "$EXT" | sed 's/^.\(.*\).$/\1/' > "$TMP"
|
||||||
|
EXT_URL="$(cat "$TMP" | jq -r '.url')"
|
||||||
|
EXT_ID="$(cat "$TMP" | jq -r '.regex')"
|
||||||
echo "$EXT_URL" >> /tmp/install-gnome-extensions.txt
|
echo "$EXT_URL" >> /tmp/install-gnome-extensions.txt
|
||||||
find "$XDG_DATA_DIR/gnome-shell/extensions" -mindepth 1 -maxdepth 1 -type d | while read EXT_FOLDER; do
|
find "${XDG_DATA_HOME:-$HOME/.local/share}/gnome-shell/extensions" -mindepth 1 -maxdepth 1 -type d | while read EXT_FOLDER; do
|
||||||
if [[ "$EXT_FOLDER" == "$EXT_REGEX"* ]]; then
|
if [[ "$EXT_FOLDER" == *"$EXT_ID"* ]] && [ -f /tmp/install-gnome-extensions.txt ]; then
|
||||||
|
TMP_EXT="$(mktemp)"
|
||||||
head -n -1 /tmp/install-gnome-extensions.txt > "$TMP_EXT"
|
head -n -1 /tmp/install-gnome-extensions.txt > "$TMP_EXT"
|
||||||
mv "$TMP_EXT" /tmp/install-gnome-extensions.txt
|
mv -f "$TMP_EXT" /tmp/install-gnome-extensions.txt > /dev/null
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
@ -28,6 +37,11 @@ else
|
||||||
logg warn 'The `~/.config/desktop/gnome.yml` file is missing so GNOME extension install orders cannot be calculated'
|
logg warn 'The `~/.config/desktop/gnome.yml` file is missing so GNOME extension install orders cannot be calculated'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
### Remove /tmp/install-gnome-extensions.txt if it is empty
|
||||||
|
if [ "$(cat /tmp/install-gnome-extensions.txt)" == "" ]; then
|
||||||
|
rm -f /tmp/install-gnome-extensions.txt > /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
### Install the GNOME extensions using the `install-gnome-extensions` script
|
### Install the GNOME extensions using the `install-gnome-extensions` script
|
||||||
if command -v install-gnome-extensions > /dev/null; then
|
if command -v install-gnome-extensions > /dev/null; then
|
||||||
if [ -f /tmp/install-gnome-extensions.txt ]; then
|
if [ -f /tmp/install-gnome-extensions.txt ]; then
|
||||||
|
@ -43,22 +57,25 @@ fi
|
||||||
|
|
||||||
### Apply plugin gsettings
|
### Apply plugin gsettings
|
||||||
if [ -f "$HOME/.config/desktop/gnome.yml" ]; then
|
if [ -f "$HOME/.config/desktop/gnome.yml" ]; then
|
||||||
cat "$HOME/.config/desktop/gnome.yml" | yq e -o=j '.' | jq -cr '.default_gnome_extensions[] | tojson' | while read EXT; do
|
cat "$TMP_YQ" | jq -c '.default_gnome_extensions[] | tojson' | while read EXT; do
|
||||||
if [ "$DEBUG_MODE" == 'true' ]; then
|
if [ "$DEBUG_MODE" == 'true' ]; then
|
||||||
logg info 'Extension data:'
|
logg info 'Extension data:'
|
||||||
echo "$EXT"
|
echo "$EXT"
|
||||||
fi
|
fi
|
||||||
EXT_ID="$(echo "$EXT" | jq -r '.regex')"
|
TMP="$(mktemp)"
|
||||||
|
echo "$EXT" | sed 's/^.\(.*\).$/\1/' > "$TMP"
|
||||||
|
EXT_URL="$(cat "$TMP" | jq -r '.url')"
|
||||||
|
EXT_ID="$(cat "$TMP" | jq -r '.regex')"
|
||||||
if [ "$DEBUG_MODE" == 'true' ]; then
|
if [ "$DEBUG_MODE" == 'true' ]; then
|
||||||
logg info 'Extension ID:'
|
logg info 'Extension ID:'
|
||||||
echo "$EXT_ID"
|
echo "$EXT_ID"
|
||||||
fi
|
fi
|
||||||
EXT_SETTINGS_TYPE="$(echo "$EXT" | jq -r '.settings | type')"
|
EXT_SETTINGS_TYPE="$(cat "$TMP" | jq -r '.settings | type')"
|
||||||
EXT_SETTINGS="$(echo "$EXT" | jq -r '.settings')"
|
EXT_SETTINGS="$(cat "$TMP" | jq -r '.settings')"
|
||||||
if [ "$EXT_SETTINGS" != 'null' ]; then
|
if [ "$EXT_SETTINGS" != 'null' ]; then
|
||||||
logg info 'Evaluating extension settings'
|
logg info 'Evaluating extension settings'
|
||||||
if [ "$EXT_SETTINGS_TYPE" == 'array' ]; then
|
if [ "$EXT_SETTINGS_TYPE" == 'array' ]; then
|
||||||
echo "$EXT_SETTINGS" | jq -cr '.[]' | while read EXT_SETTING; do
|
cat "$TMP" | jq -r '.settings[]' | while read EXT_SETTING; do
|
||||||
logg info 'Applying following extension setting:'
|
logg info 'Applying following extension setting:'
|
||||||
echo "$EXT_SETTING"
|
echo "$EXT_SETTING"
|
||||||
eval "$EXT_SETTING"
|
eval "$EXT_SETTING"
|
||||||
|
|
|
@ -31,12 +31,12 @@ fi
|
||||||
|
|
||||||
### Move ~/.gnome/apps/* to ~/.local/share/applications
|
### Move ~/.gnome/apps/* to ~/.local/share/applications
|
||||||
if [ -d "$HOME/gnome/apps" ]; then
|
if [ -d "$HOME/gnome/apps" ]; then
|
||||||
if [ ! -d "${XDG_DATA_DIR:-$HOME/.local/share}/applications" ]; then
|
if [ ! -d "${XDG_DATA_HOME:-$HOME/.local/share}/applications" ]; then
|
||||||
mkdir -p "${XDG_DATA_DIR:-$HOME/.local/share}/applications"
|
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/applications"
|
||||||
fi
|
fi
|
||||||
find "$HOME/gnome/apps" -mindepth 1 -maxdepth 1 -type f | while read DESKTOP_FILE; do
|
find "$HOME/gnome/apps" -mindepth 1 -maxdepth 1 -type f | while read DESKTOP_FILE; do
|
||||||
logg info "Moving $DESKTOP_FILE to ${XDG_DATA_DIR:-$HOME/.local/share}/applications/$(basename "$DESKTOP_FILE")"
|
logg info "Moving $DESKTOP_FILE to ${XDG_DATA_HOME:-$HOME/.local/share}/applications/$(basename "$DESKTOP_FILE")"
|
||||||
mv "$DESKTOP_FILE" "${XDG_DATA_DIR:-$HOME/.local/share}/applications/$(basename "$DESKTOP_FILE")"
|
mv "$DESKTOP_FILE" "${XDG_DATA_HOME:-$HOME/.local/share}/applications/$(basename "$DESKTOP_FILE")"
|
||||||
done
|
done
|
||||||
logg info 'Removing ~/.gnome/apps'
|
logg info 'Removing ~/.gnome/apps'
|
||||||
rm -rf "$HOME/.gnome/apps"
|
rm -rf "$HOME/.gnome/apps"
|
||||||
|
|
|
@ -6886,8 +6886,8 @@ softwarePackages:
|
||||||
# brew: vectordotdev/brew/vector
|
# brew: vectordotdev/brew/vector
|
||||||
helm: https://helm.vector.dev
|
helm: https://helm.vector.dev
|
||||||
pacman: vector
|
pacman: vector
|
||||||
script:darwin: curl --proto '=https' --tlsv1.2 -sSf https://sh.vector.dev | bash -s -- --prefix "${XDG_DATA_DIR:-$HOME/.local/share}/vector" --no-modify-path -y
|
script:darwin: curl --proto '=https' --tlsv1.2 -sSf https://sh.vector.dev | bash -s -- --prefix "${XDG_DATA_HOME:-$HOME/.local/share}/vector" --no-modify-path -y
|
||||||
script:linux: curl --proto '=https' --tlsv1.2 -sSf https://sh.vector.dev | bash -s -- --prefix "${XDG_DATA_DIR:-$HOME/.local/share}/vector" --no-modify-path -y
|
script:linux: curl --proto '=https' --tlsv1.2 -sSf https://sh.vector.dev | bash -s -- --prefix "${XDG_DATA_HOME:-$HOME/.local/share}/vector" --no-modify-path -y
|
||||||
velero:
|
velero:
|
||||||
_bin: velero
|
_bin: velero
|
||||||
_desc: null
|
_desc: null
|
||||||
|
|
Loading…
Reference in a new issue