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

X.H.StatusBar with StatusBarPropTo does not update "_XMONAD_LOG_0" UTF-8 String property #531

Closed
1 of 2 tasks
oogeek opened this issue Apr 30, 2021 · 18 comments
Closed
1 of 2 tasks

Comments

@oogeek
Copy link
Contributor

oogeek commented Apr 30, 2021

Problem Description

Use X.H.StatusBar with two monitors. The first monitor with _XMONAD_LOG_0, the second with _XMONAD_LOG_1.
When there is no window in any workspaces, by switching workspaces, the String property updates as expected.

However, if there is a window spawned in one workspace on monitor 0, such as "web", then although one can still switch to
other workspaces, the property string does not update. The same for monitor 1.

By xprop, I confirm my finding.
Update: new config link is provided below in the comments.
Update: totally my fault.

Steps to Reproduce

Configuration File

main :: IO()
main = do
    nn <- countScreens
    let hs = [statusBarPropTo ("_XMONAD_LOG_"++ show n) ("xmobar -x " ++ show n ++ " ~/.config/xmobar/xmobarrct" ++ show n) (pure myXmobarConfig) | (S n) <- [0..nn-1]]
    xmonad . withSB (mconcat hs) . ewmh . ewmhFullscreen . docks $ myConfig'

Checklist

@oogeek oogeek changed the title X.H.StatusBar does not update "_XMONAD_LOG_0" UTF-8 String property X.H.StatusBar with StatusBarPropTo does not update "_XMONAD_LOG_0" UTF-8 String property Apr 30, 2021
@oogeek
Copy link
Contributor Author

oogeek commented Apr 30, 2021

https://github.com/oogeek/dotfiles/blob/main/screen.mp4
This is the link of the screen recording.
It is about 16MB.

@TheMC47
Copy link
Member

TheMC47 commented Apr 30, 2021

You'd need to post your xmobar config and PP settings

@oogeek
Copy link
Contributor Author

oogeek commented Apr 30, 2021

Thanks, I am doing that. I need to remove some personal information.

@liskin
Copy link
Member

liskin commented Apr 30, 2021

The video doesn't seem to match the posted configuration file, where the same pure myXmobarConfig is used for both xmobars, but the video shows different sets of workspaces on each.

@oogeek
Copy link
Contributor Author

oogeek commented Apr 30, 2021

The video doesn't seem to match the posted configuration file, where the same pure myXmobarConfig is used for both xmobars, but the video shows different sets of workspaces on each.

Sorry for that, I am busying uploading my config. Let me explain that later.

@liskin
Copy link
Member

liskin commented Apr 30, 2021

Sorry for that, I am busying uploading my config. Let me explain that later.

So you really did report a bug with a sample config that does not reproduce the issue? Please don't do it again.

@oogeek
Copy link
Contributor Author

oogeek commented Apr 30, 2021

Sorry for that, I am busying uploading my config. Let me explain that later.

So you really did report a bug with a sample config that does not reproduce the issue? Please don't do it again.

Please don't get me wrong.
I have also tried the config in sample config and both of them does not work.
So I choose to post that one.
Since the other one is with the IndependentScreens PR.

@oogeek
Copy link
Contributor Author

oogeek commented Apr 30, 2021

I got this error from startx:
And Prelude is reporting something too large.

keycode 60 sym 46  ( 0x2e  " period ") mask 0x40 (mod4) clean 0x40 (mod4)
keycode 60 sym 46  ( 0x2e  " period ") mask 0x40 (mod4) clean 0x40 (mod4)
keycode 36 sym 65293  ( 0xff0d  " Return ") mask 0x40 (mod4) clean 0x40 (mod4)
user error (Error in function getWindowAttributes)
keycode 60 sym 46  ( 0x2e  " period ") mask 0x40 (mod4) clean 0x40 (mod4)
keycode 36 sym 65293  ( 0xff0d  " Return ") mask 0x40 (mod4) clean 0x40 (mod4)
keycode 88 sym 65433  ( 0xff99  " KP_Down ") mask 0x40 (mod4) clean 0x40 (mod4)
keycode 87 sym 65436  ( 0xff9c  " KP_End ") mask 0x40 (mod4) clean 0x40 (mod4)
keycode 60 sym 46  ( 0x2e  " period ") mask 0x40 (mod4) clean 0x40 (mod4)
keycode 88 sym 65433  ( 0xff99  " KP_Down ") mask 0x40 (mod4) clean 0x40 (mod4)
Prelude.!!: index too large
Prelude.!!: index too large
keycode 89 sym 65435  ( 0xff9b  " KP_Next ") mask 0x40 (mod4) clean 0x40 (mod4)
Prelude.!!: index too large
Prelude.!!: index too large
keycode 87 sym 65436  ( 0xff9c  " KP_End ") mask 0x40 (mod4) clean 0x40 (mod4)
keycode 88 sym 65433  ( 0xff99  " KP_Down ") mask 0x40 (mod4) clean 0x40 (mod4)
Prelude.!!: index too large
Prelude.!!: index too large
keycode 89 sym 65435  ( 0xff9b  " KP_Next ") mask 0x40 (mod4) clean 0x40 (mod4)
Prelude.!!: index too large
Prelude.!!: index too large
keycode 87 sym 65436  ( 0xff9c  " KP_End ") mask 0x40 (mod4) clean 0x40 (mod4)

@liskin
Copy link
Member

liskin commented Apr 30, 2021

Prelude.!!: index too large is quite likely the culprit, now we just need to find out where it comes from. :-/

@liskin
Copy link
Member

liskin commented Apr 30, 2021

Can you please try commenting out ppOrder = ppp temporarily?

@oogeek
Copy link
Contributor Author

oogeek commented Apr 30, 2021

Can you please try commenting out ppOrder = ppp temporarily?

Thanks, I found the cause. @liskin @TheMC47 Sorry for taking up you so much time. I feel embarrassed. However, I am still confused. Since it works well when I use pipes. So I think I need to dig a bit deeper.

Also I think I should close the issue.

@oogeek
Copy link
Contributor Author

oogeek commented Apr 30, 2021

Also I think there can be an improvement of document for statusbar with multiple monitors. I would be happy to open a PR for that.

@TheMC47
Copy link
Member

TheMC47 commented Apr 30, 2021

What was the problem, exactly?

Also I think there can be an improvement of document for statusbar with multiple monitors. I would be happy to open a PR for that.

By all means! The module seems obvious to me, because I spent too much time on it, so it's very likely that we missed documenting some parts.

@TheMC47 TheMC47 closed this as completed Apr 30, 2021
@liskin
Copy link
Member

liskin commented Apr 30, 2021

The lesson here should be that you should try reproducing with a minimal config next time.

This:

main :: IO()
main = do
    nn <- countScreens
    let hs = [statusBarPropTo ("_XMONAD_LOG_"++ show n) ("xmobar -x " ++ show n ++ " ~/.config/xmobar/xmobarrct" ++ show n) (pure myXmobarConfig) | (S n) <- [0..nn-1]]
    xmonad . withSB (mconcat hs) . ewmh . ewmhFullscreen . docks $ myConfig'

only reproduces the issue with certain values of myConfig' and myXmobarConfig, and you only gave us those values after being asked for that. That is where the time waste comes from.

@oogeek
Copy link
Contributor Author

oogeek commented Apr 30, 2021

What was the problem, exactly?

Also I think there can be an improvement of document for statusbar with multiple monitors. I would be happy to open a PR for that.

By all means! The module seems obvious to me, because I spent too much time on it, so it's very likely that we missed documenting some parts.

I mean if users want to use show two different flow of contents as monitor dependent. Only a "XMONAD_LOG" does not work. Maybe users would like to use XpropertyLog with Run XpropertyLog "_XMONAD_LOG_1"

@TheMC47 You work is really impressive. I just want to add a bit for xmobar integration.

@oogeek
Copy link
Contributor Author

oogeek commented Apr 30, 2021

The lesson here should be that you should try reproducing with a minimal config next time.

This:

main :: IO()
main = do
    nn <- countScreens
    let hs = [statusBarPropTo ("_XMONAD_LOG_"++ show n) ("xmobar -x " ++ show n ++ " ~/.config/xmobar/xmobarrct" ++ show n) (pure myXmobarConfig) | (S n) <- [0..nn-1]]
    xmonad . withSB (mconcat hs) . ewmh . ewmhFullscreen . docks $ myConfig'

only reproduces the issue with certain values of myConfig' and myXmobarConfig, and you only gave us those values after being asked for that. That is where the time waste comes from.

Thanks for pointing out. I have learned my lesson.

@TheMC47
Copy link
Member

TheMC47 commented Apr 30, 2021

I mean if users want to use show two different flow of contents as monitor dependent. Only a "XMONAD_LOG" does not work. Maybe users would like to use XpropertyLog with Run XpropertyLog "_XMONAD_LOG_1"

This is definitely missing in the documentation, we just briefly talked about it in a paragraph. Feel free to open a PR!

@TheMC47 You work is really impressive. I just want to add a bit for xmobar integration.

I wouldn't say it's my work, it's really a collective effort. Thanks though!

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

3 participants