Skip to content

Instantly share code, notes, and snippets.

View neffo's full-sized avatar

Michael Carroll neffo

View GitHub Profile
@neffo
neffo / terminalwallpaper.sh
Created September 13, 2022 16:15
Display current GNOME desktop wallpaper in your terminal
#!/bin/sh
# add some colour to new terminals
# add 'sh terminalwallpaper.sh' to ~/.profile or ~/.zprofile
# needs chafa (should be in most Linux repos)
chafa `gsettings get org.gnome.desktop.background picture-uri | sed "s#file://##;s/+/ /g;s/%\(..\)/\\x\1/g;s/'//g"`
@neffo
neffo / bingterminal.sh
Created September 14, 2022 08:28
Display random Bing wallpaper in your terminal
#!/bin/bash
# add some colour to new terminal
# requires:
# - Bing Wallpaper GNOME extension
# - chafa
# https://extensions.gnome.org/extension/1262/bing-wallpaper-changer/
# https://github.com/neffo/bing-wallpaper-gnome-extension
# https://github.com/hpjansson/chafa (should be available in most distribution repos)
# add 'sh bingterminal.sh' to ~/.profile or ~/.zprofile
@neffo
neffo / bg_remove.sh
Last active April 13, 2025 08:02
Extract sprites from recordings of 8-bit or 16-bit games (or whatever really)
#!/bin/bash
# extract sprites from 8-bit or 16-bit game recordings
# if current directory has a bunch screencaps from a 8-bit or 16-bit game recording (with a more or less static background)
# works best if the image is scaled with integer nearest neighbour scaling and the recording is loss less
# I record like this:
# ffmpeg -f x11grab -framerate 50 $(slop --nodecorations -f '-video_size %wx%h -i +%x,%y') -vf "crop=<w>:<h>:<x>:<y>,scale=<w>:<h>:flags=neighbor" -frames:v 400 animation%00d.png
# i find a screen that has a nice static background with the sprite missing (or paint out the sprites so the background doesn't have it) and rename it 'static_bg.png'