mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-10-27 02:54:36 +00:00
core/qmlglobal: add shellRoot property
This commit is contained in:
2 files changed
+13
No files matched your search
@@ -166,6 +166,12 @@ void QuickshellGlobal::reload(bool hard) {
|
||||
root->reloadGraph(hard);
|
||||
}
|
||||
|
||||
QString QuickshellGlobal::shellRoot() const {
|
||||
auto* generation = EngineGeneration::findObjectGeneration(this);
|
||||
// already canonical
|
||||
return generation->rootPath.path();
|
||||
}
|
||||
|
||||
QString QuickshellGlobal::workingDirectory() const { // NOLINT
|
||||
return QuickshellSettings::instance()->workingDirectory();
|
||||
}
|
||||
|
||||
@@ -98,6 +98,11 @@ class QuickshellGlobal: public QObject {
|
||||
/// This creates an instance of your window once on every screen.
|
||||
/// As screens are added or removed your window will be created or destroyed on those screens.
|
||||
Q_PROPERTY(QQmlListProperty<QuickshellScreenInfo> screens READ screens NOTIFY screensChanged);
|
||||
/// The full path to the root directory of your shell.
|
||||
///
|
||||
/// The root directory is the folder containing the entrypoint to your shell, often referred
|
||||
/// to as `shell.qml`.
|
||||
Q_PROPERTY(QString shellRoot READ shellRoot CONSTANT);
|
||||
/// Quickshell's working directory. Defaults to whereever quickshell was launched from.
|
||||
Q_PROPERTY(QString workingDirectory READ workingDirectory WRITE setWorkingDirectory NOTIFY workingDirectoryChanged);
|
||||
/// If true then the configuration will be reloaded whenever any files change.
|
||||
@@ -133,6 +138,8 @@ public:
|
||||
/// > of your icon theme.
|
||||
Q_INVOKABLE static QString iconPath(const QString& icon);
|
||||
|
||||
[[nodiscard]] QString shellRoot() const;
|
||||
|
||||
[[nodiscard]] QString workingDirectory() const;
|
||||
void setWorkingDirectory(QString workingDirectory);
|
||||
|
||||
|
||||
Reference in new issue
Block a user