Slide
A slider, with on_change
property which will be executing a shell command when value changes.
You can use Slider
as status bar with update_with_interval_ms
to update the progress on a regular interval.
Example:
{
"edge": "top",
"widget": {
"type": "slide",
"width": 20,
"height": 400,
"transition_duration": 100,
"frame_rate": 120,
"bg_color": "#0D47A1",
"fg_color": "#29B6F6",
"text_color": "#fff",
"border_color": "#000",
"on_change": "notify-send {progress}"
}
}
type*
const `slide`
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
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: []
on_change
Command to execute, replace '{progress}' with the progress from 0-1.
Example: notify-send {progress}
Type: null | string
Default: null
draggable
Is progress in slide changeable by mouse left click drag.
Type: bool
Default: true
update_with_interval_ms
Array of tuples. each tuple contains millisecond
and shell command
:
[<millisecond>, <shell_command>]
Example: [1000, \"echo 0.2333\"]
For shell command
, the returned value must be a number within [0, 1]
.
Type: [[int, string]...]
Default: []
bg_color
Color of the background of widget.
Support: #rgb
/#rrggbb
/#rrrgggbbb
/rgb(r, g, b)
/rgba(r, g, b, a)
...
For full info, check RGBA
Type: string
Default: #808080
fg_color
Color of the foreground of widget.
Support: #rgb
/#rrggbb
/#rrrgggbbb
/rgb(r, g, b)
/rgba(r, g, b, a)
...
For full info, check RGBA
Type: string
Default: #FFB847
border_color
Color of the border of widget.
Support: #rgb
/#rrggbb
/#rrrgggbbb
/rgb(r, g, b)
/rgba(r, g, b, a)
...
For full info, check RGBA
Type: string
Default: #646464
text_color
Color of the text of widget.
For full info, check RGBA
Support: #rgb
/#rrggbb
/#rrrgggbbb
/rgb(r, g, b)
/rgba(r, g, b, a)
...
For full info, check RGBA
Type: string
Default: #000000
preview_size
How much area should the widget reveal when hidden
Type: int
Default: 3
progress_direction
Progress bar: Forward/Backward
Type: string
Default: Forward
is_text_position_start
Which side percentage info at, start or end of the widget
Type: bool
Default: true
obtuse_angle
The 2 obtuse angle in trapezoid, set it within [90, 180)
, when 90
, you'll get a square.
Type: int
Default: 120
radius
Radius of the rounded corners for 2 obtuse angle in trapezoid.
Type: int
Default: 20