mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-09-14 06:07:21 -04:00
Build udev from DetectionManager
This commit is contained in:
1 parent
8121ee29f4
commit
33854f8886
4 files changed
+140
No files matched your search
@@ -22,6 +22,10 @@
|
||||
#include "ResourceManager.h"
|
||||
#include "RGBController.h"
|
||||
|
||||
#ifdef __linux__
|
||||
#include "DetectionManager.h"
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Quirk for MSVC; which doesn't support this |
|
||||
| case-insensitive function |
|
||||
@@ -452,6 +456,9 @@ void OptionHelp()
|
||||
help_text += "--autostart-check Check if OpenRGB starting at login is enabled.\n";
|
||||
help_text += "--autostart-disable Disable OpenRGB starting at login.\n";
|
||||
help_text += "--autostart-enable arguments Enable OpenRGB to start at login. Requires arguments to give to OpenRGB at login.\n";
|
||||
#ifdef __linux__
|
||||
help_text += "--generate-udev-rules [filename] Generate the OpenRGB udev rules file and save it to the given filename.\n";
|
||||
#endif
|
||||
|
||||
std::cout << help_text << std::endl;
|
||||
}
|
||||
@@ -957,6 +964,13 @@ bool OptionSaveProfile(std::string argument)
|
||||
return(true);
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
void OptionGenerateUdevRules(std::string argument)
|
||||
{
|
||||
DetectionManager::get()->GenerateUdevRules(argument);
|
||||
}
|
||||
#endif
|
||||
|
||||
int ProcessOptions(Options* options, std::vector<RGBController *>& rgb_controllers)
|
||||
{
|
||||
unsigned int ret_flags = 0;
|
||||
@@ -1134,6 +1148,18 @@ int ProcessOptions(Options* options, std::vector<RGBController *>& rgb_controlle
|
||||
arg_index++;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
/*-------------------------------------------------*\
|
||||
| --generate-udev-rules |
|
||||
\*-------------------------------------------------*/
|
||||
else if(option == "--generate-udev-rules")
|
||||
{
|
||||
OptionGenerateUdevRules(arg_path.generic_u8string());
|
||||
|
||||
arg_index++;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Invalid option |
|
||||
\*-------------------------------------------------*/
|
||||
|
||||
Reference in new issue
Block a user