Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI in 19 lines #2

Closed
rochacbruno opened this issue Sep 3, 2024 · 1 comment
Closed

UI in 19 lines #2

rochacbruno opened this issue Sep 3, 2024 · 1 comment

Comments

@rochacbruno
Copy link
Contributor

rochacbruno commented Sep 3, 2024

I added a simple UI so I am sharing it here:

Requirements:

  • YAD
  • AWK
  • not-my-ex

Saved this file ~/bin/post.sh

#!/bin/bash

export NOT_MY_EX_BSKY_PASSWORD="....."
export NOT_MY_EX_BSKY_EMAIL=fooo@bar.com
export NOT_MY_EX_MASTODON_INSTANCE=https://social.me.com
export NOT_MY_EX_MASTODON_TOKEN=sfsdffsdgsdfgsdfgsdfgsdfgsdfgsdfg
export NOT_MY_EX_DEFAULT_LANG=pt

yad --title='Not My Ex' \
    --text='New Post:' \
    --form \
    --field='Text:TXT' \
    --field="Image:FL" \
    "" "" | while read line; do
      TEXT=`echo $line | awk -F'|' '{print $1}'`
      IMAGE=`echo $line | awk -F'|' '{print $2}'`

    if [ -n "$IMAGE" ]; then
        IMAGE_FRAGMENT="--images $IMAGE"
    fi

    not-my-ex -y "$TEXT" $IMAGE_FRAGMENT
done

Then I configured a global keyborad shortcut Mod + P to execute the script and then post.

Screenshot_20240903_193007

I could add more 4 image dialogs but I was lazy.

@cuducos
Copy link
Owner

cuducos commented Sep 4, 2024

Feel free to add a contrib/ and some docs : ) I think a lot of people might like it!

@cuducos cuducos closed this as completed in cb6812a Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants