-
Notifications
You must be signed in to change notification settings - Fork 24
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
Ignore file for appmenu #303
Comments
https://specifications.freedesktop.org/desktop-entry-spec/latest/recognized-keys.html |
Not a solution. Not flexible. I don't need to hide programs system-wide. I need to hide them in sfwbar menu - like i'm able to hide them in Labwc menu. |
OnlyShowIn= |
This is theory, in practice it doesn't work. Either way, I think my proposal is worth considering by developers. |
Header/footer - do you mean manually added items at the top/bottom of the menu or just static text? This looks like a part of #302 coincidentally also opened today. It should also be reasonably easy to implement. Filtering out specific entries. I think there are a few reasons to implement this:
|
Yes, I mean manually added commands. Just an idea taken from how Jgmenu does this... Something like:
~/.config/sfwbar/menu_bottom.csv
Very easy for users to customize. |
New actions added to the appmenu module:
|
Thank you. |
You can add them to the unit function in your config. I.e. copy
sfwbar.config from /usr/share/sfwbar to $HOME/.config/sfwbar
Then edit it and add to Function("SfwBarInit") {
AppMenuItemTop "MyItem", "firefox"
}
…On Thu, 2 Jan 2025, 19:30 Daniel Napora, ***@***.***> wrote:
Thank you.
Installed sfwbar-git, now I'm trying to figure out how to use this (apply
those actions to appmenu module).
Can somebody point me to the right direction?
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFA4MCC6BZJ43ZNWUJL2IWHVPAVCNFSM6AAAAABUOSFJUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRYGI3DSMJQGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I updated the functionality for the manually added items to be sorted by the
order in which they were added.
For the filtering functionality, can you try the latest git please and if
it still doesn't work, run "sfwbar -d -g appmenu" please and post it's
output?
…On Thu, Jan 2, 2025 at 9:45 PM Daniel Napora ***@***.***> wrote:
It works, partially.
sfwbarmenu2.png (view on web)
<https://github.com/user-attachments/assets/ca5114ec-07af-461b-8c18-0cbeaf6e0765>
Two things:
1. Items added to top and bottom are sorted alphabetically (not in the
order they added).
2. AppMenuFilter action does not work.
My SfwbarInit:
function("SfwbarInit") {
sway_bar_id "bar-0"
layer "top"
AppMenuFilter "panelxpose.desktop"
AppMenuFilter "arandr.desktop"
AppMenuFilter "gxkb.desktop"
AppMenuFilter "lxrandr.desktop"
AppMenuFilter "lxinput.desktop"
AppMenuFilter "espanso.desktop"
AppMenuItemTop "File Manager%pcmanfm", "pcmanfm"
AppMenuItemTop "Web Browser%firefox", "firefox"
AppMenuItemTop "Add/remove Software%pamac-manager", "pamac-manager"
AppMenuItemBottom "Take screenshot%image", "/home/napcok/bin/grimshot --cursor --wait 10 save area sfwbarmenu2.png"
AppMenuItemBottom "Logout%system-log-out", "labwc --exit"
AppMenuItemBottom "Reboot%system-reboot", "systemctl reboot"
AppMenuItemBottom "PowerOff%system-shutdown", "systemctl poweroff"
}
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFFR3UX2ECPTX5CWXVL2IWXQPAVCNFSM6AAAAABUOSFJUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRYGQYTSMZVGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Wouldn't it be better to make Besides it would be good to have a separator between main and Top\Bottom menus like “separator”. Is it possible to add submenu(“sub”, “mysubmenu”) |
Top/bottom ordering should work now. @sfs-pra, I think I'll need to support both desktop entry based binned items as well as custom items. Looking at how @napcok example, he's adding custom commands to the menu. It is theoretically possible to add these via custom desktop files, but I'd rather not force users to create those. That said, adding entries based on desktop files should also be an option. Will work on this later (and will look at adding support for custom submenus as well). |
I confirm, it works as it should One more question/request: |
sfwbar-git r1753.701626d - yes!
ok
|
I think we need to think about better way of configuring the menu items.
Originally these were envisioned as simple constructs. You declare a menu,
stick some items into it with titles and actions attached. Then I added
icons using the fvwm % notation. Then I added I's so items could be
deleted.
I don't think sticking more optional parameters into an Item() keyword
makes sense. We'll end up with an uncertain grammar (i.e. if you have 3
parameters, if the last one an id or a tooltip?). It may also be worthwhile
to be able to build an item from a .desktop entry and override some
parameters (i.e. take an icon, translated name, but add some parameters
…On Sat, Jan 4, 2025 at 6:49 AM sfs-pra ***@***.***> wrote:
I confirm, it works as it should
sfwbar-git r1753.701626d - yes!
Will work on this later
ok
Now “tooltip” is not in AppMenuItemBottom
AppMenuItemTop GT("File manager", "sfwbar-ext") + "%spacefm%tooltip",
"spacefm" ?
Besides it would be good to have a separator
AppMenuItemTop "╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼", "true"
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFCHDNBNXJXXW7VSH7L2I576FAVCNFSM6AAAAABUOSFJUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZQGM2TKOJSGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Eek. my e-mail has gone beserk and sent the message before I finished
writing it. Thinking a user may want to add some parameters to a command
line leaving the rest of the parameters inherited from the desktop entry.
…On Sat, Jan 4, 2025 at 7:33 PM Lev Babiev ***@***.***> wrote:
I think we need to think about better way of configuring the menu items.
Originally these were envisioned as simple constructs. You declare a menu,
stick some items into it with titles and actions attached. Then I added
icons using the fvwm % notation. Then I added I's so items could be
deleted.
I don't think sticking more optional parameters into an Item() keyword
makes sense. We'll end up with an uncertain grammar (i.e. if you have 3
parameters, if the last one an id or a tooltip?). It may also be worthwhile
to be able to build an item from a .desktop entry and override some
parameters (i.e. take an icon, translated name, but add some parameters
On Sat, Jan 4, 2025 at 6:49 AM sfs-pra ***@***.***> wrote:
> I confirm, it works as it should
>
> sfwbar-git r1753.701626d - yes!
>
> Will work on this later
>
> ok
>
> Now “tooltip” is not in AppMenuItemBottom
>
> AppMenuItemTop GT("File manager", "sfwbar-ext") + "%spacefm%tooltip",
> "spacefm" ?
>
> Besides it would be good to have a separator
>
> AppMenuItemTop "╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼", "true"
>
> —
> Reply to this email directly, view it on GitHub
> <#303 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ASHPFFCHDNBNXJXXW7VSH7L2I576FAVCNFSM6AAAAABUOSFJUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZQGM2TKOJSGQ>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
where should i add |
in startmenu.widget |
I added functionality to allow configuring properties of menu items similar to widgets (including sort order), but haven't exposed this in the config yet. The question now is how to make this user accessible. As always with more flexibility, we get more config complexity. If we follow widget config model, we'll end up with something like this:
If we use this mode, we can set system menu index to something like 500 by default, so user defined items can be added before or after it as needed. The downside is that the user will need to specify sort index explicitly in the menu. |
No, this shouldn't be happening. Should be fixed in the latest git. |
sfwbar-git-r1794.1ed698b |
sfwbar-git-r1794.1ed698b |
I added support for HIdden= to the latest git version, but NoDisplay should
have been supported already. Can you check if either/both of these still
don't work.
…On Sun, Jan 26, 2025 at 9:11 AM sfs-pra ***@***.***> wrote:
sfwbar-git-r1794.1ed698b
They don't work Hidden= NoDisplay=
<https://specifications.freedesktop.org/desktop-entry-spec/latest/recognized-keys.html>
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFE325ZPHESXA2H2NXL2MSRDFAVCNFSM6AAAAABUOSFJUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJUGI4DONBTGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This is what the comment #303 (comment) is for. We really need to figure out a better way to specify menu items, both for the custom menus and for the application menu. Using actions to add menu items limits us to only a few parameters (and only one optional parameter realistically). It also only allows binding Exec actions to menu items. I would very much like some feedback on a more full featured menu item config, which should ideally allow specifying multiple optional properties (including sort order). I don't like the way the sort order works in my comment above. It is more or less required unless you want all items in the menu to be sorted alphabetically. |
sfwbar-git-r1795.ff14406
In my opinion it is optimal to sort alphabetically in the application menu, in AppMenuItem - without sorting, i.e. as written. |
Works. The problem was a duplicate in ~/local/share/applications |
Looks like gio is being pedantic and doesn't handle trailing semicolons for
these keys. I added a workaround in the latest git version. Can you check
if these work as expected now?
…On Wed, Jan 29, 2025 at 10:39 AM sfs-pra ***@***.***> wrote:
sfwbar-git-r1795.ff14406
Hidden= NoDisplay=
<https://specifications.freedesktop.org/desktop-entry-spec/latest/recognized-keys.html>
without improvement
Works. The problem was a duplicate in ~/local/share/applications
The problem remains - it doesn't work:
NoDisplay=true;
Hidden=true;
; - sometimes used
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFH4ONINORVMLQST6TD2NCVUPAVCNFSM6AAAAABUOSFJUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRRGI3DQMBVGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
sfwbar-git-r1806.c74fd8d
without improvement |
How to solve the problem with AppMenuItem sorting now ?
That's next on my list
…On Sat, Feb 1, 2025 at 7:22 PM sfs-pra ***@***.***> wrote:
NoDisplay=true;
Hidden=true;
sfwbar-git-r1806.c74fd8d
problem solved
How to solve the problem with AppMenuItem sorting now ?
?
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFGOFFNK5NQZ75DFCK32NUNHTAVCNFSM6AAAAABUOSFJUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRZGA3TSMBTGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Ok, the new menu declaration system should be ready to test. It' still subject to change, so I'm not documenting it yet. Here's an example:
|
This should replace AppMenuItemTop/AppMenuItemBottom. Instead of these, you can just add items to the application menu with explicit index specified. |
Where to add this code instead of AppMenuItemTop/AppMenuItemBottom ? |
menu("app_menu_system") {
item {
label = "aaa"
index = 1000
}
}
…On Tue, Feb 4, 2025 at 7:22 PM sfs-pra ***@***.***> wrote:
example:
Where to add this code instead of AppMenuItemTop/AppMenuItemBottom ?
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFEHVOPIZOPMFPHQS632OEHOVAVCNFSM6AAAAABUOSFJUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZUHA3DMOJQHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
You can also create items from desktop files and override any of their
properties:
item {
desktopid = "Alacritty"
label = "my label"
}
…On Wed, Feb 5, 2025 at 6:32 PM Lev Babiev ***@***.***> wrote:
menu("app_menu_system") {
item {
label = "aaa"
index = 1000
}
}
On Tue, Feb 4, 2025 at 7:22 PM sfs-pra ***@***.***> wrote:
> example:
>
> Where to add this code instead of AppMenuItemTop/AppMenuItemBottom ?
>
> —
> Reply to this email directly, view it on GitHub
> <#303 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ASHPFFEHVOPIZOPMFPHQS632OEHOVAVCNFSM6AAAAABUOSFJUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZUHA3DMOJQHE>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
How do you now get an apps menu with the addition of what used to be called AppMenuItemTop/AppMenuItemBottom ?
Is this addition to the Alacritty.desktop menu ? |
menu("app_menu_system") { ... }
This is the autogenerated menu, so if you add an item to it, it will be
added to the system menu. The index of your item will determine its
position. Currently, the automatically added items have index of 2, but I
will change it to 500 to allow more flexibility positioning top items.
…On Wed, 5 Feb 2025, 18:49 sfs-pra, ***@***.***> wrote:
How do you now get an app menu with the addition of what used to be called
AppMenuItemTop/AppMenuItemBottom ?
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFEDMAMCTMR54QK2O432OJML5AVCNFSM6AAAAABUOSFJUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZXG42TAMBXGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
It works like this. But it's still not clear about the desktopid. |
desktop id allows you to add a menu item based on a .desktop file. I.e. pin
a program to the main menu. You can also override any of the parameters of
this item (i.e. label, tooltip or action), but you don't have to. You can
just use the item as is.
…On Wed, Feb 5, 2025 at 8:04 PM sfs-pra ***@***.***> wrote:
module("appmenu")
menu("app_menu_system") {
Item {
Label = "gtkhash%gtkhash"
Action = "gtkhash"
Tooltip = "Some text here"
Index = 1
}
item {
label = "aaa"
index = 1000
}
item {
desktopid = "gtkhash"
label = "my label"
}
}
layout {
button {
value = "open-menu"
style = "startmenu"
action = Menu "app_menu_system"
tooltip = GT("Application menu")
}
}
It works like this. But it's still not clear about the desktopid.
—
Reply to this email directly, view it on GitHub
<#303 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFCPSZFM2AOGUSCOGTD2OJVDPAVCNFSM6AAAAABUOSFJUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZXHEYTEMBTGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
work! |
Tooltip = GT("Application menu") - dont work : "missing "string" in tooltip" label "╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼" - Is there no other way to draw the line? |
It is possible to implement a file listing .desktop files to exclude from the output menu?
Maybe also a good idea... user-defined HEADER and FOOTER file for the menu?
I'm new in wayland world.... and sfwbar is amazing. :)
Thank you.
The text was updated successfully, but these errors were encountered: