User Tools

Site Tools


terminal:profanity

Profanity

Profanity is a console based XMPP client. Some notable features of Profanity include off-the-record (OTR) support for end-to-end encryption as well as PGP/GPG encryption. It also supports C and Python plugins. If you're a member of the DevDungeon Virtual Hackerspace you get your own XMPP chat account you@devdungeon.com.

Refer to the official user guide for more details: https://profanity-im.github.io/userguide.html.

Video course

Installation

Official install guide: http://www.profanity.im/install.html

  • Debian/Ubuntu: apt install profanity
  • Mac: brew install profanity
  • Windows: Use Windows Subsystem for Linux (WSL) and use Ubuntu.

Then run it:

profanity --version
profanity --help
profanity

Basics

When you start you will be in the console with a shell at the bottom. You can type in commands to this shell.

  • /quit to quit
  • /help for help
  • /connect you@devdungeon.com tls trust connect/login to server with your username. Full connect options
  • /disconnect - logout/disconnect
  • /rooms service conference.devdungeon.com - List chat rooms
  • /join general@conference.devdungeon.com - Join chat room
  • /roster add nanodano@devdungeon.com NanoDano - Add contact to roster
  • /sub request nanodano@devdungeon.com - Request status updates
  • /msg nanodano@devdungeon.com hi - Send direct message

Store password

If you want to store your password in plain-text (not recommended!) run:

/account set nobody@devdungeon.com password 'my$ecretpass'
# Install dependencies (if needed)
sudo apt install pass gpg
 
# Generate a private PGP key (if needed)
gpg --quick-generate-key nobody@devdungeon.com
 
# Initialize password database (utilizes PGP encryption)
# <gpg_key_id> should match GPG key ID. e.g. nobody@devdungeon.com
pass init <gpg_key_id> 
# Add a password to the database (name however you want)
pass insert xmpp/nobody  # Enter password at prompt

Then inside Profanity:

/account set nobody@devdungeon.com eval_password "pass xmpp/nobody"

DevDungeon theme file

The devdungeon (no file extension) theme file can live in ~/config/profanity/themes/devdungeon. In Profanity, load the theme with: /theme load devdungeon.

Theme template at https://github.com/profanity-im/profanity/blob/master/theme_template.

Theme documentation at https://profanity-im.github.io/guide/0100/themes.html.

devdungeon
# ~/.config/profanity/themes/devdungeon
# Load it with: /theme load devdungeon
# Template: https://github.com/profanity-im/profanity/blob/master/theme_template

[colours]
bkgnd=Grey3
titlebar=Grey15
titlebar.text=Grey93
titlebar.brackets=Cyan1

titlebar.unencrypted=yellow
titlebar.encrypted=Grey93
titlebar.untrusted=bold_yellow
titlebar.trusted=Grey93

titlebar.online=Grey93
titlebar.offline=Grey70
titlebar.away=bold_yellow
titlebar.chat=Green1
titlebar.dnd=bold_red
titlebar.xa=yellow

statusbar=Grey15
statusbar.text=Grey93
statusbar.time=Grey93
statusbar.brackets=Cyan1
statusbar.active=Grey70
statusbar.current=Grey93
statusbar.new=Cyan1
# Shell input color
input.text=Grey93
# Console text
main.text=Grey93
# Direct message text
main.text.me=Grey93
main.text.them=Grey93
# Profanity ASCII art title
main.splash=Cyan1
main.help.header=white
# Timestamp on the left
main.time=bold_black

# Notifications in console when someone's status changes
online=white
away=bold_yellow
chat=Green1
dnd=bold_red
xa=yellow
offline=bold_black

occupants.header=bold_black
roster.header=bold_black
roster.chat=Green1
roster.chat.active=Green1
roster.chat.unread=bold_cyan
roster.online=white
roster.online.active=white
roster.online.unread=bold_cyan
roster.away=bold_yellow
roster.away.active=bold_yellow
roster.away.unread=bold_cyan
roster.xa=yellow
roster.xa.active=yellow
roster.xa.unread=bold_cyan
roster.dnd=bold_red
roster.dnd.active=bold_red
roster.dnd.unread=bold_cyan
roster.offline=bold_black
roster.offline.active=bold_black
roster.offline.unread=bold_cyan
roster.room=white
roster.room.unread=bold_white
roster.room.mention=bold_cyan
roster.room.trigger=bold_cyan

otr.started.trusted=green
otr.started.untrusted=yellow
otr.ended=red
otr.trusted=green
otr.untrusted=yellow

incoming=bold_yellow
mention=bold_cyan
trigger=yellow
typing=yellow
gone=bold_black
error=bold_black
roominfo=bold_white
roommention=bold_cyan
roommention.term=bold_cyan
roomtrigger=bold_black
roomtrigger.term=bold_black
subscribed=white
unsubscribed=bold_black

# Usernames
me=white
them=bold_cyan
receipt.sent=bold_black

profrc file

The profrc file should reside in ~/.config/profanity/profrc and contains your preferences. There is a template at https://github.com/profanity-im/profanity/blob/master/profrc.example

profrc
# ~/.config/profanity/profrc
# Template: https://github.com/profanity-im/profanity/blob/master/profrc.example

[ui]
theme=devdungeon

[connection]
defaccount=you@devdungeon.com
account=you@devdungeon.com

[presence]
autoaway.mode=away
autoaway.check=true
autoaway.awaytime=15
autoaway.awaymessage=Away from computer

[alias]
nanodano=/msg nanodano@devdungeon.com Hello
devdungeon=/join general@conference.devdungeon.com

[logging]
chlog=true
grlog=true
maxsize=1048580
rotate=true
shared=true

[otr]
warn=true
log=on
policy=manual

[presence]
autoaway.mode=away
autoaway.time=15
autoaway.message=Away from computer
autoaway.check=true

PGP Encryption

You need a private key for yourself and the public key of your recipient. If you need someone to send a message to, you can send me a message using my public key. You can get my public key from https://www.devdungeon.com/gpg or via:

# Download/import public key for nanodano@devdungeon.com
curl -O https://www.devdungeon.com/nanodano.gpg; gpg --import nanodano.gpg
 
#or
 
# Fetch nanodano@devdungeon.com public key from a keyserver
gpg --keyserver pgp.mit.edu --recv A6D4E83A1866995E
gpg --keyserver hkps.pool.sks-keyservers.net --recv A6D4E83A1866995E

In Profanity, configure which PGP key should be associated with your XMPP account and set the public key for your recipient:

# List keys in your store
/pgp keys
# Set your private PGP key to your account
/account set <account> pgpkeyid <keyid>
# For example:
/account set me@devdungeon.com pgpkeyid AAAABBBBCCCCDDDD
# Set recipient account public key
/pgp setkey nanodano@devdungeon.com A6D4E83A1866995E

Start and end PGP-encrypted conversations with:

/pgp start nanodano@devdungeon.com
/pgp end

vi keybinds

Profanity uses readline so it supports tab completion and all the same keybinds a shell does like CTRL-P and CTRL-W. You can also set it to use vi keybinds. Update your `~/.inputrc` file to specify vi mode:

input.rc
set editing-mode vi
terminal/profanity.txt · Last modified: 2021/05/30 21:22 by nanodano