How to make a Rofi button widget execute a shell command?

Hi everyone!

I've been working on recreating the Windows 11 Start Menu style in Rofi, and I'm really happy with how it turned out! I managed to get the layout, icons, search bar, and overall look working great.

However, I'm stuck on one last thing — I added a power button at the bottom right of the menu, but I can't figure out how to make it actually execute a command (like opening a power menu or running a shutdown script) when clicked.

From what I've researched, Rofi's button widget supports the action property, but it only accepts keybindings, not shell commands directly.

Does anyone experienced with Rofi know how to make a clickable button execute an external command or script? Any help would be greatly appreciated!

Here's a screenshot of my current design:

https://preview.redd.it/neclhjf9db8h1.png?width=842&format=png&auto=webp&s=32f0bbcfee88c3f68aeeb5cc805181136083a6ed

https://www.mediafire.com/file/eff4psykrlu09u6/rofi.tar.gz/file

reddit.com
u/Ali-1075 — 17 days ago

ياجدعان لو في واحد فاهم في rofi عايز أعرف إزاي أخصص كل border بلون مختلف يعني مثلاً اللي فوق يكون بلون واللي تحت يكون بلون تاني وهكذا

inputbar {
    enabled:                     true;
    spacing:                     10px;
    padding:                     10px;
    border:                      0px 0px 2px 0px;
    border-radius:               5px;
    border-color:                ;
    background-color:            transparent;
    text-color:                  u/foreground;
    children:                    ["entry"];
}
reddit.com
u/Ali-1075 — 19 days ago