Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate all screenshots again #67

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

Quezler
Copy link
Contributor

@Quezler Quezler commented Jun 18, 2024

Hi, it's me again from #16 👋

I regret not having posted the scripts back then, but i recall it being a weird mess of autoclickers and resizing scripts, surely somewhere still on my device 2 laptops ago, but spending houuurs remaking it was easier than fetching the charging cable.

This pull request gives all the photos another onceover, but this time all the required scripts are included.

Since some themes include font changes all screenshots are in the dimension that'll fit the largest ones.

The included scripts are a little prone to error, but hey at least it's automated.

I would have preferred to clean it up a bit more, but half my day is gone on this already.

Was contemplating on stripping out the custom fonts/widths so all screenshots were uniform, but i couldn't get the templates to behave even when removing some stuff from the plist and people might want to choose based on the font/spacing anyways.

Since it's a little messy i'll just leave it in draft mode for now, feel free to merge as is or clean up some of it.

Afterglow is still my favorite and every new computer i use leads me back to this repo, you have my thanks. 🫡

Contents of the applescript file: (opening it on mac gives this text too, but reviewing it as a pr is a tad inconvenient)

set scriptPath to (path to me as string)
set scriptPath to POSIX path of scriptPath

set AppleScript's text item delimiters to "/"
set scriptPathList to text items of scriptPath
set AppleScript's text item delimiters to ":"
set scriptDir to items 1 thru -2 of scriptPathList as string

set scriptDir to POSIX path of scriptDir
set command to "clear && bash /" & scriptDir & "/preview.sh && echo && echo && echo"
command

tell application "Terminal"
	activate
	do script command in front window
	
	set currentSettings to current settings of front window
	set font size of currentSettings to 14
	set current settings of front window to currentSettings
	
	set currentWindow to front window
	set windowID to id of currentWindow
	#log windowID
	
	set screenshot_filename to "/" & scriptDir & "/screenshot-in.png"
	set screenshot_command to "screencapture -o -l " & windowID & " " & quoted form of screenshot_filename
	#log screenshot_command
	
	delay 1
	do script screenshot_command in front window
	
	delay 1 # or the screenshot somehow stays blank
	close (every window whose id is windowID)
end tell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant