|
| 1 | +# Komorebi Control Widget |
| 2 | +*This widget provides a control interface for Komorebi, allowing users to start, stop, and reload the application. It also includes options for running AutoHotKey and WHKD, as well as displaying the Komorebi version.* |
| 3 | + |
| 4 | +| Option | Type | Default | Description | |
| 5 | +|-------------------|---------|-------------------------------------------------------------------------|-----------------------------------------------------------------------------| |
| 6 | +| `label` | string | `"\udb80\uddd9"` | Icon or text label. | |
| 7 | +| `icons` | dict | `'{'start': "\uead3",'stop': "\uead7",'reload': "\uead2",}'` | Button icons. | |
| 8 | +| `run_ahk` | boolean | `false` | Whether to run AutoHotKey. | |
| 9 | +| `run_whkd` | boolean | `false` | Whether to run WHKD. | |
| 10 | +| `show_version` | boolean | `false` | Whether to show the komorebi version. | |
| 11 | +| `komorebi_menu` | dict | `{'blur': True, 'round_corners': True, 'round_corners_type': 'normal','border_color': 'System', 'alignment': 'right', 'direction': 'down', 'offset_top': 6, 'offset_left': 0}` | Settings for the Komorebi menu. | |
| 12 | +| `callbacks` | dict | `{'on_left': 'toggle_menu', 'on_middle': 'do_nothing', 'on_right': 'do_nothing'}` | Callbacks for mouse events. | |
| 13 | +| `container_padding` | dict | `{'top': 0, 'left': 0, 'bottom': 0, 'right': 0}` | Explicitly set padding inside widget container. | |
| 14 | +| `animation` | dict | `{'enabled': True, 'type': 'fadeInOut', 'duration': 200}` | Animation settings for the widget. | |
| 15 | + |
| 16 | +## Example Configuration |
| 17 | + |
| 18 | +```yaml |
| 19 | + komorebi_control: |
| 20 | + type: "komorebi.control.KomorebiControlWidget" |
| 21 | + options: |
| 22 | + label: "<span>\udb80\uddd9</span>" |
| 23 | + icons: |
| 24 | + start: "\uead3" |
| 25 | + stop: "\uead7" |
| 26 | + reload: "\uead2" |
| 27 | + run_ahk: false |
| 28 | + run_whkd: true |
| 29 | + show_version: true |
| 30 | + komorebi_menu: |
| 31 | + blur: True |
| 32 | + round_corners: True |
| 33 | + round_corners_type: 'normal' |
| 34 | + border_color: 'System' |
| 35 | + alignment: 'left' |
| 36 | + direction: 'down' |
| 37 | + offset_top: 6 |
| 38 | + offset_left: 0 |
| 39 | +``` |
| 40 | +
|
| 41 | +## Description of Options |
| 42 | +
|
| 43 | +- **label:** Icon or text label. |
| 44 | +- **icons:** Button icons. |
| 45 | + - **start:** Icon for the start button. |
| 46 | + - **stop:** Icon for the stop button. |
| 47 | + - **reload:** Icon for the reload button. |
| 48 | +- **run_ahk:** Whether to run AutoHotKey. |
| 49 | +- **run_whkd:** Whether to run WHKD. |
| 50 | +- **show_version:** Whether to show the komorebi version. |
| 51 | +- **komorebi_menu:** Settings for the Komorebi menu. |
| 52 | + - **blur:** Whether to enable blur effect. |
| 53 | + - **round_corners:** Whether to round corners. |
| 54 | + - **round_corners_type:** Type of rounding (normal, small, large). |
| 55 | + - **border_color:** Border color (System, Custom). |
| 56 | + - **alignment:** Alignment of the menu (left, right, top, bottom). |
| 57 | + - **direction:** Direction of the menu (up, down, left, right). |
| 58 | + - **offset_top:** Top offset for the menu. |
| 59 | + - **offset_left:** Left offset for the menu. |
| 60 | +- **callbacks:** Callbacks for mouse events. |
| 61 | +- **container_padding:** Explicitly set padding inside widget container. |
| 62 | +- **animation:** Animation settings for the widget. |
| 63 | + - **enabled:** Whether to enable animation. |
| 64 | + - **type:** Type of animation (fadeInOut, slideIn, etc.). |
| 65 | + - **duration:** Duration of the animation in milliseconds. |
| 66 | +
|
| 67 | +## Widget Style |
| 68 | +```css |
| 69 | +.komorebi-control-widget {} |
| 70 | +.komorebi-control-widget .widget-container {} |
| 71 | +.komorebi-control-widget .widget-container .label {} |
| 72 | +.komorebi-control-widget .widget-container .icon {} |
| 73 | +/* Komorebi Menu */ |
| 74 | +.komorebi-control-menu {} |
| 75 | +.komorebi-control-menu .button {} |
| 76 | +.komorebi-control-menu .button:hover {} |
| 77 | +.komorebi-control-menu .button.start {} |
| 78 | +.komorebi-control-menu .button.stop {} |
| 79 | +.komorebi-control-menu .button.reload {} |
| 80 | +.komorebi-control-menu .button.active {} |
| 81 | +.komorebi-control-menu .button:disabled {} |
| 82 | +.komorebi-control-menu .footer {} |
| 83 | +.komorebi-control-menu .footer .text {} |
| 84 | +``` |
| 85 | + |
| 86 | +## Example Style |
| 87 | +```css |
| 88 | +.komorebi-control-widget .label { |
| 89 | + font-size: 14px; |
| 90 | + color: #cdd6f4; |
| 91 | + font-weight: 600; |
| 92 | +} |
| 93 | +.komorebi-control-menu { |
| 94 | + background-color: rgba(17, 17, 27, 0.2); |
| 95 | +} |
| 96 | +.komorebi-control-menu .button { |
| 97 | + color: rgba(162, 177, 199, 0.4); |
| 98 | + padding: 8px 16px; |
| 99 | + font-size: 32px; |
| 100 | + border-radius: 8px; |
| 101 | + background-color: rgba(255, 255, 255, 0.04); |
| 102 | +} |
| 103 | +.komorebi-control-menu .button.active { |
| 104 | + color: rgb(228, 228, 228); |
| 105 | + background-color: rgba(255, 255, 255, 0.04); |
| 106 | +} |
| 107 | +.komorebi-control-menu .button:disabled, |
| 108 | +.komorebi-control-menu .button.active:disabled { |
| 109 | + background-color: rgba(255, 255, 255, 0.01); |
| 110 | + color: rgba(255, 255, 255, 0.2); |
| 111 | +} |
| 112 | +.komorebi-control-menu .footer .text { |
| 113 | + font-size: 12px; |
| 114 | + color: #6c7086; |
| 115 | +} |
| 116 | +``` |
| 117 | + |
| 118 | +## Preview |
| 119 | + |
0 commit comments