<commit_before>// A mirror of the remote menubar windows.
import * as ChatConstants from '../constants/chat2'
import * as NotificationTypes from '../constants/types/notifications'
import * as FSTypes from '../constants/types/fs'
import * as Container from '../util/container'
import * as React from 'react'
import * as Styles from '../styles'
import * as Electron from 'electron'
import {intersect} from '../util/set'
import useSerializeProps from '../desktop/remote/use-serialize-props.desktop'
import {serialize} from './remote-serializer.desktop'
import {isDarwin, isWindows} from '../constants/platform'
import {isSystemDarkMode} from '../styles/dark-mode'
import {uploadsToUploadCountdownHOCProps} from '../fs/footer/upload-container'
import {ProxyProps, RemoteTlfUpdates} from './remote-serializer.desktop'
import {mapFilterByKey} from '../util/map'
import {memoize} from '../util/memoize'
import shallowEqual from 'shallowequal'

const getIcons = (iconType: NotificationTypes.BadgeType, isBadged: boolean) => {
  const devMode = __DEV__ ? '-dev' : ''
  let color = 'white'
  const colorSelected = 'white'
  const badged = isBadged ? 'badged-' : ''
  let platform = ''

  if (isDarwin) {
    color = isSystemDarkMode() ? 'white' : 'black'
  } else if (isWindows) {
    color = 'black'
    platform = 'windows-'
  }

  const size = isWindows ? 16 : 22
  const icon = `icon-${platform}keybase-menubar-${badged}${iconType}-${color}-${size}${devMode}@2x.png`
  // Only used on Darwin
  const iconSelected = `icon-${platform}keybase-menubar-${iconType}-${colorSelected}-${size}${devMode}@2x.png`
  return [icon, iconSelected]
}

type WidgetProps = {
  desktopAppBadgeCount: number
  widgetBadge: NotificationTypes.BadgeType
}

function useDarkSubscription() {
  const [count, setCount] = React.useState(-1)
  React.useEffect(() => {
    if (isDarwin) {
      const subscriptionId = Electron.remote.systemPreferences.subscribeNotification(
        'AppleInterfaceThemeChangedNotification',
        () => {
          setCount(c => c + 1)<commit_msg>fix miniature menubar icon on Linux (#23069)<commit_after>// A mirror of the remote menubar windows.
import * as ChatConstants from '../constants/chat2'
import * as NotificationTypes from '../constants/types/notifications'
import * as FSTypes from '../constants/types/fs'
import * as Container from '../util/container'
import * as React from 'react'
import * as Styles from '../styles'
import * as Electron from 'electron'
import {intersect} from '../util/set'
import useSerializeProps from '../desktop/remote/use-serialize-props.desktop'
import {serialize} from './remote-serializer.desktop'
import {isDarwin, isWindows, isLinux} from '../constants/platform'
import {isSystemDarkMode} from '../styles/dark-mode'
import {uploadsToUploadCountdownHOCProps} from '../fs/footer/upload-container'
import {ProxyProps, RemoteTlfUpdates} from './remote-serializer.desktop'
import {mapFilterByKey} from '../util/map'
import {memoize} from '../util/memoize'
import shallowEqual from 'shallowequal'

const getIcons = (iconType: NotificationTypes.BadgeType, isBadged: boolean) => {
  const devMode = __DEV__ ? '-dev' : ''
  let color = 'white'
  const colorSelected = 'white'
  const badged = isBadged ? 'badged-' : ''
  let platform = ''

  if (isDarwin) {
    color = isSystemDarkMode() ? 'white' : 'black'
  } else if (isWindows) {
    color = 'black'
    platform = 'windows-'
  }

  const size = isWindows ? 16 : 22
  const x = isLinux ? '' : '@2x'
  const icon = `icon-${platform}keybase-menubar-${badged}${iconType}-${color}-${size}${devMode}${x}.png`
  // Only used on Darwin
  const iconSelected = `icon-${platform}keybase-menubar-${iconType}-${colorSelected}-${size}${devMode}${x}.png`
  return [icon, iconSelected]
}

type WidgetProps = {
  desktopAppBadgeCount: number
  widgetBadge: NotificationTypes.BadgeType
}

function useDarkSubscription() {
  const [count, setCount] = React.useState(-1)
  React.useEffect(() => {
    if (isDarwin) {
      const subscriptionId = Electron.remote.systemPreferences.subscribeNotification(
        'AppleInterfaceThemeChangedNotification',
        () => {
          setCount(c => c + 1)
{'fraction_non_alphanumeric': 0.14528889954447374, 'fraction_numerical': 0.005274514504914889, 'mean_word_length': 4.228070175438597, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2751618', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1278, 'n_words': 330}