Giter Site home page Giter Site logo

ocss's Issues

Is_mac does not work

Hi,

the is_mac as function does not really work, it always uses the "linux"-case. Perhaps you have an idea to make it work. I could test it for you, if you dont have a mac system.

Cu

Robin

Mac not working

Hi there,

using the script with mac doesnt work. Because you use gnome-screenshot is not available on mac an there is no else case for this.

Perhaps you could do something like this:

function take_screenshot() {
  echo "Please select area"
  is_mac || sleep 0.1 # https://bbs.archlinux.org/viewtopic.php?pid=1246173#p1246173

  if(is_mac)
  then
    screencapture -s "$1" &>/dev/null
  else
      if ! (gnome-screenshot -a -f "$1" &>/dev/null || gnome-screenshot -a -f "$1" &>/dev/null); then #takes a screenshot with selection
        echo "Couldn't make selective shot (mouse trapped?). Trying to grab active window instead"
        if ! (gnome-screenshot -wb -f "$1" &>/dev/null || gnome-screenshot -wb -f "$1" &>/dev/null); then
          echo "Error for image '$1'!" >> "$log_file"
          echo "Error for image '$1'!"
          notify error "Something went wrong :(" "Information has been logged"
          exit 1
        fi
      fi
  fi
}

screencapture -s

-s = Selection Mode

Hope it helps

Robin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.