Command line interface to Pidgin + bash completion
# Reads message from stdin
echo "My message" | pidginMsg <buddy1> <buddy2> ...
# Just opens the chat window
pidginMsg <buddy1> <buddy2> ...
-
python-dbus
Distro Command line Ubuntu sudo apt-get install python-dbus
Fedora dnf install python3-dbus
-
Pidgin must be running.
-
Clone this repo
git clone https://github.com/tfga/pidginCli cd pidginCli
-
Install
-
Ubuntu
-
Without virtualenv:
pip2 install .
-
With virtualenv:
-
Edit the
install
script and change the value ofINSTALL_DIR
to point to the directory where the executables should be installed. This directory should be in your$PATH
. -
Run:
./install
-
-
-
Fedora
Fedora has
dbus
bindings for Python 3 only. So, you should do instead:./install python3
-
-
Now you should have two new executables on your PATH:
pidginMsg
: the main executable_pidginCompleteBuddy
: used by the bash completion
Add this to your .bashrc
:
source <absolute path to pidginCli>/bash/bashCompletion
If you don't want to keep the repo around, move bash/bashCompletion
somewhere else and adjust the path accordingly.
The completion takes into account both the username and full name. For instance, in the demo (above), the following completions take place:
luciv_ => lucivaldo.costa
-- username matchbern_ => thiago.almeida
-- full name match ("Thiago Bernardes de Almeida")
where _
is where the cursor was when I pressed TAB
.
-
Is this thing interactive?
No. The use case is, e.g. when you want to send the output of some command to a co-worker without leaving the terminal.
Actually... there's a second application hidden in this repo.
🤨
The attentive user will certainly have noticed that after the installation, a third executable is also present:
pidginQuickLaunch
Hum... what might that be? 🤔
It's a GUI version of pidginMsg
.
🤯
If you want to use this, you must also install python-keybinder
and python-gtk2
:
sudo apt-get install python-keybinder python-gtk2
Fedora
Sorry, this part is python 2 only. And the migration to python 3 also implies a migration from PyGtk to GObject Introspection. So... it probably won't happen anytime soon.
That said, this is a small amount of code and, with pygtkcompat, it might be possible to make it work with both. If anyone out there is willing to do the work, PRs will be wellcome.
Once the application is running, the GUI can be summoned with the (global) shortcut Ctrl + Alt + m
. And dismissed with Esc
.