From 1e1bb5caabe78b32f69e53a2851b3556b1856d24 Mon Sep 17 00:00:00 2001 From: Pim Nelissen Date: Sun, 15 Jun 2025 17:05:09 +0200 Subject: [PATCH] update website publish script --- scripts/pcs-auto-resolution-monitor | 2 +- scripts/pcs-clean-config | 45 +++++++++++++++++++++++++++++ scripts/pcs-hugo-pub | 1 + 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100755 scripts/pcs-clean-config diff --git a/scripts/pcs-auto-resolution-monitor b/scripts/pcs-auto-resolution-monitor index 88139c0..509484b 100755 --- a/scripts/pcs-auto-resolution-monitor +++ b/scripts/pcs-auto-resolution-monitor @@ -1,7 +1,7 @@ #!/bin/bash # Check if display connected -if xrandr --listactivemonitors | grep -q "1: +DP"; then +if xrandr --listactivemonitors | grep -q "2560/597x1440/336+0+0"; then autorandr --load home_usbc --force else echo "Monitor 1 (DP) is not connected." diff --git a/scripts/pcs-clean-config b/scripts/pcs-clean-config new file mode 100755 index 0000000..f9d1ff0 --- /dev/null +++ b/scripts/pcs-clean-config @@ -0,0 +1,45 @@ +#!/bin/bash + +# Get list of config folders +CONFIG_DIR="$HOME/.config" +CONFIG_FOLDERS=($(find "$CONFIG_DIR" -mindepth 1 -maxdepth 1 -type d -printf "%f\n")) + +# Get list of installed APT packages +APT_PACKAGES=($(dpkg -l | awk '{print $2}' | tail -n +6)) + +# Get list of installed Flatpak apps (application IDs only) +FLATPAK_APPS=($(flatpak list --app --columns=application)) + +# Combine all installed package names +INSTALLED_APPS=("${APT_PACKAGES[@]}" "${FLATPAK_APPS[@]}") + +# Initialize list of redundant config folders +REDUNDANT=() + +for folder in "${CONFIG_FOLDERS[@]}"; do + FOUND=0 + for app in "${INSTALLED_APPS[@]}"; do + if [[ "$folder" == "$app" ]]; then + FOUND=1 + break + fi + done + if [[ $FOUND -eq 0 ]]; then + REDUNDANT+=("$CONFIG_DIR/$folder") + fi +done + +# Output results +COUNT=${#REDUNDANT[@]} + +if [[ $COUNT -eq 0 ]]; then + echo "No redundant config folders found." +else + echo "$COUNT redundant config folders found:" + for path in "${REDUNDANT[@]}"; do + echo "- $path" + done + echo + echo "To remove them, run:" + echo "rm -r ${REDUNDANT[*]}" +fi diff --git a/scripts/pcs-hugo-pub b/scripts/pcs-hugo-pub index 3f36706..bcee943 100755 --- a/scripts/pcs-hugo-pub +++ b/scripts/pcs-hugo-pub @@ -1,2 +1,3 @@ hugo --minify scp -r public/* cloud:/home/pim/website +echo -e "\e[1;32mDon't forget to update your CV as well!\e[0m"