summaryrefslogtreecommitdiffstats
path: root/.local/bin/dmscrot
diff options
context:
space:
mode:
authorJoe <bousset.rudy@gmail.com>2022-05-04 16:47:22 +0200
committerJoe <bousset.rudy@gmail.com>2022-05-04 16:47:22 +0200
commitf9bc9be726f3dbb829d5b6c20e0746b9048eaece (patch)
tree4428188c612451971bd17049db0d67cfb9ccac42 /.local/bin/dmscrot
parentupdate (diff)
downloaddotfiles-bsd-f9bc9be726f3dbb829d5b6c20e0746b9048eaece.tar.gz
dotfiles-bsd-f9bc9be726f3dbb829d5b6c20e0746b9048eaece.tar.bz2
dotfiles-bsd-f9bc9be726f3dbb829d5b6c20e0746b9048eaece.tar.xz
dotfiles-bsd-f9bc9be726f3dbb829d5b6c20e0746b9048eaece.tar.zst
dotfiles-bsd-f9bc9be726f3dbb829d5b6c20e0746b9048eaece.zip
scrot script update
Diffstat (limited to '.local/bin/dmscrot')
-rwxr-xr-x.local/bin/dmscrot35
1 files changed, 29 insertions, 6 deletions
diff --git a/.local/bin/dmscrot b/.local/bin/dmscrot
index 5a13835..0503abe 100755
--- a/.local/bin/dmscrot
+++ b/.local/bin/dmscrot
@@ -7,7 +7,8 @@ use constant {
SAVE_PATH => 'pics/scrot/',
SCREENSHOT_PATH => '/usr/local/bin/scrot',
IMGVIEW_PATH => '/usr/local/bin/nsxiv',
- XCLIP_PATH => '/usr/local/bin/xclip'
+ XCLIP_PATH => '/usr/local/bin/xclip',
+ NOTIFY_PATH => '/usr/local/bin/notify-send'
};
use constant LIST => [
'Select region',
@@ -29,6 +30,30 @@ sub show_img
return;
}
+sub notify_img
+{
+ my ($file) = @_;
+
+ system(
+ NOTIFY_PATH,
+ '-u', 'low',
+ '-t', '2000',
+ 'scrot',
+ 'a Screenshot captured to ' . "\n" .
+ '<b>' . $file . '</b>'
+ );
+ return;
+}
+
+sub clip_img
+{
+ my ($file) = @_;
+
+ chomp $file;
+ system('echo -n ' . $file . ' | ' . XCLIP_PATH);
+ return;
+}
+
sub file_name
{
my $file_name;
@@ -56,7 +81,6 @@ sub action
'-s',
'-l', 'mode=classic,style=dash,width=2,color=#990000'
);
- show_img($file_name);
}
elsif ($var eq ${+LIST}[1]) {
$file_name = file_name();
@@ -66,7 +90,6 @@ sub action
'-q', '100',
'-u'
);
- show_img($file_name);
}
elsif ($var eq ${+LIST}[2]) {
$file_name = file_name();
@@ -75,7 +98,6 @@ sub action
$file_name,
'-q', '100'
);
- show_img($file_name);
}
elsif ($var eq ${+LIST}[3]) {
$file_name = file_name();
@@ -85,7 +107,6 @@ sub action
'-q', '100',
'-a', '0,0,1920,1080'
);
- show_img($file_name);
}
elsif ($var eq ${+LIST}[4]) {
$file_name = file_name();
@@ -95,8 +116,10 @@ sub action
'-q', '100',
'-a', '1920,180,1440,900'
);
- show_img($file_name);
}
+ show_img($file_name);
+ notify_img($file_name);
+ clip_img($file_name);
return;
}