38 lines
1.2 KiB
Text
38 lines
1.2 KiB
Text
|
#!/bin/bash
|
||
|
|
||
|
# screenie - capture a screenshot and use elixiremanager to send to
|
||
|
# elixi.re. uses flameshot as a drop-in replacement for kshare's "editing
|
||
|
# before sending" mechanic
|
||
|
|
||
|
# based off lynnesbian's sshotr.sh,
|
||
|
# https://gist.github.com/Lynnesbian/203e2a90a312cd02880f8e5762c01797
|
||
|
|
||
|
# this:
|
||
|
# - uses ~/Screenshots as a folder to store them all
|
||
|
# - requires notify-send, elixiremanager.sh requires it as well, so.
|
||
|
# - uses flameshot, more @ https://github.com/lupoDharkael/flameshot
|
||
|
# - On latest versions of flameshot, the Return key has been changed. You
|
||
|
# want to set the return key to copy image, rather than upload to imgur.
|
||
|
# - NOTE: press enter after doing a screenshot, instead of saving, for all
|
||
|
# of this to work
|
||
|
|
||
|
# change this if wanted
|
||
|
screenshot_folder="$HOME/Screenshots"
|
||
|
|
||
|
# set this to the path for elixiremanager.sh
|
||
|
elixiremanager="$HOME/.local/bin/elixiremanager.sh"
|
||
|
|
||
|
mkdir -p "$screenshot_folder"
|
||
|
date_str=$(date +'%Y-%m-%d-%H_%M_%S')
|
||
|
target="$screenshot_folder/screenie-$date_str.png"
|
||
|
|
||
|
maim -s "$target"
|
||
|
|
||
|
if [ ! -f "$target" ]; then
|
||
|
notify-send -t 5000 "screenshot not found, skipping sending"
|
||
|
else
|
||
|
notify-send -t 5000 "screenie: sending: $target"
|
||
|
source ~/.secrets
|
||
|
$elixiremanager "$target"
|
||
|
fi
|