mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2025-01-07 04:19:48 +01:00
a82b20e979
* Add autocopy option * Specify autocopy requirements
19 lines
No EOL
371 B
C++
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);
|
|
} |