fix(qtile): check if backlight present before parsing
This commit is contained in:
parent
e20d7c7157
commit
9bc68fa7cf
1 changed files with 20 additions and 14 deletions
|
@ -580,21 +580,27 @@ def init_widget_list(main=True, laptop=False):
|
||||||
*optional_list(
|
*optional_list(
|
||||||
laptop,
|
laptop,
|
||||||
[
|
[
|
||||||
|
(
|
||||||
[
|
[
|
||||||
widget.TextBox(text=" 🔆", padding=0, fontsize=14),
|
widget.TextBox(
|
||||||
|
text=" 🔆", padding=0, fontsize=14
|
||||||
|
),
|
||||||
widget.Backlight(
|
widget.Backlight(
|
||||||
backlight_name=(
|
backlight_name=(
|
||||||
run_command(
|
backlight.splitlines()[0].split(",")[0]
|
||||||
"brightnessctl -lm | grep backlight"
|
|
||||||
)
|
|
||||||
.splitlines()[0]
|
|
||||||
.split(",")[0]
|
|
||||||
),
|
),
|
||||||
change_command="brightnessctl set {0}%",
|
change_command="brightnessctl set {0}%",
|
||||||
step=5,
|
step=5,
|
||||||
padding=5,
|
padding=5,
|
||||||
),
|
),
|
||||||
],
|
]
|
||||||
|
if (
|
||||||
|
backlight := run_command(
|
||||||
|
"brightnessctl -lm | grep backlight"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else []
|
||||||
|
),
|
||||||
[ # TODO: Create battery icon widget using NerdFont icons
|
[ # TODO: Create battery icon widget using NerdFont icons
|
||||||
widget.Battery(
|
widget.Battery(
|
||||||
format="{char} {percent:2.1%} {hour:d}h:{min:02d}m",
|
format="{char} {percent:2.1%} {hour:d}h:{min:02d}m",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue