diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-02-05 17:52:34 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-02-05 17:52:34 +0100 |
commit | 21c4996c71d76b01a4333ef9905589b3fffa687d (patch) | |
tree | bbf41aa6c88d6875181f0089273567f47fb58209 /cam |
Initial commit (upstream 1.3.4)
Diffstat (limited to 'cam')
-rw-r--r-- | cam/ChangeLog | 14 | ||||
-rw-r--r-- | cam/Makefile.am | 11 | ||||
-rw-r--r-- | cam/Makefile.in | 214 | ||||
-rw-r--r-- | cam/README | 45 | ||||
-rwxr-xr-x | cam/cam | 192 | ||||
-rw-r--r-- | cam/cam_bookmarks | 24 | ||||
-rwxr-xr-x | cam/gen_cam_menu.sh | 41 |
7 files changed, 541 insertions, 0 deletions
diff --git a/cam/ChangeLog b/cam/ChangeLog new file mode 100644 index 0000000..4a562bd --- /dev/null +++ b/cam/ChangeLog @@ -0,0 +1,14 @@ +0.3 +--- +- added this changelog.. + +0.4 +--- +- added richlowe's patch. since he pretty much rewrote everything, he's +an author, not a contributor. :) +- uses "use strict" now +- uses POD for documentation +- added title support in cam bookmarks file +- cmd line flag for different bookmars file +- getoppt_long use for command-line flags +- rmeoved richlow's damn nonstandard Pod::Usage stuff diff --git a/cam/Makefile.am b/cam/Makefile.am new file mode 100644 index 0000000..fb14a22 --- /dev/null +++ b/cam/Makefile.am @@ -0,0 +1,11 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = 1.4 foreign + +# A list of all the files in the current directory which can be regenerated +MAINTAINERCLEANFILES = Makefile.in + +EXTRA_DIST = README cam_bookmarks cam gen_cam_menu.sh + +camdir = $(bindir) +cam_SCRIPTS = cam gen_cam_menu.sh diff --git a/cam/Makefile.in b/cam/Makefile.in new file mode 100644 index 0000000..97f79ca --- /dev/null +++ b/cam/Makefile.in @@ -0,0 +1,214 @@ +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +GIBLIB_CFLAGS = @GIBLIB_CFLAGS@ +GIBLIB_LIBS = @GIBLIB_LIBS@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_LIB = @HAVE_LIB@ +HAVE_XINERAMA = @HAVE_XINERAMA@ +IMLIB_CFLAGS = @IMLIB_CFLAGS@ +IMLIB_LIBS = @IMLIB_LIBS@ +LIB = @LIB@ +LTLIB = @LTLIB@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +UP = @UP@ +VERSION = @VERSION@ +XINERAMA_LIBS = @XINERAMA_LIBS@ + +AUTOMAKE_OPTIONS = 1.4 foreign + +# A list of all the files in the current directory which can be regenerated +MAINTAINERCLEANFILES = Makefile.in + +EXTRA_DIST = README cam_bookmarks cam gen_cam_menu.sh + +camdir = $(bindir) +cam_SCRIPTS = cam gen_cam_menu.sh +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../src/config.h +CONFIG_CLEAN_FILES = +SCRIPTS = $(cam_SCRIPTS) + +DIST_COMMON = README ChangeLog Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps cam/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +install-camSCRIPTS: $(cam_SCRIPTS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(camdir) + @list='$(cam_SCRIPTS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(camdir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $$p $(DESTDIR)$(camdir)/`echo $$p|sed '$(transform)'`; \ + else if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(camdir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(camdir)/`echo $$p|sed '$(transform)'`; \ + else :; fi; fi; \ + done + +uninstall-camSCRIPTS: + @$(NORMAL_UNINSTALL) + list='$(cam_SCRIPTS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(camdir)/`echo $$p|sed '$(transform)'`; \ + done +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = cam + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-camSCRIPTS +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-camSCRIPTS +uninstall: uninstall-am +all-am: Makefile $(SCRIPTS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(camdir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: uninstall-camSCRIPTS install-camSCRIPTS tags distdir info-am \ +info dvi-am dvi check check-am installcheck-am installcheck \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/cam/README b/cam/README new file mode 100644 index 0000000..281c550 --- /dev/null +++ b/cam/README @@ -0,0 +1,45 @@ +Cam 0.4 README +============== +This document was last updated on 20010223-1620-PST. +Please see the file COPYING for licensing information. + +Description +=========== +Cam is a Perl wrapper for feh that simlifies viewing webcams. Cam uses +keyed bookmarks. Type "cam --help" at the command line for usage +information. + +Webcam Information +================== +All webcam images are the property of their respective owners. If you +enjoy the cam, you should check out the page too! The initial list of +cam bookmarks (in the cam_bookmarks file) is a combination of webcams +scoured from the #E People Page (http://bma.debian.net/~bma/e-irc/), +my favorite webcams from the Stile Project's cam pages +(http://www.stileproject.com/), and additional #e people cams that +have come online since cam's original release (0.1). + +Installation +============ +- Copy the "cam" script to a location in your PATH (ex /usr/bin, + /usr/local/bin, or $HOME/bin), and make sure hte execute bit on the + script is set (type "chmod a+x $HOME/.cam_bookmarks"). +- Copy the "cam_bookmarks" file to $HOME/.cam_bookmarks and make sure + cam can see it by typing "cam --list". +- Optionally, modify the options inside the cam script. You can pass + feh any options before the image by adjusting the $PRE variable, + and any options after the image by adjustin the $POST variable. + For example, I like to keep all cam images by default; you can enable + this behavior with the -k command line option, or enable it permanently + by adding it to the $PRE flags in cam. + +About the Authors +================= +Paul Duncan <pabs@pablotron.org>, pabs on #e +http://www.pablotron.org/ + +Richard Lowe <richlowe@btinternet.com>, richlowe on #e +http://www.richlowe.btinternet.co.uk/ + +...but the real credit goes to Tom Gilbert for making feh, an awesome +image viewer. :) @@ -0,0 +1,192 @@ +#!/usr/bin/perl -w + +use strict; +use Getopt::Long; + +############################################# +############# CAM RUN-TIME OPTIONS ########## +############################################# +my $feh = "feh"; + +# additional feh cmdline options +my $PRE = " -q -G -Twebcam -1 0 -0 1 "; +my $POST = ""; +############################################# +############################################# + +# Options +my $help = ''; +my $fullscreen = ''; +my $geometry = ''; +my $list = ''; +my $verbose = ''; +my $add = ''; +my $keep = ''; +my $deftitle = '%cCAM - %u'; +my $title = ''; +my $bp = $ENV{HOME}."/.cam_bookmarks"; +my $DEBUG = 0; + +# check args +&print_usage_and_exit unless (@ARGV); + + +# Url, Refresh, and bookmarks +my $url = ""; +my $ref = ""; +my %bms = (); + +GetOptions('help|?|h' => \$help, + 'full-screen|f|giblets-mom' => \$fullscreen, + 'list|l' => \$list, + 'geometry|g=s' => \$geometry, + 'verbose|v' => \$verbose, + 'add|a' => \$add, + 'keep-images|k|save-pr0n' => \$keep, + 'title|t=s' => \$title, + 'debug|d' => \$DEBUG, + 'bookmarks|b=s' => \$bp + ); + +my $key = shift @ARGV; + +&print_usage_and_exit if ($help); + +if ($verbose) { + $PRE .= " -V "; +} + +if ($fullscreen) { + $PRE =~ s/-w//; + $PRE .= " --full-screen --auto-zoom "; +} + +if ($geometry) { + $PRE .= " --geometry $geometry "; +} + +# if requested, add a key/url pair to bookmarks file +if ($add) { + my $mytitle = ''; + ($url,$ref,$mytitle) = @ARGV; + die "Bad key syntax\n" unless ($key && $url && $ref); + + $mytitle="" unless ($mytitle); + + open(BMF, ">>$bp") or die "Couldn't open bookmarks file \"$bp\": $!\n"; + print BMF "$key=$ref,$url \"$mytitle\"\n"; + close BMF; + print "Added URL key \"$key\" = $url, $ref.\n"; # its useful to have this even if you arent debugging --richlowe + exit 0; +} + +if ($keep) { + $PRE .= " -k "; +} + + + +# load bookmarks +open(BMF, "$bp") or die "Couldn't open bookmarks file \"$bp\": $!\n"; +foreach (<BMF>) { + next unless /^(.*?)=(.*)$/; + $bms{$1} = $2; + print "key=$1, url=$2\n" if ($DEBUG); +} +close BMF; + +# if requested, dump a list of key/url pair values +if ($list) { + foreach (sort keys %bms) { + my $t = $bms{$_}; + + $t =~ s/^(.+?),(.+?)(^ "(.*)"|)?$/$2/; + chomp $t; + print "$_ = $t, $1, $3\n"; + } + exit 0; +} + +# main loop +MAIN: { + do { + $title=""; + $url = $bms{$key}; + die "Couldn't find URL key \"$key.\"\n" unless($url); + + $url =~ s/^(.+?),(.+?)( "(.*)")?$/$2/; + $ref = $1; + + if ($4) { + $title = $4; + } else { + $title = $deftitle; + } + + if ($title) { + $title =~ s/\%c/$key/g; + $title =~ s/\%u/$url/g; + $title =~ s/\%r/$ref/g; + $title =~ s/\%\%/\%/g; + $title = " --title \"$title\" "; + } + + my $cmd = "$feh $PRE $title -T".$key."cam -R $ref $url $POST"; + print "$cmd\n" if ($DEBUG); + FORK: { + my $pid; + if ($pid = fork) { + # We're a daddy! :) + } elsif (defined $pid) { + # child + exec "$cmd" or die "Couldnt exec() $feh: $!\n"; + } elsif ( $! =~ /No more process/) { + sleep 5; + redo FORK; + } else { + # wtf? + die "Unrecoverable fork() error: $!\n"; + } + } + } while ($key = shift @ARGV); +} + + +sub print_usage_and_exit() { + print <<END_USAGE; +$0 0.4 +by Paul Duncan <pabs\@pablotron.org>, and + Richard Lowe <richlowe\@btinternet.com> + +Description: + A convenient webcam wrapper for feh. + +Usage: + $0 <keys> + Load the urls specified by the given keys. + key : a url key stored in the bookmarks file (\"$bp\"). + $0 <-a|--add> key url refresh + Add a key to the bookmarks file. + key : short key (ex \"jenni\"), + url : url (ex \"http://www.jennicam.org/webcam/cam.jpg\"), + refresh : refresh, in seconds (ex 120) + $0 <-l|--list> + List each url key in the bookmarks file (\"$bp\"). + $0 [-f|--full-screen] keys + Start feh in full-screen mode (aka --giblets-mom \"viewing\" mode). + $0 [-k|--keep-images] keys + Save each image in the current directory (aka --save-pr0n). + $0 [-g|--geometry] xxx + Use window geometry xxx (e.g. 640x480). + $0 [-v|--verbose] options + Start feh in verbose mode (feh -V). + $0 <-h|-?|--help> + Display usage information (this screen). + +Notes: +Thanks to giblet for feh, an awesome image and webcam viewing program, +and raster for Imlib2. +END_USAGE + exit(-1); +} + diff --git a/cam/cam_bookmarks b/cam/cam_bookmarks new file mode 100644 index 0000000..5a5f100 --- /dev/null +++ b/cam/cam_bookmarks @@ -0,0 +1,24 @@ +giblet=20,http://geeks.linux.com/~gilbrit/images/webcam.jpg +raster=120,http://www.rasterman.com/webcam/cam.jpg +raster_work=20,http://www.rasterman.com/webcam/cam2.jpg +dawn=240,http://www.suburbanchaos.com/cammie.jpg +jenni=600,http://www.jennicam.org/guests/cam.jpg +milo=300,http://www.mil0.com/images/webcam32.jpg +juju=300,http://www.jujucam.com/8533362.jpg +puce=300,http://www.puce.com/cam/puce.jpg +codi=300,http://manifestangel.com/codi/webcam32.jpg +dphase=20,http://saturn5.locnet.net/dphase/seed.jpg +mandrake=20,http://www.mandrake.net/mandrake-cam.jpg +kaitlin=300,http://illusion.org/webcam/krs.jpg +demonishi=20,http://demonishi.net/webcam.jpg +sbizz=10,http://voyeur.nontoxic.org/~webcam/webcam.jpg +schmoo=20,http://www.schmoo.org/bouncycam/pic/image.jpg +fusion94=20,http://fusion94.sourceforge.net/cam/webcam.jpg +ng=20,http://www.shagged.org/~ng/images/webcam.jpg +x5rings=30,http://x5rings.fsck.org/webcam/webcam.jpg +mich=30,http://mich.unelite.net/dorkarus/mich.jpg +deuce=30,http://home.pablotron.org/~cam/webcam.jpg +nasa_shuttle=60,http://science.ksc.nasa.gov/shuttle/countdown/video/chan2large.jpg +rock104=10,http://www.rock104.com/campict/fullsize.jpg +richlowe=30,http://www.richlowe.btinternet.co.uk/images/webcam.jpg + diff --git a/cam/gen_cam_menu.sh b/cam/gen_cam_menu.sh new file mode 100755 index 0000000..9fe3770 --- /dev/null +++ b/cam/gen_cam_menu.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +###################################################################### +# gen_cam_menu.sh 0.1 # +# by Paul Duncan <pabs@pablotron.org> # +# # +# This script will generate a menu of cam bookmarks for # +# Enlightenment DR0.16.x. TYou can safely run this script more than # +# once; it won't add an another entry to the left-click menu if it's # +# already been run once. It doesn't delete any existing menu # +# entries, and it backs up your existing menu files as well. (just # +# in case I screwed up.. hehe). THe two variables below allow you # +# rename the left-click menuitem, and the menu title. # +# # +# # +MENU_ITEM="Webcams"; # +MENU_TITLE="Webcam List"; # +BMARKS=$HOME"/.cam_bookmarks"; # +# # +###################################################################### + + +C_MENUFILE="webcam.menu"; +F_MENUFILE="file.menu"; +C_MENU=$HOME"/.enlightenment/"$C_MENUFILE; +F_MENU=$HOME"/.enlightenment/"$F_MENUFILE; + +# make backups, just in case +cp -f $C_MENU $C_MENU"-cam_menu.backup" +cp -f $F_MENU $F_MENU"-cam_menu.backup" + +# generate cam menu +echo "Generating \""$C_MENU"\"."; +echo "\"$TITLE\"" > "$C_MENU"; +cat $BMARKS | perl -e "while (<>) { /(.*?)=/; \$keys{\$1}=\"1\"; } foreach(sort keys %keys) { /(.)(.*$)/; print \"\\\"\".uc(\$1).\"\$2\\\" NULL exec \\\"cam \$1\$2\\\"\\n\"; }">> $C_MENU; + +# add entry to file menu if there isn't one +echo "Generating \""$F_MENU"\"."; +perl -i -e "\$already_there=0; while (<>) { \$already_there++ if (/$MENU_ITEM/); print \"\\\"$MENU_ITEM\\\" NULL menu \\\"$C_MENUFILE\\\"\\n\" if (!\$already_there&&/Restart/); print; }" $F_MENU; + +echo "Done."; |