Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

How to use nanotodon on OpenBSD

0. What is nanotodon?

Nanotodon is text-based Mastodon client developed by kagura1050(Takaki Yoda).

nanotodon

1. Install required libraries

We can use net/curl and devel/json-c in OpenBSD packages collection.

# pkg_add curl json-c

2. Get nanotodon source from github

% git clone https://github.com/taka-tuos/nanotodon

3. Apply patch

Apply following patch. Recent nanotodon does not need any modification in c source, this patch generates OpenBSD dedicated Makefile. It should be work on both OpenBSD/amd64 (and possibly OpenBSD/luna88k) with original nanotodon source as of Oct 13, 2020.

https://gist.github.com/ao-kenji/d38e128f50f1356afcf5747021d5f878

4. Make

% cd nanotodon
% make -f Makefile.bsd-wrapper

If you like, copy executable binary 'nanotodon' to your favorite place, like /usr/local/bin or ~/bin.

5. First time run

Recent nanotodon supports English guidance messages. If you do not set environment variable LANG to 'ja_JP.UTF-8', the English messages will be used. Please run nanotodon in UTF-8 compatible terminal, like x11/mlterm in OpenBSD packages collection.

% nanotodon
Hello! Welcome to nanotodon!
First, please tell me the instance where you live.
(https://[please enter this part]/)
>

In my case, put my instance "bsd.network", and [enter].

% nanotodon
Hello! Welcome to nanotodon!
First, please tell me the instance where you live.
(https://[please enter this part]/)
>bsd.network

Next, I will do application authentication.
Please access to following URL, then after authorization, please input displayed authorization code.
https://bsd.network/oauth/authorize?client_id=..(snip)
>

Then copy the URL and paste it on some browser to access authorization page. Next, copy the authorization code displayed on the browser, and paste it on nanotodon terminal, press [enter]. After input authorization code, you will see the main screen!

Note: this initial settings are stored in ~/.config/nanotodon folder.

6. How to toot

Write your toot text on top-half of the screen. Then press [ESC] to toot.

7. Acknowledgment

Original nanotodon author kagura1050(Takaki Yoda) / github: taka-tuos / Mastodon: @taka_hvc1@social.mikutter.hachune.net

8. Author

Kenji Aoyama / 青山 健治 / Twitter: @ao_kenji / Mastodon: @ao_kenji@bsd.network

ABSOLUTELY NO WARRANTY

@rjc

This comment has been minimized.

Copy link

@rjc rjc commented Jul 21, 2019

s/URL-/UTF-/

@ao-kenji

This comment has been minimized.

Copy link
Owner Author

@ao-kenji ao-kenji commented Jul 22, 2019

s/URL-/UTF-/

Oops, fixed. Thank you!

@tsutsui

This comment has been minimized.

Copy link

@tsutsui tsutsui commented Sep 22, 2019

FYI, the latest version includes most of fixes and also has toot improvements (toot's date/time etc.):
https://github.com/taka-tuos/nanotodon/commits/master

Note "gcc -std=gnu99" should work around to handle "for (int i=0; i<foo; i++)" C99 format, even with gcc 3.x.

@ao-kenji

This comment has been minimized.

Copy link
Owner Author

@ao-kenji ao-kenji commented Sep 24, 2019

FYI, the latest version includes most of fixes and also has toot improvements (toot's date/time etc.):
https://github.com/taka-tuos/nanotodon/commits/master

Note "gcc -std=gnu99" should work around to handle "for (int i=0; i<foo; i++)" C99 format, even with gcc 3.x.

Thank you. I have updated the patch, actually it just generates OpenBSD dedicated Makefile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.