iron

speedie's website

🏠 Home πŸ’Ύ Projects πŸ“˜ Blog πŸ“• Guides πŸ“§ Email 🐧 Dotfiles πŸ“° RSS πŸ’°Donate

iron

image

What is iron?

iron is a minimal rautafarmi client written in Bash for GNU/Linux. It allows the user to post/recieve messages using the rautafarmi API and it displays the information to the user in a nice format. iron is based on the older rchat rautafarmi client that used messages.txt to get messages.

Why should I use iron over rchat?

Unlike rchat, iron is minimal in design and only does what you expect a basic client to do. It does not have auto updating, no history, no donate command, no news, no changelog, and no :open. It also brings a much cleaner and improved codebase. Because of this, bugs are less likely and the client is much faster. The user doesn't have to run lines of code he doesn't need.

Most importantly though, iron does not use the old messages.txt method used by older instances. This also means iron is the first rautafarmi client to use and support the new JSON based rautafarmi API. This API is much faster and will allow compatible instances to push updates without breaking client support.

Features

Modes

iron has three modes - Normal mode, Command mode and Insert mode. When you first load messages, you will be in Normal mode. This mode is simply used for reading and entering another mode. If you choose to enter Command mode, you're able to perform actions to iron such as exiting or composing a message in an editor.

If you press 'i', you'll be in Insert mode. This mode is used to compose messages. This will bring up a little area where you can type your message. If you press enter, your message will be sent. If you want to send messages with multiple lines, press e or :e to open up a file in an editor ($EDITOR).

Usage

Simply run iron inside a terminal emulator or something like tmux. For iron to work though, it needs to connect to an instance. As of writing this document, there is only one. You can find it here. Run ':set instance' and then type in the URL of the instance. If you press enter, the instance will be set. This is saved until settings are reset (or ~/.local/share/iron is deleted). To join the instance, type ':j' and press Enter. This will (assuming dependencies are installed and you are connected to the internet) download the API and then print messages to the screen. Here, you are in Normal mode.

From here, you may run commands, or enter Insert mode to compose a message. See 'Commands' or 'Keybinds' for more information.

Installation

Download it (see 'Download') and run 'make install' as root.

Download

iron can be downloaded using dev-vcs/git. To do this:

- cd
- git clone https://codeberg.org/speedie/iron
- cd iron

Commands

Keybinds

Patches

To submit patches, Create a pull request with your patch in the patches branch or send me an email. Patches can be generated using the 'diff -up' command on a GNU/Linux system.

tput colors

This patch replaces the ANSI escape codes with tput commands. This allows for more colors and also allows you to separate your iron color scheme from your terminal color scheme (Useful if you use Pywal).

iron-tputcols-1.0.diff iron-tputcols-1.1.diff

Embed Image

This patch adds new image functionality to iron. Specifically it allows you to post images (using the imgurl field). To post an image, simply add the link somewhere in your message. It will be moved to the Image URL field before the post is sent to the instance.

iron-embed-image-1.0.diff iron-embed-image-1.1.diff

.Xresources

This patch adds xrdb or .Xresources support to iron. Note that values must be defined with the 'iron' prefix to be used. You may modify the patch to use any values if you want which would enable Pywal support.

iron-xresources-1.0.diff

History

This patch adds keybinds for viewing older/newer messages. If you press 'u', you will see the newest messages. If you press 'd', you will go down the history.

Do note that this requires parsing ALL messages, not just the terminal size meaning loading messages takes longer. Because of this, there are two variants. The regular variant will download and parse every single message on load and then will not parse it again. The ondemand variant will only parse the old messages when navigating through the history. I personally prefer this variant!

iron-viewhist-1.1.diff iron-viewhist-ondemand-1.1.diff

Nickname

This patch allows the user of iron to set nicknames for themselves. It will be saved until the ':reset' command is used (data is cleared) or the nickname is changed.

Once a nickname is set, messages will be sent with it. To set a nickname, simply use the ':set nickname' command.

iron-nickname-1.1.diff

Hide messages

This patch adds two commands, ':hide' and ':show'. The hide command will open all messages sent inside $EDITOR (or Vim if $EDITOR is not defined) and allow the user to make changes. A patch will then be created that will be applied on startup. The show command does the complete opposite, it reverts the patch.

This means the patch is useful for other things because it allows you to modify the messages in any way you want (or even create new ones client side).

iron-hidemessages-1.1.diff

Notification

This patch implements notification support. With this patch, the latest message along with the username will be sent as a notification. It requires a notification daemon and libnotify-send to work. If it is not available, no notification will be sent.

iron-notification-1.0.diff

Open URL

This patch adds a keybind to open a URL. To open the latest image sent (using the image field), you use the ':i' command. To open the latest URL sent (using the message field), you use the ':o' command. By default this patch uses xdg-open but you can change the browser to anything you want.

iron-openurl-1.0.diff

Insert mode editor

This patch replaces the 'i' bind with the action of the ':e' command. You can still access the old insert mode by pressing 'e' though.

iron-itoedit-1.0.diff iron-itoedit-1.1.diff

Art

This patch allows you to add art or general text to display in the iron starter menu.

iron-art-1.0.diff

Hide status

This patch removes the iron version number, all separators and the instance status from the chat area so that all space (minus two lines) will be used for messages.

iron-hidestatus-1.0.diff iron-hidestatus-1.1.diff

speedie's combo patch

This patch is a combo patch. It adds embed image, hide messages, i to edit, nickname, tput colors and view history patches into one patch that can be applied to a clean iron build.

This diff was created for use with the Gentoo ebuild (because a few of the patches I use conflict with each other). If you want these patches, simply apply this patch.

iron-speedie-1.1.diff

License

iron, along with any contributions made to it (such as all user-submitted patches) are licensed under the GNU GPLv3 free software license.

Issues

Submit them in the Codeberg repository or let me know elsewhere such as email.