File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1+ __version__ = "0.1.0"
2+
3+ from zenlib .util import contains
4+ from zenlib .util import colorize as c_
5+
6+
7+ @contains ("kmod_autodetect_input" )
8+ def autodetect_input (self ):
9+ """ Adds _input_device_kmods to "_kmod_auto" if they are in /proc/modules"""
10+ with open ("/proc/modules" , "r" ) as f :
11+ modules = f .read ()
12+
13+ for input_kmod in self ["_input_device_kmods" ]:
14+ if input_kmod in modules :
15+ self ["_kmod_auto" ] = input_kmod
16+ self .logger .info (f"Autodetected input device kernel module: { c_ (input_kmod , 'cyan' )} " )
17+
Original file line number Diff line number Diff line change 1+ kmod_autodetect_input = true
2+ _input_device_kmods = [ " hid_apple" , " hid_generic" , " usbhid" ]
3+
4+ [imports .build_enum ]
5+ "ugrd.kmod.input" = [ " autodetect_input" ]
6+
7+ [import_order .after ]
8+ "autodetect_input" = " get_kernel_version"
9+
10+ [custom_parameters ]
11+ kmod_autodetect_input = " bool" # Whether or not to detect input devices
12+ _input_device_kmods = " NoDupFlatList" # List of input device kernel modules
Original file line number Diff line number Diff line change 1- modules = [ " ugrd.kmod.standard_mask" ]
1+ modules = [ " ugrd.kmod.standard_mask" , " ugrd.kmod.input " ]
22
33binaries = [ " modprobe" ]
44
You can’t perform that action at this time.
0 commit comments