hyprlock: add battery

This commit is contained in:
end-4
2024-02-29 16:40:44 +07:00
parent e1ce65379a
commit 67be4f8f3b
3 changed files with 57 additions and 11 deletions
@@ -40,7 +40,7 @@ label { # Clock
halign = center
valign = center
}
label {
label { # Greeting
monitor =
text = hi $USER !!!
color = $text_color
@@ -51,7 +51,7 @@ label {
halign = center
valign = center
}
label {
label { # lock icon
monitor =
text = lock
color = $text_color
@@ -62,7 +62,7 @@ label {
halign = center
valign = bottom
}
label {
label { # "locked" text
monitor =
text = locked
color = $text_color
@@ -72,4 +72,16 @@ label {
position = 0, 50
halign = center
valign = bottom
}
label { # Status
monitor =
text = cmd[update:5000] ~/.config/hypr/hyprlock/status.sh
color = $text_color
font_size = 14
font_family = $font_family
position = 30, -30
halign = left
valign = top
}
+20 -8
View File
@@ -1,13 +1,13 @@
$text_color = rgba(eae0e4FF)
$entry_background_color = rgba(120F1111)
$entry_border_color = rgba(9a8d9555)
$entry_color = rgba(d1c2cbFF)
$text_color = rgba(ede0deFF)
$entry_background_color = rgba(130F0F11)
$entry_border_color = rgba(a08c8955)
$entry_color = rgba(d8c2bfFF)
$font_family = Gabarito
$font_family_clock = Gabarito
$font_material_symbols = Material Symbols Rounded
background {
color = rgba(120F1177)
color = rgba(130F0F77)
# path = {{ SWWW_WALL }}
path = screenshot
blur_size = 5
@@ -40,7 +40,7 @@ label { # Clock
halign = center
valign = center
}
label {
label { # Greeting
monitor =
text = hi $USER !!!
color = $text_color
@@ -51,7 +51,7 @@ label {
halign = center
valign = center
}
label {
label { # lock icon
monitor =
text = lock
color = $text_color
@@ -62,7 +62,7 @@ label {
halign = center
valign = bottom
}
label {
label { # "locked" text
monitor =
text = locked
color = $text_color
@@ -72,4 +72,16 @@ label {
position = 0, 50
halign = center
valign = bottom
}
label { # Status
monitor =
text = cmd[update:5000] ~/.config/hypr/hyprlock/status.sh
color = $text_color
font_size = 14
font_family = $font_family
position = 30, -30
halign = left
valign = top
}
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
############ Variables ############
enable_battery=false
####### Check availability ########
for battery in /sys/class/power_supply/*BAT*; do
if [[ -f "$battery/uevent" ]]; then
enable_battery=true
break
fi
done
############# Output #############
if [[ $enable_battery == true ]]; then
if [[ $(cat /sys/class/power_supply/*/status | head -1) == "Charging" ]]; then
echo -n "(+) "
fi
echo -n "$(cat /sys/class/power_supply/*/capacity | head -1)"% remaining
fi
echo ''