Skip to content

Commit

Permalink
new: moved screenshots to a separate repository (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
pamburus committed Apr 6, 2024
1 parent 52d5ec3 commit 78a053f
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "extra"]
path = extra
url = ../hl-extra.git
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.DEFAULT_GOAL := build

THEMES = $(notdir $(basename $(wildcard etc/defaults/themes/*.yaml)))
SCREENSHOT_SAMPLE = prometheus.log

## Print help
help:
@echo "$$(tput setaf 2)Usage$$(tput sgr0)";sed -ne"/^## /{h;s/.*//;:d" -e"H;n;s/^## /---/;td" -e"s/:.*//;G;s/\\n## /===/;s/\\n//g;p;}" ${MAKEFILE_LIST}|awk -F === -v n=$$(tput cols) -v i=4 -v a="$$(tput setaf 6)" -v z="$$(tput sgr0)" '{printf" '$$(tput setaf 2)make$$(tput sgr0)' %s%s%s\t",a,$$1,z;m=split($$2,w,"---");l=n-i;for(j=1;j<=m;j++){l-=length(w[j])+1;if(l<= 0){l=n-i-length(w[j])-1;}printf"%*s%s\n",-i," ",w[j];}}' | column -ts $$'\t'
Expand Down Expand Up @@ -40,14 +43,16 @@ clean:
@cargo clean
.PHONY: clean

## Create screenshot
screenshot: build
## Create screenshots
screenshots: build $(THEMES:%=screenshot-%)

screenshot-%: build
@defaults write org.alacritty NSRequiresAquaSystemAppearance -bool yes
@contrib/bin/screenshot.sh light prometheus.log
@contrib/bin/screenshot.sh light $(SCREENSHOT_SAMPLE) $*
@defaults write org.alacritty NSRequiresAquaSystemAppearance -bool no
@contrib/bin/screenshot.sh dark prometheus.log
@contrib/bin/screenshot.sh dark $(SCREENSHOT_SAMPLE) $*
@defaults delete org.alacritty NSRequiresAquaSystemAppearance
.PHONY: screenshot
.PHONY: screenshot-%

## Install dependencies needed for contribution
contrib:
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ High performance and convenient features are the main goals.

### Screenshot

![screenshot-light](doc/screenshot-light.png#gh-light-mode-only)
![screenshot-dark](doc/screenshot-dark.png#gh-dark-mode-only)
![screenshot-light](https://github.com/pamburus/hl-extra/raw/f1dd31cbcae4f373cafc70db85ce76b2ff60a577/screenshot/universal/light.png#gh-light-mode-only)
![screenshot-dark](https://github.com/pamburus/hl-extra/raw/f1dd31cbcae4f373cafc70db85ce76b2ff60a577/screenshot/universal/dark.png#gh-dark-mode-only)

See other [screenshots](https://github.com/pamburus/hl-extra/tree/f1dd31cbcae4f373cafc70db85ce76b2ff60a577/screenshot#readme)


## Features and usage
Expand Down
7 changes: 5 additions & 2 deletions contrib/bin/screenshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ALACRITTY=/Applications/Alacritty.app/Contents/MacOS/alacritty
HL_SRC=$(cd $(dirname ${0:?})/../.. && pwd)
MODE=${1:?}
SAMPLE=${2:?}
THEME=${3:?}
TITLE="hl ${SAMPLE:?}"

HL_CONFIG= "${ALACRITTY:?}" \
Expand All @@ -14,11 +15,13 @@ HL_CONFIG= "${ALACRITTY:?}" \
--hold \
-e \
"${HL_SRC:?}"/target/debug/hl \
--theme ${THEME:?} \
-P \
"${HL_SRC:?}"/sample/${SAMPLE:?} &

sleep 1
sleep 0.5

screencapture -l$(GetWindowID Alacritty "${TITLE:?}") "${HL_SRC:?}"/doc/screenshot-${MODE:?}.png
mkdir -p "${HL_SRC:?}"/extra/screenshot/${THEME:?}
screencapture -l$(GetWindowID Alacritty "${TITLE:?}") "${HL_SRC:?}"/extra/screenshot/${THEME:?}/${MODE:?}.png

kill $!
2 changes: 1 addition & 1 deletion contrib/etc/alacritty/light.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ white = "#c7c7c7"
black = "#676f78"
red = "#ff6d67"
green = "#5ff967"
yellow = "#fefb67"
yellow = "#decb00"
blue = "#6871ff"
magenta = "#ff76ff"
cyan = "#5ffdff"
Expand Down
Binary file removed doc/screenshot-dark.png
Binary file not shown.
Binary file removed doc/screenshot-light.png
Binary file not shown.
1 change: 1 addition & 0 deletions extra
Submodule extra added at 5364e5

0 comments on commit 78a053f

Please sign in to comment.