1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-08 12:13:31 -04:00

feat(settings): Added Settings Tab Autostart App (XDG Autostart) (#2535)

* feat(Autostart): add Autostart tab and application selection popup

* fix(AutoStartTab): update systemdUserDir property to use XDG_CONFIG_HOME

* fix(AutoStartTab): update autostartDir and systemdUserDir to use StandardPaths for config home

* refactor(AutoStartTab): use FileView & FolderListModel

* refactor(AutoStartTab): implement systemd override generation for autostart applications using FileView

* feat(AutoStartTab): add systemd check to determine environment and update tray icon visibility

* feat(SettingsSidebar, AutoStartTab, DesktopService): add autostart functionality and systemd checks

* feat(AutoStartTab): add hidden property support for desktop entries and toggle functionality

* feat(AutoStartTab): add initialize autostart directory and add toast if writer failed

* add(AutoStartTab): logging for scoped log tracking

---------
This commit is contained in:
arfan
2026-06-03 09:52:58 +07:00
committed by GitHub
parent 1ee42506b6
commit d2905072c0
5 changed files with 1144 additions and 0 deletions
+35
View File
@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Common
import qs.Services
@@ -12,6 +13,40 @@ Singleton {
readonly property var log: Log.scoped("DesktopService")
property var _cache: ({})
property bool isSystemd: false
property bool systemdAutostartTargetActive: false
property bool systemdAutostartTargetChecked: false
readonly property bool autostartAvailable: root.systemdAutostartTargetChecked && (!root.isSystemd || root.systemdAutostartTargetActive)
Component.onCompleted: initSystemCheckProcess.running = true
Process {
id: initSystemCheckProcess
command: ["sh", "-c", "cat /proc/1/comm 2>/dev/null | tr -d '\\n'"]
running: false
stdout: StdioCollector {
onStreamFinished: {
root.isSystemd = (text || "").trim() === "systemd";
if (!root.isSystemd)
root.systemdAutostartTargetChecked = true;
else
systemdAutostartTargetCheck.running = true;
}
}
}
Process {
id: systemdAutostartTargetCheck
command: ["systemctl", "--user", "is-active", "xdg-desktop-autostart.target"]
running: false
stdout: StdioCollector {
onStreamFinished: {
root.systemdAutostartTargetActive = (text || "").trim() === "active";
root.systemdAutostartTargetChecked = true;
}
}
}
function resolveIconPath(moddedAppId) {
if (!moddedAppId)
return "";