Closed hemanti0503 closed 1 year ago
use empty name (without any spaces!) instead of '--' to add real menu separator
Sat, 14 Jan 2023 01:14:26 -0800 hemanti0503 @.***> написав:
Hi, I use YAD to execute often-used commands from my systray. It currently looks like this:
yad --notification --image="applications-all" --text="My Tray Icon" --menu=" Group 1 Command_1 ! group_1_command_1 | Group 1 Command_2 ! group_1_command_2 \ |-- \ | Group 2 Command_1 ! group_2_command_1 \ | Group 2 Command_2 ! group_2_command_2 \ | Group 2 Command_3 ! group_2_command_3 \ | -- \ | Quit ! quit" \ \ --command="menu"
As you see, I separate the commands by
--
. It works, but it seems not very space-efficient. Is there (or could there be) an option to use a thin horizontal separator line instead, that doesn't take away the space of a complete command line?
-- wbr Victor Ananjevsky @.***>
That's beautiful! Thank you so much! :)
While your solution works nicely, I now have a problem with readability. My code now looks like this:
yad --notification --image="applications-all" --text="My Tray Icon" --menu=" Group 1 Command_1 ! group_1_command_1
| Group 1 Command_2 ! group_1_command_2 || Group 2 Command_1 ! group_2_command_1 \
| Group 2 Command_2 ! group_2_command_2 \
| Group 2 Command_3 ! group_2_command_3 || Quit ! quit" \
\
--command="menu"
It looked really neat before when every menu entry was on a separate line. Now it gets quite messy, especially since some of my commands are quite long. I think, I might be able to solve this somehow by escaping whitespace, but I can't figure out how.
That's beautiful! Thank you so much! :)
While your solution works nicely, I now have a problem with readability. My code now looks like this:
yad --notification --image="applications-all" --text="My Tray Icon" --menu=" Group 1 Command_1 ! group_1_command_1 | Group 1 Command_2 ! group_1_command_2 || Group 2 Command_1 ! group_2_command_1 \ | Group 2 Command_2 ! group_2_command_2 \ | Group 2 Command_3 ! group_2_command_3 || Quit ! quit" \ \ --command="menu"
It looked really neat before when every menu entry was on a separate line. Now it gets quite messy, especially since some of my commands are quite long. I think, I might be able to solve this somehow by escaping whitespace, but I can't figure out how.
Hi, This is how i did it and that worked for me.
yad --notification --image="applications-all" --text="My Tray Icon" \
--menu=" Group 1 Command_1 ! group_1_command_1 \
| Group 1 Command_2 ! group_1_command_2 \
|| Group 2 Command_1 ! group_2_command_1 \
| Group 2 Command_2 ! group_2_command_2 \
| Group 2 Command_3 ! group_2_command_3 \
|| Quit ! quit" \
\
--command="menu"
Such a simple solution! Works great, thank you! :)
Hi, I use YAD to execute often-used commands from my systray. It currently looks like this:
As you see, I separate the commands by
--
. It works, but it seems not very space-efficient. Is there (or could there be) an option to use a thin horizontal separator line instead, that doesn't take away the space of a complete command line?