nwg-piotr / nwg-wrapper

Wrapper to display a script output or a text file content on the desktop in sway or other wlroots-based compositors
MIT License
139 stars 8 forks source link

Allow different layer for wraper #3

Closed Iss-in closed 2 years ago

Iss-in commented 2 years ago

Feature request : to have an option to show wrapper in bottom or top layer.

infact having an option like waybar where you can send a custom signal to a module will be awesome. an id can be given to wraper window which can be used to toggle surface layer . It sounds a bit over the edge but will be an aweosme option to have

nwg-piotr commented 2 years ago

Well, I could add the -l | --layer argument to select the initial layer (1 and 2 for bottom and top) and switch them on SIGUSR1. I'll take a look at this.

nwg-piotr commented 2 years ago

Could you check if it meets your expectations? Use pkill -USR1 nwg-wrapper to switch layers.

Iss-in commented 2 years ago

awesome, it works as expected, except that toggle is applied globally to all windows, while its sufficient for my usecase, a better implementation will be to give all windows an Id (N) and trigger using pkill -USRN nwg-wrapper or something similar

nwg-piotr commented 2 years ago

If I understand their wiki well, Waybar allows to choose The signal number used to update the module, not a "window ID", whatever you mean.

Iss-in commented 2 years ago

yeah, I meant in that context, every wrapper window should've its own unique id which could be toggled using a signal

Figuera commented 2 years ago

This is very useful. Is there, or can we add, an hide signal as well?

I mean I want to send a signal to nwg-wrapper so it become invisible but the process is still running.

nwg-piotr commented 2 years ago

Consecutive pkill -f -usr1 nwg-wrapper switches the layer both ways.

Figuera commented 2 years ago

I got that but meant fully hide as in not visible even if no window is open.

nwg-piotr commented 2 years ago

Of course it could be done by just window.hide() / window.show(). Could you give me a use case to justify the new feature?

Figuera commented 2 years ago

To be honest this would be feature request 1/2 to implement my use case.

I want to use the wrapper as a sort of waybar substitute in which when I hold a key the wrapper show me information such as Current Window Title, Time and Weather. But when I release it the wrapper is hidden.

It is already possible to do something like that but I would enjoy to have my background fully visible when no window is open.

My second feature request would be an update signal or an update frequency. So the wrapper can be running in the background but updating time and weather at predetermined frequency.

nwg-piotr commented 2 years ago

Couldn't the latter be done inside the script?

I'll take a closer look at this soon. I had some surgery done last Friday, and can't focus well enough on the code at the moment. Will get back to it as soon as I can.

Figuera commented 2 years ago

Yeah, thinking about it more deeply I think I can just send a kill signal when I release the key. Will try that.

I wish you the best recovery. Hopefully everything went well in your procedure.

Figuera commented 2 years ago

So, testing the idea of killing and reopening I remember the problem I was facing. It is slow.

Things like requesting weather condition takes like 1s which beats the purpose of being a quick reference. If I could update it I can open the quick reference and let the weather update arrives when it can.