Skip to content

Commit

Permalink
Add manjaro and endeavour os
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean28518 committed Mar 9, 2024
1 parent 2e828b0 commit 9654d60
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 54 deletions.
4 changes: 3 additions & 1 deletion additional/python/setup_keybinding.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ def add_linux_assistant_keybinding_gnome():
# Xfce ----------------------------------------------------------------------------------

def add_linux_assistant_keybinding_xfce():
jessentials.run_command(f"xfconf-query -c xfce4-keyboard-shortcuts -p '/commands/custom/{KEY_MODIFIER}q' -n -t string -s linux-assistant")
os.environ["DBUS_SESSION_BUS_ADDRESS"] = "unix:path=/run/user/" + str(os.getuid()) + "/bus"
os.system(f"xfconf-query -c xfce4-keyboard-shortcuts -p '/commands/custom/{KEY_MODIFIER}q' -n -t string -s linux-assistant")
#jessentials.run_command(f"xfconf-query -c xfce4-keyboard-shortcuts -p '/commands/custom/{KEY_MODIFIER}q' -n -t string -s linux-assistant")

# KDE ----------------------------------------------------------------------------------
# Keymodifier is always <Alt> here.
Expand Down
74 changes: 37 additions & 37 deletions features.csv
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
Feature,Flatpak,Debian,Ubuntu,Linux Mint,LMDE,PopOS,MX Linux,Zorin OS,KDE neon,openSUSE,Fedora,Arch,Gnome,Xfce,Cinnamon,KDE,Notes
Adabtable dark mode,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes *,yes,yes,yes,"*) depends on window theme,not gtk "
Hotkey handling,yes,yes *,yes *,yes,yes,yes,yes,yes,yes,yes,yes *,yes,yes *,yes,yes,yes,*) only works on wayland with workaround described in #24
Feedback function,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
Automatic recognition of environment,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,
App search,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,
Folder structure search,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,
Bookmark/Places folder search,yes,-,-,-,-,-,-,-,-,-,-,-,yes,yes,yes,yes,
Recent file search,yes,-,-,-,-,-,-,-,-,-,-,-,yes,yes,yes,yes,
Favorite file search,yes,-,-,-,-,-,-,-,-,-,-,-,no,no,yes,no,
Browser bookmark search,yes,yes,?,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes," Currently works with firefox,chromium and chrome; needs to checked with firefox on snap "
Security check,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,
Health check,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,,,,,
After installation routine,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,
Warpinator,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,Only works if flatpak is installed/available in the sources
Nvidia installation,-,(yes),yes,yes,(yes),(yes),(yes),(yes),(yes),no,no,no,-,-,-,-,
Multimedia codecs installation,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
Timeshift setup,yes,yes,yes,yes,yes,yes,yes,yes *,yes,no,no,yes,-,-,-,-,*) When you start timeshift the welcome dialog with config is started. But the timeshift.json is configured successfully??
Automatic update setup,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,no,-,-,-,-,integrates on Linux Mint with mintupdate
Update full system (all packages of all pack. man.),yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
Search and installation/uninstallation of system packages,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
General integration of system package manager,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
General integration of flatpak,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
General integration of snapd,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
Recognition of drive space utilization,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,,,,,
Change user passwort dialog,yes,-,-,-,-,-,yes,-,no,-,yes,-,yes,yes,yes,no,
open system information,yes,-,-,-,-,-,yes,-,no,-,yes,-,yes,yes,yes,no,
automatic update check & install of linux assistant,no,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,no,-,-,-,-,
openAdditionalSoftwareSourcesSettings,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes *,no,-,-,-,-,*) We can only open gnome-software here
Change Power Mode,yes,yes,yes,yes,yes,yes,yes,no,yes,?,yes,yes,-,-,-,-,
Change user profile,yes,-,-,-,yes,-,yes,-,no,-,yes,-,yes,yes,yes,no,
hardinfo,yes,yes,yes,yes,yes,yes,yes,yes,yes,?,no *,no *,-,-,-,-,*) Fedora and arch do not have package hardinfo anymore
redshift,yes,yes,yes,yes,yes,yes,yes,yes,yes,?,yes,no *,yes,yes,yes,yes,*) Does only work with further complicated setup.
makeCurrentUserToAdministrator,?,yes,yes,yes,yes,yes,yes,yes,yes,?,yes,yes,-,-,-,-,
setupSnapAndInstallSnapStore,?,yes,yes,yes,yes,yes,yes,yes,yes,no,yes,yes,-,-,-,-,
Commands in Searchbar,?,-,-,-,-,-,-,-,-,-,-,-,yes,yes,yes,yes,
AutomaticRepairOfPackageManager,?,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,no,-,-,-,-,
Feature,Flatpak,Debian,Ubuntu,Linux Mint,LMDE,PopOS,MX Linux,Zorin OS,KDE neon,openSUSE,Fedora,Arch,Manjaro,Endeavour,Gnome,Xfce,Cinnamon,KDE,Notes
Adabtable dark mode,yes,-,-,-,-,-,-,-,-,-,-,-,-,-,yes *,yes,yes,yes,"*) depends on window theme,not gtk "
Hotkey handling,yes,yes *,yes *,yes,yes,yes,yes,yes,yes,yes,yes *,yes,?,?,yes *,yes,yes,yes,*) only works on wayland with workaround described in #24
Feedback function,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
Automatic recognition of environment,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,
App search,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes*,yes,yes,yes,yes,*) Icons are very small here
Folder structure search,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,
Bookmark/Places folder search,yes,-,-,-,-,-,-,-,-,-,-,-,-,-,yes,yes,yes,yes,
Recent file search,yes,-,-,-,-,-,-,-,-,-,-,-,-,-,yes,yes,yes,yes,
Favorite file search,yes,-,-,-,-,-,-,-,-,-,-,-,-,-,no,no,yes,no,
Browser bookmark search,yes,yes,?,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes," Currently works with firefox,chromium and chrome; needs to checked with firefox on snap "
Security check,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,?,?,yes,yes,yes,yes,
Health check,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,,,,,
After installation routine,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,
Warpinator,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,Only works if flatpak is installed/available in the sources
Nvidia installation,-,(yes),yes,yes,(yes),(yes),(yes),(yes),(yes),no,no,no,no,no,-,-,-,-,
Multimedia codecs installation,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
Timeshift setup,yes,yes,yes,yes,yes,yes,yes,yes *,yes,no,no,yes,yes,yes,-,-,-,-,*) When you start timeshift the welcome dialog with config is started. But the timeshift.json is configured successfully??
Automatic update setup,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,no,no,no,-,-,-,-,integrates on Linux Mint with mintupdate
Update full system (all packages of all pack. man.),yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
Search and installation/uninstallation of system packages,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
General integration of system package manager,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
General integration of flatpak,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
General integration of snapd,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,-,-,-,-,
Recognition of drive space utilization,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,,,,,
Change user passwort dialog,yes,-,-,-,-,-,yes,-,no,-,yes,-,,,yes,yes,yes,no,
open system information,yes,-,-,-,-,-,yes,-,no,-,yes,-,yes,yes,yes,yes,yes,no,
automatic update check & install of linux assistant,no,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,no,no,no,-,-,-,-,
openAdditionalSoftwareSourcesSettings,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes *,no,no,no,-,-,-,-,*) We can only open gnome-software here
Change Power Mode,yes,yes,yes,yes,yes,yes,yes,no,yes,?,yes,yes,yes,yes,-,-,-,-,
Change user profile,yes,-,-,-,yes,-,yes,-,no,-,yes,-,-,-,yes,yes,yes,no,
hardinfo,yes,yes,yes,yes,yes,yes,yes,yes,yes,?,no *,no *,no *,no *,-,-,-,-,*) Fedora and arch do not have package hardinfo anymore
redshift,yes,yes,yes,yes,yes,yes,yes,yes,yes,?,yes,no *,yes,yes,yes,yes,yes,yes,*) Does only work with further complicated setup.
makeCurrentUserToAdministrator,?,yes,yes,yes,yes,yes,yes,yes,yes,?,yes,yes,yes,yes,-,-,-,-,
setupSnapAndInstallSnapStore,?,yes,yes,yes,yes,yes,yes,yes,yes,no,yes,yes,?,?,-,-,-,-,
Commands in Searchbar,?,-,-,-,-,-,-,-,-,-,-,-,yes,yes,yes,yes,yes,yes,
AutomaticRepairOfPackageManager,?,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,no,no,no,-,-,-,-,
14 changes: 10 additions & 4 deletions lib/content/basic_entries.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ List<ActionEntry> getBasicEntries(BuildContext context) {
color: MintY.currentColor,
),
disableEntryIf: () {
return [DISTROS.FEDORA, DISTROS.ARCH]
.contains(Linux.currentenvironment.distribution);
return [
DISTROS.FEDORA,
DISTROS.ARCH,
DISTROS.MANJARO,
DISTROS.ENDEAVOUR
].contains(Linux.currentenvironment.distribution);
},
),
ActionEntry(
Expand Down Expand Up @@ -133,7 +137,8 @@ List<ActionEntry> getBasicEntries(BuildContext context) {
),
disableEntryIf: () =>
// We disable this entry on arch because the user should check the update manager by himself.
Linux.currentenvironment.distribution == DISTROS.ARCH,
[DISTROS.ARCH, DISTROS.MANJARO, DISTROS.ENDEAVOUR]
.contains(Linux.currentenvironment.distribution),
),
ActionEntry(
name: AppLocalizations.of(context)!.automaticSnapshots,
Expand Down Expand Up @@ -168,7 +173,8 @@ List<ActionEntry> getBasicEntries(BuildContext context) {
iconWidget: Icon(Icons.bug_report, size: 48, color: MintY.currentColor),
keywords: ["fix", "package", "manager", "apt", "dpkg", "rpm", "zypper"],
disableEntryIf: () {
return [DISTROS.ARCH].contains(Linux.currentenvironment.distribution);
return [DISTROS.ARCH, DISTROS.MANJARO, DISTROS.ENDEAVOUR]
.contains(Linux.currentenvironment.distribution);
},
),
ActionEntry(
Expand Down
4 changes: 3 additions & 1 deletion lib/content/recommendations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ List<ActionEntry> getRecommendations(BuildContext context) {
color: MintY.currentColor,
),
disableEntryIf: () {
return [DISTROS.ARCH].contains(Linux.currentenvironment.distribution);
return [
DISTROS.ARCH,
].contains(Linux.currentenvironment.distribution);
},
),
ActionEntry(
Expand Down
6 changes: 6 additions & 0 deletions lib/enums/distros.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ enum DISTROS {
LMDE,
FEDORA,
ARCH,
MANJARO,
ENDEAVOUR,
}

String getNiceStringOfDistrosEnum(var distro) {
Expand All @@ -36,6 +38,10 @@ String getNiceStringOfDistrosEnum(var distro) {
return "Fedora";
case DISTROS.ARCH:
return "Arch";
case DISTROS.MANJARO:
return "Manjaro";
case DISTROS.ENDEAVOUR:
return "EndeavourOS";
default:
return "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ class AfterInstallationAutomaticConfiguration extends StatelessWidget {
false; // disabled because of snapper
}

if (Linux.currentenvironment.distribution == DISTROS.ARCH) {
AfterInstallationService.setupAutomaticUpdates = false;
AfterInstallationService.installNvidiaDrivers = false;
}

List<Widget> content = [
MintYSelectableEntryWithIconHorizontal(
icon: const SystemIcon(
Expand Down Expand Up @@ -130,12 +125,16 @@ class AfterInstallationAutomaticConfiguration extends StatelessWidget {
element.runtimeType != MintYSelectableEntryWithIconHorizontal);

// Remove the Nvidia Card Installation and the Automatic Update Manager Configuration if the distribution is Arch
if (Linux.currentenvironment.distribution == DISTROS.ARCH) {
// Also set the AfterInstallationService.setupAutomaticUpdates and ... to false
if ([DISTROS.ARCH, DISTROS.MANJARO, DISTROS.ENDEAVOUR]
.contains(Linux.currentenvironment.distribution)) {
AfterInstallationService.setupAutomaticUpdates = false;
content.removeWhere((element) =>
element.runtimeType == MintYSelectableEntryWithIconHorizontal &&
(element as MintYSelectableEntryWithIconHorizontal).title ==
AppLocalizations.of(context)!
.automaticUpdateManagerConfiguration);
AfterInstallationService.installNvidiaDrivers = false;
content.removeWhere((element) =>
element.runtimeType == MintYSelectableEntryWithIconHorizontal &&
(element as MintYSelectableEntryWithIconHorizontal).title ==
Expand Down
3 changes: 2 additions & 1 deletion lib/layouts/security_check/overview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class SecurityCheckOverview extends StatelessWidget {
root: true,
arguments: ["--home=${Platform.environment['HOME']}"],
getErrorMessages: true);
} else if (Linux.currentenvironment.distribution == DISTROS.ARCH) {
} else if ([DISTROS.ARCH, DISTROS.MANJARO, DISTROS.ENDEAVOUR]
.contains(Linux.currentenvironment.distribution)) {
checkerOutputString = Linux.runPythonScript("check_security_arch.py",
root: true,
arguments: ["--home=${Platform.environment['HOME']}"],
Expand Down
7 changes: 7 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ class MyApp extends StatelessWidget {
case DISTROS.ARCH:
MintY.currentColor = const Color.fromARGB(255, 15, 148, 210);
break;
case DISTROS.MANJARO:
MintY.currentColor = const Color.fromARGB(255, 53, 191, 164);
break;
case DISTROS.ENDEAVOUR:
MintY.currentColor = const Color.fromARGB(255, 127, 63, 191);
MintY.secondaryColor = const Color.fromARGB(255, 127, 127, 255);
break;
default:
MintY.currentColor = Colors.blue;
}
Expand Down
27 changes: 24 additions & 3 deletions lib/services/linux.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ class Linux {
await loadCurrentEnvironment();
}

static String getCacheDirectory() {
homeFolder = getHomeDirectory();
String cacheDir = "$homeFolder/.cache/linux-assistant/";
cacheDir = cacheDir.replaceAll("//", "/");
// Ensure that the cache directory exists
Directory(cacheDir).createSync(recursive: true);
return cacheDir;
}

/// Returns the stdout and the stderr.
///
/// If [hostOnFlatpak] is set to false, the command will be issued in the flatpak sandbox, if available.
Expand Down Expand Up @@ -922,6 +931,10 @@ class Linux {
newEnvironment.distribution = DISTROS.FEDORA;
} else if (lines[0].toLowerCase().contains("arch")) {
newEnvironment.distribution = DISTROS.ARCH;
} else if (lines[0].toLowerCase().contains("manjaro")) {
newEnvironment.distribution = DISTROS.MANJARO;
} else if (lines[0].toLowerCase().contains("endeavour")) {
newEnvironment.distribution = DISTROS.ENDEAVOUR;
}

// get version:
Expand Down Expand Up @@ -1140,6 +1153,8 @@ class Linux {
));
break;
case DISTROS.ARCH:
case DISTROS.MANJARO:
case DISTROS.ENDEAVOUR:
commandQueue.add(LinuxCommand(
userId: 0,
command:
Expand Down Expand Up @@ -1175,7 +1190,7 @@ class Linux {
print("Run python script: $executable $commandList");

return runCommandWithCustomArguments(executable, commandList,
getErrorMessages: getErrorMessages);
getErrorMessages: getErrorMessages, environment: Platform.environment);
}

static Future<bool> isNvidiaCardInstalledOnSystem() async {
Expand Down Expand Up @@ -1240,7 +1255,8 @@ class Linux {
static Future<void> enableAutomaticSnapshots() async {
await ensureApplicationInstallation(["timeshift"]);
String additional = "";
if (currentenvironment.distribution == DISTROS.ARCH) {
if ([DISTROS.ARCH, DISTROS.MANJARO, DISTROS.ENDEAVOUR]
.contains(currentenvironment.distribution)) {
additional = "--daily";
}
commandQueue.add(LinuxCommand(
Expand Down Expand Up @@ -2535,6 +2551,11 @@ class Linux {
static void openCommandInTerminal(command) {
command =
"echo 'Running command: $command'; $command; echo 'Closing in 10 seconds...'; sleep 10";
// Write the command into a temporary file
String cacheDir = getCacheDirectory();
String tempFile = "$cacheDir/temp_command.sh";
File(tempFile).writeAsStringSync(command);

print("Opening command in terminal: $command");
switch (currentenvironment.desktop) {
case DESKTOPS.KDE:
Expand All @@ -2551,7 +2572,7 @@ class Linux {
break;
case DESKTOPS.XFCE:
runCommandWithCustomArguments(
"xfce4-terminal", ["-e", "bash", "-c", command]);
"xfce4-terminal", ["-e", "bash $cacheDir/temp_command.sh"]);
break;
default:
// Xterm
Expand Down
3 changes: 2 additions & 1 deletion lib/services/updater.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class LinuxAssistantUpdater {
// Return false if we are running on Arch Linux and the user has it not running in flatpak.
// We are missing an update mechanism for Arch Linux at the current time.
if (!Linux.currentenvironment.runningInFlatpak &&
Linux.currentenvironment.distribution == DISTROS.ARCH) {
[DISTROS.ARCH, DISTROS.MANJARO, DISTROS.ENDEAVOUR]
.contains(Linux.currentenvironment.distribution)) {
return false;
}

Expand Down

0 comments on commit 9654d60

Please sign in to comment.