1
2
Fork
You've already forked deskpet
0
An easy-to-script and very lightweight Wayland-first desktop pet app. Written in C with SDL3 and intended for use with hyprland.
2026年01月31日 06:06:08 +00:00
art Upload New File 2026年01月19日 19:10:15 +00:00
README.md Edit README.md 2026年01月31日 06:06:08 +00:00

Deskpet

(aka. hyprpets)

I'm not sure why being sick drove me to make this, but this is a great way to have an annoying desktop pet (i.e. Clippy) that can react to input and/or your system. If something isn't implemented here, you honestly can just do it in a few lines of bash.

While I don't see any reason for X11 to not work with this, I also won't offer support for it (sorry). If something's broken with a wayland wm I'll give fixing it a shot.

Just want to run it already? Binaries are here! (arm64 binaries are artifacts in CI). Source code is in the src branch.

DeskPet and its engine are currently being further split apart. Issues will be handled differently once the engine stops being glorified helper code.

Screenshots

clippy_demo

An example of Clippy responding to CPU temperature.

Your pet can be repositioned both manually and via scripting.

Main features over other apps

  • Uses less resources (was using about 1/4th the amount of cpu that Hyprland itself was using while on the 'nuisance' demo)

This also only uses ~5MiB of VRAM and (according to heaptrack), 18MB of RAM! (I think the number is higher in btop due to nvidia's driver)

  • Is a lot more customizable compared to other pets (if you want to run a python script or C application after init, go ahead!)

Yes, this means that you can have an AI vision model literally sitting in the corner of your screen. I don't know why you would ever do this, but that's an option here. You could even have an API (network and/or system) integration made so your pet can give random updates (i.e. weather, mail, etc).

  • some anti-distraction features (fade out on hover/double-click).

  • Animations can be fully replaced by you (supports up to 9999 animations currently), with configurable looping behaviours.

  • Is wayland-native, reducing the amount of bugs and extra overhead that Xwayland would introduce.

  • Doesn't hijack focus or open a fake fullscreen app

  • doesn't jump around your desktop like crazy (unless you write a script to do that!), so it's actually quite usuable!

  • Is written in pure C (sense of pride and accomplishment).

  • Is free and open-source under GPLv3! (Aside from Clippy)

  • Optionally, 2X integer scaling is available for dense displays/accessibility (in widgetcfg.conf).

Drawbacks

While I think this is better than most free apps, it is currently limited in a few ways:

  • No permissions system for scripts, meaning that I can't safely make a place to share pets that aren't mine.
  • You'll have to play sounds yourself. This may actually be a good thing depending on how complex your pet's logic is.

(note) Input DOES NOT go to the app's stdin. This is very easy to work around (you can just pipe it to your app through something like inotify), but does increase the workload a bit when it catches you off-guard.

What is this actually

(you'll understand this way faster if you check out what the demo scripts do)

Deskpet is basically a really fancy interactive wrapper for a collection of bash scripts. It writes any keys input to the app into /tmp/deskpet_lastkey. This can then be read from the script via inotify to respond to most types of key behaviours (typing, backspace, keys being held, etc).

The program's init.sh script is opened on another thread so that rendering and other application features stay outside of script handling. The end result is that Deskpet spends basically all of its time sleeping and waiting for a script to write to stdout.

However, this detection isn't totally instant, so you should sleep for a couple miliseconds if you're chaining an animation with a message.

Speaking of which, animations are triggered by _xxxx (substitute x's for something like echo _0001) being written to stdout. This plays the given index. If you want to add more animations, or change the frame size/framerate, check out ./deskpet/animations/animation.conf.

Writing a pair of blank quotes to stdout (e.g. echo "") will clear the textbox and leave only your pet.

It's worth noting that one of the default scripts, chase_to_hyprland_workspace.sh will move the pet to your current workspace whenever it has something to say. It doesn't take your input focus away when it does this, but you could accidentally click it and lose focus. You can just delete that script's contents to stop this, but it's much more funny for it to never stop yapping in your face.

This all might sound chaotic, but it actually worked very well for my use case of a clippy joke. You can honestly just throw something dumb together and have it 'just work'.

Updates?

I plan to update this in big releases instead of incremental fixes. I feel like this motivates me more to keep working.

So you actually want to use it?

Deskpet:

You'll need the following:

  • SDL3 (almost every package manager has it)
  • SDL3_ttf (most do, but are outdated. Arch now seems to bundle a recent enough version)
  • SDL3_image (appears to be outdated on arch)

For demo scripts:

  • inotify-tools
  • any version of bash from this decade

Known issues:

  • Plasma Wayland cuts off most of your DeskPet, and does not let it sit on top of most maximised applications.

When making a pet, you'll generally only want to touch scripts, pet.png and animations. Touching the config will only either break stuff or display extra debug messages that aren't too useful for regular users. You can replace the messagebox/font if you want to, but they need to be a similar size to work correctly.

It all works suprisingly well considering how much of a noob I was/currently am at C. Memory usage stayed constant for me while running this, so I assume that I somehow didn't make code which leaks memory.

Attribution:

DeskPet uses Cozette as a font!