Recycle Bin Widget#
Recycle Bin widget is simple widget that shows the status of the recycle bin. It displays the number of items in the recycle bin and the total size of the items. The widget can be customized to show different icons and colors based on the status of the recycle bin.
| Option | Type | Default | Description |
|---|---|---|---|
label |
string | {icon} {items_count} {items_size} |
Format for displaying recycle bin information. Available variables: {icon}, {items_count}, {items_size}. |
label_alt |
string | {icon} {items_count} {items_size} |
Alternative label format that can be toggled with left-click (or configured callback). |
class_name |
string | "" |
Additional CSS class name for the widget. |
icons |
dict | See below | Customize icons used for different recycle bin states. |
tooltip |
boolean | True |
Whether to show the tooltip on hover. |
show_confirmation |
boolean | False |
Show Windows confirmation dialog before emptying. |
keybindings |
list | [] |
Optional hotkeys. See Keybindings. |
callbacks |
dict | See below | Configure widget interaction callbacks. |
Icons Options#
The icons option accepts the following keys. All keys are optional, the values shown are the defaults.
icons:
bin_empty: "\udb82\ude7a"
bin_filled: "\udb82\ude79"
Example Configuration#
bin:
type: "yasb.recycle_bin.RecycleBinWidget"
options:
label: "<span>{icon}</span> Items {items_count} ({items_size})"
label_alt: "Items {items_count}, Total size ({items_size})"
icons:
bin_empty: "\udb82\ude7a"
bin_filled: "\udb82\ude79"
callbacks:
on_left: "open_bin"
on_right: "toggle_label"
on_middle: "empty_bin"
show_confirmation: true
Description of Options#
- label: Format for displaying recycle bin information. Available variables:
{icon},{items_count},{items_size}. - label_alt: Alternative label format that can be toggled with left-click (or configured callback).
- class_name: Additional CSS class name for the widget. This allows for custom styling.
- icons: Customize icons used for different recycle bin states. The default icons are:
- bin_empty: Icon when the recycle bin is empty.
- bin_filled: Icon when the recycle bin has items.
- tooltip: Whether to show the tooltip on hover.
- show_confirmation: Show Windows confirmation dialog before emptying.
- keybindings: A list of global hotkeys for this widget. See Keybindings.
- callbacks: Mouse event callbacks. See Callbacks.
Available Callbacks#
The callbacks option maps mouse buttons (on_left, on_middle, on_right) to actions. All keys are optional, the values shown are the defaults.
callbacks:
on_left: "toggle_label"
on_middle: "do_nothing"
on_right: "open_bin"
Available actions:
- toggle_label: Toggle between main and alternative label format.
- empty_bin: Empty the recycle bin.
- open_bin: Open the recycle bin.
Available Style#
.recycle-bin-widget {} /*Style for widget.*/
.recycle-bin-widget.your_class {} /* If you are using class_name option */
.recycle-bin-widget .widget-container {} /*Style for widget container.*/
.recycle-bin-widget .label {} /*Style for label.*/
.recycle-bin-widget .icon {} /*Style for icon.*/
.recycle-bin-widget .label.bin-empty {} /*Style for label when bin is empty.*/
.recycle-bin-widget .label.bin-filled {} /*Style for label when bin is filled.*/
.recycle-bin-widget .icon.bin-empty {} /*Style for icon when bin is empty.*/
.recycle-bin-widget .icon.bin-filled {} /*Style for icon when bin is filled.*/