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

bottomline (-b) option is 0 indexed #151

Open
oredaze opened this issue Jun 29, 2023 · 6 comments
Open

bottomline (-b) option is 0 indexed #151

oredaze opened this issue Jun 29, 2023 · 6 comments

Comments

@oredaze
Copy link

oredaze commented Jun 29, 2023

I don't know anyone who has their desktop numbers start at 0... This feature is useless if the number doesn't correctly correspond to the virtual desktop number.

@sagb
Copy link
Owner

sagb commented Jun 29, 2023

Please show exact options you run attab with, and what do you see in bottom line.

@oredaze
Copy link
Author

oredaze commented Jun 30, 2023

With default options it has -b 1 if I am not in single-desktop mode, which is true.
At the bottom right corner there is a number, it corresponds to the desktop number the application is on, you know how it works. However if my program is on desktop 1 it shows 0, if it is on desktop 2 it shows 1, etc...

@sagb
Copy link
Owner

sagb commented Jun 30, 2023

The common standard for desktops (workspaces) is Freedesktop set of standards.
According to https://specifications.freedesktop.org/wm-spec/1.3/ar01s03.html

_NET_CURRENT_DESKTOP
The index of the current desktop. This is always an integer between 0 and _NET_NUMBER_OF_DESKTOPS - 1.

If your window manager generally conforms to this standard (alttab -v says "ewmh compatible"), then you can check how your WM assigns numbers to desktops: wmctrl -d

WM may also assign an arbitrary internal label to desktop number 0, making it, say, "1" for user. I doubt that incrementing standard integer value is reasonable. What if WM allows renaming the workspace to arbitrary text label? There is no standard way to obtain such labels.

@sagb
Copy link
Owner

sagb commented Jun 30, 2023

Actually, there is a way to obtain this label. What wmctrl -d says for you?

@oredaze
Copy link
Author

oredaze commented Jun 30, 2023

0  * DG: 1920x1080  VP: 0,0  WA: 0,0 1920x1080  1
1  - DG: 1920x1080  VP: 0,0  WA: 0,0 1920x1080  2
2  - DG: 1920x1080  VP: 0,0  WA: 0,0 1920x1080  3
3  - DG: 1920x1080  VP: 0,0  WA: 0,0 1920x1080  4
4  - DG: 1920x1080  VP: 0,0  WA: 0,0 1920x1080  5
5  - DG: 1920x1080  VP: 0,0  WA: 0,0 1920x1080  6
6  - DG: 1920x1080  VP: 0,0  WA: 0,0 1920x1080  7
7  - DG: 1920x1080  VP: 0,0  WA: 0,0 1920x1080  8
8  - DG: 1920x1080  VP: 0,0  WA: 0,0 1920x1080  9

This is openbox, and it correctly sets the index to 0. My point is that nobody considers starting with 0 when they work.
We set a hotkey and name to 1(maybe not always name...) for the first desktop (index 0). I guess I can just ignore that and never use it... but it's weird. Like when you login you start there...

sagb added a commit that referenced this issue Jul 1, 2023
Because indexing from zero may be unexpected, #151
@sagb
Copy link
Owner

sagb commented Jul 1, 2023

Proper solution would be an option to display _NET_DESKTOP_NAMES/_WIN_WORKSPACE_NAMES.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants