Comments (9)
Ok, I logged some output of your main.py (in $HOME/.local/share/ulauncher/extensions/com.github.dflock.ulauncher-window-switcher
):
Problem is that on my dwm this is not delivering what you expect:
# Get list of all workspaces and process into a dictionary that looks like this:
# {<workspace_id>: <workspace_name>}
result = subprocess.run(
['wmctrl -d | awk \'{$1=$2=$3=$4=$5=$6=$7=$8=$9=""; print $0}\''],
capture_output=True,
shell=True,
text=True,
).stdout
On my system wmctrl -d
delivers 511 lines, matching their tag combinations (they don't have classic workspaces) - and none matches the w_dict
. So I just omit the workspace info and all is fine:
# Get list of all workspaces and process into a dictionary that looks like this:
# {<workspace_id>: <workspace_name>}
# result = subprocess.run(
# ['wmctrl -d | awk \'{$1=$2=$3=$4=$5=$6=$7=$8=$9=""; print $0}\''],
# capture_output=True,
# shell=True,
# text=True,
# ).stdout
# ws_list = [y for y in (x.strip() for x in result.splitlines()) if y]
# ws_dict = {i: x for i, x in enumerate(ws_list)}
for w_idx, window in w_dict.items():
if search == '' or search in window['name'].lower():
items.append(
ExtensionResultItem(
icon='images/window.svg',
# Workaround for https://github.com/Ulauncher/Ulauncher/issues/587
name=window['name'].replace('&', '&')
if search
else window['name'],
description=f'Workspace: {window["ws"]}, Window Id: {w_idx}',
on_enter=RunScriptAction(f'wmctrl -ia {w_idx}'),
)
)
Not sure how you could autodetect and remember that though, you would need global state or a tempfile, where you flag if ws_list is empty or so... I guess a config setting resolve_workspace_names
default true
would be the most robust answer.
from ulauncher-window-switcher.
Same issue for me with awesomewm and fancy workspace names. My workspaces are, according to wmctrl -d
:
0 - DG: N/A VP: N/A WA: N/A ~
1 * DG: N/A VP: N/A WA: N/A ~
2 - DG: N/A VP: N/A WA: N/A ➋ ·web·🌏
3 - DG: N/A VP: N/A WA: N/A ➐ ·foo
4 - DG: N/A VP: N/A WA: N/A ➎ ·media·♫
This gets parsed as ws_dict = {0: '·web·🌏', 1: '·foo', 2: '·media·♫'}
- seems like awk
is cutting off too much. For me it works properly when I remove the $9=
(giving me ws_dict = {0: '~', 1: '~', 2: '➋ ·web·🌏', 3: '➐ ·foo', 4: '➎ ·media·♫'}
).
from ulauncher-window-switcher.
You need wmctrl
installed - do you have it?
$ wmctrl --version
1.07
from ulauncher-window-switcher.
Yep - version 1.07
from ulauncher-window-switcher.
same problem hier, wmctrl version 1.07.
WM is dwm.
Distri Fedora 32.
/home/gk$ wmctrl -l
0x01800006 1 gkfedora gk@gkfedora [1] /home/gk
0x01a00005 4 gkfedora Loading... · Issue #2 · dflock/ulauncher-window-switcher - Google Chrome
(...)
from ulauncher-window-switcher.
Could you post the output of wmctrl -d
on your system - or some of it, at least?
from ulauncher-window-switcher.
This is very helpful, thank you! I'm just about to go on vacation, but will be back in a week and will have a go at fixing this then - if no one else fixes it first ;)
from ulauncher-window-switcher.
Sure, I can submit a PR. Sounds like wmctrl
isn't entirely sticking to its documentation:
List all desktops managed by the window manager. One line is output for each desktop, with the line broken up into spacce separated columns. The first column contains an integer desktop number. The second column contains a '*' character for the current desktop, otherwise it contains a '-' character. The next two columns contain the fixed string DG: and then the desktop geometry as 'x' (e.g. '1280x1024'). The following two columns contain the fixed string VP: and then the viewport position in the format ',' (e.g. '0,0'). The next three columns after this contains the fixed string WA: and then two columns with the workarea geometry as 'X,Y and WxH' (e.g. '0,0 1280x998'). The rest of the line contains the name of the desktop (possibly containing multiple spaces).
In my case, because no workarea is available, there's one less column. I'm not that fluent with awk
and would probably move this (more complex) parsing to the python code.
Thanks for providing this extension and enjoy your holiday - hopefully somewhere a bit colder!
from ulauncher-window-switcher.
This is fixed by @furgerf and myself in #7 - thanks everyone for your help & patience.
from ulauncher-window-switcher.
Related Issues (10)
- Crashing on launch HOT 3
- Icons issue HOT 1
- Extension crashes immediately HOT 4
- Show icons next to applications HOT 4
- icons not showing in my ubuntu 20.04 ulauncher 5.7.5 HOT 2
- Integrate fuzzy window search
- Not working, stuck at loading HOT 13
- Switched window doesn't have focus
- No window detected HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ulauncher-window-switcher.