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

[window_switcher:1.1] support global query #171

Closed
wants to merge 0 commits into from

Conversation

talengu
Copy link

@talengu talengu commented May 15, 2023

No description provided.

@ManuelSchneid3r
Copy link
Member

ManuelSchneid3r commented May 16, 2023

I am not really a friend of the shipped icons. there is the freedesktop icon lookup for such things. albert implements it. this way the users icon theme is taken into account. iirc older version supported this. well they used iconlookup() in the old api.

@talengu
Copy link
Author

talengu commented May 18, 2023

I am not really a friend of the shipped icons. there is the freedesktop icon lookup for such things. albert implements it. this way the users icon theme is taken into account. iirc older version supported this. well they used iconlookup() in the old api.

Nice. XDG is a good way, but lots of icon can not be found. Do we have icon_lookup fun to return false , then start using shipped icons ?

@ManuelSchneid3r
Copy link
Member

Nice. XDG is a good way, but lots of icon can not be found. Do we have icon_lookup fun to return false , then start using shipped icons ?

they are tried in the order you provide them in this url list. but actually every window should have an icon. which ones are not found?

@ManuelSchneid3r
Copy link
Member

Do we have icon_lookup fun to return false

note that we dont have icon_lookup fun at all. 0.18 (iirc) began making use of an icon url list in item.

@talengu
Copy link
Author

talengu commented May 20, 2023

Do we have icon_lookup fun to return false

note that we dont have icon_lookup fun at all. 0.18 (iirc) began making use of an icon url list in item.

using icon like icon=["xdg:%s"%win_instance.lower()], will be found that :

vscode , virtual box, and ubuntu defaults and so on.
image

@ManuelSchneid3r
Copy link
Member

See here https://github.com/albertlauncher/python/blob/master/.archive/window_switcher/__init__.py#L38 this probably works

every app comes with an icon installed. therefore this should work. Shipping icons is not generalizing well.

@ManuelSchneid3r
Copy link
Member

ManuelSchneid3r commented May 20, 2023

See also the related issues and PRs. There have been a lot of discussions around interpreting the outpout correctly.

@luutuankiet
Copy link

luutuankiet commented May 29, 2023

hey! any chance I can add this plugin this from source to test out ?
EDIT : nvm got that to work. looking forward to this being merged !

@talengu
Copy link
Author

talengu commented May 30, 2023

hey! any chance I can add this plugin this from source to test out ?

EDIT : nvm got that to work. looking forward to this being merged !

I do not have free time to find a good way of icon lookup func.🥹
Work is eating me!

@ManuelSchneid3r
Copy link
Member

ManuelSchneid3r commented Jun 3, 2023

Icon lookup is built in. Just use the xdg URL scheme. Like xdg:<appname>

@talengu
Copy link
Author

talengu commented Jun 4, 2023

Icon lookup is built in. Just use the xdg URL scheme. Like xdg:<appname>

OK, I have changed it to the xdg:<appname> func and test it well.

if someone likes, here is the window_switcher backup using the "the shipped icons".
window_switcher.tar.gz

@PC-02
Copy link

PC-02 commented Jun 4, 2023

built the project from source and loaded this plugin, albert throws this warning and doesn't seem to load the plugin, am I doing something wrong?

02:05:35 [warn:python] Plugin invalid: Incompatible major interface version. Expected 1, got 0. (/home/pc/.local/share/albert/python/plugins/window_switcher)

@ManuelSchneid3r
Copy link
Member

0.21 on master is not released yet. Get the pre-built one or build the latest tag

@PC-02
Copy link

PC-02 commented Jun 8, 2023

building from the latest tag got it working, thank you!

@ManuelSchneid3r ManuelSchneid3r force-pushed the master branch 2 times, most recently from e9f11dc to 6a76444 Compare June 19, 2023 16:19
@talengu talengu changed the title [window_switcher:1.0] move from old [window_switcher:1.0] move from old and support albert 0.21.1 Jul 27, 2023
@talengu
Copy link
Author

