aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe2017-06-07 01:18:04 +0200
committerGiuseppe2017-06-07 01:18:04 +0200
commitab2912a0826c2d3f92e0ae6e1bfd17a154ab2e27 (patch)
tree96ba710b833a964018c206763610f14f13e13a57
downloadaur-ab2912a0826c2d3f92e0ae6e1bfd17a154ab2e27.tar.gz
Root commit
-rw-r--r--.SRCINFO16
-rw-r--r--LICENSE14
-rw-r--r--PKGBUILD23
-rw-r--r--README.md1
-rw-r--r--notify-when-done-i3-git.install4
-rw-r--r--nwd-preexec.sh14
6 files changed, 72 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..6a09c54c20c6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = notify-when-done-git
+ pkgdesc = Send notification in i3 when command in a non-focused workspace finish.
+ pkgver = ...
+ pkgrel = 1
+ url = https://github.com/giuscri/notify-when-done-i3
+ install = notify-when-done-i3-git.install
+ arch = x86_64
+ license = WTFPL
+ makedepends = git
+ depends = jq
+ depends = i3
+ source = $pkgname::git+https://github.com/giuscri/notify-when-done-i3.git
+ md5sums = SKIP
+
+pkgname = notify-when-done-git
+
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000000..ee7d6a54e914
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,14 @@
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ Version 2, December 2004
+
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
+
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..7a27521915f0
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,23 @@
+# Maintainer: Giuseppe <giuscri@gmail.com>
+pkgname=notify-when-done-git
+pkgver=...
+pkgrel=1
+pkgdesc="Send notification in i3 when command in a non-focused workspace finish."
+arch=('x86_64')
+url="https://github.com/giuscri/notify-when-done-i3"
+license=('WTFPL')
+depends=('jq' 'i3')
+makedepends=('git')
+install=notify-when-done-i3-git.install
+source=('$pkgname::git+https://github.com/giuscri/notify-when-done-i3.git')
+md5sums=('SKIP')
+
+pkgver() {
+ cd "$srcdir/${pkgname}"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+package() {
+ install -Dm0644 "$srcdir/$pkgname/nwd-preexec.sh" "$pkgdir/etc/nwd/nwd-preexec.sh"
+ install -Dm0644 "$srcdir/$pkgname/LICENSE" "$pkgdir/usr/share/licenses/nwd/LICENSE"
+}
diff --git a/README.md b/README.md
new file mode 100644
index 000000000000..e784b247fbba
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+# notify-when-done-i3
diff --git a/notify-when-done-i3-git.install b/notify-when-done-i3-git.install
new file mode 100644
index 000000000000..7963e620d98c
--- /dev/null
+++ b/notify-when-done-i3-git.install
@@ -0,0 +1,4 @@
+post_install() {
+ echo "## To complete installation, add the following line to your bashrc"
+ echo '## "source /etc/notify-when-done-i3/nwd-preexec.sh"'
+}
diff --git a/nwd-preexec.sh b/nwd-preexec.sh
new file mode 100644
index 000000000000..80f99a50188a
--- /dev/null
+++ b/nwd-preexec.sh
@@ -0,0 +1,14 @@
+_precmd() {
+ CURRENT_WS=$(i3-msg -t get_workspaces|jq -c '.[]| select(.focused)|.num')
+ if [[ $ND_FOCUSED_WS -ne $CURRENT_WS ]]; then
+ notify-send -u critical "$ND_CMD" "Done @workspace=$ND_FOCUSED_WS"
+ fi
+}
+
+_preexec() {
+ ND_FOCUSED_WS=$(i3-msg -t get_workspaces|jq -c '.[]| select(.focused)|.num')
+ ND_CMD=$1
+}
+
+preexec_functions+=(_preexec)
+precmd_functions+=(_precmd)