I am currently trying to add the following script to a eww-button-widget (with :onclick):
#!/bin/bash
selected=$(echo -e "balanced\npower-saver\nperformance" | dmenu -i -p "Select Power-Profile")
powerprofilesctl set ${selected}
I am calling it in my eww.yuck like so:
(defwidget battery []
(button :onclick "./scripts/battery_profile_dmenu" ...)
)
The script is definetly being executed (I am getting the dmenu prompt) yet nothing past the selected=... part is getting executed.
I've already managed getting other scripts to run (e.g. redshift), only dmenu scripts seem not to be working (networkmanager_dmenu doesn't work this way either).
Note: dmenu also seems to return just fine, piping the result into a file (echo ... | dmenu ... > test.txt) writes the selected field into the file as expected.