aboutsummaryrefslogtreecommitdiff
path: root/blog/2023-11-08-scli.org
diff options
context:
space:
mode:
Diffstat (limited to 'blog/2023-11-08-scli.org')
-rw-r--r--blog/2023-11-08-scli.org193
1 files changed, 100 insertions, 93 deletions
diff --git a/blog/2023-11-08-scli.org b/blog/2023-11-08-scli.org
index 9c0bf89..16c723d 100644
--- a/blog/2023-11-08-scli.org
+++ b/blog/2023-11-08-scli.org
@@ -1,146 +1,153 @@
-+++
-date = 2023-11-08T21:37:00.307616604+00:00
-title = "Installing scli on Alpine Linux (musl)"
-description = ""
-+++
-
-[scli](https://github.com/isamert/scli) is a command-line tool that allows you
-to connect to your Signal messenger account. This program utilizes a two-pane
-display that shows you chats on the left and the focused conversation on the
-right.
-
-This guide will show you how to install `scli` and its dependencies on Alpine
-Linux, which requires some extra work due to musl.
-
-If you're using a non-musl system, you can likely following the `scli` README
-and download the packaged binaries for an easier installation process.
+#+title: Installing scli on Alpine Linux (musl)
+#+date: 2023-11-08
-## Dependencies
+[[https://github.com/isamert/scli][scli]] is a command-line tool that allows you to connect to your Signal messenger
+account. This program utilizes a two-pane display that shows you chats on the
+left and the focused conversation on the right.
-In order to use `scli`, you need a few dependencies:
-
-- `openjdk17-jre` - Used as a dependency for the `signal-cli` tool. Version may
-vary.
-- `signal-cli` - Used as the backbone of the `scli` tool.
-- `findutils` - Replaces the standard Busybox version of `xargs`.
-- `urwid` - A console user interface library for Python.
-- `urwid-readline` - For GNU emacs-like keybinds on the input line.
-- `qrencode` - Displays a QR code in the terminal to link the device using your
-phone. Not necessary if you're only linking on desktop and can copy/paste the
-connection URL.
+This guide will show you how to install =scli= and its dependencies on Alpine
+Linux, which requires some extra work due to musl.
-Let's start by installing the packages available via Alpine's repositories. Be
-sure to install the latest version of `openjdk`. If you run into Java-related
-issues, uninstall `openjdk` and install an older version.
+If you're using a non-musl system, you can likely following the =scli= README
+and download the packaged binaries for an easier installation process.
-```sh
+** Dependencies
+:PROPERTIES:
+:CUSTOM_ID: dependencies
+:END:
+In order to use =scli=, you need a few dependencies:
+
+- =openjdk17-jre= - Used as a dependency for the =signal-cli= tool.
+ Version may vary.
+- =signal-cli= - Used as the backbone of the =scli= tool.
+- =findutils= - Replaces the standard Busybox version of =xargs=.
+- =urwid= - A console user interface library for Python.
+- =urwid-readline= - For GNU emacs-like keybinds on the input line.
+- =qrencode= - Displays a QR code in the terminal to link the device
+ using your phone. Not necessary if you're only linking on desktop and
+ can copy/paste the connection URL.
+
+Let's start by installing the packages available via Alpine's
+repositories. Be sure to install the latest version of =openjdk=. If you
+run into Java-related issues, uninstall =openjdk= and install an older
+version.
+
+#+begin_src sh
doas apk add openjdk17-jre findutils qrencode
-```
+#+end_src
-Next, let's install `signal-cli`. Be sure to export the version of `signal-cli`
-that you want. I use version `0.12.4` below, but that may be outdated by the
-time you're reading this.
+Next, let's install =signal-cli=. Be sure to export the version of
+=signal-cli= that you want. I use version =0.12.4= below, but that may
+be outdated by the time you're reading this.
-```sh
+#+begin_src sh
export VERSION="0.12.4"
wget https://github.com/AsamK/signal-cli/releases/download/v"${VERSION}"/signal-cli-"${VERSION}".tar.gz
doas tar xf signal-cli-"${VERSION}".tar.gz -C /opt
doas ln -sf /opt/signal-cli-${VERSION}"/bin/signal/cli /usr/local/bin
-```
+#+end_src
-Finally, install the `urwid` packages using the Python packaging utility.
+Finally, install the =urwid= packages using the Python packaging
+utility.
-```sh
+#+begin_src sh
pip3 install urwid urwid-readline
-```
-
-## Installation
+#+end_src
-Now that we have all of the dependencies we need, we can install `scli`. Start
-by simply cloning the repository.
+** Installation
+:PROPERTIES:
+:CUSTOM_ID: installation
+:END:
+Now that we have all of the dependencies we need, we can install =scli=.
+Start by simply cloning the repository.
-```sh
+#+begin_src sh
git clone https://github.com/isamert/scli
-```
+#+end_src
-When I cloned this repository on 2023-11-08, I found a bug in the logic that
-required a fix. You must edit the `scli` file and replace the one instance of
-`RLIMIT_OFILE` with `RLIMIT_NOFILE`.
+When I cloned this repository on 2023-11-08, I found a bug in the logic
+that required a fix. You must edit the =scli= file and replace the one
+instance of =RLIMIT_OFILE= with =RLIMIT_NOFILE=.
-```sh
+#+begin_src sh
cd scli
nano scli
-```
+#+end_src
-Once complete, you can move this program to anywhere on your `$PATH`. I chose
-the following directory.
+Once complete, you can move this program to anywhere on your =$PATH=. I
+chose the following directory.
-```sh
+#+begin_src sh
doas mv scli /usr/local/bin/scli
-```
+#+end_src
-## Initial Setup
+** Initial Setup
+:PROPERTIES:
+:CUSTOM_ID: initial-setup
+:END:
+Now that everything is installed, we can login and configure the client.
+Start by generating a connection link.
-Now that everything is installed, we can login and configure the client. Start
-by generating a connection link.
-
-```sh
+#+begin_src sh
signal-cli link -n "YOUR-DEVICE-NICKNAME" | tee >(xargs -L 1 qrencode -t utf8)
-```
+#+end_src
-This will generate a connection link and related QR code for you to use to link
-the devices together. Once complete, **wait patiently** for the connection
-process to finish.
+This will generate a connection link and related QR code for you to use
+to link the devices together. Once complete, *wait patiently* for the
+connection process to finish.
-Once it completes, it will exit and return you to the prompt. From here, you
-need to perform an initial `receive` command to start things off. The `USERNAME`
-variable should be your phone number, such as `+15551237890`.
+Once it completes, it will exit and return you to the prompt. From here,
+you need to perform an initial =receive= command to start things off.
+The =USERNAME= variable should be your phone number, such as
+=+15551237890=.
-```sh
+#+begin_src sh
signal-cli -u USERNAME receive
-```
+#+end_src
-Also be sure to test the daemon to ensure it works properly. If no errors occur,
-it's working. If you run into errors because you're not running a DBUS session,
-see my notes below.
+Also be sure to test the daemon to ensure it works properly. If no
+errors occur, it's working. If you run into errors because you're not
+running a DBUS session, see my notes below.
-```sh
+#+begin_src sh
signal-cli -u USERNAME daemon
-```
+#+end_src
-Once the initial reception is complete, you are ready to use `scli`.
+Once the initial reception is complete, you are ready to use =scli=.
-This process will differ depending on your desktop environment (DE). If you are
-running a DE, you likely have a DBUS session running already and can simply
-launch the program.
+This process will differ depending on your desktop environment (DE). If
+you are running a DE, you likely have a DBUS session running already and
+can simply launch the program.
-However, if you're like me and running your computer straight on the TTY without
-a DE, you'll need to start a DBUS session for this program.
+However, if you're like me and running your computer straight on the TTY
+without a DE, you'll need to start a DBUS session for this program.
-```sh
+#+begin_src sh
# If you're not running a DBUS session yet, you need to start one for scli
dbus-run-session -- scli
# OR - If you're already running a DBUS session, simply run scli
scli
-```
-
-## Configuration
+#+end_src
-Lastly, there are a number of configuration options that you can pass via the
-command or in the `~/.config/sclirc` file. See the Github README for more
-information on configuration options.
+** Configuration
+:PROPERTIES:
+:CUSTOM_ID: configuration
+:END:
+Lastly, there are a number of configuration options that you can pass
+via the command or in the =~/.config/sclirc= file. See the Github README
+for more information on configuration options.
-```sh
+#+begin_src sh
nano ~/.config/sclirc
-```
+#+end_src
-```conf
+#+begin_src conf
# ~/.config/sclirc
wrap-at = 80
enable-notifications = true
-```
+#+end_src
-That's it! Following this guide, I have a functional `scli` program that
+That's it! Following this guide, I have a functional =scli= program that
successfully sends messages to my contacts and myself!