13
295
Fork
You've already forked yambar
74

Tray feature? #4

Open
opened 2020年01月25日 10:23:40 +01:00 by ashimokawa · 13 comments

Are there any plans to support a "tray" area?

Or is this out of scope for yambar?

You you accept a PR given I can find the time to do it?

Are there any plans to support a "tray" area? Or is this out of scope for yambar? You you accept a PR given I can find the time to do it?
Owner
Copy link

There aren't any concrete plans, but I have considered it. It's not something I need/use myself, which is why I never got around to implement it.

It's definitely not out of scope, and yes, I would gladly accept a PR.

There aren't any concrete plans, but I have considered it. It's not something I need/use myself, which is why I never got around to implement it. It's definitely not out of scope, and yes, I would gladly accept a PR.

I hacked together some scripts around putting a tray in my yambar.

Runs both scripts. They MUST be the right-most scripts.
https://github.com/sagotsky/.dotfiles/blob/master/config/yambar/config.yml#L186-L196

Launches trayer. Stalonetray flickered in my wm. I needed the trayer-srg fork. There's nothing to output yet. I like having yambar launch trayer so that if yambar gets killed, it takes trayer with it.
https://github.com/sagotsky/.dotfiles/blob/master/home/scripts/yambar-tray.sh

Outputs padding. This script figures out how wide the trayer window is, attempts to convert pixels to a number of spaces, and outputs that as a yambar variable. This padding pushes the next right most module towards the middle of the screen. I have this refreshing every 10 seconds because I'm still tweaking it, but it could probably be lowered since systray apps don't launch or die very frequently.
https://github.com/sagotsky/.dotfiles/blob/master/home/scripts/yambar-tray-width.sh

I hacked together some scripts around putting a tray in my yambar. Runs both scripts. They MUST be the right-most scripts. https://github.com/sagotsky/.dotfiles/blob/master/config/yambar/config.yml#L186-L196 Launches trayer. Stalonetray flickered in my wm. I needed the trayer-srg fork. There's nothing to output yet. I like having yambar launch trayer so that if yambar gets killed, it takes trayer with it. https://github.com/sagotsky/.dotfiles/blob/master/home/scripts/yambar-tray.sh Outputs padding. This script figures out how wide the trayer window is, attempts to convert pixels to a number of spaces, and outputs that as a yambar variable. This padding pushes the next right most module towards the middle of the screen. I have this refreshing every 10 seconds because I'm still tweaking it, but it could probably be lowered since systray apps don't launch or die very frequently. https://github.com/sagotsky/.dotfiles/blob/master/home/scripts/yambar-tray-width.sh
Contributor
Copy link

Hi

I am looking into this subject.
I took a look to waybar and swaybar to see how DBus shall be used to retrieve infos about the icon. I also succeeded in using nanosvg to make yambar display a scaled svg icon.

I have a question about the theming, I would like to find a way to resolve the icon given by the DBus message into the correct icon path for the current gdk theme.

However I did not found anything except using gtk. You said you prefer not using cairo in this project. If I use gtk I guess I'll have to link against cairo. I still plan to use nanosvg and pixman to render the icon, I just need gtk to resolve the path of the corresponding icon.

Do you have an idea about how to do this ?

Regards

Hi I am looking into this subject. I took a look to waybar and swaybar to see how DBus shall be used to retrieve infos about the icon. I also succeeded in using nanosvg to make yambar display a scaled svg icon. I have a question about the theming, I would like to find a way to resolve the icon given by the DBus message into the correct icon path for the current gdk theme. However I did not found anything except using gtk. You said you prefer not using cairo in this project. If I use gtk I guess I'll have to link against cairo. I still plan to use nanosvg and pixman to render the icon, I just need gtk to resolve the path of the corresponding icon. Do you have an idea about how to do this ? Regards
Owner
Copy link

I am looking into this subject.

@aacebedo thanks! I'm sure this is something that will be appreciated by a lot of people :)

Do you have an idea about how to do this ?

fnott already does this, and I think you should be able to reuse its code. See https://codeberg.org/dnkl/fnott/src/branch/master/icon.c#L329 and https://codeberg.org/dnkl/fnott/src/branch/master/icon.c#L28.

> I am looking into this subject. @aacebedo thanks! I'm sure this is something that will be appreciated by a lot of people :) > Do you have an idea about how to do this ? fnott already does this, and I think you should be able to reuse its code. See https://codeberg.org/dnkl/fnott/src/branch/master/icon.c#L329 and https://codeberg.org/dnkl/fnott/src/branch/master/icon.c#L28.
Contributor
Copy link

Thank you for the response !

I'll take a look to the code.
You confirm I shall avoid gtk too ?

I'll try to obtain a first version with only icons but no menus. Without gtk it is going to be quite complex to implement menu support I think.

Thank you for the response ! I'll take a look to the code. You confirm I shall avoid gtk too ? I'll try to obtain a first version with only icons but no menus. Without gtk it is going to be quite complex to implement menu support I think.
Owner
Copy link

You confirm I shall avoid gtk too ?

Yes, let's do a first iteration without gtk. I also think the tray feature on a whole should be optional (i.e. we shouldn't force a dbus dependency on people who don't want the tray feature).

Without gtk it is going to be quite complex to implement menu support I think.

Yeah, let's start with that. After that we can make a decision on whether to use gtk, or draw menus ourselves.

