summaryrefslogtreecommitdiffstats
path: root/conky-update-interval
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2024-10-14 21:34:04 +0200
committerFlorian Pritz <bluewind@xinu.at>2024-10-14 21:54:03 +0200
commitd5ffb01d87852eb74f6b17ae06ac0c476010065b (patch)
tree1ac6a86d874f30c968ba26bf0f8a5954fa0c67a6 /conky-update-interval
parentd10ee7703e20ef844907e90797ad66bf0fb984da (diff)
downloadbin-d5ffb01d87852eb74f6b17ae06ac0c476010065b.tar.gz
bin-d5ffb01d87852eb74f6b17ae06ac0c476010065b.tar.xz
Add new scripts
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'conky-update-interval')
-rwxr-xr-xconky-update-interval13
1 files changed, 13 insertions, 0 deletions
diff --git a/conky-update-interval b/conky-update-interval
new file mode 100755
index 0000000..94d794f
--- /dev/null
+++ b/conky-update-interval
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set-conky-update-interval() {
+ sed -ri 's#^(update_interval) = .*,#\1 = '"$1"',#' ~/.i3/conkyrc-perl
+}
+
+if [[ $# -gt 0 ]]; then
+ set-conky-update-interval "$1"
+elif [[ "$(cat /sys/class/power_supply/ACAD/online)" = "0" ]]; then
+ set-conky-update-interval 3
+else
+ set-conky-update-interval 0.5
+fi