The thread formerly known as "Weekend Coding"

WSLg is short for Windows Subsystem for Linux GUI and the purpose of the project is to enable support for running Linux GUI applications (X11 and Wayland) on Windows in a fully integrated desktop experience.

WSLg is going to be generally available alongside the upcoming release of Windows.

2021, the year of the Linux desktop!

This is great. It was announced long ago, and is almost here. Very exciting. I would very much like to stop using X servers such as VcXsrv or Xming. However, it looks like WSLg is designed to run Linux GUI apps as one-offs. Thatā€™s not what I, personally, need.

We already have Windows Terminal, WSL, and there is a windows-native vim. Thatā€™s pretty much all the Linux apps I use. The reason I use an X server is because I use i3 to tile and manage all the terminals and vims in a keyboard-only way that is efficient in terms of screen real estate usage and speed. If WSLg can run a window manager in full screen mode on just one of my two monitors, then Iā€™m all in. If not, then I may have to keep using VcXsrv, which will be disappointing.

All the time I have shit-talk ideas. And I always feel compelled to do things if they are new, big, might accomplish something, etc. I realized, hey. Iā€™m very much allowed to do something that isnā€™t new and just creates some art even if itā€™s poop.

So I got PICO-8 and I started making a cute little shmup. Itā€™s not going to be anything special or revolutionary. Iā€™m expecting it to be less fancy than Galaga.

So far I made a little spaceship that flies around. Then I spent way too much effort on the star field in the background.

1 Like

Weā€™re shooting now.

2 Likes

Is the ship flying up or into the screen?

1 Like

It looked okay until the shooting starts. It feels like the bullets should be going into the screen like Star Fox, not up the screen like Galaga.

Yeah, this is because when I searched for starfield drawing algorithms, the one I found and implemented was the Gyruss style even though the game is going to be Galaga style. I guess Iā€™ll have to change it if itā€™s too disorienting.

Come for Stanley Kubrick shooting the shit about programming documentation manuals in 1984, stay for his cat passed out on the desk:

1 Like

Found a cool font library that was relatively easy to port to PSP (aside from the LLVM FPU bugs, but thatā€™s another story). Decided the best way to try out a font library was a scrolltext demo, so without further adoā€¦

2 Likes

Love that DISCO font.

The font is called Monoton-Regular. Or were you referring to the sine wave bouncing?

No, the font itself is what I was referring to.

I set up a script to periodically pull a couple random wallpapers from the unsplash API, and put them in my rotating-wallpaper folder.

Great move, I hadnā€™t changed my backgrounds in a long time. Feels like I got a new computer.

1 Like

Did the same with phone, highly recommend.

Not hitting an API, I just harvested a bunch of jpgs and set up a rotating-wallpapers folder.

TIL after over a decade in the field, episode #24601: /dev/shm/.

Itā€™s a ramdisk, just sitting there waiting for you!

mount | grep tmpfs also shows /run/user/$UID, a good place to cache things.

Iā€™ve had this on the brain lately:

Of course. Scrape some webpage, use git to store the diffs. Runs in a github action.

name: Scrape latest data

on:
  push:
  workflow_dispatch:
  schedule:
    - cron:  '6,26,46 * * * *'

jobs:
  scheduled:
    runs-on: ubuntu-latest
    steps:
    - name: Check out this repo
      uses: actions/checkout@v2
    - name: Fetch latest data
      run: |-
        curl https://www.fire.ca.gov/umbraco/Api/IncidentApi/GetIncidents | jq . > incidents.json
    - name: Commit and push if it changed
      run: |-
        git config user.name "Automated"
        git config user.email "actions@users.noreply.github.com"
        git add -A
        timestamp=$(date -u)
        git commit -m "Latest data: ${timestamp}" || exit 0
        git push

I recently learned a lot of GitHub Actions stuff. Using it for CI/CD on the in-progress new GeekNights website. I was not aware that it had a cron schedule mode! I thought you could only fire an action off on Git events such as push, merge pull request, release/tag, etc.

While this technique is very powerful, and I may use it, it might require paying for GitHub. GitHub Actions charges by minutes of compute time used. The free plan gives a somewhat good amount, but probably not enough for this. Itā€™s probably cheaper to just have a cron job running on a Raspberry Pi or VPC that scrapes, commits, and pushes.

1 Like

I think for very short scrapes youā€™ll be ok, if youā€™re not using Actions for much else.

Free tier gets 2,000 minutes a month:

64 minutes a day, or about 2:40 an hour.

Iā€™ve had one running the last day or so, 3 times an hour. Itā€™s been taking 14-20 seconds per run, so I think Iā€™m good. That one baby scraper uses up a lot of my minutes though! Might switch to RPi or VPS just because.

Yeah. Itā€™s enough free minutes to support about one active project. As soon as you add a second project, or if your project becomes very active, then youā€™re in the money zone.