aboutsummaryrefslogtreecommitdiff
path: root/env/.local/bin
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2021-08-09 22:27:31 +0300
committereug-vs <eugene@eug-vs.xyz>2021-08-09 22:27:31 +0300
commitb712c88e40891d801a577a269baa6c28c4cd1c4c (patch)
tree0555888a876c470fd04cc5b0a97f01bb659f5e79 /env/.local/bin
parent0579126646f49866f7c5757829b96b558d7822a6 (diff)
downloaddotfiles-b712c88e40891d801a577a269baa6c28c4cd1c4c.tar.gz
feat: add notify_low_battery script
Diffstat (limited to 'env/.local/bin')
-rwxr-xr-xenv/.local/bin/notify_low_battery.sh4
-rwxr-xr-xenv/.local/bin/screenshot.sh2
2 files changed, 4 insertions, 2 deletions
diff --git a/env/.local/bin/notify_low_battery.sh b/env/.local/bin/notify_low_battery.sh
new file mode 100755
index 0000000..e0e6f84
--- /dev/null
+++ b/env/.local/bin/notify_low_battery.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+CAPACITY=$(cat /sys/class/power_supply/BAT0/capacity)
+[ $CAPACITY -lt 20 ] && notify-send --urgency=critical "Low battery" "Less then $CAPACITY% remaining.\n Charge your laptop."
+
diff --git a/env/.local/bin/screenshot.sh b/env/.local/bin/screenshot.sh
index 66d9c5c..5acf77b 100755
--- a/env/.local/bin/screenshot.sh
+++ b/env/.local/bin/screenshot.sh
@@ -5,7 +5,5 @@
SCREENSHOTS_DIR=$HOME/Pictures/Screenshots
FILENAME=$SCREENSHOTS_DIR/$(date +%F_%H-%M-%S).png
-echo "$@"
-
mkdir -p $SCREENSHOTS_DIR
import $@ $FILENAME && xclip -selection clipboard -target image/png -i < $FILENAME