diff --git a/_install.sh b/_install.sh new file mode 100755 index 0000000..773d17a --- /dev/null +++ b/_install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# ./_install.sh [DESTDIR] [BINDIR] +mkdir -p "$1/${2:-usr/local/bin}" || exit +cp -v dotoolc dotoold "$1/${2:-usr/local/bin}" || exit +mkdir -p "$1/usr/share/X11/xorg.conf.d" || exit +cp -v 50-dotool.conf "$1/usr/share/X11/xorg.conf.d" || exit +mkdir -p "$1/etc/sway/config.d" || exit +cp -v dotool.sway "$1/etc/sway/config.d/dotool" || exit diff --git a/install.sh b/install.sh index b409278..712198b 100755 --- a/install.sh +++ b/install.sh @@ -3,11 +3,11 @@ : "${DOTOOL_VERSION=$(git describe --long --abbrev=12 --tags --dirty 2>/dev/null || echo 1.1)}" go build -ldflags "-X main.Version=$DOTOOL_VERSION" || exit mkdir -p "$1/${2:-usr/local/bin}" || exit -cp -v dotool dotoolc dotoold "$1/${2:-usr/local/bin}" || exit +cp -v dotool "$1/${2:-usr/local/bin}" || exit mkdir -p "$1/etc/udev/rules.d" || exit cp -v 80-dotool.rules "$1/etc/udev/rules.d" || exit -mkdir -p "$1/usr/share/X11/xorg.conf.d" || exit -cp -v 50-dotool.conf "$1/usr/share/X11/xorg.conf.d" || exit -mkdir -p "$1/etc/sway/config.d" || exit -cp -v dotool.sway "$1/etc/sway/config.d/dotool" || exit +./_install.sh "$1" "$2" || exit + +# Make the new/updated udev rule effective +udevadm control --reload udevadm trigger