aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclyhtsuriva <aimeric@adjutor.xyz>2023-05-04 11:19:58 +0200
committerclyhtsuriva <aimeric@adjutor.xyz>2023-05-04 11:19:58 +0200
commit36413d2a55a9c51f29d7a002c1f0081a791d713b (patch)
tree7da36c23317c4568e8c0e40340e6f2b6b3ea8ae1
parent4d36c191792c853ff562aa0513359e1090eaed3b (diff)
Improve update-scripts-rep.sh and added new script
potentia displays battery level in the term + notification
-rwxr-xr-xbin/potentia.sh30
-rwxr-xr-xbin/update-scripts-repo.sh1
2 files changed, 31 insertions, 0 deletions
diff --git a/bin/potentia.sh b/bin/potentia.sh
new file mode 100755
index 0000000..a6e3e68
--- /dev/null
+++ b/bin/potentia.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+#
+# Clyhtsuriva
+#
+#
+# -- potentia --
+#
+# Displays the battery percentage in the terminal
+# and as a notification.
+#
+
+# An array containing the required programs
+required_programs=("acpi" "notify-send")
+
+# Check if each program is installed
+for program in "${required_programs[@]}"; do
+ if ! command -v "$program" &> /dev/null; then
+ echo "Error: $program is not installed. Please install $program and try again."
+ exit 1
+ fi
+done
+
+# Get the current battery percentage using acpi
+battery_level=$(acpi | awk '{print $4}' | tr -d ',')
+
+# Display in the terminal
+echo "Battery level: $battery_level"
+
+# Send a notification using notify-send
+notify-send "Battery level: $battery_level"
diff --git a/bin/update-scripts-repo.sh b/bin/update-scripts-repo.sh
index e699472..03a20ee 100755
--- a/bin/update-scripts-repo.sh
+++ b/bin/update-scripts-repo.sh
@@ -9,6 +9,7 @@ cp -rv "$HOME/.local/usr/local/bin" .
cp -rv "$HOME/workbench/auto-void-packages" .
cp -rv "$HOME/workbench/ansible" .
+git status | less && git diff | less
git add . && git commit && git push -v --progress
popd || exit 1