commit 432335a837090bf6d04d3dba5fbde67fa14457cc from: Omar Polo date: Mon Feb 21 14:54:37 2022 UTC +sshot commit - 662b0d0590add27fc0f37b3c1a91b05692b75c6f commit + 432335a837090bf6d04d3dba5fbde67fa14457cc blob - /dev/null blob + 2263c1ca1f34bcd3badbd4025fc869bb97c6e236 (mode 644) --- /dev/null +++ bin/sshot.lp @@ -0,0 +1,40 @@ +# sshot + +sshot is a simple script to make a screenshot! + + #!/bin/sh + + select= + while getopts s name; do + case $name in + s) select=1 ;; + ?) echo "Usage: $0 [-s]" >&2; exit 1 ;; + esac + done + +The usage is simple, it just accepts a -s flag to select a window +instead of grabbing the whole screen. + +The image is saved in /tmp/YYYYMMDDHHMMSS.png + + file=/tmp/`date +%Y%m%d%H%M%S`.png + + if [ -n "$select" ]; then + maim -su > "$file" + else + maim -u > "$file" + fi + +During the "select" maim aborts if a key is pressed; this however leaves +a zero-byte file around, something I don't really like, so remove it in +case + + if [ $? -ne 0 ]; then + rm "$file" + notify-send "sshot: aborted" + exit 1 + fi + +Then send a notification to give a feedback of the success + + notify-send "sshot: done" "$file" blob - 7f88a4b33886cc971e44f8804325abe97531702c blob + 6830a53c1fa9ca1fcb5371b11ecd05c5b1501a97 --- gen +++ gen @@ -49,8 +49,10 @@ pair .kshrc kshrc.lp pair lib/profile rc.lp pair .sqliterc sqliterc.lp pair .psqlrc psqlrc.lp + pair bin/acmerc bin/acmerc.lp +x pair bin/browser bin/browser.lp +x +pair bin/sshot bin/sshot.lp +x conv index index.lp for file in $files; do