Button
Button widget provides mouse event map, you can specify mouse key ID
along with the shell command
which will be executed when button is clicked with that key.
[!TIP] This widget can't be pinned
Example:
{
"edge": "top",
"position": "left",
"layer": "overlay",
"margin": {
"left": "25%"
},
"widget": {
"type": "btn",
"width": 15,
"height": "25%",
"frame_rate": 90,
"transition_duration": 150,
"extra_trigger_size": 5,
"event_map": [
[1, "hyprctl dispatch movefocus l"],
[3, "hyprctl dispatch 'workspace -1'"]
]
}
}
*
means required property.
type*
const `btn`
width*
*Thickness* of the button, from screen edge to the screen center.
Support relative value, but don't recommend using relative value for this property.
Type: int | string
height*
Length of the button.
Support relative value.
Type: int | string
frame_rate
Frame rate per second, won't hurt if over screen refresh rate.
Type: int
Default: 60
transition_duration
Time cost of showing the widget from the edge.
Millisecond.
Type: int
Default: 100
extra_trigger_size
Extra mouse event input region of the widget, if 0
then the widget won't be shown by mouse hover.
Type: int | string
Default: 5
color
Color of the button.
Support: #rgb
/#rrggbb
/#rrrgggbbb
/rgb(r, g, b)
/rgba(r, g, b, a)
...
For full info, check RGBA
Type: string
Default: #7B98FF
event_map
Array of tuples. each tuple contains mouse key ID
and shell command
:
[<mouse_key_id>, <shell_command>]
This event map does not support long press
/doule press
/hover event
... only support single click.
Default mouse keys:
1
- Left button2
- Middle button3
- Right button- ...others you need to test on your self by passing
--mouse-debug
:way-edges daemon --mouse-debug
Type: [[int, string]...]
Default: []