mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2024-12-22 18:52:46 +01:00
darkman-setup.bash: symlink scripts instead of directories for customizing options
This commit is contained in:
parent
f5e14af247
commit
5dc91eb4ba
@ -1,25 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
if ! hash darkman 2> /dev/null; then
|
||||
echo "You don't seem to have darkman installed." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -vp ~/.local/share/
|
||||
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
|
||||
|
||||
if [ -d /usr/share/doc/darkman/examples ]; then
|
||||
ln -nsfv /usr/share/doc/darkman/examples/{dark,light}-mode.d ~/.local/share/
|
||||
export EXAMPLESDIR="/usr/share/doc/darkman/examples"
|
||||
elif [ -d /usr/local/share/doc/darkman/examples ]; then
|
||||
ln -nsfv /usr/local/share/doc/darkman/examples/{dark,light}-mode.d ~/.local/share/
|
||||
export EXAMPLESDIR="/usr/local/share/doc/darkman/examples"
|
||||
elif [ -d ~/.local/share/doc/darkman/examples ]; then
|
||||
ln -nsfv ~/.local/share/doc/darkman/examples/{dark,light}-mode.d ~/.local/share/
|
||||
elif [ -d ~/src/gitlab.com/WhyNotHugo/darkman ]; then
|
||||
ln -nsfv ~/src/gitlab.com/WhyNotHugo/darkman/examples/{dark,light}-mode.d ~/.local/share/
|
||||
export EXAMPLESDIR="/.local/share/doc/darkman/examples"
|
||||
elif [ -d ~/src/gitlab.com/WhyNotHugo/darkman/examples ]; then
|
||||
export EXAMPLESDIR="~/src/gitlab.com/WhyNotHugo/darkman/examples"
|
||||
else
|
||||
echo "Darkman examples not found in expected locations."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ln -nsfv $EXAMPLESDIR/dark-mode.d/* ~/.local/share/dark-mode.d/
|
||||
ln -nsfv $EXAMPLESDIR/light-mode.d/* ~/.local/share/light-mode.d/
|
||||
|
||||
unset $EXAMPLESDIR
|
||||
systemctl --user disable --now darkman.service
|
||||
systemctl --user mask darkman.service
|
||||
echo "Creating an autostart seems to work better than the systemd service."
|
||||
set +x
|
||||
|
Loading…
Reference in New Issue
Block a user