commit a3f2f770ed90a025ca8044a2fb33bf0cec2170e9
parent 98374cda43a22616ba5ca2399bdcd19435665e8d
Author: Andrew Laack <andrew@laack.co>
Date: Tue, 15 Sep 2026 10:51:40 -0500
Move background setting to seperate function
Diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/background/src/main.cpp b/background/src/main.cpp
@@ -8,7 +8,13 @@
#include <unordered_set>
#include <filesystem>
-void CustomTakeScreenshot(char* filePath){
+void setBackground(std::string filePath) {
+ std::string command = "/usr/bin/feh --no-fehbg --bg-scale " + filePath;
+ const char* fp = command.c_str();
+ system(fp);
+}
+
+void customTakeScreenshot(char* filePath){
const char *customParam;
Image screenshot = LoadImageFromScreen();
ExportImage(screenshot, TextFormat(filePath, customParam));
@@ -52,9 +58,9 @@ int main() {
// Basically all of the cost happens within these bounds
char path[] = "/dev/shm/bg/out.bmp";
- CustomTakeScreenshot(path);
+ customTakeScreenshot(path);
// TODO: Can this be done away with? It's not *that* slow...
- system("/usr/bin/feh --no-fehbg --bg-scale /dev/shm/bg/out.bmp");
+ setBackground(path);
// Above here.
oneStepPrim(toVisit, visitedIndices, g);