Argh!
if [ "$(systemctl --user show -p PartOf --value)" = "graphical-session.target" ]; then
The systemctl --user call is missing a $unit argument, so this loop never actually worked.
Argh!
if [ "$(systemctl --user show -p PartOf --value)" = "graphical- session. target" ]; then
The systemctl --user call is missing a $unit argument, so this loop never actually worked.