summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Osipov <mike.osipov@gmail.com>2019-02-18 12:40:32 +0300
committerMikhail Osipov <mike.osipov@gmail.com>2019-02-18 12:40:32 +0300
commitd3a6869c1af91bfa74c86ab766f2b934bd2c7ae4 (patch)
treec40183373b69edde47688c38fe820169193847f4
add screenshot.sh, since.sh, sys.sh
-rwxr-xr-xscreenshot.sh5
-rwxr-xr-xsince.sh8
-rwxr-xr-xsys.sh30
3 files changed, 43 insertions, 0 deletions
diff --git a/screenshot.sh b/screenshot.sh
new file mode 100755
index 0000000..e0019d1
--- /dev/null
+++ b/screenshot.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+DIR=/tmp/screenshot
+
+mkdir -p $DIR && gnome-screenshot --area --file $DIR/$(date +"%Y-%m-%d.%H:%M:%S.png")
diff --git a/since.sh b/since.sh
new file mode 100755
index 0000000..40d4ca5
--- /dev/null
+++ b/since.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+CUR=$(journalctl -qS today | awk 'NR == 1 { print $3 " "; end }')
+DIFF=$(($(date +%s) - $(date --date $CUR +%s)))
+UPTIME=$(date -u --date @$DIFF "+%H:%M:%S")
+
+echo "<txt>$CUR</txt>"
+echo "<tool>$UPTIME</tool>"
diff --git a/sys.sh b/sys.sh
new file mode 100755
index 0000000..7c8973e
--- /dev/null
+++ b/sys.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+INSTALLED=$(cat /usr/lib/modules/extramodules-ARCH/version)
+CURRENT=$(uname -r)
+
+KERNEL=$(echo $CURRENT | cut -d- -f1)
+UPDATES=$(checkupdates)
+
+NUPDATES=0
+STATUS=
+
+if test -n "$UPDATES"; then
+ NUPDATES=$(wc -l <<<$UPDATES)
+fi
+
+if grep -q "^linux " <<<$UPDATES; then
+ STATUS="$STATUS(+)"
+fi
+
+if test "$CURRENT" != "$INSTALLED"; then
+ STATUS="$STATUS(-)"
+fi
+
+echo "<txt>sys: ${KERNEL}${STATUS}, upd: ${NUPDATES}</txt>"
+
+if test -z "$UPDATES"; then
+ echo "<tool>no updates</tool>"
+else
+ echo "<tool>$UPDATES</tool>"
+fi