<commit_before>const electron = require('electron')
const desktopCapturer = electron.desktopCapturer
const electronScreen = electron.screen
const shell = electron.shell

const fs = require('fs')
const os = require('os')
const path = require('path')

const screenshot = document.getElementById('screen-shot')

screenshot.addEventListener('click', function (event) {
  const thumbSize = determineScreenShotSize()
  desktopCapturer.getSources({types: ['screen'], thumbnailSize: thumbSize}, function (error, sources) {
    if (error) return console.log(error)

    sources.forEach(function (source) {
      if (source.name === "Entire screen") {
        var screenshotPath = path.join(os.tmpdir(), 'screenshot.png')

        fs.writeFile(screenshotPath, source.thumbnail.toPng(), function (error) {
          if (error) return console.log(error)
          shell.openItem(screenshotPath)
        })
      }
    })
  })
})

function determineScreenShotSize () {
  var screenSize = electronScreen.getPrimaryDisplay().workAreaSize
  var maxDimension = Math.max(screenSize.width, screenSize.height)
  return {
    width: maxDimension * window.devicePixelRatio,
    height: maxDimension * window.devicePixelRatio
  }
}
<commit_msg>Display path of screenshot file<commit_after>const electron = require('electron')
const desktopCapturer = electron.desktopCapturer
const electronScreen = electron.screen
const shell = electron.shell

const fs = require('fs')
const os = require('os')
const path = require('path')

const screenshot = document.getElementById('screen-shot')

screenshot.addEventListener('click', function (event) {
  const thumbSize = determineScreenShotSize()
  desktopCapturer.getSources({types: ['screen'], thumbnailSize: thumbSize}, function (error, sources) {
    if (error) return console.log(error)

    sources.forEach(function (source) {
      if (source.name === "Entire screen") {
        var screenshotPath = path.join(os.tmpdir(), 'screenshot.png')

        fs.writeFile(screenshotPath, source.thumbnail.toPng(), function (error) {
          if (error) return console.log(error)
          shell.openItem(screenshotPath)
          var message = 'Wrote screenshot to: ' + screenshotPath
          document.getElementById('screenshot-path').innerHTML = message
        })
      }
    })
  })
})

function determineScreenShotSize () {
  var screenSize = electronScreen.getPrimaryDisplay().workAreaSize
  var maxDimension = Math.max(screenSize.width, screenSize.height)
  return {
    width: maxDimension * window.devicePixelRatio,
    height: maxDimension * window.devicePixelRatio
  }
}

{'fraction_non_alphanumeric': 0.11739799846035412, 'fraction_numerical': 0.0, 'mean_word_length': 4.261133603238866, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7650663', 'n_tokens_mistral': 730, 'n_tokens_neox': 720, 'n_words': 164}