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

bar mode toggle? #157

Closed
kflak opened this issue Jan 31, 2019 · 14 comments
Closed

bar mode toggle? #157

kflak opened this issue Jan 31, 2019 · 14 comments
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@kflak
Copy link

kflak commented Jan 31, 2019

Thanks for a beautiful bar! Just installed it now, and I have a question: is it possible to run something like

bindsym $mod+x bar mode toggle 

to hide the bar? I have been using this with i3bar, and would love this feature in waybar as well!

@Alexays
Copy link
Owner

Alexays commented Jan 31, 2019

You can use killall -SIGUSR1 waybar but I just saw that there's a bug that doesn't completely hide it.

@Alexays Alexays added the question Further information is requested label Jan 31, 2019
@kflak
Copy link
Author

kflak commented Jan 31, 2019

Hmmm.... -SIGUSR1 doesn't even stop waybar on my system, i have to do a killall -9 waybar to get rid of it, and then I reload sway-config to get it back up again

@Alexays
Copy link
Owner

Alexays commented Jan 31, 2019

SIGUSR1 is not for kill waybar but to hide it ;)

@kflak
Copy link
Author

kflak commented Jan 31, 2019

ah! still a linux rookie ;-) in any case, there is no hiding going on when using -SIGUSR1, the only thing happening is that vim's command line disappears. At least I know now how to get rid of the bar when necessary... a toggle hide mode would still be very much appreciated, though!

@Alexays Alexays added the bug Something isn't working label Jan 31, 2019
@jlbribeiro
Copy link
Contributor

@Alexays To add a bit more detail, if it helps (since your description and @kflak's doesn't mention this): when using sway, sending a killall -SIGUSR1 waybar "un-docks" the bars from the tiling layout; they stay visible, but start floating above (overlaying) the rest of the layout, which expands to use the newly available space. Sending USR1 again makes them "dock" as before. I assume the "un-docking" is expected behaviour, it's just the "hiding" part that is missing.

On a separate note, thank you for this wonderful project. I needed a polybar replacement since I moved to Wayland, and this bar is both gorgeous and super customisable, congrats!

@Alexays Alexays added this to the 0.6.0 milestone Apr 15, 2019
@Alexays
Copy link
Owner

Alexays commented Apr 15, 2019

Done in ecc5f48
You must define the .hidded class in your style file,
In the default style file, I set opacity' to 0.2' to keep an eye on it but you can hide it completely :)

@Alexays Alexays closed this as completed Apr 15, 2019
@kflak
Copy link
Author

kflak commented Apr 19, 2019

Cool! Will take a bit more detailed look at this when I have a bit more time. Just a quick question, though: how would you set this up in swayconfig so that fx. ctrl-x would toggle visible/invisible?

@Alexays
Copy link
Owner

Alexays commented Apr 19, 2019

@kflak bindsym $mod+x killall -SIGUSR1 waybar ;)

@kflak
Copy link
Author

kflak commented Apr 19, 2019

bindsym $mod+x exec killall -SIGUSR1 waybar to be a bit more precise ;-)

The toggle works fine with SIGUSR1. However, the change of opacity seems not to take, seems like it is stuck on 0.2... And the text as well as all the modules (battery, wifi, etc) are all at 1.0 opacity. How do I make them inherit the .hidded attribute?

This is my ~/.config/waybar/style.css:

* {
    border: none;
    border-radius: 0;
    font-family: Roboto, Helvetica, Arial, sans-serif;
    font-size: 24px;
    min-height: 0;
}

window#waybar {
    background: rgba(43, 48, 59, 0.5);
    border-bottom: 3px solid rgba(100, 114, 125, 0.5);
    color: white;
}

window#waybar.hidded {
    opacity: 0.0;
}

#workspaces button {
    padding: 0 5px;
    background: transparent;
    color: white;
    border-bottom: 3px solid transparent;
}

#workspaces button.focused {
    background: #64727D;
    border-bottom: 3px solid white;
}

#mode {
    background: #64727D;
    border-bottom: 3px solid white;
}

#clock, #battery, #cpu, #memory, #network, #pulseaudio, #custom-spotify, #tray, #mode {
    padding: 0 10px;
    margin: 0 5px;
}

#clock {
    background-color: #64727D;
}

#battery {
    background-color: #ffffff;
    color: black;
}

#battery.charging {
    color: white;
    background-color: #26A65B;
}

@keyframes blink {
    to {
        background-color: #ffffff;
        color: black;
    }
}

#battery.warning:not(.charging) {
    background: #f53c3c;
    color: white;
    animation-name: blink;
    animation-duration: 0.5s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

#cpu {
    background: #2ecc71;
    color: #000000;
}

#memory {
    background: #9b59b6;
}

#network {
    background: #2980b9;
}

#network.disconnected {
    background: #f53c3c;
}

#pulseaudio {
    background: #f1c40f;
    color: black;
}

#pulseaudio.muted {
    background: #90b1b1;
    color: #2a5c45;
}

#custom-spotify {
    background: #66cc99;
    color: #2a5c45;
}

#tray {
    background-color: #2980b9;
}

@kflak
Copy link
Author

kflak commented Apr 19, 2019

Doh, my stupid! Forgot to update waybar. Please forgive my ignorance. I will go into a corner and shame myself a bit.

@toger5
Copy link

toger5 commented Jul 16, 2019

Why is it desinged with a SIGUSR1 ? is that a comman way to do sth like that?
Is taht documented somewhere? It took me some time to figure it out. Is sway sending some event when mod is pressed so hat the bar could appear when u hold mod.

@kRHYME7
Copy link

kRHYME7 commented Aug 1, 2024

Hi anyone here got issues with SIGUSR1 ?

It only hides it but I can't call it back.

Using hyprland.

@gernotfeichter
Copy link

gernotfeichter commented Aug 1, 2024

@kRHYME7 Same here. Figured that SIGUSR1 means hide and SIGUSR2 show again. Unfortunately this broke the toggle effect that I preferred for my use case.

UPDATE: It seems this is fixed already via #3459, need to wait till this release hits my package manager

@kRHYME7
Copy link

kRHYME7 commented Aug 1, 2024

Gotta use the latest commits then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants