Starts work on ActOnLast

This is a script that provides context menus (via rofi) based on a
previous action.

It takes an optional --first argument that, when present, causes the
script to select the first option on the list automatically.

It currently has two actions that it knows how to follow:

* using my password manager script to select a password
    - In this situation it will get a otp for the same password
* After taking a screenshot
    - open the screenshot
    - Add a shadow to the screenshot
    - Perform ocr on the screenshot

I will extend this to do more things in time.
This commit is contained in:
Jonathan Hodgson 2021-11-18 11:29:18 +00:00
parent 8ea14abe9e
commit e325e49959
3 changed files with 129 additions and 31 deletions

View file

@ -56,6 +56,7 @@ function copy_password(){
exit 1
fi
echo "$pw" | clipboard
echo "password $password" > ~/.local/share/lastaction
notify-send -t 3000 "Password put on clipboard" "Will be removed in 3 seconds"
(
( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '3' & wait" )
@ -84,7 +85,7 @@ if [ -d "$PASSWORDS" ]; then
name="$(rofi -dmenu -p Name -lines 0)"
# Todo - create new passwords
else
if [ "$ret" -ne "11" ]; then
if [ "$ret" != "11" ]; then
copy_password "$selection" "$ret"
else
type_password "$selection" "$ret"