new scripts
authorMatthew Owens <matthew@owens.tech>
Wed, 29 Jul 2020 18:08:02 +0000 (19:08 +0100)
committerMatthew Owens <matthew@owens.tech>
Wed, 29 Jul 2020 18:08:02 +0000 (19:08 +0100)
dorf [new file with mode: 0755]
mailcount [new file with mode: 0755]
numupdates [new file with mode: 0755]

diff --git a/dorf b/dorf
new file mode 100755 (executable)
index 0000000..1508904
--- /dev/null
+++ b/dorf
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [ "$EUID" -ne 0 ]; then
+       echo "$0 wasn't run as root, dwarftherapist won't be run"
+else
+       sysctl -w kernel.yama.ptrace_scope=0
+       sudo -u mokou dwarftherapist
+       sysctl -w kernel.yama.ptrace_scope=1
+fi
diff --git a/mailcount b/mailcount
new file mode 100755 (executable)
index 0000000..3f122b5
--- /dev/null
+++ b/mailcount
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+count=$(ls ~/.local/share/mail/matthew/INBOX/new | wc -l)
+
+[ $count -ne 0 ] && echo "$count"
diff --git a/numupdates b/numupdates
new file mode 100755 (executable)
index 0000000..7c91851
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+n=$((checkupdates && checkupdates-aur) | wc -l)
+[ $n -eq 0 ] || echo $n