mirror of
https://github.com/polybar/polybar.git
synced 2024-11-11 13:50:56 -05:00
fix(build): Handle empty list of bat/adp names
This commit is contained in:
parent
d02e2a47fb
commit
fe1d0579ec
1 changed files with 11 additions and 2 deletions
|
@ -33,8 +33,17 @@ string(REGEX REPLACE /%adapter%.* "" PATH_ADP ${SETTING_PATH_ADAPTER_STATUS})
|
|||
file(GLOB BAT_LIST RELATIVE ${PATH_BAT} ${PATH_ADP}/B*)
|
||||
file(GLOB ADP_LIST RELATIVE ${PATH_ADP} ${PATH_ADP}/A*)
|
||||
|
||||
if(BAT_LIST)
|
||||
list(GET BAT_LIST 0 BATTERY)
|
||||
else()
|
||||
set(BATTERY BAT0)
|
||||
endif()
|
||||
|
||||
if(ADP_LIST)
|
||||
list(GET ADP_LIST 0 ADAPTER)
|
||||
else()
|
||||
set(ADAPTER ADP1)
|
||||
endif()
|
||||
|
||||
# }}}
|
||||
# Configure and install {{{
|
||||
|
|
Loading…
Reference in a new issue