From a2920ce604e7e2b0afbd0facf27b0c187422641a Mon Sep 17 00:00:00 2001 From: ferreo Date: Sun, 27 Oct 2024 18:23:11 +0100 Subject: [PATCH] Update pika-hyprland-settings/debian/postinst --- pika-hyprland-settings/debian/postinst | 31 +++++++++++++------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/pika-hyprland-settings/debian/postinst b/pika-hyprland-settings/debian/postinst index 3761dd1..a5daab9 100755 --- a/pika-hyprland-settings/debian/postinst +++ b/pika-hyprland-settings/debian/postinst @@ -2,21 +2,22 @@ set -e +# Check if /home has any subdirectories +if [ "$(ls -A /home)" ]; then + for u in /home/*; do + # Check if the current item is a directory + if [ -d "$u" ]; then + if [ ! -f "${u}/.config/hypr/hypridle.conf" ]; then + cp -a /etc/skel/. "${u}/" + chown -R "$(basename "$u"):$(basename "$u")" "${u}/" + fi - for u in /home/* - do - if [[ "${u}" == '/home/*' ]] - then - continue - fi - if ! test -f "${u}/.config/hypr/hypridle.conf" - then - cp -a /etc/skel/. "${u}/" - chown -R "${u}:${u}" "${u}/" - fi - - if ! test -f "${u}/.config/ags/widgets/systray.js" - then - cp -af /etc/skel/.config/ags/. "${u}/.config/ags/" + if [ ! -f "${u}/.config/ags/widgets/systray.js" ]; then + mkdir -p "${u}/.config/ags/" + cp -af /etc/skel/.config/ags/. "${u}/.config/ags/" + fi fi done +else + echo "/home is empty. No user directories to process." +fi \ No newline at end of file