2024-07-16 11:35:28 +02:00
|
|
|
#!/usr/bin/env bash
|
2024-07-17 09:23:51 +02:00
|
|
|
set -x
|
2024-07-16 11:35:28 +02:00
|
|
|
if ! hash darkman 2> /dev/null; then
|
|
|
|
echo "You don't seem to have darkman installed." 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-07-17 09:23:51 +02:00
|
|
|
if [ ! -d ~/.local/share/dark-mode.d ]; then
|
|
|
|
rm ~/.local/share/{dark,light}-mode.d
|
|
|
|
mkdir -vp ~/.local/share/{dark,light}-mode.d
|
|
|
|
echo "Ensure ~/.local/share/ has directories {dark,light}-mode.d/"
|
|
|
|
fi
|
2024-07-16 11:35:28 +02:00
|
|
|
|
2024-07-19 20:16:12 +02:00
|
|
|
echo "Ctrl-C unless you want the examples... Sleeping for 3."
|
|
|
|
sleep 3
|
|
|
|
|
2024-07-16 11:35:28 +02:00
|
|
|
if [ -d /usr/share/doc/darkman/examples ]; then
|
2024-07-17 09:23:51 +02:00
|
|
|
export EXAMPLESDIR="/usr/share/doc/darkman/examples"
|
2024-07-16 11:35:28 +02:00
|
|
|
elif [ -d /usr/local/share/doc/darkman/examples ]; then
|
2024-07-17 09:23:51 +02:00
|
|
|
export EXAMPLESDIR="/usr/local/share/doc/darkman/examples"
|
2024-07-16 11:35:28 +02:00
|
|
|
elif [ -d ~/.local/share/doc/darkman/examples ]; then
|
2024-07-17 09:23:51 +02:00
|
|
|
export EXAMPLESDIR="/.local/share/doc/darkman/examples"
|
|
|
|
elif [ -d ~/src/gitlab.com/WhyNotHugo/darkman/examples ]; then
|
|
|
|
export EXAMPLESDIR="~/src/gitlab.com/WhyNotHugo/darkman/examples"
|
2024-07-16 11:35:28 +02:00
|
|
|
else
|
|
|
|
echo "Darkman examples not found in expected locations."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-07-17 09:23:51 +02:00
|
|
|
ln -nsfv $EXAMPLESDIR/dark-mode.d/* ~/.local/share/dark-mode.d/
|
|
|
|
ln -nsfv $EXAMPLESDIR/light-mode.d/* ~/.local/share/light-mode.d/
|
|
|
|
|
|
|
|
unset $EXAMPLESDIR
|
2024-07-17 08:24:16 +02:00
|
|
|
systemctl --user disable --now darkman.service
|
|
|
|
systemctl --user mask darkman.service
|
|
|
|
echo "Creating an autostart seems to work better than the systemd service."
|
2024-07-17 09:23:51 +02:00
|
|
|
set +x
|