https://github.com/Niols/scd.niols.fr
Revision 9a4b354c8ea56366f62fd3764a92ebdc28006f0b authored by Nicolas Jeannerod on 11 February 2023, 22:59:20 UTC, committed by GitHub on 11 February 2023, 22:59:20 UTC
* Enter flake-parts

* Run `nixfmt`

* Move `mkDerivation` to own lib

* Enable pre-commit hooks

* Rework CI to use Cachix

* Enable cache in flake

* Try TeXlive medium

* Try TeXlive small

* Try TeXlive basic

* Custom TeXlive

* Use action to create PR comment

* +enumitem

* Enable action for testing purposes

* github.event.issue.number

* github.event.number

* +wrapfig

* Comment token

* Missing slash

* Re-disable action

* Run `prettier` on CSS files

* Run `prettier` on YAML files

* Run flake checks in CI as well

* Move `nixConfig` to proper place in flake

* Base on `scheme-small`

* Move packages to own files

* Breaaathe
1 parent 4f41204
Raw File
Tip revision: 9a4b354c8ea56366f62fd3764a92ebdc28006f0b authored by Nicolas Jeannerod on 11 February 2023, 22:59:20 UTC
Rework and improve Nix environment (#150)
Tip revision: 9a4b354
take-screenshot
#!/usr/bin/env python3

import sys
import time

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.support.wait import WebDriverWait

source = sys.argv[1]
target = sys.argv[2]
width  = sys.argv[3]

## Get a driver for a headless Firefox.
options = FirefoxOptions()
options.headless = True
driver = webdriver.Firefox(options=options)

## Get the requested page.
driver.get(source)

## Maximize the window, set its size and give time for the page to stabilise.
driver.maximize_window()
driver.set_window_size(width, 8000)
time.sleep(1)

## Save a screenshot and leave.
driver.find_element_by_tag_name('body').screenshot(target)
driver.quit()
back to top