There are other feature requests that would benefit from tooltip/menu style popups, which makes it slightly more "ok" to implement them ourselves. But one step a time; we'll get to that later.

> You confirm I shall avoid gtk too ? Yes, let's do a first iteration without gtk. I also think the tray feature on a whole should be optional (i.e. we shouldn't force a dbus dependency on people who don't want the tray feature). > Without gtk it is going to be quite complex to implement menu support I think. Yeah, let's start with that. After that we can make a decision on whether to use gtk, or draw menus ourselves. There are other feature requests that would benefit from tooltip/menu style popups, which makes it slightly more "ok" to implement them ourselves. But one step a time; we'll get to that later.
Contributor
Copy link

Yeah I agree about the gtk dependency this shall be only needed if the module "tray" is compiled and/or loaded. I'll try without for the moment.

I am not used to draw stuff in programs. Your help will be very welcome if we ended to implement stuff like menus ;)

Yeah I agree about the gtk dependency this shall be only needed if the module "tray" is compiled and/or loaded. I'll try without for the moment. I am not used to draw stuff in programs. Your help will be very welcome if we ended to implement stuff like menus ;)

Would it be easier to only implement tray icons, for starters? Without menus, like swaybar does for now.

I wrote a little tool that renders DBus tray menus using fzf, so the tray support would be very useful to me even without menus.

Would it be easier to only implement tray icons, for starters? Without menus, like swaybar does for now. I wrote a little tool that renders DBus tray menus using fzf, so the tray support would be very useful to me even without menus.

Is this thread worth bumping? Do you guys have anything to share about the tray so far? It's been a year since this thread was posted so I thought I would ask..

Is this thread worth bumping? Do you guys have anything to share about the tray so far? It's been a year since this thread was posted so I thought I would ask..
Collaborator
Copy link

I'd love to have a tray, but unfortunately this is rather annoying to implement. You can see @dnkl put a "help wanted" tag on this particular issue.

I am currently a little busy with life, and am (slowly) trying to get an hwmon (see #257) working. The hwmon also turned out to be more annoying than I had predicted.

Overall, this is likely still going to take a while.

I'd love to have a tray, but unfortunately this is rather annoying to implement. You can see @dnkl put a "help wanted" tag on this particular issue. I am currently a little busy with life, and am (slowly) trying to get an `hwmon` (see #257) working. The `hwmon` also turned out to be more annoying than I had predicted. Overall, this is likely still going to take a while.

I see, Thank you for sharing!

I see, Thank you for sharing!

Would it be easier to only implement tray icons, for starters? Without menus, like swaybar does for now.

I wrote a little tool that renders DBus tray menus using fzf, so the tray support would be very useful to me even without menus.

Is the tool available anywhere ? @adamantgarth

> Would it be easier to only implement tray icons, for starters? Without menus, like swaybar does for now. > > I wrote a little tool that renders DBus tray menus using fzf, so the tray support would be very useful to me even without menus. Is the tool available anywhere ? @adamantgarth

Would it be easier to only implement tray icons, for starters? Without menus, like swaybar does for now.

I wrote a little tool that renders DBus tray menus using fzf, so the tray support would be very useful to me even without menus.

Is the tool available anywhere ? @adamantgarth

@Eragon, here you go: https://codeberg.org/adamantgarth/traytool

Some disclaimers:

  • I no longer use the tool.
  • I used it only with a couple of programs (NetworkManager, TelegramDesktop, qBittorrent), so it may or may not work with others.
  • I am not a C programmer.

So, no warranty, it may not work, it may burn your house, yada yada.

sudo make install will place the binary into /usr/local/bin/traytool. I think it requires somewhat recent version systemd, but I don't remember which one or how recent it is.

Run the tool without arguments first to find out the IDs of your tray items, and then use, for example, -cm qBittorrent to show the menu (with colors) using fzf.

> > Would it be easier to only implement tray icons, for starters? Without menus, like swaybar does for now. > > > > I wrote a little tool that renders DBus tray menus using fzf, so the tray support would be very useful to me even without menus. > > Is the tool available anywhere ? @adamantgarth @Eragon, here you go: https://codeberg.org/adamantgarth/traytool Some disclaimers: * I no longer use the tool. * I used it only with a couple of programs (NetworkManager, TelegramDesktop, qBittorrent), so it may or may not work with others. * I am not a C programmer. So, no warranty, it may not work, it may burn your house, yada yada. `sudo make install` will place the binary into `/usr/local/bin/traytool`. I think it requires somewhat recent version systemd, but I don't remember which one or how recent it is. Run the tool without arguments first to find out the IDs of your tray items, and then use, for example, `-cm qBittorrent` to show the menu (with colors) using fzf.
Sign in to join this conversation.
No Branch/Tag specified
master
releases/1.11
releases/1.10
releases/1.9
releases/1.8
releases/1.7
releases/1.6
releases/1.5
releases/1.4
releases/1.3
releases/1.2
releases/1.1
releases/1.0
1.11.0
1.10.0
1.9.0
1.8.0
1.7.0
1.6.2
1.6.1
1.6.0
1.5.0
1.4.0
1.3.1
1.3.0
1.2.0
1.1.1
1.1.0
1.0.2
1.0.1
1.0.0
0.9.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
8 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/yambar#4
Reference in a new issue
dnkl/yambar
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?