File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ fn read_attr(path: &Path, attr: &str) -> u32 {
2929fn find_backlight ( ) -> Result < PathBuf > {
3030 for entry in fs:: read_dir ( "/sys/class/backlight/" ) ? {
3131 let entry = entry?;
32- if entry. file_name ( ) . to_string_lossy ( ) . contains ( "display-pipe" ) {
32+ let file_name = entry. file_name ( ) ;
33+ let name = file_name. to_string_lossy ( ) ;
34+
35+ if [ "display-pipe" , "appletb_backlight" ] . iter ( ) . any ( |s| name. contains ( s) ) {
3336 return Ok ( entry. path ( ) ) ;
3437 }
3538 }
@@ -39,7 +42,7 @@ fn find_backlight() -> Result<PathBuf> {
3942fn find_display_backlight ( ) -> Result < PathBuf > {
4043 for entry in fs:: read_dir ( "/sys/class/backlight/" ) ? {
4144 let entry = entry?;
42- if entry. file_name ( ) . to_string_lossy ( ) . eq ( "apple-panel-bl" ) {
45+ if [ "apple-panel-bl" , "intel_backlight" ] . iter ( ) . any ( |s| entry. file_name ( ) . to_string_lossy ( ) . contains ( s ) ) {
4346 return Ok ( entry. path ( ) ) ;
4447 }
4548 }
You can’t perform that action at this time.
0 commit comments