From cdcf46f206f8957b65962b72a644ba8e601b51ce Mon Sep 17 00:00:00 2001 From: frosty Date: Fri, 12 Jul 2024 12:24:02 -0400 Subject: [PATCH] update scripts --- .local/bin/monitors | 14 ++++++++++++++ .local/bin/toggle | 3 +++ 2 files changed, 17 insertions(+) create mode 100755 .local/bin/toggle diff --git a/.local/bin/monitors b/.local/bin/monitors index 6942d8e..2f3ad1f 100755 --- a/.local/bin/monitors +++ b/.local/bin/monitors @@ -111,6 +111,20 @@ monitor_volume() { printf '%s%%\n' "$volume" } +monitor_uptime() { + up=$(uptime -p) + up=${up#up } + up=${up//,} + up=${up// day/d} + up=${up// days/d} + up=${up// minutes/m} + up=${up// minute/m} + up=${up// hours/h} + up=${up// hour/h} + + printf '%s\n' "$up" +} + if command -v monitor_"$1" >/dev/null 2>&1; then monitor_"$1" fi diff --git a/.local/bin/toggle b/.local/bin/toggle new file mode 100755 index 0000000..b008a2b --- /dev/null +++ b/.local/bin/toggle @@ -0,0 +1,3 @@ +#!/bin/sh + +killall "$1" || "$@"