aboutsummaryrefslogtreecommitdiff
path: root/Scripts/.local/scripts/status
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts/.local/scripts/status')
-rwxr-xr-xScripts/.local/scripts/status/battery25
-rwxr-xr-xScripts/.local/scripts/status/connection9
-rwxr-xr-xScripts/.local/scripts/status/datetime2
-rwxr-xr-xScripts/.local/scripts/status/music10
-rwxr-xr-xScripts/.local/scripts/status/volume21
5 files changed, 67 insertions, 0 deletions
diff --git a/Scripts/.local/scripts/status/battery b/Scripts/.local/scripts/status/battery
new file mode 100755
index 0000000..7680ac5
--- /dev/null
+++ b/Scripts/.local/scripts/status/battery
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+capacity=$(cat /sys/class/power_supply/BAT0/capacity) || break
+status=$(cat /sys/class/power_supply/BAT0/status)
+
+if [[ $status == "Charging" ]]
+then
+ status=""
+else
+ if [[ $capacity -ge 75 ]]
+ then
+ status=""
+ elif [[ $capacity -ge 50 ]]
+ then
+ status=""
+ elif [[ $capacity -ge 25 ]]
+ then
+ status=""
+ elif [[ $capacity -ge 10 ]]
+ then
+ status=""
+ else
+ status=""
+ fi
+fi
+echo "$status $capacity%"
diff --git a/Scripts/.local/scripts/status/connection b/Scripts/.local/scripts/status/connection
new file mode 100755
index 0000000..139fea0
--- /dev/null
+++ b/Scripts/.local/scripts/status/connection
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+internet=$(nmcli g | sed -n 2p | awk '{print $1}')
+if [[ $internet == "connected" ]]
+then
+ echo "Connected"
+else
+ echo "Not connected"
+fi
diff --git a/Scripts/.local/scripts/status/datetime b/Scripts/.local/scripts/status/datetime
new file mode 100755
index 0000000..39f1c06
--- /dev/null
+++ b/Scripts/.local/scripts/status/datetime
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+echo $(date +'%a %F %R')
diff --git a/Scripts/.local/scripts/status/music b/Scripts/.local/scripts/status/music
new file mode 100755
index 0000000..262dc81
--- /dev/null
+++ b/Scripts/.local/scripts/status/music
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+name="$(mpc -f '%title%' | head -1)"
+offline="$(echo $name | grep -E 'volume:|MPD')"
+if [[ $offline ]]
+then
+ name="MPD off"
+else
+ name="Playing: $name"
+fi
+echo $name
diff --git a/Scripts/.local/scripts/status/volume b/Scripts/.local/scripts/status/volume
new file mode 100755
index 0000000..c3de64c
--- /dev/null
+++ b/Scripts/.local/scripts/status/volume
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+sinks="$(pactl list sinks)"
+vol="$(echo "$sinks" | grep '[0-9]\+%' | sed "s,.* \([0-9]\+\)%.*,\1,;1q")"
+mpc_vol="$($HOME/.local/scripts/mpc_volume)"
+
+if [[ $vol -gt 50 ]]
+then
+ icon=""
+elif [[ $vol -gt 10 ]]
+then
+ icon=""
+else
+ icon=""
+fi
+
+if [[ $mpc_vol == "n/a" ]]
+then
+ echo "$icon $vol%"
+else
+ echo "$icon $vol% $mpc_vol%"
+fi