mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2026-04-12 06:21:54 +10:00
Compare commits
No commits in common. "d4c92973b53d9fa34cc110d3b974eb6bde5b3027" and "7c5a6c4bd4be1f258aa47626cf5cde02215adad2" have entirely different histories.
d4c92973b5
...
7c5a6c4bd4
8 changed files with 31 additions and 123 deletions
|
|
@ -43,8 +43,6 @@ set shell id.
|
||||||
- Added `QS_DISABLE_CRASH_HANDLER` environment variable to disable crash handling.
|
- Added `QS_DISABLE_CRASH_HANDLER` environment variable to disable crash handling.
|
||||||
- Added `QS_CRASHREPORT_URL` environment variable to allow overriding the crash reporter link.
|
- Added `QS_CRASHREPORT_URL` environment variable to allow overriding the crash reporter link.
|
||||||
- Added `AppId` pragma and `QS_APP_ID` environment variable to allow overriding the desktop application ID.
|
- Added `AppId` pragma and `QS_APP_ID` environment variable to allow overriding the desktop application ID.
|
||||||
- Added `DropExpensiveFonts` pragma and `QS_DROP_EXPENSIVE_FONTS` environment variable which avoids loading fonts which may cause lag and excessive memory usage if many variants are used.
|
|
||||||
- Unrecognized pragmas are no longer a hard error for future backward compatibility.
|
|
||||||
|
|
||||||
## Bug Fixes
|
## Bug Fixes
|
||||||
|
|
||||||
|
|
@ -73,7 +71,6 @@ set shell id.
|
||||||
- Fixed JsonAdapter sending unnecessary property changes for primitive values.
|
- Fixed JsonAdapter sending unnecessary property changes for primitive values.
|
||||||
- Fixed JsonAdapter serialization for lists.
|
- Fixed JsonAdapter serialization for lists.
|
||||||
- Fixed pipewire crashes after hotplugging devices and changing default outputs.
|
- Fixed pipewire crashes after hotplugging devices and changing default outputs.
|
||||||
- Fixed launches failing for `--daemonize` on some systems.
|
|
||||||
|
|
||||||
## Packaging Changes
|
## Packaging Changes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,6 @@ int launch(const LaunchArgs& args, char** argv, QCoreApplication* coreApplicatio
|
||||||
QString iconTheme = qEnvironmentVariable("QS_ICON_THEME");
|
QString iconTheme = qEnvironmentVariable("QS_ICON_THEME");
|
||||||
QHash<QString, QString> envOverrides;
|
QHash<QString, QString> envOverrides;
|
||||||
QString appId = qEnvironmentVariable("QS_APP_ID");
|
QString appId = qEnvironmentVariable("QS_APP_ID");
|
||||||
bool dropExpensiveFonts = false;
|
|
||||||
QString dataDir;
|
QString dataDir;
|
||||||
QString stateDir;
|
QString stateDir;
|
||||||
QString cacheDir;
|
QString cacheDir;
|
||||||
|
|
@ -93,7 +92,6 @@ int launch(const LaunchArgs& args, char** argv, QCoreApplication* coreApplicatio
|
||||||
else if (pragma == "NativeTextRendering") pragmas.nativeTextRendering = true;
|
else if (pragma == "NativeTextRendering") pragmas.nativeTextRendering = true;
|
||||||
else if (pragma == "IgnoreSystemSettings") pragmas.desktopSettingsAware = false;
|
else if (pragma == "IgnoreSystemSettings") pragmas.desktopSettingsAware = false;
|
||||||
else if (pragma == "RespectSystemStyle") pragmas.useSystemStyle = true;
|
else if (pragma == "RespectSystemStyle") pragmas.useSystemStyle = true;
|
||||||
else if (pragma == "DropExpensiveFonts") pragmas.dropExpensiveFonts = true;
|
|
||||||
else if (pragma.startsWith("IconTheme ")) pragmas.iconTheme = pragma.sliced(10);
|
else if (pragma.startsWith("IconTheme ")) pragmas.iconTheme = pragma.sliced(10);
|
||||||
else if (pragma.startsWith("Env ")) {
|
else if (pragma.startsWith("Env ")) {
|
||||||
auto envPragma = pragma.sliced(4);
|
auto envPragma = pragma.sliced(4);
|
||||||
|
|
@ -118,7 +116,8 @@ int launch(const LaunchArgs& args, char** argv, QCoreApplication* coreApplicatio
|
||||||
} else if (pragma.startsWith("CacheDir ")) {
|
} else if (pragma.startsWith("CacheDir ")) {
|
||||||
pragmas.cacheDir = pragma.sliced(9).trimmed();
|
pragmas.cacheDir = pragma.sliced(9).trimmed();
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "Unrecognized pragma" << pragma;
|
qCritical() << "Unrecognized pragma" << pragma;
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
} else if (line.startsWith("import")) break;
|
} else if (line.startsWith("import")) break;
|
||||||
}
|
}
|
||||||
|
|
@ -178,48 +177,6 @@ int launch(const LaunchArgs& args, char** argv, QCoreApplication* coreApplicatio
|
||||||
qputenv(var.toUtf8(), val.toUtf8());
|
qputenv(var.toUtf8(), val.toUtf8());
|
||||||
}
|
}
|
||||||
|
|
||||||
pragmas.dropExpensiveFonts |= qEnvironmentVariableIntValue("QS_DROP_EXPENSIVE_FONTS") == 1;
|
|
||||||
|
|
||||||
if (pragmas.dropExpensiveFonts) {
|
|
||||||
if (auto* runDir = QsPaths::instance()->instanceRunDir()) {
|
|
||||||
auto baseConfigPath = qEnvironmentVariable("FONTCONFIG_FILE");
|
|
||||||
if (baseConfigPath.isEmpty()) baseConfigPath = "/etc/fonts/fonts.conf";
|
|
||||||
|
|
||||||
auto filterPath = runDir->filePath("fonts-override.conf");
|
|
||||||
auto filterFile = QFile(filterPath);
|
|
||||||
if (filterFile.open(QFile::WriteOnly | QFile::Truncate | QFile::Text)) {
|
|
||||||
auto filterTemplate = QStringLiteral(R"(<?xml version="1.0"?>
|
|
||||||
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
|
|
||||||
<fontconfig>
|
|
||||||
<include ignore_missing="no">%1</include>
|
|
||||||
<selectfont>
|
|
||||||
<rejectfont>
|
|
||||||
<pattern>
|
|
||||||
<patelt name="fontwrapper">
|
|
||||||
<string>woff</string>
|
|
||||||
</patelt>
|
|
||||||
</pattern>
|
|
||||||
<pattern>
|
|
||||||
<patelt name="fontwrapper">
|
|
||||||
<string>woff2</string>
|
|
||||||
</patelt>
|
|
||||||
</pattern>
|
|
||||||
</rejectfont>
|
|
||||||
</selectfont>
|
|
||||||
</fontconfig>
|
|
||||||
)");
|
|
||||||
|
|
||||||
QTextStream(&filterFile) << filterTemplate.arg(baseConfigPath);
|
|
||||||
filterFile.close();
|
|
||||||
qputenv("FONTCONFIG_FILE", filterPath.toUtf8());
|
|
||||||
} else {
|
|
||||||
qCritical() << "Could not write fontconfig filter to" << filterPath;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
qCritical() << "Could not create fontconfig filter: instance run directory unavailable";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// The qml engine currently refuses to cache non file (qsintercept) paths.
|
// The qml engine currently refuses to cache non file (qsintercept) paths.
|
||||||
|
|
||||||
// if (auto* cacheDir = QsPaths::instance()->cacheDir()) {
|
// if (auto* cacheDir = QsPaths::instance()->cacheDir()) {
|
||||||
|
|
|
||||||
|
|
@ -84,29 +84,21 @@ void exitDaemon(int code) {
|
||||||
|
|
||||||
close(DAEMON_PIPE);
|
close(DAEMON_PIPE);
|
||||||
|
|
||||||
auto fd = open("/dev/null", O_RDWR);
|
close(STDIN_FILENO);
|
||||||
if (fd == -1) {
|
close(STDOUT_FILENO);
|
||||||
qCritical().nospace() << "Failed to open /dev/null for daemon stdio" << errno << ": "
|
close(STDERR_FILENO);
|
||||||
<< qt_error_string();
|
|
||||||
return;
|
if (open("/dev/null", O_RDONLY) != STDIN_FILENO) { // NOLINT
|
||||||
|
qFatal() << "Failed to open /dev/null on stdin";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dup2(fd, STDIN_FILENO) != STDIN_FILENO) { // NOLINT
|
if (open("/dev/null", O_WRONLY) != STDOUT_FILENO) { // NOLINT
|
||||||
qCritical().nospace() << "Failed to set daemon stdin to /dev/null" << errno << ": "
|
qFatal() << "Failed to open /dev/null on stdout";
|
||||||
<< qt_error_string();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dup2(fd, STDOUT_FILENO) != STDOUT_FILENO) { // NOLINT
|
if (open("/dev/null", O_WRONLY) != STDERR_FILENO) { // NOLINT
|
||||||
qCritical().nospace() << "Failed to set daemon stdout to /dev/null" << errno << ": "
|
qFatal() << "Failed to open /dev/null on stderr";
|
||||||
<< qt_error_string();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dup2(fd, STDERR_FILENO) != STDERR_FILENO) { // NOLINT
|
|
||||||
qCritical().nospace() << "Failed to set daemon stderr to /dev/null" << errno << ": "
|
|
||||||
<< qt_error_string();
|
|
||||||
}
|
|
||||||
|
|
||||||
close(fd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,7 @@ void I3IpcController::handleWorkspaceEvent(I3IpcEvent* event) {
|
||||||
|
|
||||||
if (newWorkspace->bindableMonitor().value()) {
|
if (newWorkspace->bindableMonitor().value()) {
|
||||||
auto* monitor = newWorkspace->bindableMonitor().value();
|
auto* monitor = newWorkspace->bindableMonitor().value();
|
||||||
monitor->setActiveWorkspace(newWorkspace);
|
monitor->setFocusedWorkspace(newWorkspace);
|
||||||
this->bFocusedMonitor = monitor;
|
this->bFocusedMonitor = monitor;
|
||||||
}
|
}
|
||||||
} else if (change == "empty") {
|
} else if (change == "empty") {
|
||||||
|
|
@ -286,7 +286,13 @@ void I3IpcController::handleWorkspaceEvent(I3IpcEvent* event) {
|
||||||
|
|
||||||
if (oldWorkspace != nullptr) {
|
if (oldWorkspace != nullptr) {
|
||||||
qCInfo(logI3Ipc) << "Deleting" << oldWorkspace->bindableId().value() << name;
|
qCInfo(logI3Ipc) << "Deleting" << oldWorkspace->bindableId().value() << name;
|
||||||
|
|
||||||
|
if (this->bFocusedWorkspace == oldWorkspace) {
|
||||||
|
this->bFocusedMonitor->setFocusedWorkspace(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
this->workspaces()->removeObject(oldWorkspace);
|
this->workspaces()->removeObject(oldWorkspace);
|
||||||
|
|
||||||
delete oldWorkspace;
|
delete oldWorkspace;
|
||||||
} else {
|
} else {
|
||||||
qCInfo(logI3Ipc) << "Workspace" << name << "has already been deleted";
|
qCInfo(logI3Ipc) << "Workspace" << name << "has already been deleted";
|
||||||
|
|
|
||||||
|
|
@ -40,37 +40,21 @@ void I3Monitor::updateFromObject(const QVariantMap& obj) {
|
||||||
this->bHeight = rect.value("height").value<qint32>();
|
this->bHeight = rect.value("height").value<qint32>();
|
||||||
this->bScale = obj.value("scale").value<qreal>();
|
this->bScale = obj.value("scale").value<qreal>();
|
||||||
|
|
||||||
auto* activeWorkspace = this->bActiveWorkspace.value();
|
if (!this->bActiveWorkspace
|
||||||
if (!activeWorkspace || activeWorkspaceName != activeWorkspace->bindableName().value()) {
|
|| activeWorkspaceName != this->bActiveWorkspace->bindableName().value())
|
||||||
|
{
|
||||||
if (activeWorkspaceName.isEmpty()) {
|
if (activeWorkspaceName.isEmpty()) {
|
||||||
activeWorkspace = nullptr;
|
this->bActiveWorkspace = nullptr;
|
||||||
} else {
|
} else {
|
||||||
activeWorkspace = this->ipc->findWorkspaceByName(activeWorkspaceName);
|
this->bActiveWorkspace = this->ipc->findWorkspaceByName(activeWorkspaceName);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this->setActiveWorkspace(activeWorkspace);
|
|
||||||
|
|
||||||
Qt::endPropertyUpdateGroup();
|
Qt::endPropertyUpdateGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void I3Monitor::updateInitial(const QString& name) { this->bName = name; }
|
void I3Monitor::updateInitial(const QString& name) { this->bName = name; }
|
||||||
|
|
||||||
void I3Monitor::setActiveWorkspace(I3Workspace* workspace) {
|
void I3Monitor::setFocusedWorkspace(I3Workspace* workspace) { this->bActiveWorkspace = workspace; };
|
||||||
auto* oldWorkspace = this->bActiveWorkspace.value();
|
|
||||||
if (oldWorkspace == workspace) return;
|
|
||||||
|
|
||||||
if (oldWorkspace) {
|
|
||||||
QObject::disconnect(oldWorkspace, nullptr, this, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (workspace) {
|
|
||||||
QObject::connect(workspace, &QObject::destroyed, this, &I3Monitor::onActiveWorkspaceDestroyed);
|
|
||||||
}
|
|
||||||
|
|
||||||
this->bActiveWorkspace = workspace;
|
|
||||||
}
|
|
||||||
|
|
||||||
void I3Monitor::onActiveWorkspaceDestroyed() { this->bActiveWorkspace = nullptr; }
|
|
||||||
|
|
||||||
} // namespace qs::i3::ipc
|
} // namespace qs::i3::ipc
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ public:
|
||||||
[[nodiscard]] QBindable<qreal> bindableScale() { return &this->bScale; }
|
[[nodiscard]] QBindable<qreal> bindableScale() { return &this->bScale; }
|
||||||
[[nodiscard]] QBindable<bool> bindableFocused() { return &this->bFocused; }
|
[[nodiscard]] QBindable<bool> bindableFocused() { return &this->bFocused; }
|
||||||
|
|
||||||
[[nodiscard]] QBindable<I3Workspace*> bindableActiveWorkspace() const {
|
[[nodiscard]] QBindable<I3Workspace*> bindableActiveWorkspace() {
|
||||||
return &this->bActiveWorkspace;
|
return &this->bActiveWorkspace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ public:
|
||||||
void updateFromObject(const QVariantMap& obj);
|
void updateFromObject(const QVariantMap& obj);
|
||||||
void updateInitial(const QString& name);
|
void updateInitial(const QString& name);
|
||||||
|
|
||||||
void setActiveWorkspace(I3Workspace* workspace);
|
void setFocusedWorkspace(I3Workspace* workspace);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void idChanged();
|
void idChanged();
|
||||||
|
|
@ -79,9 +79,6 @@ signals:
|
||||||
void lastIpcObjectChanged();
|
void lastIpcObjectChanged();
|
||||||
void focusedChanged();
|
void focusedChanged();
|
||||||
|
|
||||||
private slots:
|
|
||||||
void onActiveWorkspaceDestroyed();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
I3IpcController* ipc;
|
I3IpcController* ipc;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,17 +43,14 @@ void I3Workspace::updateFromObject(const QVariantMap& obj) {
|
||||||
|
|
||||||
auto monitorName = obj.value("output").value<QString>();
|
auto monitorName = obj.value("output").value<QString>();
|
||||||
|
|
||||||
auto* monitor = this->bMonitor.value();
|
if (!this->bMonitor || monitorName != this->bMonitor->bindableName().value()) {
|
||||||
if (!monitor || monitorName != monitor->bindableName().value()) {
|
|
||||||
if (monitorName.isEmpty()) {
|
if (monitorName.isEmpty()) {
|
||||||
monitor = nullptr;
|
this->bMonitor = nullptr;
|
||||||
} else {
|
} else {
|
||||||
monitor = this->ipc->findMonitorByName(monitorName, true);
|
this->bMonitor = this->ipc->findMonitorByName(monitorName, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this->setMonitor(monitor);
|
|
||||||
|
|
||||||
Qt::endPropertyUpdateGroup();
|
Qt::endPropertyUpdateGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -61,21 +58,4 @@ void I3Workspace::activate() {
|
||||||
this->ipc->dispatch(QString("workspace number %1").arg(this->bNumber.value()));
|
this->ipc->dispatch(QString("workspace number %1").arg(this->bNumber.value()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void I3Workspace::setMonitor(I3Monitor* monitor) {
|
|
||||||
auto* oldMonitor = this->bMonitor.value();
|
|
||||||
if (oldMonitor == monitor) return;
|
|
||||||
|
|
||||||
if (oldMonitor) {
|
|
||||||
QObject::disconnect(oldMonitor, nullptr, this, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (monitor) {
|
|
||||||
QObject::connect(monitor, &QObject::destroyed, this, &I3Workspace::onMonitorDestroyed);
|
|
||||||
}
|
|
||||||
|
|
||||||
this->bMonitor = monitor;
|
|
||||||
}
|
|
||||||
|
|
||||||
void I3Workspace::onMonitorDestroyed() { this->bMonitor = nullptr; }
|
|
||||||
|
|
||||||
} // namespace qs::i3::ipc
|
} // namespace qs::i3::ipc
|
||||||
|
|
|
||||||
|
|
@ -57,13 +57,11 @@ public:
|
||||||
[[nodiscard]] QBindable<bool> bindableActive() { return &this->bActive; }
|
[[nodiscard]] QBindable<bool> bindableActive() { return &this->bActive; }
|
||||||
[[nodiscard]] QBindable<bool> bindableFocused() { return &this->bFocused; }
|
[[nodiscard]] QBindable<bool> bindableFocused() { return &this->bFocused; }
|
||||||
[[nodiscard]] QBindable<bool> bindableUrgent() { return &this->bUrgent; }
|
[[nodiscard]] QBindable<bool> bindableUrgent() { return &this->bUrgent; }
|
||||||
[[nodiscard]] QBindable<I3Monitor*> bindableMonitor() const { return &this->bMonitor; }
|
[[nodiscard]] QBindable<I3Monitor*> bindableMonitor() { return &this->bMonitor; }
|
||||||
[[nodiscard]] QVariantMap lastIpcObject() const;
|
[[nodiscard]] QVariantMap lastIpcObject() const;
|
||||||
|
|
||||||
void updateFromObject(const QVariantMap& obj);
|
void updateFromObject(const QVariantMap& obj);
|
||||||
|
|
||||||
void setMonitor(I3Monitor* monitor);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void idChanged();
|
void idChanged();
|
||||||
void nameChanged();
|
void nameChanged();
|
||||||
|
|
@ -74,9 +72,6 @@ signals:
|
||||||
void monitorChanged();
|
void monitorChanged();
|
||||||
void lastIpcObjectChanged();
|
void lastIpcObjectChanged();
|
||||||
|
|
||||||
private slots:
|
|
||||||
void onMonitorDestroyed();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
I3IpcController* ipc;
|
I3IpcController* ipc;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue