elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
9.02k stars 371 forks source link

[WIDGET] taskbar #414

Open godalming123 opened 2 years ago

godalming123 commented 2 years ago

Description of the widget

A basic taskbar widget like that in windows or waybar.

Implementation proposal

This would use the box widget as well as smaller buttons with an image and label.

Example usage

(taskbar :format "icon name"
              :icon-size 15
              :tooltip-format ""
              :on-click "activate"
              :on-middle-click "close"
              :on-right-click "new-instance"
              :ignore "alacritty"
              :direction "h"

Additional context

No response

elkowar commented 2 years ago

Given that that heavily depends on your display server, and is really hard to do in a way that is flexible enough to fit with the spirit of eww, I'll probably say a builtin Taskbar widget is largely out of scope for now. (not 100% sure on that, of course)

In the future there might be some sort of plugin system, or some other cleaner way to have external extensions to eww that can directly interact with gtk -- with those, such a widget might be a thing again.

Until then, do know that a Taskbar widget should already generally be achievable via some scripts, literal, etc - not super pretty, but possible

godalming123 commented 2 years ago

Do you have any help in finding those scripts I had a polybar windows script on xorg but that doesnt work on wayland is there any tool/script that works for wayland?

VuiMuich commented 2 years ago

You might want to search the issues, there has been some discussion about using stalonetray or trayer iirc.

elkowar commented 2 years ago

Do you have any help in finding those scripts I had a polybar windows script on xorg but that doesnt work on wayland is there any tool/script that works for wayland?

I don't know of any specific tools, no. On Wayland these things tend to be a lot more complex, as I understand it, as Wayland gives applications far less access to information about, well, anything (for security reasons). My assumption is that such scripts would have to be compositor dependant, unless there is some well supported extension protocol for that info - idk about that.

Should most definitely not be tooooo hard to do yourself, depending on your compositor, ofc

Electrostasy commented 2 years ago

To add to this from the Wayland side, something like what is proposed in this wlrctl issue would definitely help script a taskbar, but it doesn't seem to be a priority for now. I haven't been able to find a tool that can be molded into a functional taskbar yet besides wlrctl (if the feature proposed in the issue could be implemented), unfortunately.

Waybar and tools similar to wlrctl use the wlr-foreign-toplevel-management-unstable protocol extension to receive and communicate toplevel (window) events with the compositor. It seems most compositors currently actively developed support it (not sure about mutter and kwin, though). Waybar's "wlr/taskbar" module seems to maintain its own list of opened toplevels, handles compositor toplevel events, asks the compositor to minimize/maximize/close toplevels etc.

There are more tools that can list opened Wayland toplevels, such as Waylevel and lswt, though monitoring toplevel events seems out of scope for them.

Bavalionprolate commented 1 year ago

Описание виджета

Базовый виджет панели задач, такой как в окнах или путевой панели.

Предложение по реализации

Это будет использовать виджет коробки, а также меньшие кнопки с изображением и меткой.

Пример использования

(taskbar :format "icon name"
              :icon-size 15
              :tooltip-format ""
              :on-click "activate"
              :on-middle-click "close"
              :on-right-click "new-instance"
              :ignore "alacritty"
              :direction "h"

Дополнительный контекст

Good idea to have a built-in taskbar widget, I'm literally looking for ways to write myself a taskbar widget for my rice myself. I saw a rice on reddit not too long ago where a person replicated the win11 design and recreated literally everything with eww (and taskbar, start menu, gamebar and more), I can attach the link below for you. Hope this helps you in some way, as I can't figure out the colossal amount of scripts and how they work.

link - https://www.reddit.com/r/unixporn/comments/13zdhqd/hyprland_windows_rice_with_too_much_eww_with_blur/

siduck commented 12 months ago

it'd be great if there were some initially supported compositors ( xorg's pretty easy ) and provide a magic variable ( which is a json arr of objects ) and each object has useful info about each window

example

image

siduck commented 4 months ago

I managed to make a taskbar widget in my bar and it need good amount of scripting & had to use wmctrl for click actions and using xprop to for capturing xorg events

Rofi to show menu of multiple window titles of the same app just above the app's icon

https://github.com/elkowar/eww/assets/59060246/94d8d755-b860-48b6-b77f-a37dad601623