-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Implement launch filters #369
Conversation
I'll take a look as soon as I can. |
No worries, take as much time as you need. I've taken a look at "Restart on display connected" and it seems that it's only implemented on sway (on_i3ipc_event). I'll try to implement a hyprland check when I have some time. |
Yes, I don't remember doing this on Hyprland. |
I have added the missing "Restart on display connected" for Hyprland. It seemed suspiciously easy, so let me know any mistakes I may have made. |
Actually I think that you may be the one and only user of these settings. It would be not bad to invent a more intuitive way to do what you want. However, I have no better idea, at least at the time. Let me play with it as is for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let's leave it as is, apart from one change: as this feature does not support monitor names, but only output names, and it most probably won't be used by 99% of users, I'd like the fields "Run in output exists" and "Run if outputs absent" to go the the very bottom of the config form. It would be also not bad if you could add some info on the Configuration Wiki page.
318710a
to
6d69a77
Compare
"Run if outputs exist": Comma-separated list of outputs which must all be connected in order for this panel to be launched "Run if outputs absent": Comma-separated list of outputs which must all be disconnected in order for this panel to be launched
Implement restart on display connected/disconnected in hyprland (previously only worked in sway)
6d69a77
to
a223ab7
Compare
No problem. I've moved the new text fields to the bottom of the form and rebased the branch with the new commits from master. |
I recently installed hyprland on my laptop and realized that nwg-panel doesn't have any way to define screen "layouts". For example:
The simplest way I found to allow this was to add some filters that determine if a panel will be launched, based on the displays that are currently connected.
I added 2 new panel settings:
"Run if outputs exist": Comma-separated list of outputs which must all be connected in order for this panel to be launched.
"Run if outputs absent": Comma-separated list of outputs which must all be disconnected in order for this panel to be launched
Since the two conditions can be combined and each allow a list of displays, I think this system is flexible enough for complex situations. Perhaps in the future it could be extended to consider monitor names instead of output (port) names.
I placed the new settings next to the Output selector:
![image](https://private-user-images.githubusercontent.com/65060696/398225561-36917129-629d-4a24-9a8c-303d0bf90754.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwOTA3OTgsIm5iZiI6MTczOTA5MDQ5OCwicGF0aCI6Ii82NTA2MDY5Ni8zOTgyMjU1NjEtMzY5MTcxMjktNjI5ZC00YTI0LTlhOGMtMzAzZDBiZjkwNzU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDA4NDEzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUwODM4YTkyZjM3MWJkYTQ2ZDRhMGMxY2MyMDI2Njc5MDNkNDU3NTc4NmUzNjA4ODdmZDhmZGZkMDE0Mjg2NjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.tMLHa2_SuAouPjaQ307ovDoes_wNeEkTMz2mLJ3l8ZI)
Feel free to change the presentation and translations (I used ChatGPT) as you see fit.
I've seen there is a setting called "Restart on display connected" which would work nicely with this filtering feature, but it doesn't seem to work on my end, and I currently need to manually relaunch nwg-panel when I plug or unplug a monitor. Tomorrow I will investigate and see if I discover why.