packages:userscripts
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
packages:userscripts [2011-01-31 04:01] – - very simple description SamChi | packages:userscripts [2011-02-02 21:37] (current) – - note about restart and reload SamChi | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | |||
+ | ====== UserScripts ====== | ||
rc-scripts-user allows users to run scripts at system startup and shutdown. | rc-scripts-user allows users to run scripts at system startup and shutdown. | ||
- | Create ~/ | ||
- | Example | + | |
+ | ===== how to use ===== | ||
+ | Create | ||
+ | |||
+ | |||
+ | |||
+ | ====== Sample user scripts ====== | ||
+ | |||
+ | |||
+ | ==== irssi ==== | ||
+ | ~/ | ||
+ | |||
< | < | ||
+ | |||
+ | # TODO: replace pidof with something that takes into account | ||
+ | # only processes from this user | ||
+ | |||
+ | # download fifo_remote.pl irssi script to control it remotelly | ||
+ | REMOTE=" | ||
+ | install_fifo_remote() | ||
+ | { | ||
+ | install -d ~/ | ||
+ | cd ~/ | ||
+ | wget http:// | ||
+ | cd autorun | ||
+ | ln -s ../ | ||
+ | rm $REMOTE | ||
+ | mkfifo $REMOTE | ||
+ | chmod 600 $REMOTE | ||
+ | } | ||
case " | case " | ||
start) | start) | ||
+ | [ -p " | ||
+ | |||
if ! pidof irssi > /dev/null; then | if ! pidof irssi > /dev/null; then | ||
screen -d -m -S irssi irssi | screen -d -m -S irssi irssi | ||
Line 14: | Line 47: | ||
;; | ;; | ||
stop) | stop) | ||
- | | + | |
- | irssi_remote | + | |
- | sleep 1 | + | |
- | killall -INT irssi | + | |
+ | usleep 10000 | ||
+ | if pidof irssi > /dev/null; then | ||
+ | | ||
+ | killall -INT irssi | ||
+ | fi | ||
+ | ;; | ||
+ | install) | ||
+ | install_fifo_remote | ||
+ | ;; | ||
+ | esac | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== dropbox ==== | ||
+ | ~/ | ||
+ | |||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | case " | ||
+ | start) | ||
+ | exec / | ||
+ | --pidfile $HOME/ | ||
+ | --exec / | ||
+ | ;; | ||
+ | stop) | ||
+ | exec / | ||
+ | --retry TERM/ | ||
+ | --pidfile $HOME/ | ||
;; | ;; | ||
esac | esac | ||
</ | </ | ||
packages/userscripts.1296442885.txt.gz · Last modified: 2011-01-31 04:01 by SamChi