-
-
Notifications
You must be signed in to change notification settings - Fork 732
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
Only show waybar when modifier key is pressed #255
Comments
This is the feature that I'm also waiting for to be able to make the switch to waybar, great tool! |
Would be great to have that feature! |
Seems like there is already some kind of hide functionality built in the code (the Line 8 in 67593b8
It seems that there is a USRSIG which is used for the toggle. I tired with a little c program
and the bar actually gives the space to the compositor. |
Also this is realted to #157. |
I've been poking around in sway's IPC docs and here's what I've learned. I will use this as an example config:
By default, bar1 is started in mode Now, if either While the bar is in mode "hide", pressing and releasing Either:
There are a number of benefits to the second option:
The downsides to the second option:
EDIT: @Alexays, comments on feasibility? Am I off the mark here? EDIT2: Optimally, swaywm/wlr-protocols#41 would be adopted so waybar can change layers without destroying its surface. |
Not sure if I'm off the mark here, but another, albeit more complex, option would be to implement a control program for
|
This works for normal keys, but not modifiers. If you want to bind this to This can be worked around by having another IPC client which reads the |
…essed Closes Alexays#255 Setup instructions: - Set the *mode* of the bar to "hide" in sway configuration file - Set the *layer* of the bar to "overlay" in Waybar configuration file - Add "sway/hide" into *modules-left* -list in Waybar configuration file
I was playing around with this feature in my fork, and have got it into a shape where it is mostly good enough for my use. In order to not tie Waybar too much into sway, I created a "meta-module" There are still problems, though. The biggest one I am facing right now is that when the bar is in overlay mode (on top of tiled windows) and hidden by the gtk style option, the invisible bar still sucks the mouse events from the area. In other words for example the tab bar in my browser is difficult to use with a mouse as the invisible bar covers about 75% of it. (I am still ok with it, as I mostly use keyboard shortcuts anyway, but...) Ideas on how to solve the invisible overlay stealing mouse clicks would be welcome, as that would make the feature more suitable for daily use. |
@nyyManni Have you tried setting waybar to use the |
@xPMo I am setting the layer into |
You can't right now, but there's already an issue for it (swaywm/wlr-protocols#41, I linked it earlier in this thread). Currently, swaybar destroys its surface instead of changing layers when it hides. |
…essed Closes Alexays#255 Setup instructions: - Set the *mode* of the bar to "hide" in sway configuration file - Set the *layer* of the bar to "overlay" in Waybar configuration file - Add "sway/hide" into *modules-left* -list in Waybar configuration file
wlroots 0.9.0 has been released; the layer shell protocol and wlroots now support changing layer at runtime. It is now possible for waybar to simply raise its layer on modifier. I like this option, since waybar will always be visible on empty workspaces, or when it is uncovered/partially covered by floating windows. Additionally, it solves the focus-stealing problem @nyyManni mentioned. However, some may prefer their bar to be completely hidden, even on empty workspaces (like swaybar). A |
@xPMo indeed! I already tried it last week (see the referenced commit 5 days ago), and have been using it since. My solution is a hack, though, and I am having an issue that when I "raise" the bar with the modifier, sometimes the remaining of the screen "jumps back in time" showing an old version of my framebuffer, at least with XWayland clients. |
…essed Closes Alexays#255 Setup instructions: - Set the *mode* of the bar to "hide" in sway configuration file - Set the *layer* of the bar to "overlay" in Waybar configuration file - Add "sway/hide" into *modules-left* -list in Waybar configuration file
I am wanting to raise the ante' and configure the bar to be say '2px and transparent(or peaking through)' and then when the move hovers over the area, the bar changes height to the full area with whatever styling I tried using hideIt.sh but couldn't get it to work properly. :/ VV theres also this bit of code in bar.cpp VV auto waybar::Bar::toggle() -> void { ...
...
window.get_style_context()->add_class("hidden")
...
} but I am not quite sure what to do with it. I don't know .. ? |
theres also this bit of code .. |
Hey, is there any progress so far? |
Can we not make a modifier/module that contains the entire bar - or
overrides it's settings to turn everything off like a docker.
Essentially just aa waybar container that could be configured to work with
mouse over or hotkeys/keybind?
I would just do this myself but I don't know enough about
programming/Wayland to even know where to start.
…On Thu, Aug 27, 2020, 6:09 AM mox-mox ***@***.***> wrote:
Hey, is there any progress so far?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#255 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKQVPQK3TUKXSUCOFUQPPDTSCY5F3ANCNFSM4HCQ77BA>
.
|
I have some work on the feature, but unfortunately it is both old and didn't quite work. My severe inexperience with C++ is the biggest culprit, I have a decent grasp on the wayland/sway side of things. |
This allows auto-showing the bar when the modifier is pressed Closes Alexays#255 Setup instructions: - Set the `mode` of the bar to "hide" in sway configuration file - Set the `layer` of the bar to "overlay" in Waybar configuration file - Add "sway/hide" into `modules-left` in Waybar configuration file
swaywm/wlr-protocols#41 was fixed by swaywm/wlr-protocols#59 apparently, I don't have problem with hiding and showing the bar now, if I send a My use case is having a simple main bar that it's always on, and another more complex one that is only shown when a modifier is pressed, for extra information. https://github.com/xPMo/Waybar/tree/sway-hide sounds like a good solution that doesn't tie Waybar to sway so much, but provides integration, particularly with more than one bar. I tweaked the code by trying to reuse the |
This allows auto-showing the bar when the modifier is pressed Closes Alexays#255 Setup instructions: - Set the `mode` of the bar to "hide" in sway configuration file - Set the `layer` of the bar to "overlay" in Waybar configuration file - Add "sway/hide" into `modules-left` in Waybar configuration file
Is it possible to merge this commit? This is a functionality I am personally very much waiting for! |
Please see #860 (comment), it's really just a draft. It needs more C++ expertise than I have, sadly. |
Okay, I really like this hide functionality, so I have switched back to sway-bar for the time being. |
Hi, is there any progress on this? |
#860 has some initial work, but my C++ knowledge prevents me from going further. It's out of sync with the main branch now. |
Hey there, I am happy to adjust anything further that is required to merge it! Sorry @somini, I was not able to push to your draft. However if thats somehow possible, I am happy to push the changes to your PR and cancel mine. Greetings! |
@emirror-de No problem, my PR was a just a hack anyway. I'll close it in favour of your PR, it's more advanced than mine. |
great news! |
In case anyone is only tracking this on this issue, #1241 by @emirror-de does the trick, it's implemented now. |
The PR is still marked as Draft because I found that it is not stable enough yet. I have a multimonitor setup and sometimes one bar freezes and the other one works as expected. In addition to that, the application sometimes crashes with an "Address boundary error". I was not able to find the reason yet, I think I need help to fix this. Analysis with
This report repeats for every module that is configured on the bar. Maybe this is a separate issue? When I am correctly interpreting the report, this is an error in Any help would be appreciated! 🚀 |
This finally moved to #1244, that's already merged. This issue can be closed once that's released. |
How can I send the IPC message on another WM? |
I would also love to have this feature on Hyprfine, has anyone tried that? |
i'm using hyprland. i just binded a key combination (super+Print) to toggle the waybar process. it does the job. |
Well you can do it a bit more "properly". Add these lines to the hyprland config
And following to waybar config:
|
@dron1885 Does that work for you? For me, the "release" modifier only works if I click and release Super_L alone. If I hold the Super_L key as part of another key bind, like Superh, waybar appears and never disappears, and the toggle behavior is now inverted :S |
@Hubro It should be bindit and binditr respectively. |
Ah, I was missing the Also the background blur behind waybar seems to stick around while waybar is hidden. This would definitely need some polish in order to be usable. |
@Hubro The issue with the system tray is caused by the bindings to resize windows where it is listening for mouse events and not propagating to waybar. To fix it, simply disable it by removing the following lines from
I'm keyboard-oriented, so mouse bindings in a tiling window manager are completely useless for me. |
@gustavosbarreto Aha, you're right! Unfortunately I'm a heavy user of the mouse for moving and resizing floating windows 😞 I guess I can't have both without some changes to Hyprland. |
Is there any way to configure sway/waybar so that it behaves similar to i3's mode hide?
Sway already supports
mode hide
for theirswaybar
. I was wondering if it would be possible to implement the same forwaybar
?Basically what I'm looking for is having this sway configuration work as expected:
The text was updated successfully, but these errors were encountered: