hyprpicker/src/clipboard/Clipboard.cpp
Maksim a82b20e979
Add autocopy option (#13)
* Add autocopy option

* Specify autocopy requirements
2022-11-19 14:53:05 +00:00

19 lines
No EOL
371 B
C++

#include "Clipboard.hpp"
#include "../includes.hpp"
void Clipboard::copy(const char* fmt, ...) {
char buf[CLIPBOARDMESSAGESIZE] = "";
char* outputStr;
va_list args;
va_start(args, fmt);
vsnprintf(buf, sizeof buf, fmt, args);
va_end(args);
outputStr = strdup(buf);
execlp("wl-copy", "wl-copy", outputStr, NULL);
free(outputStr);
}