Files
dots-hyprland/.config/quickshell/oo/singletons/Directories.qml
T
2025-07-27 08:52:38 +07:00

31 lines
1.6 KiB
QML

pragma Singleton
pragma ComponentBehavior: Bound
import qs.modules.common.functions
import Qt.labs.platform
import QtQuick
import Quickshell
Singleton {
// XDG Dirs, with "file://"
readonly property string config: StandardPaths.standardLocations(StandardPaths.ConfigLocation)[0]
readonly property string state: StandardPaths.standardLocations(StandardPaths.StateLocation)[0]
readonly property string cache: StandardPaths.standardLocations(StandardPaths.CacheLocation)[0]
readonly property string pictures: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0]
readonly property string downloads: StandardPaths.standardLocations(StandardPaths.DownloadLocation)[0]
// Other dirs used by the shell, without "file://"
property string assetsPath: Quickshell.shellPath("assets")
property string generatedMaterialThemePath: FileUtils.trimFileProtocol(`${Directories.state}/user/generated/colors.json`)
property string notificationsPath: FileUtils.trimFileProtocol(`${Directories.cache}/notifications/notifications.json`)
property string scriptPath: Quickshell.shellPath("scripts")
property string shellConfig: FileUtils.trimFileProtocol(`${Directories.config}/quickshell`)
property string shellConfigName: "oo.json"
property string shellConfigPath: `${Directories.shellConfig}/${Directories.shellConfigName}`
property string wallpaperSwitchScriptPath: FileUtils.trimFileProtocol(`${Directories.scriptPath}/colors/switchwall.sh`)
// Cleanup on init
Component.onCompleted: {
Quickshell.execDetached(["mkdir", "-p", `${shellConfig}`])
}
}