Comments (9)
lsof | grep -w "AppleCamera\|USBVDC\|iSight" | awk '{printf $2"\n"}' | xargs ps
This will output the COMMAND
path using ps.
from dotfiles.
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.
@vinceprignano 's solution is pretty tight
from dotfiles.
+1 Nice!
from dotfiles.
although it shows some stale matches:
but it seems like lsof isn't going to give us any recency sort.
from dotfiles.
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.
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.
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.
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)
- Consider fnm (Fast Node Manager) HOT 1
- Screenshot in README
- [contribute] useful function set proxy
- localip sed illegal option HOT 6
- [Suggestion] Allow more fine grained installation of dotfiles HOT 3
- [Suggestion] use pigz instead of gzip HOT 1
- import * from bash-sensible
- Ctrl left, Ctrl right shortcuts from .inputrc not workign after update to El Capitan HOT 3
- [vim] FastEscape seems to affect inoremap HOT 3
- ip doesnt work HOT 2
- Why do we require `templatedir = ~/.git_template` HOT 4
- brew-cask.sh browser casks no longer available HOT 4
- Pearl package manager HOT 1
- Typo? HOT 2
- brew_bash_completion.sh: No such file or directory HOT 1
- About setup fish HOT 1
- histappend not being set, since shopt is a shell builtin HOT 2
- entr is deprecated HOT 2
- dircolors: command not found HOT 1
- Could not write domain ~/Library/Preferences/ByHost/com.apple.systemuiserver HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotfiles.