Skip to content

SGT-WATCH: A Bash script that monitors main.dart with real-time, military-themed feedback. Dramatic sergeant chatter for empty files, errors, or successes. Ideal for Dart beginners! 🚨

License

Notifications You must be signed in to change notification settings

BiqqMax/sgt-watch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SGT-WATCH

A fun Bash watcher for Dart β€” military-flavored feedback for beginners

Monitors main.dart for changes and responds with dramatic, sarcastic, and encouraging chatter. Great teaching tool for new Dart programmers.


Features

  • Watches main.dart for changes (Linux by default).
  • Military-style chatter for:
    • Empty files (sarcastic sergeants).
    • Errors (debug tips for common Dart exceptions such as NoSuchMethodError, FormatException, etc.).
    • Successful runs (celebratory messages).
  • Detects interactive programs and prints manual-run instructions (for stdin.readLineSync()-style code).
  • Optional Believing Soldier β€” encouraging messages to keep you motivated.
  • Idle chatter after 10 minutes of inactivity.
  • Customize all chatter via files in sgt_tmp/.
  • Username authentication for playful access control.
  • VS Code extension in development: sgt-watch-vscode.

Quick example

Create main.dart:

void main() {
  print('Hello, Dart programmers!');
}

You can install SGT-WATCH in multiple ways:

Option 1 β€” Clone the full repo (all files)

git clone https://github.com/BiqqMax/sgt-watch.git
cd sgt-watch
chmod +x sgt-watch.sh
./sgt-watch.sh

This gives you access to all helper files (including a main.dart file).

Option 2 β€” curl (single script only)

curl -O https://raw.githubusercontent.com/BiqqMax/sgt-watch/main/sgt-watch.sh
chmod +x sgt-watch.sh
./sgt-watch.sh

(This single script option runs the script directly after fetching β€” use with caution.)

Option 3 β€” wget (single script only)

wget https://raw.githubusercontent.com/BiqqMax/sgt-watch/main/sgt-watch.sh
chmod +x sgt-watch.sh
./sgt-watch.sh

(This single script option runs the script directly after fetching β€” use with caution.)

Option 4 β€” Git sparse-checkout (single file only)

git clone --no-checkout https://github.com/BiqqMax/sgt-watch.git
cd sgt-watch
git sparse-checkout init --cone
git sparse-checkout set sgt-watch.sh
git checkout main
chmod +x sgt-watch.sh
./sgt-watch.sh

(This single script option runs the script directly after fetching β€” use with caution.)

Option 5 β€” One-liner install script

sh -c "$(curl -fsSL https://raw.githubusercontent.com/BiqqMax/sgt-watch/main/sgt-watch.sh)"

(This One-liner option runs the script directly after fetching β€” use with caution.)

You will see sergeant-style messages, a radio-style report of program output, and an encouraging message from the Believing Soldier if enabled.


Prerequisites

  • Dart SDK β€” verify with dart --version.
  • Linux: inotify-tools and coreutils (e.g. sudo apt-get install inotify-tools coreutils).
  • macOS: install fswatch (brew install fswatch) and replace the watch command with fswatch -o \"$DART_FILE\" | while read -r; do ... in the script.
  • Windows: run under WSL2 and install the Linux dependencies.
  • Git β€” git --version.

Usage

  1. Run ./sgt-watch.sh and enter a username when prompted (default allowed users include admin, commander, general, captain, lieutenant).
  2. Edit and save your main.dart to trigger feedback:
    • Empty file: sarcastic sergeant lines.
    • Errors: error chatter with debug tips (e.g. β€œπŸ’‘ Use try-catch with int.parse()”).
    • Interactive code: instructions to run dart main.dart manually.
    • Success: celebratory messages and Believing Soldier encouragement (if enabled).
  3. Idle chatter starts after the configured delay (default 600 seconds / 10 minutes).

Configuration

Edit variables at the top of sgt-watch.sh:

Variable Default Description
DART_FILE main.dart File to monitor
IDLE_DELAY 600 Seconds before idle chatter
IDLE_INTERVAL 10 Seconds between idle messages
IDLE_CHATTER_COUNT 3 Max idle messages
BELIEVING_SOLDIER_ENABLED true Toggle encouraging messages
AUTH_USERS admin, commander, general, captain, lieutenant Allowed usernames

Customizable chatter files (sgt_tmp/)

On first run the script creates sgt_tmp/ with these files. Edit them to change the messages used by the watcher.

  • output_chatters_line1.txt, output_chatters_line2.txt β€” success messages
  • error_chatters_line1.txt, error_chatters_line2.txt β€” error messages
  • empty_chatter_line1.txt, empty_chatter_line2.txt β€” empty file messages
  • hush_chatters.txt, hush_instructions.txt β€” interactive-code messages
  • idle_chatters.txt, idle_notices.txt β€” idle messages
  • believing_soldier_chatters.txt β€” encouraging messages (if enabled)

You can use $USERNAME or $RANDOM_USER in these files to personalize messages.


Limitations

  • Linux-only by default (requires inotify-tools). macOS and Windows need adjustments.
  • Monitors a single file by default.
  • Covers common Dart errors but might miss rare cases.
  • The watcher uses a 2-second timeout for runs; long-running programs may be interrupted.

Contributing

  1. Fork the repo and create a branch: git checkout -b my-feature
  2. Commit your changes: git commit -m \"Add feature\"
  3. Push and open a pull request: git push origin my-feature

Report issues via GitHub Issues.


License

MIT License


Contact

Open an issue or ping on X (Twitter): @BiqqMax β€” tag #SGTWatch.


VS Code extension sgt-watch-vscode is in development for seamless IDE integration.

About

SGT-WATCH: A Bash script that monitors main.dart with real-time, military-themed feedback. Dramatic sergeant chatter for empty files, errors, or successes. Ideal for Dart beginners! 🚨

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published