I was feeling sad so I decided to queer my #rstats startup message, and now I don't feel so sad

Code to print the rainbow stripe, if anyone wants it:

c("#e50000", "#ff8d00", "#ffee00", "#028121", "#004cff", "#770088") |>
purrr::map(crayon::make_style) |>
purrr::walk(~ cat(.x(paste0(rep("\u2583", 6), collapse = ""))))

Just for fun, a short blog post on this:

https://blog.djnavarro.net/ansi-tricks/

A little ANSI trickery – Notes from a data witch

Fun and games with asciicast and cli. There’s really not much to this one except a little bit of personal entertainment

Notes from a data witch
@djnavarro I plan to read this again when I am actually awake (11pm here).
@djnavarro Coincidentally, I just realized why I like Sinclair ZX Spectrum's old logo so much. :)
@djnavarro Ooohhh pretty 🤩
@eliocamp it makes me happy!
@djnavarro I will definitely steal and personalise it. Although I will need to add something to easily disable it when I teach so my students don't get confused about weird stuff they don't have on their computers.
@eliocamp Totally. Presumably there's an easy way to force the --vanilla flag whenever RStudio restarts the R session? I've never really looked into it, but I imagine it's possible
@djnavarro I think I can just run it conditional on some env var that I set up then teaching.

@djnavarro There, I solved it. I have two small small bash scripts that change all my rstudio settings to daily or teaching mode, so modified them to either create or remove a ~/.config/taeching file and then have my .Rprofile modify the startup message only if the file doesn't exist.

I also added a few different flags and it prints a random one. Yey!

@djnavarro That's awesome! And I'm glad it helped lift your spirits!
@djnavarro (and thank you for sharing and so also lifting mine further 🙂)
@djnavarro Thank you! I totally stole this and made my own little version.
@Drmowinckels Fabulous!
@djnavarro I think you just cost me a days work as I am here thnking about how I can make it actually print flags not just a banner :P
@Drmowinckels sorry not sorry. (there is a flag version in the blog post, though it would only work for flags that have stripes I guess)
@djnavarro <3 I will try to force myself to do other dev work, but damn I am very eager on this now :P
@djnavarro ok, now I'm going to work. But in this version, I'm all rainbows for pride month, and all R-Ladies the rest of the year :D
@djnavarro I am also super curious to the remaining R startup message though! Its so neat and concise, how do you do that?

@Drmowinckels Oh yeah that's a bit of a hack. My .Rprofile has a line in it that clears the screen (and with it the default startup message):

cat("\014")

After that, I write my own startup message like this:

cli::cli_alert(R.version.string)
cli::cli_alert(paste("Running under", utils::osVersion))
cli::cli_alert(paste("System time is", as.character(lubridate::now())))

@Drmowinckels That works fine in RStudio, but if you want it to work for R at the terminal you have to do a bit more work, so the actual "clear screen" code I use is

system2("clear")
cat("\014")

@djnavarro this so way more fun than it should be :) I also added one alert for library paths, which I think is neat to alert me when I'm renv'ing etc. :D
@Drmowinckels oh that’s a good idea
@djnavarro this just actually made me realise that it has set up no less than 5 paths on our server and two of them are completely empty and likely redundant. So, it does help!
@djnavarro @Drmowinckels That's a really nice hack though! I've been looking for a way to get rid of (or replace) the startup message for ages. This is possible with the `--quiet` command line argument, but RStudio doesn't support any unfortunately.
@djnavarro This seems like as good of a time as any to let everyone know I use Arch BTW
@nabsiddiqui lololololol. my arch machine died a few months back and so alas I am now an ubuntu-only girl 🫠