Skip to content

Instantly share code, notes, and snippets.

@ao-kenji
Last active October 13, 2020 12:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ao-kenji/c734809b784fd451a56147601adb200b to your computer and use it in GitHub Desktop.
Save ao-kenji/c734809b784fd451a56147601adb200b to your computer and use it in GitHub Desktop.

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
Copy link

rjc commented Jul 21, 2019

s/URL-/UTF-/

@ao-kenji
Copy link
Author

s/URL-/UTF-/

Oops, fixed. Thank you!

@tsutsui
Copy link

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
Copy link
Author

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