11#pragma once
22
3+ #include < qclipboard.h>
34#include < qcontainerfwd.h>
45#include < qjsengine.h>
56#include < qobject.h>
1011#include < qtmetamacros.h>
1112#include < qtypes.h>
1213#include < qvariant.h>
14+ #include < qwindowdefs.h>
1315
1416#include " qmlscreen.hpp"
1517
@@ -108,6 +110,10 @@ class QuickshellGlobal: public QObject {
108110 // / If true then the configuration will be reloaded whenever any files change.
109111 // / Defaults to true.
110112 Q_PROPERTY (bool watchFiles READ watchFiles WRITE setWatchFiles NOTIFY watchFilesChanged);
113+ // / The system clipboard.
114+ // /
115+ // / > [!WARNING] Under wayland the clipboard will be empty unless a quickshell window is focused.
116+ Q_PROPERTY (QString clipboardText READ clipboardText WRITE setClipboardText NOTIFY clipboardTextChanged);
111117 // / The per-shell data directory.
112118 // /
113119 // / Usually `~/.local/share/quickshell/by-shell/<shell-id>`
@@ -176,6 +182,9 @@ class QuickshellGlobal: public QObject {
176182 [[nodiscard]] bool watchFiles () const ;
177183 void setWatchFiles (bool watchFiles);
178184
185+ [[nodiscard]] static QString clipboardText ();
186+ static void setClipboardText (const QString& text);
187+
179188 [[nodiscard]] QString dataDir () const ;
180189 [[nodiscard]] QString stateDir () const ;
181190 [[nodiscard]] QString cacheDir () const ;
@@ -195,6 +204,10 @@ class QuickshellGlobal: public QObject {
195204 void screensChanged ();
196205 void workingDirectoryChanged ();
197206 void watchFilesChanged ();
207+ void clipboardTextChanged ();
208+
209+ private slots:
210+ void onClipboardChanged (QClipboard::Mode mode);
198211
199212private:
200213 QuickshellGlobal (QObject* parent = nullptr );
0 commit comments