i3/sway: add support for the I3 and Sway IPC
sway: add urgent and focused dispatchers to workspaces flake: add sway toggle WIP sway: add monitor status sway: handle multiple ipc events in one line sway: reuse socket connection for dispatches & better command type handling WIP sway: add associated monitor to a workspace i3/sway: update to allow for i3 compatibility i3/sway: manage setting the focused monitors i3/sway: fix multi monitor crash i3/sway: fix linting errors i3/sway: update nix package flag naming to i3 i3/sway: add documentation, fix module.md and impl monitorFor i3/sway: handle more workspace ipc events i3/sway: fix review i3/sway: fix crash due to newline breaking up an IPC message i3/sway: handle broken messages by forwarding to the next magic sequence i3/sway: break loop when buffer is empty i3/sway: fix monitor focus & focused monitor signal not being emitted i3/sway: use datastreams instead of qbytearrays for socket reading i3/sway: fix lint issues i3/sway: drop second socket connection, remove dispatch return value, recreate IPC connection on fatal error i3/sway: handle run_command responses i3/sway: remove reconnection on unknown event i3/sway: fix formatting, lint & avoid writing to socket if connection is not open
This commit is contained in:
parent
84ce47b6d3
commit
31adcaac76
15 changed files with 1252 additions and 1 deletions
55
src/x11/i3/ipc/qml.cpp
Normal file
55
src/x11/i3/ipc/qml.cpp
Normal file
|
@ -0,0 +1,55 @@
|
|||
#include "qml.hpp"
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qstring.h>
|
||||
|
||||
#include "../../../core/model.hpp"
|
||||
#include "../../../core/qmlscreen.hpp"
|
||||
#include "connection.hpp"
|
||||
#include "workspace.hpp"
|
||||
|
||||
namespace qs::i3::ipc {
|
||||
|
||||
I3IpcQml::I3IpcQml() {
|
||||
auto* instance = I3Ipc::instance();
|
||||
|
||||
QObject::connect(instance, &I3Ipc::rawEvent, this, &I3IpcQml::rawEvent);
|
||||
QObject::connect(instance, &I3Ipc::connected, this, &I3IpcQml::connected);
|
||||
QObject::connect(
|
||||
instance,
|
||||
&I3Ipc::focusedWorkspaceChanged,
|
||||
this,
|
||||
&I3IpcQml::focusedWorkspaceChanged
|
||||
);
|
||||
QObject::connect(instance, &I3Ipc::focusedMonitorChanged, this, &I3IpcQml::focusedMonitorChanged);
|
||||
}
|
||||
|
||||
void I3IpcQml::dispatch(const QString& request) { I3Ipc::instance()->dispatch(request); }
|
||||
|
||||
void I3IpcQml::refreshMonitors() { I3Ipc::instance()->refreshMonitors(); }
|
||||
|
||||
void I3IpcQml::refreshWorkspaces() { I3Ipc::instance()->refreshWorkspaces(); }
|
||||
|
||||
QString I3IpcQml::socketPath() { return I3Ipc::instance()->socketPath(); }
|
||||
|
||||
ObjectModel<I3Monitor>* I3IpcQml::monitors() { return I3Ipc::instance()->monitors(); }
|
||||
|
||||
ObjectModel<I3Workspace>* I3IpcQml::workspaces() { return I3Ipc::instance()->workspaces(); }
|
||||
|
||||
I3Workspace* I3IpcQml::focusedWorkspace() { return I3Ipc::instance()->focusedWorkspace(); }
|
||||
|
||||
I3Monitor* I3IpcQml::focusedMonitor() { return I3Ipc::instance()->focusedMonitor(); }
|
||||
|
||||
I3Workspace* I3IpcQml::findWorkspaceByName(const QString& name) {
|
||||
return I3Ipc::instance()->findWorkspaceByName(name);
|
||||
}
|
||||
|
||||
I3Monitor* I3IpcQml::findMonitorByName(const QString& name) {
|
||||
return I3Ipc::instance()->findMonitorByName(name);
|
||||
}
|
||||
|
||||
I3Monitor* I3IpcQml::monitorFor(QuickshellScreenInfo* screen) {
|
||||
return I3Ipc::instance()->monitorFor(screen);
|
||||
}
|
||||
|
||||
} // namespace qs::i3::ipc
|
Loading…
Add table
Add a link
Reference in a new issue