Rewrite screenshot cleanup in bash with cross-platform support#68
Draft
Rewrite screenshot cleanup in bash with cross-platform support#68
Conversation
Co-authored-by: colindean <197224+colindean@users.noreply.github.com>
Co-authored-by: colindean <197224+colindean@users.noreply.github.com>
Co-authored-by: colindean <197224+colindean@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Rewrite screenshot cleanup script in bash
Rewrite screenshot cleanup in bash with cross-platform support
Feb 5, 2026
colindean
requested changes
Feb 5, 2026
Co-authored-by: colindean <197224+colindean@users.noreply.github.com>
colindean
requested changes
Feb 9, 2026
|
|
||
| # Create test files with valid Linux screenshot names | ||
| local old_date | ||
| old_date=$(date -d "10 days ago" "+%Y-%m-%d") |
Owner
There was a problem hiding this comment.
suggestion: @copilot This doesn't work on macOS:
(in test file tests/test_screenshot_cleanup.bats, line 184)
`old_date=$(date -d "10 days ago" "+%Y-%m-%d")' failed
date: illegal option -- d
usage: date [-jnRu] [-I[date|hours|minutes|seconds|ns]] [-f input_fmt]
[ -z output_zone ] [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
[[[[mm]dd]HH]MM[[cc]yy][.SS] | new_date] [+output_fmt]
Add something here so that it'll work on macOS.
|
|
||
| # Calculate a timestamp from 10 days ago | ||
| local ten_days_ago | ||
| ten_days_ago=$(date -d "10 days ago" "+%Y-%m-%d %H:%M:%S") |
Owner
There was a problem hiding this comment.
suggestion: @copilot This doesn't work on macOS:
(in test file tests/test_screenshot_cleanup.bats, line 184)
`ten_days_ago=$(date -d "10 days ago" "+%Y-%m-%d")' failed
date: illegal option -- d
usage: date [-jnRu] [-I[date|hours|minutes|seconds|ns]] [-f input_fmt]
[ -z output_zone ] [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
[[[[mm]dd]HH]MM[[cc]yy][.SS] | new_date] [+output_fmt]
Add something here so that it'll work on macOS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Screenshot Cleanup Bash Rewrite Plan
get_screenshot_dir()) that usesuname -sto determine macOS or Linuxextract_timestamp())age_in_days())trash())archive())process_archive())process_screenshots())defaults read com.apple.screencapture locationgsettingsfor screenshot location and filename templatescreenshot_cleanup.shtoscreenshot_cleanupuses:format for Dependabot compatibility--yesand--no-install-recommendsget_screenshot_pattern()functionOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.