echtejosh / desktop-pet

Decorate your desktop with a pet duck that wanders around on your taskbar!
MIT License
6 stars 3 forks source link

Interesting project. A Few problems #1

Open Lewiscowles1986 opened 1 month ago

Lewiscowles1986 commented 1 month ago

Hey 👋 this is very cool

Intended platform

It looks like it is Windows platform specific for a python bundled with tkinter. Might be a good idea to share with folks how you set that up. Just-in-case.

In my case; I'm on a mac; which doesn't bundle tkinter by default.

Using TKinter (mac instructions)

Homebrew

If folks are using homebrew, they can brew install python-tk; but some of the options are OS specific... Kinda defeating the purpose of a cross-platform library for GUI; but that is TK, not your project specific.

pyenv

For folks using pyenv (I happen to use homebrew and pyenv); an additional step; as well as running or doing something to install libtk and libtcl; is to ensure your python build supports dynamic libraries. env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.11.8.

There are more comprehensive guides which also cover linux; but I've only so-far tested with OSX

Bug?

I noticed, sometimes the creature would go left, right, left, or right, left, right. I narrowed this down to being at, the window border. Rather than call self.change_direction(), which involves random; I use self.dir = -self.dir, which simply put, reverses the direction.

Thanks for sharing this code. Hope some of this helps.

Update: Todo

echtejosh commented 1 month ago

Hi @Lewiscowles1986 , thank you for your contribution. I also agree that we can find better ways for the pet to move around the taskbar, there isn't a lot of sophisticated behaviorism implemented into this project. Maybe, just maybe, you could contribute to this project also?

Lewiscowles1986 commented 1 month ago

Happy to contribute the bug fix. The OSX fix isn't done, as the display is still not rendering when the label and window are transparent.

echtejosh commented 1 month ago

It's also possible for us to use another framework that's more compatible for both windows and macos?

Lewiscowles1986 commented 1 month ago

So I don't know that a framework is needed at all, or that it's not specific to the libraries built by homebrew, that cause this issue.

I have not seen a single tk pet that works with my OSX out of the box. I Own several macs. None of them work.

I Do have a Qt one that works, but it feels a bit heavyweight a lift.

do you have any other suggestions around tooling or tech?

echtejosh commented 1 month ago

I'll take a look today!

echtejosh commented 1 month ago

Hi @Lewiscowles1986 , want to take a look at tkmacosx?

Lewiscowles1986 commented 1 month ago

I Just did, but it doesn't seem to solve much. Why, and how did you think these would help?

echtejosh commented 1 month ago

I wasn't sure whether the issue was with running the application, or whether the issue lies in the way these frameworks display elements on the desktop screen. I was thinking this would help.

Lewiscowles1986 commented 1 month ago

Ah, it's a bug in Tk (which is not in QT). I Spent some time with pyobjc today, seeing if I can make a native example and define a thin API. Not much luck yet.