racket / racket/drracket

Add default quickscripts

Open
#616 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
516
Forks
103
PR merge metrics
No merged PRs in 30d

Description

One of the features of DrRacket I am enthusiastic about is the Scripts capability.

I think it is fair to say that developers often find value in customising their tools to meet their needs.

The scripts functionality is a safe and beginner friendly way for new developers to do this without the risk of making change that negatively impacts their experience.

The list should be short - I would suggest the following would be sufficient

  • Open terminal - opens the terminal in the current folder
  • Get more scripts - only the script that opens the wiki page with more scripts to review and install.

The impact on the Racket installer would be minimal:

#lang racket/base
(require racket/system
         racket/path
         quickscript)

(script-help-string "Open a terminal in the directory of the current file.")

(define-script open-terminal
  #:label "Open terminal here"
  #:menu-path ("&Utils")
  #:os-types (unix macosx windows)
  (λ (str #:file f)
    (unless f
      (set! f (current-directory)))
    (define dir (path->string (path-only f)))
    (case (system-type 'os)
      [(unix)
       (system (string-append "gnome-terminal"
                              " --working-directory=\"" dir "\""
                              " -t \"" dir "\""
                              "&"))]
      [(macosx)
       (system
        (string-append "osascript -e 'tell app \"Terminal\" to do script \"cd \\\"" dir "\\\"\"'" ))]
      [(windows)
       (shell-execute #f "cmd.exe" "" dir 'sw_shownormal)])
    #false))
(define-script more-scripts
  #:label "Get more scripts (browser)"
  #:menu-path ("url2script")
  #:help-string "Opens the Racket wiki page for DrRacket Quickscript scripts."
  (λ (str) 
    (send-url "https://github.com/racket/racket/wiki/Quickscript-Scripts-for-DrRacket")
    #f))

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the quickscript API and the DrRacket installer integration described in the issue. Verify the proposed default scripts on Unix, macOS, and Windows; done means both scripts appear in the Scripts menu, open a terminal in the current folder where supported, and open the Quickscript wiki page.

Written by the indexing model from the issue text.

Assessment

Domain
desktop, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.