forked from Shinonome/dots-hyprland
hyprlock: add battery
This commit is contained in:
@@ -40,7 +40,7 @@ label { # Clock
|
|||||||
halign = center
|
halign = center
|
||||||
valign = center
|
valign = center
|
||||||
}
|
}
|
||||||
label {
|
label { # Greeting
|
||||||
monitor =
|
monitor =
|
||||||
text = hi $USER !!!
|
text = hi $USER !!!
|
||||||
color = $text_color
|
color = $text_color
|
||||||
@@ -51,7 +51,7 @@ label {
|
|||||||
halign = center
|
halign = center
|
||||||
valign = center
|
valign = center
|
||||||
}
|
}
|
||||||
label {
|
label { # lock icon
|
||||||
monitor =
|
monitor =
|
||||||
text = lock
|
text = lock
|
||||||
color = $text_color
|
color = $text_color
|
||||||
@@ -62,7 +62,7 @@ label {
|
|||||||
halign = center
|
halign = center
|
||||||
valign = bottom
|
valign = bottom
|
||||||
}
|
}
|
||||||
label {
|
label { # "locked" text
|
||||||
monitor =
|
monitor =
|
||||||
text = locked
|
text = locked
|
||||||
color = $text_color
|
color = $text_color
|
||||||
@@ -72,4 +72,16 @@ label {
|
|||||||
position = 0, 50
|
position = 0, 50
|
||||||
halign = center
|
halign = center
|
||||||
valign = bottom
|
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
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
$text_color = rgba(eae0e4FF)
|
$text_color = rgba(ede0deFF)
|
||||||
$entry_background_color = rgba(120F1111)
|
$entry_background_color = rgba(130F0F11)
|
||||||
$entry_border_color = rgba(9a8d9555)
|
$entry_border_color = rgba(a08c8955)
|
||||||
$entry_color = rgba(d1c2cbFF)
|
$entry_color = rgba(d8c2bfFF)
|
||||||
$font_family = Gabarito
|
$font_family = Gabarito
|
||||||
$font_family_clock = Gabarito
|
$font_family_clock = Gabarito
|
||||||
$font_material_symbols = Material Symbols Rounded
|
$font_material_symbols = Material Symbols Rounded
|
||||||
|
|
||||||
background {
|
background {
|
||||||
color = rgba(120F1177)
|
color = rgba(130F0F77)
|
||||||
# path = {{ SWWW_WALL }}
|
# path = {{ SWWW_WALL }}
|
||||||
path = screenshot
|
path = screenshot
|
||||||
blur_size = 5
|
blur_size = 5
|
||||||
@@ -40,7 +40,7 @@ label { # Clock
|
|||||||
halign = center
|
halign = center
|
||||||
valign = center
|
valign = center
|
||||||
}
|
}
|
||||||
label {
|
label { # Greeting
|
||||||
monitor =
|
monitor =
|
||||||
text = hi $USER !!!
|
text = hi $USER !!!
|
||||||
color = $text_color
|
color = $text_color
|
||||||
@@ -51,7 +51,7 @@ label {
|
|||||||
halign = center
|
halign = center
|
||||||
valign = center
|
valign = center
|
||||||
}
|
}
|
||||||
label {
|
label { # lock icon
|
||||||
monitor =
|
monitor =
|
||||||
text = lock
|
text = lock
|
||||||
color = $text_color
|
color = $text_color
|
||||||
@@ -62,7 +62,7 @@ label {
|
|||||||
halign = center
|
halign = center
|
||||||
valign = bottom
|
valign = bottom
|
||||||
}
|
}
|
||||||
label {
|
label { # "locked" text
|
||||||
monitor =
|
monitor =
|
||||||
text = locked
|
text = locked
|
||||||
color = $text_color
|
color = $text_color
|
||||||
@@ -72,4 +72,16 @@ label {
|
|||||||
position = 0, 50
|
position = 0, 50
|
||||||
halign = center
|
halign = center
|
||||||
valign = bottom
|
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
|
||||||
}
|
}
|
||||||
Executable
+22
@@ -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 ''
|
||||||
Reference in New Issue
Block a user