dflock / ulauncher-window-switcher

Linux/X11 Window Switcher plugin for Ulauncher
GNU General Public License v3.0
14 stars 10 forks source link

Not working, stuck at loading #11

Closed OmarShawky1 closed 2 years ago

OmarShawky1 commented 2 years ago

image

OS: Elementary OS 5.1.7 Hera based on Ubuntu 18.04 LTS using Pantheon Desktop.

Error from terminal log

2021-12-04 18:09:44,873 | DEBUG | ulauncher.ui.windows.UlauncherWindow: show_results() | render 1 results
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ulauncher/api/client/Client.py", line 54, in on_message
    self.extension.trigger_event(event)
  File "/usr/lib/python3/dist-packages/ulauncher/api/client/Extension.py", line 52, in trigger_event
    action = listener.on_event(event, self)
  File "/home/omar/.local/share/ulauncher/extensions/com.github.dflock.ulauncher-window-switcher/main.py", line 80, in on_event
    window["ws"], ws_dict[window["ws"]], w_idx
KeyError: 0
com.github.dflock.ulauncher-window-switcher | 2021-12-04 18:09:44,874 | DEBUG | ulauncher.api.client.Client: on_message() | Incoming event KeywordQueryEvent
dflock commented 2 years ago

Could you post the output from the following commands please?

$ python --version

and

$ wmctrl -l | awk '{ if( $2 != "-1") { $3="";  print $0} }'

and

$ wmctrl -d | sed -n -E -e 's/^.*WA: (N\/A|.,. [[:digit:]]+x[[:digit:]]+)  //p'

Thanks!

OmarShawky1 commented 2 years ago
$python --version
Python 2.7.17
$ wmctrl -l | awk '{ if( $2 != "-1") { $3="";  print $0} }'
0x01a00003 0  wingpanel
0x06800008 0  program-langs-part-a - Discord
0x04a00016 0  Warm & Cozy November Jazz - Relax Coffee Time Jazz For Study, Work, Stress Relief - Jazz BGM - YouTube
0x04a00017 0  Not working, stuck at loading · Issue #11 · dflock/ulauncher-window-switcher - Google Chrome
0x0360000a 0  wmctrl -l
0x04800007 0  Mailspring · Re: [dflock/ulauncher-window-switcher] Not working, stuck at loading (Issue #11)
$ wmctrl -d | sed -n -E -e 's/^.*WA: (N\/A|.,. [[:digit:]]+x[[:digit:]]+)  //p'
dflock commented 2 years ago

Fantastic, thanks!

Sorry, I forgot one:

$ python3 --version
OmarShawky1 commented 2 years ago
$ python3 --version
Python 3.6.9
vipranarayan14 commented 2 years ago

I also get the same error.

OS: elementary OS 6 Odin

$ python --version
Python 3.10.0
$ python3 --version
Python 3.10.0
$ wmctrl -l | awk '{ if( $2 != "-1") { $3="";  print $0} }'
0x01e00003 0  io.elementary.wingpanel
0x05a00007 0  /home/user/Documents/Data
0x04000001 0  v3.md - Visual Studio Code
0x0540002b 1  Not working, stuck at loading · Issue #11 · dflock/ulauncher-window-switcher — Mozilla Firefox
0x0580004a 1  Synaptic Package Manager
0x028001ec 0  Ulauncher Preferences
$ wmctrl -d | sed -n -E -e 's/^.*WA: (N\/A|.,. [[:digit:]]+x[[:digit:]]+)  //p'
dflock commented 2 years ago

I have just pushed a change which fixes one instance of getting suck at "Loading..." which I found. Maybe this fixes it for you?

OmarShawky1 commented 2 years ago

Nope.

dflock commented 2 years ago

It seems like this command doesn't work on elementaryOS, for some reason:

$ wmctrl -d | sed -n -E -e 's/^.*WA: (N\/A|.,. [[:digit:]]+x[[:digit:]]+)  //p'

This should spit out a list of workspace names, something like this:

$ wmctrl -d | sed -n -E -e 's/^.*WA: (N\/A|.,. [[:digit:]]+x[[:digit:]]+)  //p'

Personal: Email
Notes
Todo
Finances
Project: duncanlock.net
Personal: D&D
Project: Nim
[empty]
Project: dotfiles
[empty]
Project: antora-default-ui
Project: Home Dashboard
Project: LanguageTool
Project: Gemini
Project: lite-xl
Project: Standard eBooks
Project: NAS & Storage
Project: Processing
Personal: Retro Hardware
Project: ulauncher
[empty]
[empty]
[empty]
Music

If running that doesn't produce any output, can you please just try this command on its own:

$ wmctrl -d

and paste the output from that?

OmarShawky1 commented 2 years ago

I have 2 screens and 2 workspaces which add up to 3.

$ wmctrl -d
0  * DG: 2640x1024  VP: 0,0  WA: 0,30 2640x994  Workspace 1
1  - DG: 2640x1024  VP: N/A  WA: 0,30 2640x994  Workspace 2
2  - DG: 2640x1024  VP: N/A  WA: 0,30 2640x994  Workspace 3

Edit: This solution appears to be working, it uses wmctrrl -l instead if d flag Here is the output sample:

$ wmctrl -l
0x01c00003 -1 omar-LLaptop plank
0x02e00003 -1 omar-LLaptop 
0x02e0007d -1 omar-LLaptop HTC
0x06200001  1 omar-LLaptop hw7.sml - Programming-Languages-Course - Visual Studio Code
0x05e00006  0 omar-LLaptop Barrier
0x07400003  1 omar-LLaptop hw7.pdf - Personal - Microsoft​ Edge
0x01a00003  0 omar-LLaptop wingpanel
0x0ae00002  0 omar-LLaptop Spotify
0x07200088  0 omar-LLaptop How can I get a list of all open windows in the command line? - Ask Ubuntu - Google Chrome
0x0aa0000a  0 omar-LLaptop wmctrl -l
authmane512 commented 2 years ago

I have the same problem on Linux Mint 20.3 Xfce

stefanjarina commented 2 years ago

Hi,

fix here is fairly easy, posted pull request #12

In the meantime before author merges pull request, you can check if it works for you by editing the line 62 in $HOME/.local/share/ulauncher/extensions/com.github.dflock.ulauncher-window-switcher/main.py

result = subprocess.run(
            [
-                 "wmctrl -d | sed -n -E -e 's/^.*WA: (N\/A|.,. [[:digit:]]+x[[:digit:]]+)  //p'"
+                 "wmctrl -d | sed -n -E -e 's/^.*WA: (N\/A|.+,.+ [[:digit:]]+x[[:digit:]]+)  //p'"
            ],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,  # equivalent to capture_output=True
            shell=True,
            universal_newlines=True,  # equivalent to text=True
        ).stdout

For me it now works flawlessly: image

OmarShawky1 commented 2 years ago

@stefanjarina Yes, This solved the entire problem & it worked smooth. Thank you.

Base-115 commented 1 year ago

Wow, awesome, thank you so much to fix this useful plugin! ❤️