Skip to content

Latest commit

 

History

History
213 lines (182 loc) · 8.13 KB

File metadata and controls

213 lines (182 loc) · 8.13 KB

Update Check Widget

This widget checks for available updates using Windows Update, Winget, and Scoop.

Important

  • Winget must be installed and configured for Winget update checking to work.
  • Scoop must be installed and configured for Scoop update checking to work.
  • Each source can be enabled or disabled independently.

Options

Windows Update Options

Option Type Default Description
enabled boolean false Enable Windows Update checking.
label string '{count}' Format string for the widget label. {count} shows update count.
tooltip boolean true Whether to show the tooltip on hover.
interval integer 1440 Check interval in minutes (30 to 10080).
exclude list [] List of updates to exclude (matched against name).
show_popup_menu boolean false Whether to show a popup menu on left click. This allows the user to choose between opening Windows Update in Settings or executing a command (with a UAC elevation prompt) to directly update Windows Defender Virus' security intelligence updates.
popup_menu_padding integer 8 Padding (in pixels) around the menu items if show_popup_menu: true. (Valid range: 0 - 80)

Winget Update Options

Option Type Default Description
enabled boolean false Enable Winget package update checking.
label string '{count}' Format string for the widget label. {count} shows update count.
tooltip boolean true Whether to show the tooltip on hover.
interval integer 240 Check interval in minutes (10 to 10080).
exclude list [] List of packages to exclude (matched against name and id).

Scoop Update Options

Option Type Default Description
enabled boolean false Enable Scoop package update checking.
label string '{count}' Format string for the widget label. {count} shows update count.
tooltip boolean true Whether to show the tooltip on hover.
interval integer 240 Check interval in minutes (10 to 10080).
exclude list [] List of packages to exclude (matched against name).

Widget Shadow Options

Option Type Default Description
container_shadow dict None Container shadow options.
label_shadow dict None Label shadow options.

Click Handlers

  • Left-click on Winget container: opens a terminal to upgrade all detected Winget packages.
  • Left-click on Scoop container: opens a terminal to upgrade all detected Scoop packages.
  • Left-click on Windows Update container: opens Windows Update settings.
  • Right-click on any container: forces a re-check for that source.

Example Configuration

update_check:
  type: "yasb.update_check.UpdateCheckWidget"
  options:
    windows_update:
      enabled: true
      label: "<span>\uf0ab</span> {count}"
      interval: 1440
      exclude: []
    winget_update:
      enabled: true
      label: "<span>\uf0ab</span> {count}"
      interval: 240
      exclude: ["Microsoft.Edge"]
    scoop_update:
      enabled: true
      label: "<span>\uf0ab</span> {count}"
      interval: 240
      exclude: []
    label_shadow:
      enabled: true
      color: "black"
      radius: 3
      offset: [ 1, 1 ]

Available Styles

.update-check-widget {}
.update-check-widget .widget-container {}
.update-check-widget .widget-container.winget {}
.update-check-widget .widget-container.scoop {}
.update-check-widget .widget-container.windows {}
.update-check-widget .widget-container.paired-left {}
.update-check-widget .widget-container.paired-right {}
.update-check-widget .label {}
.update-check-widget .icon {}
/* Styles for the new optional Windows Update popup menu */
.widget-container.windows.menu-popup {}
.widget-container.windows.menu-popup .menu-item {}
.widget-container.windows.menu-popup .menu-item:hover {}
.widget-container.windows.menu-popup .menu-item .icon {}
.widget-container.windows.menu-popup .menu-item .label {}
.widget-container.windows.menu-popup .menu-item:hover .icon {}
.widget-container.windows.menu-popup .menu-item:hover .label {}

State Classes

When two or more source containers are visible, each container gets positional classes based on its neighbors:

  • paired-left - has a visible container to the left
  • paired-right - has a visible container to the right

This allows you to add margin only on the side that faces another container, keeping outer edges untouched.

Visible Sources winget scoop windows
all 3 paired-right paired-left paired-right paired-left
winget + windows paired-right - paired-left
winget + scoop paired-right paired-left -
scoop + windows - paired-right paired-left
1 only (none) (none) (none)

Example:

.update-check-widget .widget-container.paired-left {
    margin-left: 4px;
}
.update-check-widget .widget-container.paired-right {
    margin-right: 4px;
}

Example

.update-check-widget {
    padding: 0 4px;
}
.update-check-widget .icon {
    font-size: 14px;
}
.update-check-widget .widget-container.winget,
.update-check-widget .widget-container.scoop,
.update-check-widget .widget-container.windows {
    background: #6549e6;
    margin: 6px 2px;
    border-radius: 4px;
    border: 1px solid #8267ff;
}
 
.update-check-widget .widget-container.paired-left {
    margin-left: 2px;
}
.update-check-widget .widget-container.paired-right {
    margin-right: 2px;
}
.update-check-widget .widget-container.windows {
    background: #3353e4;
    border: 1px solid #5574fc;
}
.update-check-widget .widget-container.scoop {
    background: #2b9e78;
    border: 1px solid #4ac59c;
}
.update-check-widget .widget-container.winget .icon,
.update-check-widget .widget-container.scoop .icon,
.update-check-widget .widget-container.windows .icon {
    color: #ffffff;
    margin: 0 1px 0 6px;
}
.update-check-widget .widget-container.winget .label,
.update-check-widget .widget-container.scoop .label,
.update-check-widget .widget-container.windows .label {
    margin: 0 6px 0 1px;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
} 
/* Styles for the new optional Windows Update popup menu */
.widget-container.windows.menu-popup {
    background-color: var(--surface0);
    border-radius: 4px;
}

.widget-container.windows.menu-popup .menu-item {
    background-color: var(--surface1);
    border-radius: 4px;
    padding: 4px;
}

.widget-container.windows.menu-popup .menu-item:hover {
    background-color: var(--surface2);
}

.widget-container.windows.menu-popup .menu-item .icon {
    color: var(--text);
    font-size: 16px;
    min-width: 20px;
}

.widget-container.windows.menu-popup .menu-item .label {
    color: var(--text);
    font-size: 13px;
    font-weight: 400;
}

.widget-container.windows.menu-popup .menu-item:hover .icon,
.widget-container.windows.menu-popup .menu-item:hover .label {
    color: var(--text);
}