RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Fun Facts Splashscreens

    Scheduled Pinned Locked Moved Projects and Themes
    splashscreenscarbon
    102 Posts 13 Posters 22.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • hiulitH
      hiulit @meleu
      last edited by

      @meleu Thanks! :D It's super basic now, but it seems to be working. Now it's time to take a look at your generate-launching-imagesscript and improve mine ;)

      My little contributions to the RetroPie project:

      • Shell-Script-Boilerplate
      • Fun-Facts-Splashscreens
      • Limit-Last-Played-Games
      meleuM 2 Replies Last reply Reply Quote 0
      • meleuM
        meleu @hiulit
        last edited by

        @hiulit I'm glad to know it can inspire you. I usually spend sometime making my code readable just to help others to understand it (including @meleu in the future). Knowing that you're reading it and getting some inspiration makes me feel like the work was worth it. :D

        Let me know if you have any doubt!

        • Useful topics
        • joystick-selection tool
        • rpie-art tool
        • achievements I made
        1 Reply Last reply Reply Quote 1
        • meleuM
          meleu @hiulit
          last edited by meleu

          @hiulit a small tip: if you want to store fun facts in a text file, one fun fact per line, you can get a random line from the file using the shuf command. This way:

          shuf -n 1 fun_facts.txt
          

          EDIT: This aproach would be useful if the users want to customize their fun facts. They wouldn't need to edit the script's code.

          ;-)

          • Useful topics
          • joystick-selection tool
          • rpie-art tool
          • achievements I made
          hiulitH 2 Replies Last reply Reply Quote 1
          • hiulitH
            hiulit @meleu
            last edited by

            @meleu Thanks for the tip! I'll try it! :)

            My little contributions to the RetroPie project:

            • Shell-Script-Boilerplate
            • Fun-Facts-Splashscreens
            • Limit-Last-Played-Games
            1 Reply Last reply Reply Quote 0
            • hiulitH
              hiulit @meleu
              last edited by

              @meleu Done! It works beautifully :D

              My little contributions to the RetroPie project:

              • Shell-Script-Boilerplate
              • Fun-Facts-Splashscreens
              • Limit-Last-Played-Games
              1 Reply Last reply Reply Quote 0
              • Z
                Zigurana
                last edited by

                If it takes too long, maybe run the image-generation-script on system shutdown, to be used at next boot-time?

                If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

                meleuM hiulitH 2 Replies Last reply Reply Quote 1
                • meleuM
                  meleu @Zigurana
                  last edited by

                  @zigurana good idea! ;-)

                  @hiulit I have more comments, maybe it's better to move the nerdy conversation to the nerdy topic... :)

                  • Useful topics
                  • joystick-selection tool
                  • rpie-art tool
                  • achievements I made
                  1 Reply Last reply Reply Quote 0
                  • hiulitH
                    hiulit @Zigurana
                    last edited by

                    @zigurana Yeah, good idea! Although I really don't have any idea of where I should put my script to do that... (⊙_☉) hehe! Noob at scripting here :P

                    My little contributions to the RetroPie project:

                    • Shell-Script-Boilerplate
                    • Fun-Facts-Splashscreens
                    • Limit-Last-Played-Games
                    1 Reply Last reply Reply Quote 0
                    • hiulitH
                      hiulit
                      last edited by hiulit

                      More progress! :D
                      Now the splashscreen is created using the font of the active theme in EmulationStation, and if it has none it takes the Carbon theme font as default.

                      A little video demo of the script working https://streamable.com/s/bbzzd/fecqc

                      And here's the the splashscreen of the Pixel theme with a Fun Fact!™ using Pixel's own font.

                      0_1510312850864_Captura de pantalla 2017-11-09 a les 13.20.02.png

                      My little contributions to the RetroPie project:

                      • Shell-Script-Boilerplate
                      • Fun-Facts-Splashscreens
                      • Limit-Last-Played-Games
                      meleuM 1 Reply Last reply Reply Quote 1
                      • meleuM
                        meleu @hiulit
                        last edited by

                        @hiulit you're doing a good job bro!!

                        I've submitted a PR to your repo. But, as I'm away from my RetroPie currently, please test it before merging. ;-)

                        • Useful topics
                        • joystick-selection tool
                        • rpie-art tool
                        • achievements I made
                        hiulitH 1 Reply Last reply Reply Quote 1
                        • hiulitH
                          hiulit
                          last edited by

                          WOW, thanks man! I will take a look at it and I'll get back to you :)

                          My little contributions to the RetroPie project:

                          • Shell-Script-Boilerplate
                          • Fun-Facts-Splashscreens
                          • Limit-Last-Played-Games
                          1 Reply Last reply Reply Quote 0
                          • hiulitH
                            hiulit @meleu
                            last edited by hiulit

                            @meleu Hey, I've merged your pull request but I had to make a little change because it didn't seem to work properly.

                            The change I made was adding a ! before -f "$splashscreen" when checking for the splashscreen.

                            if [[ ! -f "$splash" ]]; then
                                splash="$DEFAULT_SPLASH"
                            fi
                            

                            Besides that, everything was alright! Thanks! :)

                            My little contributions to the RetroPie project:

                            • Shell-Script-Boilerplate
                            • Fun-Facts-Splashscreens
                            • Limit-Last-Played-Games
                            1 Reply Last reply Reply Quote 1
                            • hiulitH
                              hiulit
                              last edited by

                              @meleu When I encountered the problem with Pixel theme and xmlstarlet I tried a different approach for finding the font.

                              function get_theme_font() {
                                  get_current_theme
                                  if [[ -n "$(find "$ES_DIR/themes/$current_theme/art" -type f -name '*.ttf')" ]]; then
                                      font="$(find "$ES_DIR/themes/$current_theme/art" -type f -name '*.ttf')"
                                  else
                                      font=$DEFAULT_FONT
                                  fi
                              }
                              

                              I did the job, but I wasn't happy about repeating the find function , but I don't know any better :P

                              Do you think that could be a workaround for finding theme fonts?

                              I know that some themes can have multiple fonts but I think it's ok to use the first one found.

                              My little contributions to the RetroPie project:

                              • Shell-Script-Boilerplate
                              • Fun-Facts-Splashscreens
                              • Limit-Last-Played-Games
                              meleuM 1 Reply Last reply Reply Quote 0
                              • meleuM
                                meleu @hiulit
                                last edited by

                                @hiulit it's better to move the nerdy conversation to the nerdy topic... :)

                                I'll try to answer your questions there. Wait a moment. ;)

                                • Useful topics
                                • joystick-selection tool
                                • rpie-art tool
                                • achievements I made
                                hiulitH 1 Reply Last reply Reply Quote 0
                                • hiulitH
                                  hiulit @meleu
                                  last edited by

                                  @meleu Oh, you're right! ;) See you there!

                                  My little contributions to the RetroPie project:

                                  • Shell-Script-Boilerplate
                                  • Fun-Facts-Splashscreens
                                  • Limit-Last-Played-Games
                                  1 Reply Last reply Reply Quote 0
                                  • meleuM
                                    meleu
                                    last edited by meleu

                                    @BuZz please, evaluate if you would accept the following feature for splashscreen script module (and asplashscreen.sh script):

                                    Adding an option to put a random "fun fact" on the splashscreen.

                                    The result would be something like this:

                                    pixelsplashfunfact

                                    Some notes about how I'm thinking to implement that:

                                    • add a toggle option on splashscreen script module to enable/disable fun facts.

                                    • when enabled, a new splashscreen would be generated at every boot

                                    • a new dependency to generate the images: imagemagick (same as launchingimages scriptmodule).

                                    • the image would be generated at boot in a background process and would be used in the next boot. I mean, when I boot my pi, the splashscreen I would see already exists and the script would be generating a new one for the next boot in a background process.

                                    • (obviously) it would be only used when the splashscreen is an image (do nothing when using a video)

                                    • the "fun facts database" would be a text file in $datadir/splashscreens/.

                                      • an "official" funfacts collection could be stored in the official repo in scriptmodules/supplementary/splashscreen/

                                      • provide a way to the user use a custom funfacts collection.

                                    • the font to be used for the fun fact text would be the same as the one used by the current ES theme in detailed view.

                                      • Note: RetroPie must be frontend agnostic. Then, if the script can't find the font as described above, it would use a generic font.
                                    • all the logic for the image generation would be in asplashscreen.sh script

                                    • Useful topics
                                    • joystick-selection tool
                                    • rpie-art tool
                                    • achievements I made
                                    BuZzB 1 Reply Last reply Reply Quote 0
                                    • BuZzB
                                      BuZz administrators @meleu
                                      last edited by

                                      @meleu I wouldn't be interested sorry.

                                      To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                                      meleuM 1 Reply Last reply Reply Quote 0
                                      • meleuM
                                        meleu @BuZz
                                        last edited by

                                        @buzz copy that.

                                        @hiulit let's keep the development extra-officially.

                                        • Useful topics
                                        • joystick-selection tool
                                        • rpie-art tool
                                        • achievements I made
                                        hiulitH 1 Reply Last reply Reply Quote 1
                                        • hiulitH
                                          hiulit @meleu
                                          last edited by

                                          @meleu Alright!

                                          My little contributions to the RetroPie project:

                                          • Shell-Script-Boilerplate
                                          • Fun-Facts-Splashscreens
                                          • Limit-Last-Played-Games
                                          1 Reply Last reply Reply Quote 0
                                          • hiulitH
                                            hiulit
                                            last edited by hiulit

                                            Good news everyone!
                                            We have a working Fun Facts Splashscreens generator! :D

                                            https://github.com/hiulit/RetroPie-Fun-Facts-Splashscreens

                                            Fun Facts Splashscreens for RetroPie

                                            Not working yet! Well, it's working, but it's not officially released! It's just for testing purposes!

                                            This script generates splashscreens for RetroPie with a random Fun Fact!™.

                                            WARNING: Splashscreens are only only available on the Raspberry Pi.

                                            For now, this is the best way to use the splashscreen created by this script:

                                            • Create a Fun Fact!™ splashscreen. See the examples below.
                                            • Go to the Splashscreen Menu (the Splashscreen Menu can be accessed from the RetroPie Menu in EmulationStation or through the setup script under option 3)
                                            • Select the Choose Own Splashscreen option. See the Splashscreen wiki.
                                            • Select the recently created Fun Fact!™ splashscreen.

                                            Instalation

                                            cd /home/pi/
                                            git clone https://github.com/hiulit/es-fun-facts-splashscreens.git
                                            cd es-fun-facts-splashscreens/
                                            sudo chmod +x es-fun-facts-splashscreens.sh
                                            

                                            Usage

                                            sudo ./es-fun-facts-splashscreens.sh [options]
                                            

                                            If no options are passed, you will be prompted with a usage example:

                                            USAGE: sudo ./es-fun-facts-splashscreens.sh [options]
                                            
                                            Use '--help' to see all the options
                                            

                                            Options

                                            • --help: Print the help message and exit.
                                            • --enable-boot: Enable script to be launch at boot.
                                              • $1: Path to the splashscreen to be used.
                                              • $2: Text color.
                                            • --disable-boot: Disable script to be launch at boot.
                                            • --create-fun-fact: Create Fun Fact Splashscreen.
                                              • $1: Path to the splashscreen to be used.
                                              • $2: Text color.

                                            If no options are passed to --create-fun-fact or --enable-boot, the script takes the splashscreen and the text color defaults, splash4-3.png and white, respectively.

                                            Examples

                                            --help

                                            Print the help message and exit.

                                            sudo ./es-fun-facts-splashscreens.sh --help
                                            

                                            --enable-boot [options]

                                            Enable script to be launch at boot.

                                            WARNING: Backing up /etc/rc.local it's most recommended before using this option. It could erase important stuff. Use it at your own risk.

                                            Options:

                                            • $1: Path to the splashscreen to be used.
                                            • $2: Text color.
                                            sudo ./es-fun-facts-splashscreens.sh --enable-boot /home/pi/Downloads/retropie-2014.png black
                                            

                                            --disable-boot

                                            Disable script to be launch at boot.

                                            WARNING: Backing up /etc/rc.local it's most recommended before using this option. It could erase important stuff. Use it at your own risk.

                                            sudo ./es-fun-facts-splashscreens.sh --disable-boot
                                            

                                            --create-fun-fact

                                            Create Fun Fact Splashscreen.

                                            Options:

                                            • $1: Path to the splashscreen to be used.
                                            • $2: Text color.
                                            sudo ./es-fun-facts-splashscreens.sh --create-fun-fact /home/pi/Downloads/retropie-2014.png black
                                            

                                            Credits

                                            Thanks to:

                                            • @Parviglumis - For the idea of creating the Fun Facts Splashscreens.
                                            • @meleu - For all his help and wisdom with the code :D
                                            • All the people at the RetroPie Forum.

                                            My little contributions to the RetroPie project:

                                            • Shell-Script-Boilerplate
                                            • Fun-Facts-Splashscreens
                                            • Limit-Last-Played-Games
                                            meleuM 1 Reply Last reply Reply Quote 2
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.