talengu commented Jul 27, 2023

how to do not use Triggers in python plugins ? https://github.com/albertlauncher/python/issues/170

Now python plugins support global trigger? And how to support?
image

@ManuelSchneid3r
Copy link
Member

You have to differentiate between GlobalQuery- and TriggerQueryHandlers. There have always been GlobalQueryHandlers. It's nothing new. The plugin just has to implement it. Having a TriggerQueryHandler without a trigger is not possible since it would alway be triggered and prevent the GlobalQuery from beeing executed. See the stubfile on GlobalQueryHandler

@talengu
Copy link
Author

talengu commented Jul 27, 2023

nice!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
image
image

@talengu talengu changed the title [window_switcher:1.0] move from old and support albert 0.21.1 [window_switcher:1.1] support global query Jul 27, 2023
@talengu
Copy link
Author

talengu commented Jul 27, 2023

Icon lookup is built in. Just use the xdg URL scheme. Like xdg:<appname>

OK, I have changed it to the xdg:<appname> func and test it well.

if someone likes, here is the window_switcher backup using the "the shipped icons". window_switcher.tar.gz

here is the window_switcher with some icons support albert 0.21.1

window_switcher1.1.tar.gz

@Base-115
Copy link

Base-115 commented Aug 2, 2023

Hi, talengu.

I am testing the plugin and I want provide some feedback, if it will be useful.

The plugin working well, but

1 - Sometimes I can see the terminal flash quickly when the switching is performing;

2 - Sometimes, the window is bring to front, but the focus is not give, so I need repeat the act in Albert one more time or many times until switch to window.

3 - Switch to window take some time compared with ULauncher and KRunner (native Launcher in KDE Desktop).

@ManuelSchneid3r
Copy link
Member

ManuelSchneid3r commented Aug 3, 2023

sorry for beaking things. please rebase. pyapi 2.0 is done. see the stub.

1 - Sometimes I can see the terminal flash quickly when the switching is performing;

use this

@Base-115
Copy link

Base-115 commented Aug 3, 2023

Hi, Manuel.

Sorry, I didn't understand what I should do about stuff that you sent, 😅.

Should replace something, is it?

@ManuelSchneid3r
Copy link
Member

I just pushed some new stuff. you have to git rebase master

@ManuelSchneid3r
Copy link
Member

talengu can you please reabase and make it python api 2.0 ready?

@talengu
Copy link
Author

talengu commented Aug 6, 2023

oops! git rebase faliled , and the api of albert is changing too fast! But, I will learn it. 😸

@ManuelSchneid3r
Copy link
Member

Thats just an unfortunate time atm. usually the api does not change over years. move the directory of your plugin outside the plugin dir for a moment an do git reset --hard. note that this will undo all changes. so if you have other plugins there backup or move them as well.

@ManuelSchneid3r
Copy link
Member

did you close this pr intentionally?

@talengu
Copy link
Author

talengu commented Aug 10, 2023

did you close this pr intentionally?

No,I will pull it when fixed.

@ManuelSchneid3r
Copy link
Member

please get it upstream.

@talengu
Copy link
Author

talengu commented Aug 29, 2023

Hi, New albert can not run OK in my OS. So I can not debug the python plugin.

albertlauncher/albert#1289 (comment)

git checkout tags/v0.21.1 work nice for me
but failed in the newest one : c66596e31336d1ed6e310d53b8f8cc6488aedf15

albertlauncher/albert#1289 (comment)

@ManuelSchneid3r
Copy link
Member

Have you installed all the required dependencies?

@ManuelSchneid3r
Copy link
Member

If you don't develop native plugins you could also just install the prebuilt packages

@ManuelSchneid3r
Copy link
Member

ManuelSchneid3r commented Aug 29, 2023

Please continue any discussion here: https://github.com/orgs/albertlauncher/discussions/1299

@albertlauncher albertlauncher locked and limited conversation to collaborators Aug 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants