Create your own usplash theme

    As promised in the previous topic , I describe in detail the creation of our own usplash theme. To get started, we will need: GIMP and some skills to work in it, as well as the following packages:
    gcc, libbogl-dev, libusplash-dev

    Any Usplash theme consists of at least three components: background image, body of the progress bar, background of the progress bar. Everything is clear with the background image, this is the basis on which everything else will be. The body of the progress bar is a picture that, as it downloads, replaces the background picture of the progress bar.

    So, first we’ll make a background for ourselves. I chose the one that is on my desktop as a background. Let's decide on the size of our splash. You need to choose the largest of the possible - in my case, 1024x768. Accordingly, we bring the size of the background image to this size.
    Now the most important thing: you need to create and save the color palette of your image. All other images should have the same palette.

    I specially mark - Windows-> Panels-> Color Swatches, then in the window: Menu-> Palette Menu-> Import Palette. Next, select our image . Screenshot A

    palette can contain up to 256 colors.
    Save the image with the name usplash_1024_768.png. We create the same images for other resolutions - (I only did 800x600); save the same in png format and in the same palette. We call usplash_800_600.png.

    Now is the time to create a progress bar. Create two images (I did 216x8 px) - bring them to the already created palette ( screenshot), save one - throbber_fore.png, the second - throbber_back.png (Front and rear, respectively).
    Next up is some programming.

    Directly the sources of my topic can be found here. I will

    dwell on what is really important.

    Beginning of the topic structure description: .next - pointer to the following structure. To make a theme for other permissions, we copy Structures, specify the name of the next structure in .next pointers. The pointer in the last structure must point to NULL .ratio = USPLASH_4_3 - this line sets the aspect ratio of the topic. Everything should be clear here: on the left is the element, on the right is what color it will be. The color numbers correspond to their numbers in your palette (you can see it in the same GIMP).
    struct usplash_theme usplash_theme_1024_768 = {
    .version = THEME_VERSION,
    .next = NULL,
    .ratio = USPLASH_4_3,

    /* Background and font */
    .pixmap = &pixmap_usplash_1024_768,

    /* Palette indexes */
    .background = 0x0,
    .progressbar_background = 0x0,
    .progressbar_foreground = 0x200,
    .text_background = 0x17,
    .text_foreground = 0x32,
    .text_success = 0x171,
    .text_failure = 0x156,

    /* Progress bar position and size in pixels */
    .progressbar_x = 404, /* 1024/2 - 216/2 */
    .progressbar_y = 524,
    .progressbar_width = 216,
    .progressbar_height = 8,

    Position and dimensions of the progress bar. The position is individual for each of the permissions. The sizes should correspond to the sizes of images throbber_fore and throbber_back. Description of the position of the text output zone (system messages are displayed here if they appear during boot). Actually with more everything. Further, this whole thing needs to be collected (there is a makefile in the archive), and the resulting file will be our topic. Next - either use the StartUp manager or That's it! Use :)

    /* Text box position and size in pixels */
    .text_x = 322,
    .text_y = 525,
    .text_width = 380,
    .text_height = 100,

    # update-alternatives --config

    Also popular now: