From 9682b408ab205521ba997c7833796ca3182d5b2e Mon Sep 17 00:00:00 2001 From: John Gebbie Date: Tue, 31 Jan 2023 12:26:10 +0000 Subject: [PATCH] install: have ./_install.sh for packaging --- _install.sh | 8 ++++++++ install.sh | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100755 _install.sh 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