Browse Source

Update README and add battery notification script

Bear 2 years ago
parent
commit
b5b1a6b7eb
2 changed files with 10 additions and 1 deletions
  1. 1 1
      i3wm/README.md
  2. 9 0
      i3wm/currentbattery.sh

+ 1 - 1
i3wm/README.md

@@ -6,4 +6,4 @@ Any dependencies at the top of the file.
 
 * config - Configuration file for i3wm.
 * lock.sh - Lock script for i3lock.
-
+* currentbattery.sh - Shows the current battery information through dunst.

+ 9 - 0
i3wm/currentbattery.sh

@@ -0,0 +1,9 @@
+#! /bin/bash
+
+batteryLevel1=$(acpi | awk '/^Battery 0:/ {print $4+0}')
+batteryLevel2=$(acpi | awk '/^Battery 1:/ {print $4+0}')
+batteryState1=$(acpi | awk '/^Battery 0:/ {print $3}' | sed 's/,$//')
+batteryState2=$(acpi | awk '/^Battery 1:/ {print $3}' | sed 's/,$//')
+batteryRemaining=$(acpi | awk '{print $5}')
+
+notify-send "Battery Information:" "\nBattery 1: $batteryState1 $batteryLevel1%\nBattery 2: $batteryState2 $batteryLevel2%"