first commit
This commit is contained in:
commit
0d840f0d50
9 changed files with 519 additions and 0 deletions
33
src/SwaybgProcess.h
Normal file
33
src/SwaybgProcess.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <sched.h>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#define SWAYBGPROCESS_BUFFER_SIZE 4094
|
||||
|
||||
class SwaybgProcess {
|
||||
public:
|
||||
|
||||
SwaybgProcess(const std::string& wallpaperPath, const std::string& output);
|
||||
|
||||
~SwaybgProcess();
|
||||
|
||||
void exec();
|
||||
|
||||
void kill();
|
||||
|
||||
private:
|
||||
|
||||
std::string wallpaperPath;
|
||||
std::string output;
|
||||
pid_t pid;
|
||||
bool killed = true;
|
||||
|
||||
int fds[2]; // file descriptors for pipe
|
||||
char buf[SWAYBGPROCESS_BUFFER_SIZE];
|
||||
ssize_t nbytes;
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue