Skip to content

Commit

Permalink
Merge branch 'beta' into stable
Browse files Browse the repository at this point in the history
# Conflicts:
#	changelog.txt
#	pubspec.yaml
  • Loading branch information
legacyO7 committed Mar 13, 2023
2 parents 7f3f0f5 + b4f0f3c commit 05dcb7b
Show file tree
Hide file tree
Showing 30 changed files with 394 additions and 277 deletions.
34 changes: 34 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

## FAQ

#### Q: faustus module is no longer getting compiled in kernel version 6.1 or above

A: Official faustus module is no longer supported in kernel 6.1 or above. A workaround to fix the compilation issue is added in [this fork](https://github.com/legacyO7/faustus.git). Either try to compile it manually or use the default faustus repo provided in the aurora faustus setup


#### Q: My kernel version 6.1 (or above). Why aurora is going in faustus mode?

A: Inorder for aurora to choose mainline mode, `asus-nb-wmi` should be enabled. You may have disabled it for some reason in the past, so enable it manually after reverting the changes you made while you disabled it.

To enable `asus-nb-wmi`
```
sudo modprobe asus-wmi
sudo modprobe asus-nb-wmi
```

Also make sure `asus-nb-wmi` isnt blacklisted. check inside `/etc/modprobe.d/`

#### Q: faustus module is disabled but can still be accessed / error while disabling faustus

A: install faustus using [this fork](https://github.com/legacyO7/faustus.git)
```
sudo depmod
sudo modprobe -r faustus
````
blacklist the module
```
printf "blacklist faustus" | sudo tee /etc/modprobe.d/faustus.conf
```
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ The modes will be auto-selected depending on the kernel version
Aurora comes with an AppImage release which can be opened on any common linux distros.
Find the latest release from [here](https://github.com/legacyO7/Aurora/releases).

Aurora stable versions are also available in Fedora copr buildsystem for x86_64 devices
```
sudo dnf copr enable legacy07/aurora
sudo dnf install aurora
```


[PolKit](https://en.wikipedia.org/wiki/Polkit) is required to obtain root privileges

Expand All @@ -36,8 +43,6 @@ This doesn't require any further configurations

#### Prerequisites


- [PolKit](https://en.wikipedia.org/wiki/Polkit) to obtain root privileges
- [faustus module](https://github.com/hackbnw/faustus)
- If the module is not installed, `dkms openssl mokutil git make cmake` are required for installing the module

Expand Down Expand Up @@ -69,6 +74,8 @@ Secureboot enabled devices need to enroll MOK
`flutter build linux`


## [FAQ](./FAQ.md)


## Contributing

Expand Down
17 changes: 4 additions & 13 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@

Changelogs:

- ditch faustus module, if the mainline kernel supports keyboard backlight
Faustus module is no longer supported for kernel v6.1 and above. But keyboard backlit control for Asus TUF laptops has been added to mainline kernel. so faustus module is no longer required
- added keyboard states, if on mainline
- prompt user to switch to mainline
- fixed minor bugs in faustus mode
- updated dependencies
- added secureboot status indicator
- fixed annoying update reminder
- added light theme for no good reason
- improved UI
- many changes under the hood changes
- optimized settings
- aurora stable versions will be available in fedora copr buildsystem
- override package installation for mainline mode
- updated workflow and dependencies
- minor bug fixes
12 changes: 8 additions & 4 deletions lib/data/di/di.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import 'package:aurora/user_interface/setup/domain/repository/setup_repo_impl.da
import 'package:aurora/user_interface/setup/presentation/state/setup_bloc.dart';
import 'package:aurora/user_interface/terminal/data/source/terminal_source.dart';
import 'package:aurora/user_interface/terminal/data/source/terminal_source_impl.dart';
import 'package:aurora/user_interface/terminal/domain/repository/terminal_delegate.dart';
import 'package:aurora/user_interface/terminal/domain/repository/terminal_delegate_impl.dart';
import 'package:aurora/user_interface/terminal/domain/repository/terminal_repo.dart';
import 'package:aurora/user_interface/terminal/domain/repository/terminal_repo_impl.dart';
import 'package:aurora/user_interface/terminal/presentation/state/terminal_bloc.dart';
Expand All @@ -37,7 +39,7 @@ final sl = GetIt.I;
Future initDI() async{
sl.allowReassignment=true;

sl.registerLazySingleton(() => HomeBloc(sl(),sl(),sl()));
sl.registerLazySingleton(() => HomeBloc(sl(),sl()));
sl.registerLazySingleton(() => DisablerBloc(sl()));
sl.registerLazySingleton(() => TerminalBloc());
sl.registerLazySingleton(() => KeyboardSettingsBloc(sl(),sl()));
Expand All @@ -47,12 +49,14 @@ Future initDI() async{
sl.registerLazySingleton(() => ArButtonCubit());

sl.registerLazySingleton<TerminalRepo>(() => TerminalRepoImpl(sl()));
sl.registerLazySingleton<HomeRepo>(() => HomeRepoImpl(sl()));
sl.registerLazySingleton<HomeRepo>(() => HomeRepoImpl(sl(),sl()));
sl.registerLazySingleton<PrefRepo>(() => PrefRepoImpl(sl()));
sl.registerLazySingleton<SetupRepo>(() => SetupRepoImpl(sl()));
sl.registerLazySingleton<SetupRepo>(() => SetupRepoImpl(sl(),sl()));
sl.registerLazySingleton<KeyboardSettingsRepo>(() => KeyboardSettingsRepoImpl(sl(),sl()));
sl.registerLazySingleton<BatteryManagerRepo>(() => BatteryManagerRepoImpl(sl(),sl()));
sl.registerLazySingleton<DisablerRepo>(() => DisablerRepoImpl(sl(),sl(),sl()));
sl.registerLazySingleton<DisablerRepo>(() => DisablerRepoImpl(sl(),sl()));

sl.registerLazySingleton<TerminalDelegate>(() => TerminalDelegateImpl(sl(),sl()));

sl.registerLazySingleton<SetupSource>(() => SetupSourceImpl(sl()));
sl.registerLazySingleton<TerminalSource>(() => TerminalSourceImpl()..clearLog());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import 'dart:io';

import 'package:aurora/data/shared_preference/pref_repo.dart';
import 'package:aurora/user_interface/terminal/data/source/terminal_source.dart';
import 'package:aurora/user_interface/terminal/domain/repository/terminal_delegate.dart';
import 'package:aurora/utility/constants.dart';

import 'battery_manager_repo.dart';

class BatteryManagerRepoImpl implements BatteryManagerRepo{

BatteryManagerRepoImpl(this._terminalSource, this._prefRepo);
BatteryManagerRepoImpl(this._terminalDelegate, this._prefRepo);


final TerminalSource _terminalSource;
final TerminalDelegate _terminalDelegate;
final PrefRepo _prefRepo;

@override
Expand All @@ -22,9 +22,9 @@ class BatteryManagerRepoImpl implements BatteryManagerRepo{
@override
Future setBatteryChargeLimit({required int limit, required bool serviceEnabled}) async{
if(serviceEnabled) {
await _terminalSource.execute("${Constants.globalConfig.kExecBatteryManagerPath} $limit");
await _terminalDelegate.execute("${Constants.globalConfig.kExecBatteryManagerPath} $limit");
}else{
await _terminalSource.execute("${Constants.kPolkit} ${Constants.globalConfig.kExecBatteryManagerPath} $limit");
await _terminalDelegate.execute("${Constants.kPolkit} ${Constants.globalConfig.kExecBatteryManagerPath} $limit");
}
await _prefRepo.setThreshold(limit);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'dart:ui';
import 'package:aurora/data/model/ar_mode_model.dart';
import 'package:aurora/data/model/ar_state_model.dart';
import 'package:aurora/data/shared_preference/pref_repo.dart';
import 'package:aurora/user_interface/terminal/data/source/terminal_source.dart';
import 'package:aurora/user_interface/terminal/domain/repository/terminal_delegate.dart';
import 'package:aurora/utility/ar_widgets/colors.dart';
import 'package:aurora/utility/constants.dart';
import 'package:aurora/utility/global_mixin.dart';
Expand All @@ -12,24 +12,27 @@ import 'keyboard_settings_repo.dart';

class KeyboardSettingsRepoImpl extends KeyboardSettingsRepo with GlobalMixin{

KeyboardSettingsRepoImpl(this._terminalSource, this._prefRepo);
KeyboardSettingsRepoImpl(this._terminalDelegate, this._prefRepo);

final TerminalSource _terminalSource;
final TerminalDelegate _terminalDelegate;
final PrefRepo _prefRepo;

final List<int> faustusKeys=[0,1,2,3];
final List<int> mainLineKeys=[0,1,2,9];

final _globalConfig=Constants.globalConfig;

@override
Future setMainlineStateParams({required int boot, required int awake, required int sleep}) async{
await _terminalSource.execute("${_globalConfig.kExecMainlinePath} state 1 $boot $awake $sleep 0");
await _terminalDelegate.execute("${_globalConfig.kExecMainlinePath} state 1 $boot $awake $sleep 0");
await _prefRepo.setArState(arState:ArState(awake: awake==1,sleep: sleep==1,boot: boot==1));
}

@override
Future setMainlineModeParams({required ArMode arMode}) async{
if(super.isMainLine()) {
await _terminalSource.execute(
"${_globalConfig.kExecMainlinePath} mode 1 ${arMode.mode} ${arMode
await _terminalDelegate.execute(
"${_globalConfig.kExecMainlinePath} mode 1 ${mainLineKeys[arMode.mode!]} ${arMode
.color!.red} ${arMode.color!.green} ${arMode.color!.blue} ${arMode
.speed}");
}else{
Expand All @@ -44,7 +47,7 @@ class KeyboardSettingsRepoImpl extends KeyboardSettingsRepo with GlobalMixin{
if(super.isMainLine()){
await setMainlineModeParams(arMode: arMode);
}else {
await _terminalSource.execute("${_globalConfig.kExecFaustusPath} mode ${arMode.mode} ");
await _terminalDelegate.execute("${_globalConfig.kExecFaustusPath} mode ${faustusKeys[arMode.mode!]} ");
}
await _prefRepo.setArMode(arMode: arMode);
}
Expand All @@ -55,7 +58,7 @@ class KeyboardSettingsRepoImpl extends KeyboardSettingsRepo with GlobalMixin{
await setMainlineModeParams(arMode: arMode);
}else {
Color color=arMode.color!;
await _terminalSource.execute(
await _terminalDelegate.execute(
"${_globalConfig.kExecFaustusPath} color ${color.red
.toRadixString(16)} ${color.green.toRadixString(16)} ${color
.blue.toRadixString(16)} 0");
Expand All @@ -72,14 +75,14 @@ class KeyboardSettingsRepoImpl extends KeyboardSettingsRepo with GlobalMixin{
if(super.isMainLine()){
await setMainlineModeParams(arMode: arMode);
}else {
await _terminalSource.execute("${_globalConfig.kExecFaustusPath} speed ${arMode.speed} ");
await _terminalDelegate.execute("${_globalConfig.kExecFaustusPath} speed ${arMode.speed} ");
}
await _prefRepo.setArMode(arMode: arMode);
}

@override
Future setBrightness(int brightness) async {
await _terminalSource.execute("${super.isMainLine()?_globalConfig.kExecMainlinePath: _globalConfig.kExecFaustusPath} brightness $brightness ");
await _terminalDelegate.execute("${super.isMainLine()?_globalConfig.kExecMainlinePath: _globalConfig.kExecFaustusPath} brightness $brightness ");
_prefRepo.setBrightness(brightness);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import 'package:aurora/data/shared_preference/pref_repo.dart';
import 'package:aurora/user_interface/control_panel/presentation/state/disabler/disabler_bloc.dart';
import 'package:aurora/user_interface/home/domain/home_repo.dart';
import 'package:aurora/user_interface/terminal/data/source/terminal_source.dart';
import 'package:aurora/user_interface/terminal/domain/repository/terminal_delegate.dart';
import 'package:aurora/utility/constants.dart';

import 'disabler_repo.dart';

class DisablerRepoImpl implements DisablerRepo{

DisablerRepoImpl(this._terminalSource,this._homeRepo,this._prefRepo);
DisablerRepoImpl(this._terminalDelegate,this._prefRepo);

final TerminalSource _terminalSource;
final HomeRepo _homeRepo;
final TerminalDelegate _terminalDelegate;
final PrefRepo _prefRepo;

@override
Future disableServices({required DISABLE disable}) async{

var command="${Constants.kPolkit} ${await _homeRepo.extractAsset(sourceFileName: Constants.kArSetup)} ${Constants.globalConfig.kWorkingDirectory} ";
var command="${Constants.kPolkit} ${await _terminalDelegate.extractAsset(sourceFileName: Constants.kArSetup)} ${Constants.globalConfig.kWorkingDirectory} ";

switch(disable) {
case DISABLE.faustus:
Expand All @@ -36,7 +34,7 @@ class DisablerRepoImpl implements DisablerRepo{
break;
}

await _terminalSource.execute(command);
await _terminalDelegate.execute(command);
if(disable==DISABLE.all||disable==DISABLE.threshold){
await _prefRepo.setThreshold(100);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Widget brightnessController({required BuildContext context, required String title}) {
List<ButtonAttribute<int>> a = [
List<ButtonAttribute<int>> brightnessList = [
ButtonAttribute(title: "Off", value: 0),
ButtonAttribute(title: "Low", value: 1),
ButtonAttribute(title: "Medium", value: 2),
Expand All @@ -22,7 +22,7 @@ Widget brightnessController({required BuildContext context, required String titl
children: [
Text(title),
Row(
children: a
children: brightnessList
.map((e) => ArButton(
title: e.title,
isSelected: state.brightness == e.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ class ModeController extends StatelessWidget with GlobalMixin{
final bool isVisible;
final String title;

final List<ButtonAttribute<int>> a=[
@override
Widget build(BuildContext context) {

final List<ButtonAttribute<int>> modeList=[
ButtonAttribute(title: "Static",value: 0),
ButtonAttribute(title: "Breathing",value: 1),
ButtonAttribute(title: "Color Cycle",value: 2),
ButtonAttribute(title: "Strobing",value: 3)
];
];

@override
Widget build(BuildContext context) {
return AnimatedContainer(
duration: const Duration(milliseconds: 300),
height: isVisible?100:0,
Expand All @@ -38,11 +39,10 @@ class ModeController extends StatelessWidget with GlobalMixin{
children: [
Text(title),
Row(
children: a.map((e) =>
children: modeList.map((e) =>
ArButton(
title: e.title,
isSelected: state.mode==e.value,
isEnabled: !(super.isMainLine() && e.value==3),
action: () {
context.read<KeyboardSettingsBloc>().add(KeyboardSettingsEventSetMode(mode: e.value??0));
} )).toList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Widget speedController({
required String title,
bool isVisible=true}) {

List<ButtonAttribute<int>> a=[
List<ButtonAttribute<int>> speedList=[
ButtonAttribute(title: "Slow",value: 0),
ButtonAttribute(title: "Medium",value: 1),
ButtonAttribute(title: "Fast",value: 2),
Expand All @@ -30,7 +30,7 @@ Widget speedController({
children: [
Text(title),
Row(
children: a.map((e) =>
children: speedList.map((e) =>
ArButton(
title: e.title,
isSelected: state.speed==e.value,
Expand Down
Loading

0 comments on commit 05dcb7b

Please sign in to comment.