2018-03-27 19:35:34 +02:00
|
|
|
#include <ctype.h>
|
2016-07-31 01:50:13 +02:00
|
|
|
#include <stdbool.h>
|
2015-11-12 14:31:47 +01:00
|
|
|
#include <stdio.h>
|
2015-11-13 01:04:01 +01:00
|
|
|
#include <stdlib.h>
|
2015-11-28 14:49:02 +01:00
|
|
|
#include <string.h>
|
2018-03-27 19:35:34 +02:00
|
|
|
#include <time.h>
|
|
|
|
#include <wayland-client.h>
|
|
|
|
#include <wlr/util/log.h>
|
2015-11-13 01:04:01 +01:00
|
|
|
|
2015-11-27 14:52:59 +01:00
|
|
|
enum scaling_mode {
|
2015-11-25 15:57:35 +01:00
|
|
|
SCALING_MODE_STRETCH,
|
2015-11-25 19:52:34 +01:00
|
|
|
SCALING_MODE_FILL,
|
2015-11-25 21:26:21 +01:00
|
|
|
SCALING_MODE_FIT,
|
2015-11-25 19:53:13 +01:00
|
|
|
SCALING_MODE_CENTER,
|
2015-11-25 20:07:34 +01:00
|
|
|
SCALING_MODE_TILE,
|
2015-11-25 15:57:35 +01:00
|
|
|
};
|
|
|
|
|
2016-07-31 01:50:13 +02:00
|
|
|
bool is_valid_color(const char *color) {
|
|
|
|
int len = strlen(color);
|
|
|
|
if (len != 7 || color[0] != '#') {
|
2018-03-27 19:35:34 +02:00
|
|
|
wlr_log(L_ERROR, "%s is not a valid color for swaybg. "
|
|
|
|
"Color should be specified as #rrggbb (no alpha).", color);
|
2016-07-31 01:50:13 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
int i;
|
|
|
|
for (i = 1; i < len; ++i) {
|
|
|
|
if (!isxdigit(color[i])) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-11-25 15:53:02 +01:00
|
|
|
int main(int argc, const char **argv) {
|
2018-03-27 19:35:34 +02:00
|
|
|
wlr_log_init(L_DEBUG, NULL);
|
2015-11-12 14:31:47 +01:00
|
|
|
return 0;
|
|
|
|
}
|