-
Notifications
You must be signed in to change notification settings - Fork 6
rofi #16
Comments
the rofi examples were provided by @abs3ntdev, maybe they are able to provide their configs |
Here is a quick script i wrote up. Uses wofi, but should be exactly the same for rofi # Format JSON proper;y
JSON=$(hyprkeys --from-ctl --json | jq -r --slurp "[.[]][0]");
USER_SELECTED=$(echo $JSON | jq -r '.[] | "\(.mods) \(.key) \(.dispatcher) \(.arg)"' | wofi --dmenu -p 'Keybinds' --define "dmenu-print_line_num=true");
if [ -z "$USER_SELECTED" ]; then
exit 0;
fi
EVENT=$(echo $JSON | jq -r "[.[]] | .[$USER_SELECTED]" | jq -r '"\(.dispatcher) \(.arg)"');
hyprctl dispatch "$EVENT";
It's not the prettiest but it works well enough for me! You could well enough do this with just hyprctl, but using JSON with hyprkeys does make it a lot nicer. One issue though, using --from-ctl means that we have to add this bullshit Might make an issue, unless that is intended @NotAShelf? |
Thanks for the snippet, it didn't quite work 1:1 with rofi because
|
Ah yeh, that makes sense. That's just a wofi option so that it returns an index instead of the actual data. You could strip down the data, but I thought that was a little over engineered! |
Just figured out you can output raw instead, which doesn't return the extra piece of json when using --from-ctl So we can just do JSON=$(hyprkeys --from-ctl --raw) |
Readme shows an image of hyprkeys being used with a rofi script. Is there a source for the example?
The text was updated successfully, but these errors were encountered: