diff --git a/additional/python/setup_keybinding.py b/additional/python/setup_keybinding.py index 9ce50b3..35c01e8 100644 --- a/additional/python/setup_keybinding.py +++ b/additional/python/setup_keybinding.py @@ -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 here. diff --git a/features.csv b/features.csv index 80673fe..462fea7 100644 --- a/features.csv +++ b/features.csv @@ -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,-,-,-,-, diff --git a/lib/content/basic_entries.dart b/lib/content/basic_entries.dart index d92b6f6..315af49 100644 --- a/lib/content/basic_entries.dart +++ b/lib/content/basic_entries.dart @@ -73,8 +73,12 @@ List 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( @@ -133,7 +137,8 @@ List 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, @@ -168,7 +173,8 @@ List 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( diff --git a/lib/content/recommendations.dart b/lib/content/recommendations.dart index c1b12de..9c8dfd9 100644 --- a/lib/content/recommendations.dart +++ b/lib/content/recommendations.dart @@ -57,7 +57,9 @@ List getRecommendations(BuildContext context) { color: MintY.currentColor, ), disableEntryIf: () { - return [DISTROS.ARCH].contains(Linux.currentenvironment.distribution); + return [ + DISTROS.ARCH, + ].contains(Linux.currentenvironment.distribution); }, ), ActionEntry( diff --git a/lib/enums/distros.dart b/lib/enums/distros.dart index 3ede501..b81d55f 100644 --- a/lib/enums/distros.dart +++ b/lib/enums/distros.dart @@ -10,6 +10,8 @@ enum DISTROS { LMDE, FEDORA, ARCH, + MANJARO, + ENDEAVOUR, } String getNiceStringOfDistrosEnum(var distro) { @@ -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 ""; } diff --git a/lib/layouts/after_installation/automatic_configuration_selection.dart b/lib/layouts/after_installation/automatic_configuration_selection.dart index 4ca8310..0b6fc85 100644 --- a/lib/layouts/after_installation/automatic_configuration_selection.dart +++ b/lib/layouts/after_installation/automatic_configuration_selection.dart @@ -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 content = [ MintYSelectableEntryWithIconHorizontal( icon: const SystemIcon( @@ -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 == diff --git a/lib/layouts/security_check/overview.dart b/lib/layouts/security_check/overview.dart index bccadf0..5d008de 100644 --- a/lib/layouts/security_check/overview.dart +++ b/lib/layouts/security_check/overview.dart @@ -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']}"], diff --git a/lib/main.dart b/lib/main.dart index 24cfe37..575d0f3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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; } diff --git a/lib/services/linux.dart b/lib/services/linux.dart index 111c15b..55572c7 100644 --- a/lib/services/linux.dart +++ b/lib/services/linux.dart @@ -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. @@ -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: @@ -1140,6 +1153,8 @@ class Linux { )); break; case DISTROS.ARCH: + case DISTROS.MANJARO: + case DISTROS.ENDEAVOUR: commandQueue.add(LinuxCommand( userId: 0, command: @@ -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 isNvidiaCardInstalledOnSystem() async { @@ -1240,7 +1255,8 @@ class Linux { static Future 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( @@ -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: @@ -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 diff --git a/lib/services/updater.dart b/lib/services/updater.dart index dc7b6da..77e7fdd 100644 --- a/lib/services/updater.dart +++ b/lib/services/updater.dart @@ -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; }