How to make a Rofi button widget execute a shell command? #2308
Ali-v1074
started this conversation in
Show and tell
Replies: 1 comment 1 reply
|
Rofi theme button { action: ... } cannot execute a shell command directly. How about using a wrapper script: Then run rofi from shell and check the exit code. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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
actionproperty, 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://github.com/Ali-1074/rofi-win11-theme.git
All reactions