1

What I'd like to achieve is as follows. Say, I run a command in tmux's window:

sleep 5; notify-me

And I want to see a notification telling me tmux's session name and tmux's window name of what has just finished. I'm running Awesome windows manager.

I can display a notification like so:

#!/usr/bin/env bash
set -eu
echo "
    local n = require('naughty')
    n.notify({
        text = "session 1: window 1: job's done"
        , preset = n.config.presets.normal
    })
" | awesome-client

I thought I could make use of tmux's alert hooks here, but I don't see a way to find out where it (alert) comes from.

1 Answer 1

0

I've come up with the following function (to be put into ~/.bashrc):

n() {
    local msg=$(tmux display-message -p '#S: #W: finished')
    echo "
        local n = require('naughty')
        n.notify({
            text = '$msg'
            , preset = n.config.presets.critical
        })
    " | awesome-client
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .