/madonctl-scripts

bash scripts for use with madonctl

Primary LanguageShellOtherNOASSERTION

Introduction

This repo consists of bash scripts (et cetera) for use with madonctl, the best solution for command line usage of Mastodon available, in my honest opinion.

Don't expect heavily polished stuff here. I generally make things as I go. madonctl is meant to be easily scriptable, which lends itself well to quick solutions.

Also, I'm working on a set of templates tweaked to my liking. I usually have an active tmux window of 5 panes, 4 of which are dedicated to madonctl. Using a fair amount of real estate, I like to keep things simple.

Scripts

  • toot has 3 forms, all of which take input from stdin and can optionally add a single attachment:
    1. toot dm [fileURL | path] creates a direct message. don't forget to include the mention.
    2. tootstatus-id | URL[ fileURL | path] will reply with appropriate visibility and mentions.
    3. toot [ fileURL | path] will create a new toot.
  • untootstatus-id | URL deletes toots.
  • mytoots shows recent mentions.
  • follows deals with follow requests. For each, you can accept/deny and assuming the former, follow back if you like.
  • followstatus-id | user-id | URL follows a user.
  • unfollowstatus-id | user-id | URL unfollows a user.
  • favstatus-id | URL just favorites.
  • booststatus-id | URL just boosts.
  • favbooststatus-id | URL boosts and favorites.
  • showstatus-id opens a toot in the browser.
  • tootmux adds my preferred set up to the current tmux window, occupying 60% of the total space:
    1. home stream (30%)
    2. local stream (30% - 10 lines)
    3. mentions-only notifications stream (6 lines)
    4. area for entering commands (2 lines)

Templates

  • mynotifications.tmpl to use with --template-file for notifications. pic of mynotifications.tmpl in action pic of mynotifications.tmpl with attachment
    • Bell at the beginning, which tmux makes visual.
    • Trimmed down to remove anything except stuff relevant to mentions. I don't care being notified about reblogs or favorites (but thank you for them!), so none of that is there.
    • Emojis for sensitive: true (⚠), visibility: direct (🔒), and whether or not there are attachments (📎).
    • No names, no attachment links.
    • As little as 2 lines (default can be up to 10 times that):
      1. status-id (reply-to-id as relevant), account and id, link to status
      2. spoiler (if available) followed by message.

Installation

Make sure that $HOME/bin is in your $PATH and fill it up with symlinks:

find /path/to/madonctl-scripts/src/scripts -type f -exec ln -s {} ~/bin \;

Compatibility

tl;dr Everything should Just Work™ with Mastodon instances running v2.0.0, which madonctl should be updated for at this point as well.

As of v2.0.0, id attributes are not returned as strings instead of integers. Whenever templating is employed, this is now represented as {{.id}} whereas previously it was {{printf "%.0f" .id}}. Naturally, if any conditionals are used, the logic will need to be a little different.

Support

Further questions and comments may be addressed to @wxl@soc.ialis.me

Shout outs

  • Super big thank yous to @McKael@mamot.fr for not only creating madonctl but for being so darn responsive to my many questions and suggestions. Someone give this guy a raise! (actually, there's a donation button on a website related to another project of his)
  • A special thank you to @redwolf@masto.io for the lovely example toot to show off my notifications template. It does seem to suggest that he (and/or me) is a perv, but in fact, it was a lovely picture of mating iguanas. Of course, he still might be a perv, but…
  • Thanks to @ghost@anticapitalist.party (who is super duper awesome and is always good for a thoughtful, in depth conversation!) for sending me a lovely pic of Alice in Wonderland. She's right, it's too darn cute!