~anjan/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] Updated readme with the latest files i did commit.

Details
Message ID
<20240208185429.12959-1-marc@brandisbrandisbrand.com>
DKIM signature
permerror
Download raw message
Patch: +42 -0
---
 scripts/datausage_reset.sh | 15 +++++++++++++++
 scripts/powerlevel.sh      | 27 +++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 scripts/datausage_reset.sh
 create mode 100644 scripts/powerlevel.sh

diff --git a/scripts/datausage_reset.sh b/scripts/datausage_reset.sh
new file mode 100644
index 0000000..09721b4
--- /dev/null
+++ b/scripts/datausage_reset.sh
@@ -0,0 +1,15 @@
#!/bin/sh
# title="$icon_modem_disabled zero datausage"
# Description: resets the datausage counter
# Author: magdesign
# License: MIT
# shellcheck source=scripts/core/sxmo_common.sh
. "/usr/bin/sxmo_common.sh"

# ask for sudo and execute
sxmo_terminal.sh -t "Enter password" -- sh -c '$(sudo rc-service vnstatd stop && sleep 3 && sudo rm -rf /var/lib/vnstat/vnstat.db && sudo service vnstatd start)'

# notify
#notify-send --urgency=critical "datausage set to 0"

exit 0
diff --git a/scripts/powerlevel.sh b/scripts/powerlevel.sh
new file mode 100644
index 0000000..cdf56e1
--- /dev/null
+++ b/scripts/powerlevel.sh
@@ -0,0 +1,27 @@
#!/bin/sh
# title="$icon_bat_c_3 Powerlevel"
# shows battery level and state
# Author: magdesign
# License: MIT
# Description: Shows the wlan data usage
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. "/usr/bin/sxmo_common.sh"

# read percentage
PERCENTAGE=$(upower -d | awk '/percentage/; /^$/ {exit}' | sed 's/[^0-9]//g')

# read state
STATE=$(upower -d | awk '/state/; /^$/ {exit}' |  sed 's/state://g;s/ //g')

# time to empty
EMPTY=$(upower -d | awk '/ time to empty/; /^$/ {exit}' | sed 's/ time to empty://g;s/ //g')

# when battery low, red background
if [[ "$PERCENTAGE" -lt 15 ]]; then 
    notify-send -u critical "$PERCENTAGE""%"" Battery LOW and ""$STATE" "$EMPTY"" left"
 else notify-send "$PERCENTAGE""%"" Battery ""$STATE" "$EMPTY"" left"
 
fi

exit
-- 
2.43.0

Re: [PATCH] Updated readme with the latest files i did commit.

Details
Message ID
<CZ16AXX6V6NL.3AJ2UOKDY935R@momi.ca>
In-Reply-To
<20240208185429.12959-1-marc@brandisbrandisbrand.com> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git@git.sr.ht:~anjan/sxmo-userscripts
   cbf2652..07e21dd  master -> master
-- 
w:] www.momi.ca
pgp:] https://momi.ca/publickey.txt
Reply to thread Export thread (mbox)