Wallpaper from config, readd old wallpapers

This commit is contained in:
Kevin Lange 2015-04-11 18:22:26 -07:00
parent 78db32cb6f
commit e7ff3e20f8
8 changed files with 21 additions and 17 deletions

View File

@ -17,6 +17,6 @@
;logo_padding=100
[image]
logo=/usr/share/logo_login.png
wallpaper=/usr/share/wallpaper.png
;logo=/usr/share/logo_login.png
;wallpaper=/usr/share/wallpapers/southbay.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

View File

Before

Width:  |  Height:  |  Size: 3.4 MiB

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

View File

@ -1,6 +1,7 @@
/* This file is part of ToaruOS and is released under the terms
/* vim: tabstop=4 shiftwidth=4 noexpandtab
* This file is part of ToaruOS and is released under the terms
* of the NCSA / University of Illinois License - see LICENSE.md
* Copyright (C) 2013-2014 Kevin Lange
* Copyright (C) 2013-2015 Kevin Lange
*/
/*
* glogin
@ -55,7 +56,7 @@ static int BOX_COLOR_R=0;
static int BOX_COLOR_G=0;
static int BOX_COLOR_B=0;
static int BOX_COLOR_A=127;
static char * WALLPAPER = "/usr/share/wallpaper.png";
static char * WALLPAPER = "/usr/share/wallpapers/southbay.png";
static char * LOGO = "/usr/share/logo_login.png";
#define TEXTBOX_INTERIOR_LEFT 4

View File

@ -1,7 +1,7 @@
/* vim: tabstop=4 shiftwidth=4 noexpandtab
* This file is part of ToaruOS and is released under the terms
* of the NCSA / University of Illinois License - see LICENSE.md
* Copyright (C) 2013-2014 Kevin Lange
* Copyright (C) 2013-2015 Kevin Lange
*
* Wallpaper renderer.
*
@ -16,6 +16,9 @@
#include "lib/graphics.h"
#include "lib/shmemfonts.h"
#include "lib/hashmap.h"
#include "lib/confreader.h"
#define DEFAULT_WALLPAPER "/usr/share/wallpapers/southbay.png"
#define ICON_X 24
#define ICON_TOP_Y 40
@ -290,14 +293,13 @@ int main (int argc, char ** argv) {
sprite_t * wallpaper_tmp = malloc(sizeof(sprite_t));
char f_name[512];
sprintf(f_name, "%s/.wallpaper.png", getenv("HOME"));
FILE * f = fopen(f_name, "r");
if (f) {
fclose(f);
load_sprite_png(wallpaper_tmp, f_name);
} else {
load_sprite_png(wallpaper_tmp, "/usr/share/wallpaper.png");
}
sprintf(f_name, "%s/.desktop.conf", getenv("HOME"));
confreader_t * conf = confreader_load(f_name);
load_sprite_png(wallpaper_tmp, confreader_getd(conf, "", "wallpaper", DEFAULT_WALLPAPER));
confreader_free(conf);
/* Initialize hashmap for icon cache */
icon_cache = hashmap_create(10);
@ -309,7 +311,7 @@ int main (int argc, char ** argv) {
}
sprintf(f_name, "%s/.desktop", getenv("HOME"));
f = fopen(f_name, "r");
FILE * f = fopen(f_name, "r");
if (!f) {
f = fopen("/etc/default.desktop", "r");
}

View File

@ -1,6 +1,7 @@
/* This file is part of ToaruOS and is released under the terms
/* vim: tabstop=4 shiftwidth=4 noexpandtab
* This file is part of ToaruOS and is released under the terms
* of the NCSA / University of Illinois License - see LICENSE.md
* Copyright (C) 2013-2014 Kevin Lange
* Copyright (C) 2015 Kevin Lange
*
* Configuration File Reader
*