LoginSignup
1
2

More than 5 years have passed since last update.

StumpWMでtwmnを使う

Last updated at Posted at 2015-03-03

StumpWMで通知のためにtwmnを使う方法のメモ。

直接twmndを実行することもできるが、それをするとloadrcするたびにデーモンが新規で立ち上がってtwmndプロセスが大量発生する問題が発生するので以下のような補助スクリプトを組んで間接的に起動する。保存場所は割と適当なので任意に。

尚、twmnはgithubから取ってくるなりArchならyaourtで入れるなりしてインストール済みとする。PATHは#p"/usr/bin/twmnd"に入ってるとする。

~/.stumpwm.d/helper/twmn/run.sh
#!/bin/sh

TWMND_PID=`ps aux | grep -v grep | grep twmnd | awk '{print $2}' | tr -d "\n"`
TWMND_COMMAND="/usr/bin/twmnd"

if test -x $TWMND_COMMAND ;then
    if test -z $TWMND_PID; then
        exec $TWMND_COMMAND
    else
        kill $TWMND_PID && exec $TWMND_COMMAND
    fi
else
    echo "twmnd command not found"
fi

で、~/.stumpwm.d/init.lispに以下を追記する。

~/.stumpwm.d/init.lisp
;;; -*- Lisp -*-
(in-package :stumpwm)

(defvar *stumpwm-rc-directory*
  (merge-pathnames #p".stumpwm.d/" (user-homedir-pathname)))

;; blah blah blah

(cl-user::process-pid (run-shell-command (namestring
                                          (merge-pathnames #p"helper/twmn/run.sh"
                                                           *stumpwm-rc-directory*)
                                          ) nil))

追記: twmndが動いているとEmacsでalert.elなどを使っても通知できるようになるのでいろいろ便利に使えそうです。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2