User Tools

Site Tools


packages:userscripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
packages:userscripts [2011-02-01 18:12]
SamChi - extended/finished irssi script
packages:userscripts [2011-02-01 20:43]
SamChi - no time to waste
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. ​
  
 +
 +
 +===== how to use =====
 Create ~/​.config/​init.d/​script_name. It must accept one argument, it will be either "​start"​ or "​stop"​. ​ Create ~/​.config/​init.d/​script_name. It must accept one argument, it will be either "​start"​ or "​stop"​. ​
  
-Example ​~/​.config/​init.d/​irssi ​+ 
 + 
 +====== Sample user scripts ====== 
 + 
 + 
 +==== irssi ==== 
 +~/​.config/​init.d/​irssi ​ 
 + 
  
 <​file>#​!/​bin/​sh <​file>#​!/​bin/​sh
 +
 +# TODO: replace pidof with something that takes into account
 +# only processes from this user
  
 # download fifo_remote.pl irssi script to control it remotelly # download fifo_remote.pl irssi script to control it remotelly
Line 42: Line 59:
         install)         install)
                 install_fifo_remote                 install_fifo_remote
 +                ;;
 +esac
 +</​file>​
 +
 +
 +==== dropbox ====
 +~/​.config/​init.d/​dropbox ​
 +
 +
 +
 +<​file>#​!/​bin/​sh
 +
 +case "​$1"​ in
 +        start)
 +                exec /​sbin/​start-stop-daemon --start --background \
 +                        --pidfile $HOME/​.dropbox/​dropbox.pid \
 +                        --exec /​usr/​bin/​dropboxd
 +                ;;
 +        stop)
 +                exec /​sbin/​start-stop-daemon --stop \
 +                        --retry TERM/​2/​TERM/​6/​KILL/​2 -s TERM \
 +                        --pidfile $HOME/​.dropbox/​dropbox.pid
                 ;;                 ;;
 esac esac
 </​file>​ </​file>​
  
packages/userscripts.txt · Last modified: 2011-02-02 21:37 by SamChi