Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from libayatana-appindicator/libappindicator-gtk3 to org.kde.StatusNotifierItem #1316

Open
C0rn3j opened this issue Nov 25, 2024 · 6 comments
Labels
heavy Technical debt or previous design decisions make this hard to move help wanted

Comments

@C0rn3j
Copy link
Collaborator

C0rn3j commented Nov 25, 2024

AyatanaIndicators/libayatana-appindicator#22

Tauon cannot use GTK4 before this is resolved, as the system tray feature relies on GTK3 to be available, and mixing 3.0 and 4.0 is not possible.
MENU > Settings > Function > tab3 > Show Icon in System Tray

org.kde.StatusNotifierItem does not need GTK to work.

Example project that has done this already is Safe Eyes - slgobinath/SafeEyes#558

@C0rn3j C0rn3j changed the title Migrate to org.kde.StatusNotifierItem from libayatana-appindicator/libappindicator-gtk3 Migrate from libayatana-appindicator/libappindicator-gtk3 to org.kde.StatusNotifierItem Nov 25, 2024
Taiko2k added a commit that referenced this issue Nov 29, 2024
…ylist too (#1311)

* main: Fix gensokyoradio unresolved URL

* main: Add TauonQueueItem class

* main: Rename QUE to track_queue

* main: Rename sg() to get_track_in_playlist() and type it

* main: Remove unused args from PlayerCtl

* main: Typing changes and small refactors, finish renaming g() to get_track(), Pctl console.print() to logging, fix requests timeout

* main: Return install_directory to PlayerCtl, that one was actually needed

* main: PlayerCtl changes - fix referring to itself as an object name instead of self, use new classes for Playlists/Queues, type fixes

* main: Refactor to new classes, catch lock exceptions better, refactor hide_title as bool

* main: Simplify two opens

* main: Spaces to tabs til 21KLOC

* main: Final 20K stretch of spaces to tabs

* main: Typo fixes and fix up remaining mixed tab+space indents

* main: Nicely catch all unlock failures

* rename tauon.py

* fix pyproject for main rename

* main: Fix indent level in new except

* main, webserve: Nicer exceptions

* main: Use latest available pickling protocol - v5 over v4 on all currently supported versions

* main: Add missing trailing commas

* main: Remove unnecessary trailing commas

* main: Remove extraneous parentheses

* main: Add a bunch of types

* main: Type is_level_zero

* main: Fix pickling  TauonPlaylist and TauonQueueItem

* main: Fix up TauonPlaylist being accessed as an array

* main, db_migrate: Fully type migrations

* Refactor missed playlists/queues and add a bit more typing

* main: Fix f-strings to restore Python <3.12 support

* dbus: Specify GTK version to import

* dbus: Force 3.0 GTK for the indicator

* t_main, main, dbus: Bump GTK and GDK down to 3.0 because of #1316

* tidal: Nicer exception handling

* win-build.sh: Add deprecation comment

* pyproject.toml: Add "assets/svg/*" explicitly as at least one person on Python 3.11 had an issue without it

* main: Fix unpickling the new classes

* main, extra, config: Fix fixed tryint() and fix config not being able to parse negative ints

* Phazor: Set libdir to lib64 instead of lib which is 32-bit dir on some distros

* Attempt to implement a migration

* main: Convert all console.print()s to logging

* main: Fix up v69 migration and some lingering refactors

* webserve: Clean up exceptions

* Main: Migration fixup

* Type up translation _() function

* Main: Typing and docstrings

* Main: A bit of typing and cleanup

* Delete seemingl unused parameter db_inc

* Main: Add todo and one type

* Main: Fix playlist duping

* Config: Fix passing None to tryint()

* Main: A bit more typing

* run.sh/reqs: Add devel stubs for Gtk3 and Gdk3

* Dedent code, simplify conditions, remove unused imports, add typing, use min() and max() instead of if, sort things, linter changes

* extra/main/spot: Verify subprocess return code

* Extra: Remove unused import

* Main: Add a missed min max

* pyproject.toml: Add avoid-escaped-quote linter rule

* Tagscan: Add typing

* Fix hide_title still being used as int in some places

* Add some more typing and fix pl_gen playlist name after refactor

* A bit more typing

* Revert db_inc deletion

* Refactor a missed multiplaylist object

* extra: Fix up color types

* Main: More typing

* __main__: Crash if we fail to create window or renderer, exit code 1 on error

* Main: More typing

---------

Co-authored-by: Taiko2k <[email protected]>
@stkw0
Copy link
Contributor

stkw0 commented Dec 2, 2024

How it would work for people not using KDE (nor GNOME)?

@C0rn3j
Copy link
Collaborator Author

C0rn3j commented Dec 2, 2024

The DE needs to implement the spec - https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/ - even Xfce seems to do so based on a quick check, so I imagine everyone supports it one way or another.

@stkw0
Copy link
Contributor

stkw0 commented Dec 2, 2024

I was thinking specifically with people who uses a window manager instead of a DE.

@C0rn3j
Copy link
Collaborator Author

C0rn3j commented Dec 2, 2024

Window managers tend to have tray support?

Either way, same deal, instead of AppIndicator spec you need the StatusNotifierItem spec implemented.

@stkw0
Copy link
Contributor

stkw0 commented Dec 2, 2024

Yes. At least dwm did, and most wm I know or used had it (though I moved to KDE years ago). In any case, I guess it could be made in such a way that notifications are optional and Tauon can run without notifications support if the WM don't implement that spec.

@C0rn3j
Copy link
Collaborator Author

C0rn3j commented Dec 2, 2024

Note that this is not about notifications but the tray icon and its associated functions.

Tray icon is already optional and off by default.

Both the current indicator and the kde implementation over dbus(?) actually are both SNI (StatusNotifierItem) implementations... as you can see I have not looked too deep into this

@C0rn3j C0rn3j added help wanted heavy Technical debt or previous design decisions make this hard to move labels Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
heavy Technical debt or previous design decisions make this hard to move help wanted
Projects
None yet
Development

No branches or pull requests

2 participants