Upon reading the README.md I've realized the instructions could be written
in a
more straightforward manner. All you have to do for the contrib to work is
put
the following lines in your rc file.

(load-module "notify")
(notify-server-on) ; or (notify-server-toggle)

With that in your rc file show-notification would run every time a slack
notification, or any other notification, is sent. In the case of
show-notification that means using the message box that StumpWM for its
messages.

If you would like that the notification be displayed in a different manner
you
would have to change the function stored in *notification-received-hook*
(which
incidentally is not a hook, hooks are lists of functions). For example
Ubuntu
comes with libnotify which you can use from the CLI through notify-send. One
could use libnotify by placing the following code it its rc-file after
loading
the notify module.

(defun libnotify-show-notification (app icon summary body)
  (stumpwm:run-shell-command
   (format nil "notify-send --app-name=~A --icon=~A \"~A\" \"~A\""
           app
           icon
           summary
           body)) )
(setf notify:*notification-received-hook* #'libnotify-show-notification)

Cheers

On Fri, Mar 30, 2018 at 2:27 PM, York Zhao <gtdplatf...@gmail.com> wrote:

> I still have no idea how to get "notify" working. Would it be possible for
> someone to provide me a bit more instruction as to how to get Slack
> notifications in StumpWM? The following is my ./stumpwm.d/init.lisp:
>
> ;; -*-lisp-*-
>
> (in-package :stumpwm)
>
> ;; Bind "c" to gnome-terminal instead of xterm
> (define-key *root-map* (kbd "c") "exec gnome-terminal")
>
> (setf *mode-line-position* :bottom)
> (mode-line)
>
> (add-to-load-path "/path/to/stumpwm-contrib/util/notify")
> ;; (load-module "notify")
>
> (emacs)
>
>
> On Tue, Mar 27, 2018 at 8:47 AM, York Zhao <gtdplatf...@gmail.com> wrote:
>
>> Thank you very much Javier. Because I'm new to Common Lisp, it would be a
>> lot easier for me if I could have some usage information with examples for
>> this "notify" package. Could you point me to some of these information as I
>> didn't find them on the GitHub link.
>>
>> Have a great day,
>>
>> York
>>
>>
>> On Sun, Mar 25, 2018 at 10:18 PM, Javier Olaechea <pir...@gmail.com>
>> wrote:
>>
>>> The notify contrib should display slack notifications
>>>
>>> https://github.com/stumpwm/stumpwm-contrib/tree/master/util/notify
>>>
>>> On Sun, Mar 25, 2018 at 2:26 PM, York Zhao <gtdplatf...@gmail.com>
>>> wrote:
>>>
>>>> Hi list,
>>>>
>>>> I'm using Linux Mint 17.3 at home, and 18.3 at work. I'm trying to use
>>>> StumpWM. However, since we use Slack at work, I have to be able to get
>>>> notified whenever new slack messages arrive. Without this ability, StumpWM
>>>> would be useless for me. I've tried to run `gnome-panel' but all I got was
>>>> a black band at the top of the screen showing nothing. Is it possible to
>>>> have this notification in mode line?
>>>>
>>>> Thanks in advance,
>>>>
>>>>
>>>> _______________________________________________
>>>> Stumpwm-devel mailing list
>>>> Stumpwm-devel@nongnu.org
>>>> https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
>>>>
>>>>
>>>
>>>
>>> --
>>> "I object to doing things that computers can do." — Olin Shivers
>>>
>>> _______________________________________________
>>> Stumpwm-devel mailing list
>>> Stumpwm-devel@nongnu.org
>>> https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
>>>
>>>
>>
>


-- 
"I object to doing things that computers can do." — Olin Shivers
_______________________________________________
Stumpwm-devel mailing list
Stumpwm-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel

Reply via email to