Giter Site home page Giter Site logo

who is using my camera? about dotfiles HOT 9 CLOSED

paulirish avatar paulirish commented on August 16, 2024
who is using my camera?

from dotfiles.

Comments (9)

vincepri avatar vincepri commented on August 16, 2024

lsof | grep -w "AppleCamera\|USBVDC\|iSight" | awk '{printf $2"\n"}' | xargs ps

This will output the COMMAND path using ps.

from dotfiles.

amboy00 avatar amboy00 commented on August 16, 2024

When I run imagesnap -l, the camera name is "FaceTime HD Camera". Maybe there is a way to search this without knowing the names. Maybe?

from dotfiles.

paulirish avatar paulirish commented on August 16, 2024

@vinceprignano 's solution is pretty tight

image

from dotfiles.

amboy00 avatar amboy00 commented on August 16, 2024

+1 Nice!

from dotfiles.

paulirish avatar paulirish commented on August 16, 2024

although it shows some stale matches:
image

but it seems like lsof isn't going to give us any recency sort.

from dotfiles.

vincepri avatar vincepri commented on August 16, 2024

Hmm. That's the same for me, even when the camera is not in use, the file descriptors seems to be open by Chrome. I suppose that's the intended behavior, will see if I find a better solution to match an actual active process.

from dotfiles.

paulirish avatar paulirish commented on August 16, 2024

TBH i'd be OK with dealing with the multiple results.
at least for now.

does this sort of design make sense to yall? someone wanna toss into a function and PR?

$ camerausedby
Checking to see who is using the iSight camera…
Results:
  PID   TT  STAT      TIME COMMAND
 1796   ??  S    216:57.68 /Applications/Google Chrome.app/Contents/MacOS/Google Chrome -psn_0_53261
 2090   ??  S      0:03.19 /Applications/Photo Booth.app/Contents/MacOS/Photo Booth
96675   ??  S     12:37.15 /opt/homebrew-cask/Caskroom/google-chrome-canary/latest/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary

from dotfiles.

vincepri avatar vincepri commented on August 16, 2024

Like this?

camerausedby() {
    echo "Checking to see who is using the iSight camera… 📷"
    usedby=$(lsof | grep -w "AppleCamera\|USBVDC\|iSight" | awk '{printf $2"\n"}' | xargs ps)
    echo -e "Results:\n$usedby"
}

from dotfiles.

paulirish avatar paulirish commented on August 16, 2024

lookin hot. i just pushed it.

thx yall!!

On Thu, Apr 9, 2015 at 10:40 AM, Vincenzo Prignano <[email protected]

wrote:

Like this?

camerausedby() {
echo "Checking to see who is using the iSight camera…"
usedby=$(lsof | grep -w "AppleCamera|USBVDC|iSight" | awk '{printf $2"\n"}' | xargs ps)
echo -e "Results:\n$usedby"
}


Reply to this email directly or view it on GitHub
#39 (comment).

from dotfiles.

Related Issues (20)

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.