use FindBin;
use Getopt::Long;
-use Pod::Usage;
use Mail::IMAPTalk;
use MIME::Base64;
+use Pod::Usage;
+use Proc::ProcessTable;
use lib "$FindBin::Bin/../lib";
local $0 = "$FindBin::Script " . join ' ', @ARGV;
+my $processes = Proc::ProcessTable->new;
+
+for my $process (@{$processes->table}) {
+ if ($process->cmndline eq $0 and $process->pid != $$) {
+ verbose "$FindBin::Script already running";
+
+ exit 0;
+ } # if
+} # for
+
my $defaultIMAPServer = 'defaria.com';
my $IMAP;
my %unseen;
#!/bin/bash
-gnome-screenshot -caf /System/tmp/Screenshot-$(date +%F@%T).png
+timeout=10
+screenshot_directory=/tmp
+
+function yesno {
+ question=$1
+
+ zenity --question --text "$question" --width=300 --timeout=$timeout 2> /dev/null
+}
+
+mate-screenshot -ac
+
+file="$screenshot_directory/Screenshots/$(date +%F@%T).png
+
+if yesno "Save screenshot as $file?"; then
+ xclip -selection clipboard -t image/png -o > $file
+fi
#!/bin/bash
-gnome-screenshot -cwf /System/tmp/Screenshot-$(date +%F@%T).png
+timeout=10
+screenshot_directory=/tmp
+
+function yesno {
+ question=$1
+
+ zenity --question --text "$question" --width=300 --timeout=$timeout 2> /dev/null
+}
+
+mate-screenshot -wc
+
+file=$screenshot_directory/Screenshots/$(date +%F@%T).png
+
+if yesno "Save screenshot as $file?"; then
+ xclip -selection clipboard -t image/png -o > $file
+fi
fi
fi
-if [ $host = "earth" ]; then
+#if [ $host = "earth" ]; then
export DISPLAY=:1
-else
- export DISPLAY=:0
-fi
+#else
+# export DISPLAY=:0
+#fi
sleep 2
/usr/local/bin/setdpms.sh
use strict;
use warnings;
+use experimental qw(signatures);
use FindBin;
use Getopt::Long;
return @images;
} # fillPictures
-sub writeHistory($) {
- my ($msg) = @_;
-
+sub writeHistory($msg) {
open my $hist, '>>', "$ENV{HOME}/.$FindBin::Script.hist"
or error "Unable to open $ENV{HOME}/.$FindBin::Script.hist for append - $!", 1;
$msg = localtime() . $msg;
- display $msg, $hist;
+ print $hist $msg;
close $hist;
} # writeHistory
-sub updateSetBG($$) {
- my ($bgimage, $lockimage) = @_;
+sub writeSetBG ($filename, $image) {
+ open my $file, '>', $filename
+ or error "Unable to open $filename for writing - $!", 1;
- open my $setbg, '>', "$ENV{HOME}/.$FindBin::Script"
- or error "Unable to open $ENV{HOME}/.$FindBin::Script for writing - $!", 1;
+ print $file "$image\n";
- display $bgimage, $setbg;
+ close $file;
+} # writeSetBG
- close $setbg;
+sub updateSetBG($bgimage, $lockimage) {
+ writeSetBG "$ENV{HOME}/.$FindBin::Script", $bgimage;
+ writeSetBG "$ENV{HOME}/.$FindBin::Script.lock", $lockimage;
my $msg = ":$bgimage";
$msg .= " lock:$lockimage" if $opts{lockscreen};
if ($opts{mate}) {
$setbgOpts = 'set org.mate.background picture-filename ';
- $setLockOpts = 'set org.mate.background picture-filename ';
+ $setLockOpts = 'set org.mate.screensaver picture-filename ';
} else {
$setbgOpts = "set org.gnome.desktop.background picture-uri \"file://";
$setLockOpts = "set org.gnome.desktop.screensaver picture-uri \"file://";
#!/bin/bash
-# Odd. Seems the following causes wget to use IPv6 instead of IPv4. Well
-# recently we turned off IPv6 because we suspect this causes our WiFi
-# dropout problem. But then this hangs.
-#wget -O /tmp/calendar.$$.ics 'https://www.google.com/calendar/ical/adefaria%40gmail.com/public/basic.ics' >> /tmp/updateCalendar.$$.log 2>&1
-wget --no-check-certificate -O /tmp/calendar.$$.ics 'https://172.217.11.174/calendar/ical/adefaria%40gmail.com/public/basic.ics' >> /tmp/updateCalendar.$$.log 2>&1
+wget -O /tmp/calendar.$$.ics https://calendar.google.com/calendar/ical/adefaria%40gmail.com/public/basic.ics > /tmp/updateCalendar.$$.log 2>&1
wget -O /tmp/meetups.$$.ics 'http://www.meetup.com/events/ical/10426135/8dfdd0ffaaedecf720c5faf0cf3871b7ee5f5c1e/going' >> /tmp/updateCalendar.$$.log 2>&1
-
wget -4 -O /tmp/tripit.$$.ics 'http://www.tripit.com/feed/ical/private/06C4F90D-EFEFB9C5FDB17EC5FCB327DE31A54D96/tripit.ics' >> /tmp/updateCalendar.$$.log 2>&1
# Now let's combine the files. First strip off the END:CALENDAR from the main
# Set display to local
export DISPLAY=${DISPLAY:-:0}
-# New tmp location
-if [ -d /System/tmp ]; then
- export TMP=/System/tmp
-fi
-
# Reset home in case it changed
HOME=$saved_home
StrictHostKeyChecking no
LogLevel ERROR
-Host mars earth home defaria.com
+Host mars earth home defaria.com sandboxu
ForwardX11 yes
ForwardX11Trusted yes
-Host jupiter cpanel github.com sandbox sandboxal sandboxu
+Host jupiter cpanel github.com sandbox sandboxal
ForwardX11 no
ForwardX11Trusted no
Hostname 10.2.99.106
IdentityFile ~/.ssh/cpanelkey
-Host enterprise.cpanel.net
- IdentityFile ~/.ssh/cpanelkey
-
Host 10.2.* sandbox*
ForwardAgent yes
StrictHostKeyChecking no