mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2025-05-12 21:30:43 +01:00

* clang-tidy and comp fixes * remove stupid comment * oaooaoaoaoao * quack * remove comment
20 lines
402 B
C++
20 lines
402 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);
|
|
|
|
if (fork() == 0)
|
|
execlp("wl-copy", "wl-copy", outputStr, NULL);
|
|
|
|
free(outputStr);
|
|
}
|