-
Notifications
You must be signed in to change notification settings - Fork 19
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
Menus #296
Comments
With the new functionality you can use expressions in menus, so:
Set Menu1 = "1"
menuclear("menu_name")
menu ("menu_name") {
item("item", Eval "Menu1", "2")
}
}
layout {
label {
value = $Menu1
action = menu "menu_name"
}
}
…On Fri, 27 Dec 2024, 13:04 sfs-pra, ***@***.***> wrote:
Set Menu1 = "1"
menuclear("menu_name")
menu ("menu_name") {
item("item", Set Menu1 = "2")
}
}
layout {
label {
value = $Menu1
action = menu "menu_name"
}
}
How to make “1” change to “2” when you click on “item”
—
Reply to this email directly, view it on GitHub
<#296>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFBGUNDG443OEUKTYB32HVF5LAVCNFSM6AAAAABUITKKKKVHI2DSMVQWIX3LMV43ASLTON2WKOZSG43DAOBWGIYDCMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
sfwbar-git-r1725.4627ccb - It works
cat sfwbar-hwmon.sh
doesn't work
|
Try PipeRead "sh /path/to/sfwbar-hwmon.sh"
Also, can you please post the output of the script?
…On Mon, 30 Dec 2024, 07:27 sfs-pra, ***@***.***> wrote:
With the new functionality you can use expressions in menus, so:
sfwbar-git-r1725.4627ccb - It works
Trying to put it into practice :
Function("SfwbarInit") {
PipeRead "sfwbar-hwmon.sh"
cat sfwbar-hwmon.sh
#!/bin/sh
echo 'set Hwmon = "'$(ls /sys/class/hwmon/ |tail -n1)'"'
echo '
file("/sys/class/hwmon/" + $Hwmon + "/temp1_input") {
CPUTemp = Grab()
}
'
echo 'menu ("menu_name") {'
for i in `ls /sys/class/hwmon/` ;do
echo 'item("'$i'", Eval "Hwmon", "'$i'")'
done
echo '}'
doesn't work
item("item save", Exec ("echo 1 > /tmp/sfwbar.ini"))
It's not working either.
How do you make the “hwmon” selection?
—
Reply to this email directly, view it on GitHub
<#296 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFCMO4RON6YORTJ6BVL2IDYU3AVCNFSM6AAAAABUITKKKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRVGEYTMOJRGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
No improvement
|
file("/sys/class/hwmon/" + $Hwmon + "/temp1_input")
This won't work yet. Expressions in scanner source declarations aren't
supported yet. It's on the TODO list, but I'll need to rewrite the
variable handling first (a lot of code dealing with the variables is
around 15 years old and really needs an update).
…On Mon, Dec 30, 2024 at 8:33 AM sfs-pra ***@***.***> wrote:
Try PipeRead "sh /path/to/sfwbar-hwmon.sh"
No improvement
post the output of the script
set Hwmon = "hwmon2"
file("/sys/class/hwmon/" + $Hwmon + "/temp1_input") {
CPUTemp = Grab()
}
menu ("menu_name") {
item("hwmon0", Eval "Hwmon", "hwmon0")
item("hwmon1", Eval "Hwmon", "hwmon1")
item("hwmon2", Eval "Hwmon", "hwmon2")
}
—
Reply to this email directly, view it on GitHub
<#296 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFBNZQZ5MCNU56TAE6L2IEAMZAVCNFSM6AAAAABUITKKKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRVGE3TANBWHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Then for now, the only option left is to use menu to configure sfwbar
|
There is a very hacks way to do this without reloading the config:
In your script, create scanners for all devices, I.e.:
file("/sys/class/hwmon/hwmon0/temp1_input") {
Hwmon0temp = grab()}
file("/sys/class/hwmon/hwmon1/temp1_input") {
Hwmon1temp = grab()}
...
Then declare
Set MyTemp = Hwmon0temp
And in the menu
Item("hwmon1" { config "set mytemp = hwmon1temp"})
And use mytemp as temp value
…On Tue, 31 Dec 2024, 05:57 sfs-pra, ***@***.***> wrote:
Then for now, the only option left is to use menu to configure sfwbar
item("item save", Exec ("sh -c 'echo 1 > /tmp/sfwbar.ini ; killall -1
sfwbar'")) - works
Function("SfwbarInit") {
PipeRead "sfwbar-hwmon.sh"
echo '
file("/sys/class/hwmon/'$(cat /tmp/sfwbar.ini)'/temp1_input") {
CPUTemp = Grab()
}
'
—
Reply to this email directly, view it on GitHub
<#296 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFH4KMJPSG67Q6TH5TL2IIW2PAVCNFSM6AAAAABUITKKKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRWGE2TMNBYGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Good idea, but it is better to define HwmonXtemp via PipeRead, because on different hardware the amount of Hwmon can be different. |
How to make “1” change to “2” when you click on “item”
The text was updated successfully, but these errors were encountered: