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

Feature: Group Drawers #2574

Merged
merged 8 commits into from
Oct 15, 2023
Merged

Feature: Group Drawers #2574

merged 8 commits into from
Oct 15, 2023

Conversation

Syndelis
Copy link
Contributor

About this PR

This PR introduces "group drawers". This feature allows to user to hide all but the first element of a group until the mouse hovers over the group. The user can configure the animation's speed and direction.

Demo Video

waybar_drawer.mp4

Configuration

The configuration to enable group drawers is available as a key under a group:

"group/group-power": {
    "orientation": "inherit",
    "drawer": {
        "transition-duration": 500,
        "children-class": "not-power",
        "transition-left-to-right": false,
    },
    "modules": [
        "custom/power", // First element is the "group leader" and won't ever be hidden
        "custom/quit",
        "custom/lock",
        "custom/reboot",
    ]
},
"custom/quit": {
    "format": "󰗼",
    "tooltip": false,
    "on-click": "hyprctl dispatch exit"
},
"custom/lock": {
    "format": "󰍁",
    "tooltip": false,
    "on-click": "swaylock"
},
"custom/reboot": {
    "format": "󰜉",
    "tooltip": false,
    "on-click": "reboot"
},
"custom/power": {
    "format": "",
    "tooltip": false,
    "on-click": "shutdown now"
},

@Syndelis
Copy link
Contributor Author

Linter failed because of an unrelated file. This file has been linted in #2563, which I believe will be merged first, so I won't be bothering to do it on this PR as well.

Copy link
Contributor

@khaneliman khaneliman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and works great, another cool feature! Thanks.

@khaneliman
Copy link
Contributor

khaneliman commented Oct 15, 2023

One thing I've been wanting is this functionality for the workspaces with the window-rewrite functionality. It would be nice to have the workspace name / icon always shown and then hover over the workspace to see the window-rewrite icons inside it slide out.

@Syndelis
Copy link
Contributor Author

One thing I've been wanting is this functionality for the workspaces with the window-rewrite functionality. It would be nice to have the workspace name / icon always shown and then hover over the workspace to see the window-rewrite icons inside it slide out.

That's a pretty neat idea! I'm just finishing another feature and as soon as I open its PR I'll see if I can add a parameter to allow for that!

@khaneliman
Copy link
Contributor

@Alexays this one should be good too

@Alexays
Copy link
Owner

Alexays commented Oct 15, 2023

Love it!
Wonder if we can add this to the example config 😀

@Alexays Alexays merged commit 93daf08 into Alexays:master Oct 15, 2023
7 of 8 checks passed
@Syndelis Syndelis deleted the feat/group-drawers branch October 16, 2023 13:27
@Syndelis
Copy link
Contributor Author

Just added the documentation to the wiki!

"custom/power", // First element is the "group leader" and won't ever be hidden
"custom/quit",
"custom/lock",
"custom/reboot",
Copy link

@StayPirate StayPirate Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the comma required on this line? I guess no.

@StayPirate
Copy link

@Syndelis could you please share your waybar's config and style.css? I'm trying to configure this module from my side, but I cannot find a way to make it looks like the one from your demo.

@Syndelis
Copy link
Contributor Author

Syndelis commented Nov 3, 2023

@Syndelis could you please share your waybar's config and style.css? I'm trying to configure this module from my side, but I cannot find a way to make it looks like the one from your demo.

Aside from the config listed in the PR, I believe there's just this CSS. Is there anything in particular that you couldn't get working?

@define-color macchiato-blue      #8aadf4;
@define-color macchiato-yellow    #eed49f;
@define-color macchiato-mauve     #c6a0f6;

#group-power { 
    margin-bottom: 0px;
}
    
#group-power .text-button {
    font-weight: normal;
}

#group-power .drawer .text-button {
    padding-bottom: 24px;
}

#custom-power { color: @macchiato-red; padding-bottom: 6px; }
#custom-reboot { color: @macchiato-yellow; }
#custom-lock { color: @macchiato-blue; }
#custom-quit { color: @macchiato-mauve; }

@StayPirate
Copy link

Great, I didn't get that I had to use the following classes to address hidden items. Thank you.

#custom-power,
#custom-reboot,
#custom-lock,

StayPirate added a commit to StayPirate/dotfiles that referenced this pull request Nov 3, 2023
This reverts commit de84626.

With the new features [0][1] in waybar I feel I no longer need menubar,
volume slider and audio buttons in swaync. KISS

[0] Alexays/Waybar#2574
[1] Alexays/Waybar#2575
@hmanhng
Copy link

hmanhng commented Nov 11, 2023

Is it possible to add an option to expand to the right or left?
The horizontal bar is always extended to the left, I want it to expand to the left for the right module and to the right for the left module.

@khaneliman
Copy link
Contributor

Is it possible to add an option to expand to the right or left? The horizontal bar is always extended to the left, I want it to expand to the left for the right module and to the right for the left model.

Yeah I was looking for this functionality too. But, forgot to request it.

@StayPirate
Copy link

I'm sorry, but isn't what "transition-left-to-right": false, is meant for?

"group/group-power": {
    "orientation": "inherit",
    "drawer": {
        "transition-duration": 500,
        "children-class": "not-power",
        "transition-left-to-right": false,
    },
    "modules": [
        "custom/power", // First element is the "group leader" and won't ever be hidden
        "custom/quit",
        "custom/lock",
        "custom/reboot",
    ]
},

@hmanhng
Copy link

hmanhng commented Nov 12, 2023

Tôi xin lỗi, nhưng không phải vậy "transition-left-to-right": false,là dành cho?

"group/group-power": {
    "orientation": "inherit",
    "drawer": {
        "transition-duration": 500,
        "children-class": "not-power",
        "transition-left-to-right": false,
    },
    "modules": [
        "custom/power", // First element is the "group leader" and won't ever be hidden
        "custom/quit",
        "custom/lock",
        "custom/reboot",
    ]
},

it's just a sliding effect

@StayPirate
Copy link

Gotcha, luckily I only used groups on the right-located modules. Hence, I didn't experience such a need. I agree with you that it would be nice to have. @Syndelis what do you think?

@Syndelis
Copy link
Contributor Author

Gotcha, luckily I only used groups on the right-located modules. Hence, I didn't experience such a need. I agree with you that it would be nice to have. @Syndelis what do you think?

I'll take a second look at adding this; might take a while because GTK's documentation is pretty bad

@Syndelis
Copy link
Contributor Author

Syndelis commented Dec 3, 2023

Is it possible to add an option to expand from the top to the bottom? I really need this feature in my vertical bar.

I've taken an initial look at this (the same as the above) but unfortunately I'm having little time to contribute right now as I'm running close to my master's thesis' deadline.

Being more realistically I'll probably only get back to it in early 2024. I'll gladly review any attempts at this, however!

@TR4SPY
Copy link

TR4SPY commented Jan 17, 2024

I have came across an issue where the group drawer display correctly, yet once hover over the drawer elements (apart from parent icon) the waybar freezes. -l debug gives no errors or warnings. Tested on different device with similar setup and the issue wasn't there. Both machines have same kernel, same waybar build. Tried default config for the drawer from Wiki, same issue on one machine, no problem on another. Does the drawer function add any dependencies by any chance?

@khaneliman
Copy link
Contributor

I have came across an issue where the group drawer display correctly, yet once hover over the drawer elements (apart from parent icon) the waybar freezes. -l debug gives no errors or warnings. Tested on different device with similar setup and the issue wasn't there. Both machines have same kernel, same waybar build. Tried default config for the drawer from Wiki, same issue on one machine, no problem on another. Does the drawer function add any dependencies by any chance?

Is this built from latest on master? A distribution package manager?

@Syndelis
Copy link
Contributor Author

yet once hover over the drawer elements (apart from parent icon) the waybar freezes

Also, how does your bar config look? Maybe your elements have a on-hover behavior that could cause it to freeze?

@TR4SPY
Copy link

TR4SPY commented Jan 18, 2024

@khaneliman built from latest master by yay (AUR), package waybar-cava v0.9.24-1 - both machines have same build, same config, via same method.
@Syndelis nothing like that. None of my elements have on-hover. Tried with only one or two elements or with different set - same result.

config of the group/drawer:

"group/tools": {
        "orientation": "inherit",
        "drawer": {
        "transition-duration": 500,
        "children-class": "not-tools",
        "transition-left-to-right": false,
    },
        "modules": [
        "custom/tools",
        "idle_inhibitor",
        "custom/updates",
        "custom/wallpaper",
        ]
    },
 "custom/tools":{
        "format":" ",
    },
 "idle_inhibitor": {
        "format": "{icon}",
        "format-icons": {
            "activated": "",
            "deactivated": "",
        },
       "exec-if": "$HOME/.config/waybar/scripts/inhibator_on.sh",
       "on-click": "$HOME/.config/waybar/scripts/inhibator_on.sh"
    },
 "custom/updates": {
       "format": "{icon}{}",
       "return-type": "json",
       "format-icons": {
           "has-updates": "󰮯 ",
           "updated": ""
       },
       "exec-if": "which waybar-module-pacman-updates",
       "exec": "waybar-module-pacman-updates",
       "on-click" : "kitty -e yay -Syu && flatpak update && pkill -SIGRTMIN+8 waybar",
       //"on-click" : "kitty -e sudo pacman -Syu && pkill -SIGRTMIN+8 waybar",
       "on-click-right" : "~/.config/waybar/scripts/updates.sh"
   }, 
 "custom/wallpaper":{
        "format":" ",
        "on-click": "bash $HOME/.config/hypr/scripts/wallpaper.sh 2> /dev/null"
    },

...

@Syndelis
Copy link
Contributor Author

Could you try using the regular waybar package? Oh, and let's move this conversation to an issue, doesn't make much sense to discuss this here

@TR4SPY
Copy link

TR4SPY commented Jan 19, 2024

Could you try using the regular waybar package? Oh, and let's move this conversation to an issue, doesn't make much sense to discuss this here

Tried as well, same behavior. Works on PC, doesn't on laptop. Created an issue thread - #2845

@eric-marin
Copy link

Is it possible to add an option to expand to the right or left? The horizontal bar is always extended to the left, I want it to expand to the left for the right module and to the right for the left module.

Any news about this feature?

@Syndelis
Copy link
Contributor Author

Syndelis commented Jan 25, 2024

Is it possible to add an option to expand to the right or left? The horizontal bar is always extended to the left, I want it to expand to the left for the right module and to the right for the left module.

Any news about this feature?

For my part I'm still busy with my master's which is due late march / early april. Until then I'm only working on bug fixes and the like for Waybar. Once again, I'll be glad to review any PRs that do attempt to introduce this!

In the meanwhile, could any of you open an issue for this feature request? We shouldn't be using this closed PR to track this suggestion/request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants