mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2025-01-08 04:49:49 +01:00
19 lines
371 B
C++
19 lines
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);
|
||
|
}
|