compositor: Improve screenshot saving with notifications
This commit is contained in:
parent
70fe457c96
commit
2ab7ec7923
@ -935,7 +935,15 @@ static void yutani_screenshot(yutani_globals_t * yg) {
|
|||||||
yg->screenshot_frame = 0;
|
yg->screenshot_frame = 0;
|
||||||
|
|
||||||
/* raw screenshots */
|
/* raw screenshots */
|
||||||
FILE * f = fopen("/tmp/screenshot.tga", "w");
|
|
||||||
|
char fname[1024];
|
||||||
|
struct tm * timeinfo;
|
||||||
|
struct timeval now;
|
||||||
|
gettimeofday(&now, NULL);
|
||||||
|
timeinfo = localtime((time_t *)&now.tv_sec);
|
||||||
|
strftime(fname,1024,"/tmp/screenshot_%F_%H_%M_%S.tga",timeinfo);
|
||||||
|
|
||||||
|
FILE * f = fopen(fname, "w");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
TRACE("Error opening output file for screenshot.");
|
TRACE("Error opening output file for screenshot.");
|
||||||
return;
|
return;
|
||||||
@ -999,6 +1007,14 @@ static void yutani_screenshot(yutani_globals_t * yg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
|
|
||||||
|
FILE * toast = fopen("/dev/pex/toast", "w");
|
||||||
|
fprintf(toast, "{\"icon\": \"%s\", \"body\": \"Screenshot taken.\"}", fname);
|
||||||
|
fclose(toast);
|
||||||
|
|
||||||
|
/* Blorp */
|
||||||
|
system("play /usr/share/ttk/blorp.wav &");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void resize_display(yutani_globals_t * yg) {
|
static void resize_display(yutani_globals_t * yg) {
|
||||||
|
BIN
base/usr/share/ttk/blorp.wav
Normal file
BIN
base/usr/share/ttk/blorp.wav
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user