From: Mark Wooding Date: Sun, 5 Jun 2011 10:47:36 +0000 (+0100) Subject: Merge branch 'master' of vampire:etc/profile X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/3a0e1da4b09a28a98b3ce83a309564b3b554d69c?hp=ac667d0466f3c297b09b51ce1b7f168ffbe1c774 Merge branch 'master' of vampire:etc/profile * 'master' of vampire:etc/profile: dot/xinitrc: Shut down the Gnome session properly on exit. dot/xinitrc: Fiddle with window manager selection. dot/xinitrc: Run an early user hook script. setup: Modify URL for the FTP repository. mdw.conf: Use rĂ´le address for the default web cache. dot/bash_profile: Use `kbd_mode' to check for UTF-8 console. bin/sendmail-hack: Grim hack for Emacs to invoke sendmail. --- diff --git a/bin/sendmail-hack b/bin/sendmail-hack new file mode 100755 index 0000000..0ce0ea3 --- /dev/null +++ b/bin/sendmail-hack @@ -0,0 +1,5 @@ +#! /bin/sh + +set -e +unset LD_PRELOAD +exec ${REAL_SENDMAIL-/usr/sbin/sendmail} "$@" diff --git a/dot/bash_profile b/dot/bash_profile index de5a5cf..1621d13 100644 --- a/dot/bash_profile +++ b/dot/bash_profile @@ -135,7 +135,8 @@ else : ${LANG=${LC_CTYPE-${LC_ALL-`mdw-conf console-ctype`}}} case "$TERM,`tty`" in linux,/dev/tty*) - if vt-is-UTF8 >/dev/null 2>&1; then + if { vt-is-UTF8 || + kbd_mode | grep UTF-8; } >/dev/null 2>&1; then ctype=.utf8 else ctype= diff --git a/dot/xinitrc b/dot/xinitrc index 3141367..8fce589 100755 --- a/dot/xinitrc +++ b/dot/xinitrc @@ -70,6 +70,13 @@ EOF esac done +###-------------------------------------------------------------------------- +### Preliminary hook. + +if [ -r $HOME/.xinitrc-prehook ]; then + . $HOME/.xinitrc-prehook +fi + ###-------------------------------------------------------------------------- ### Iniitial settings. @@ -98,7 +105,7 @@ initialize () { ###-------------------------------------------------------------------------- ### Start a window manager. -wm=$(pick_program window-manager enlightenment e16 twm) +wm=$(pick_program window-manager e16 compiz enlightenment e17 twm) wmopts="" case "$wm,$vnc" in enlightenment,yes | e16,yes) @@ -329,6 +336,28 @@ EOF done } +###-------------------------------------------------------------------------- +### Gnome session care and feeding. + +session-running-p () { + dbus-send --session --print-reply --dest=org.freedesktop.DBus / \ + org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager \ + >/dev/null 2>&1 +} + +kill-gnome-session () { + if session-running-p; then + info "killing Gnome session manager" + dbus-send --session \ + --dest=org.gnome.SessionManager /org/gnome/SessionManager \ + org.gnome.SessionManager.Logout uint32:2 + for i in 1 2 3 4 5; do + sleep 1 + if ! session-running-p; then break; fi + done + fi +} + ###-------------------------------------------------------------------------- ### Actually start things up. @@ -353,6 +382,7 @@ esac case "$wait" in yes) xwait + kill-gnome-session ;; no) info "not waiting before exit" diff --git a/mdw.conf b/mdw.conf index 9c78fbf..ec63e82 100644 --- a/mdw.conf +++ b/mdw.conf @@ -3,11 +3,11 @@ email = mdw@distorted.org.uk mailbox = ~/Mailbox rootly = become -g0 root -http-proxy = metalzone.distorted.org.uk:3128 -nntp-server = metalzone.distorted.org.uk +http-proxy = www-cache.distorted.org.uk:3128 +nntp-server = www-cache.distorted.org.uk cvs-root = metalzone.distorted.org.uk:/home/cvs/cvs svn-root = svn+ssh://metalzone.distorted.org.uk/home/cvs/svn -cltl-url = http://metalzone.distorted.org.uk/doc/cltl/ -hyperspec-url = http://metalzone.distorted.org.uk/doc/hyperspec/ +cltl-url = http://www.distorted.org.uk/doc/cltl/ +hyperspec-url = http://www.distorted.org.uk/doc/hyperspec/ console-ctype = en_GB.iso885915 x-ctype = en_GB.utf8 diff --git a/setup b/setup index 3df6067..307e3d0 100755 --- a/setup +++ b/setup @@ -10,7 +10,7 @@ umask 002 sub= mkdir -p $HOME$sub -: ${REPO=http://ftp.distorted.org.uk/ftp/pub/mdw/profile} +: ${REPO=http://ftp.distorted.org.uk/pub/mdw/profile} export PATH=/usr/local/bin:$HOME$sub/bin:/usr/bin:/usr/ccs/bin:/bin @@ -231,6 +231,7 @@ scripts=" mdw-build emacsclient-hack movemail-hack + sendmail-hack aspell-hack emerge-hack lesspipe.sh