Skip to content

Instantly share code, notes, and snippets.

@CodeLongAndProsper90
Last active July 10, 2020 21:06
Show Gist options
  • Save CodeLongAndProsper90/e4bfcf5b7d5cb4556a0177fe30e4264f to your computer and use it in GitHub Desktop.
Save CodeLongAndProsper90/e4bfcf5b7d5cb4556a0177fe30e4264f to your computer and use it in GitHub Desktop.

Revisions

  1. CodeLongAndProsper90 revised this gist Jul 10, 2020. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions shot.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #!/bin/bash
    !/bin/bash

    if ! test -d ~/Screenshots
    then
    @@ -18,7 +18,7 @@ fi

    if [ "$1" == "instant" ] || [ "$1" == "i" ]
    then
    scrot ~/Screenshots/`date +%s`
    scrot ~/Screenshots/`date +%s`.png

    elif [ "$1" == "gimp" ] || [ "$1" == "g" ]
    then
    @@ -33,13 +33,13 @@ elif [ "$1" == "gimp" ] || [ "$1" == "g" ]

    fi

    scrot ~/Screenshots/`date +%s`
    gimp ~/Screenshots/`date +%s`
    rm -f ~/Screenshots/`date +%s`
    scrot ~/Screenshots/`date +%s`.png
    gimp ~/Screenshots/`date +%s`.png
    rm -f ~/Screenshots/`date +%s`.png

    elif [ "$1" == "delay" ] || [ "$1" == "d" ]
    then
    scrot ~/Screenshots/`date +%s` --delay "$2"
    scrot ~/Screenshots/`date +%s`.png --delay "$2"
    else
    echo "[i]nstant: Take a screenshot"
    echo "[g]IMP: Open in the GIMP"
  2. CodeLongAndProsper90 created this gist Jul 10, 2020.
    54 changes: 54 additions & 0 deletions shot.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    #!/bin/bash

    if ! test -d ~/Screenshots
    then
    mkdir ~/Screenshots
    fi

    if ! command -v scrot &> /dev/null

    then

    echo "scrot not installed or missing from \$PATH. Cannot continue."
    echo "Stop."

    exit 1

    fi

    if [ "$1" == "instant" ] || [ "$1" == "i" ]
    then
    scrot ~/Screenshots/`date +%s`

    elif [ "$1" == "gimp" ] || [ "$1" == "g" ]
    then
    if ! command -v gimp &> /dev/null

    then

    echo "gimp not installed or missing from \$PATH. Cannot continue."
    echo "Stop."

    exit 1

    fi

    scrot ~/Screenshots/`date +%s`
    gimp ~/Screenshots/`date +%s`
    rm -f ~/Screenshots/`date +%s`

    elif [ "$1" == "delay" ] || [ "$1" == "d" ]
    then
    scrot ~/Screenshots/`date +%s` --delay "$2"
    else
    echo "[i]nstant: Take a screenshot"
    echo "[g]IMP: Open in the GIMP"
    echo "[d]elay: Delay $2 seconds"

    echo ""

    echo "Exit status 0: Finshed"
    echo "Exit status 1: Missing dependences"


    fi