initial commit
This commit is contained in:
commit
2a16f20c4c
|
@ -0,0 +1,12 @@
|
|||
PREFIX?="/usr/local"
|
||||
BINDIR?="$(PREFIX)/bin"
|
||||
|
||||
install:
|
||||
@echo Installing the executable to $(BINDIR)
|
||||
@mkdir -p "$(BINDIR)"
|
||||
@cp -f shot "$(BINDIR)/shot"
|
||||
@chmod 755 "$(BINDIR)/shot"
|
||||
|
||||
uninstall:
|
||||
@echo Removing the executable from $(BINDIR)
|
||||
@rm -f $(BINDIR)/shot
|
|
@ -0,0 +1,13 @@
|
|||
# shot
|
||||
|
||||
## dependencies
|
||||
|
||||
shot needs `imagemagick` for taking screenshot,
|
||||
[pb][0] for uploading to 0x0,
|
||||
and `xclip` for copying links.
|
||||
|
||||
## installation
|
||||
|
||||
```bash
|
||||
mk install
|
||||
```
|
|
@ -0,0 +1,37 @@
|
|||
#!/bin/bash
|
||||
args=`getopt w $*`
|
||||
eval set -- "${args}"
|
||||
|
||||
directory="${HOME}/files/shot"
|
||||
flag_window=0
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
-w)
|
||||
flag_window=1
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z $1 ]; then
|
||||
filename="$(date +'screen_%T_%F')"
|
||||
else
|
||||
filename="${$1}"
|
||||
fi
|
||||
|
||||
if [ ${flag_window} -gt 0 ]; then
|
||||
import -window root "${directory}/${filename}.png"
|
||||
else
|
||||
import "${directory}/${filename}.png"
|
||||
fi
|
||||
|
||||
echo "${directory}/${filename}.png" | pb -f | tr -d '\n' | xc
|
||||
alert "Saved screenshot to ${directory}/${filename}.png and uploaded to $(xp)"
|
Loading…
Reference in New Issue