From e2d5ac3b781cdaff671e2fb306d6d76e7e6b2d51 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Tue, 16 Feb 2010 03:15:55 +0100 Subject: xinitrc: rewrite and remove long forgotten code --- xinitrc | 137 +++++++++++++++++++++++----------------------------------------- 1 file changed, 48 insertions(+), 89 deletions(-) (limited to 'xinitrc') diff --git a/xinitrc b/xinitrc index 83aff98..161eb49 100755 --- a/xinitrc +++ b/xinitrc @@ -3,50 +3,46 @@ # anrxc's X.org init file on Arch GNU/Linux -# {{{ Log settings +# {{{ Environment settings +# +export OOO_FORCE_DESKTOP="gnome" errorlog="$HOME/.xsession-errors" +gnupglog="$HOME/.gnupg/gpg-agent.info" +# }}} + -# Start with a clean log file every time -if ( cp /dev/null "$errorlog" 2> /dev/null ); then - chmod 600 "$errorlog" - exec > "$errorlog" 2>&1 - break +# {{{ Log settings +# +# Always start X11 with a clean log file +if ( cp /dev/null "$errorlog" 2>/dev/null ); then + chmod 600 "$errorlog" + exec >"$errorlog" 2>&1 + break fi # }}} -# {{{ Environment settings +# {{{ Display settings # -# Somewhat nicer OpenOffice than with QT style -export OOO_FORCE_DESKTOP="gnome" +# Ignore reported display size and force DPI +#/usr/bin/xrandr --dpi 96 -# Disable Pango in Gecko, performance wise -export MOZ_DISABLE_PANGO=1 +# Force LVDS as the primary screen +#/usr/bin/xrandr --output LVDS1 --primary # }}} # {{{ Resource and keymap settings -usermodmap=$HOME/.Xmodmap -userresources=$HOME/.Xresources -sysmodmap=/etc/X11/xinit/.Xmodmap -sysresources=/etc/X11/xinit/.Xresources - -# Merge system and user resources and keymaps -if [ -f $sysresources ]; then - /usr/bin/xrdb -merge $sysresources -fi +usermodmap="$HOME/.Xmodmap" +userresources="$HOME/.Xresources" +sysmodmap="/etc/X11/xinit/.Xmodmap" +sysresources="/etc/X11/xinit/.Xresources" -if [ -f $sysmodmap ]; then - /usr/bin/xmodmap $sysmodmap -fi - -if [ -f $userresources ]; then - /usr/bin/xrdb -merge $userresources -fi - -if [ -f $usermodmap ]; then - /usr/bin/xmodmap $usermodmap -fi +# Merge system and user resources and keymaps +[ -f $sysresources ] && /usr/bin/xrdb -merge $sysresources +[ -f $sysmodmap ] && /usr/bin/xmodmap $sysmodmap +[ -f $userresources ] && /usr/bin/xrdb -merge $userresources +[ -f $usermodmap ] && /usr/bin/xmodmap $usermodmap # }}} @@ -58,77 +54,40 @@ fi # Pointer control, acceleration and threshold #/usr/bin/xset m 30/10 4 -# Touchpad control -# - disable tapping/scrolling when typing -#/usr/bin/syndaemon -t -i 2 & - # Pointer appearance # - xcb does not support Xcursor yet /usr/bin/xsetroot -cursor_name left_ptr -# Fix broken (HAL) key mappings -# - Lock key +# Fix broken HAL key mappings +# - Lock key, Presentation key, Sync key /usr/bin/sudo /usr/bin/setkeycodes e06e 152 -# - Presentation key /usr/bin/sudo /usr/bin/setkeycodes e075 217 -# - Sync key /usr/bin/sudo /usr/bin/setkeycodes e079 173 -# - Euro key +# - Euro key, Dollar key /usr/bin/sudo /usr/bin/setkeycodes e033 159 -# - Dollar key /usr/bin/sudo /usr/bin/setkeycodes e034 151 # }}} -# {{{ Display settings -# -# Brightness level -# - xbacklight can't be used with legacy control, so set level first -#/usr/bin/xbacklight -set 10 - -# Legacy control solves resetting brightness levels -#/usr/bin/xrandr --output LVDS1 --set BACKLIGHT_CONTROL legacy - -# Ignore reported display size and force DPI -#/usr/bin/xrandr --dpi 96 - -# Force LVDS as the primary screen -#/usr/bin/xrandr --output LVDS1 --primary -# }}} - - # {{{ Autostart settings # -# Start the GnuPG agent and enable the OpenSSH agent emulation +# Play a startup sound +/usr/bin/ogg123 -q "$HOME/.fvwm/sounds/Dream/Startup.ogg" & + +# Start the GnuPG agent and enable OpenSSH agent emulation if ( /bin/pidof gpg-agent >/dev/null ); then - eval "$(cat $HOME/.gnupg/gpg-agent-info)" - eval "$(cut -d= -f 1 < $HOME/.gnupg/gpg-agent-info | xargs echo export)" + eval "$(cat $gnupglog)" + eval "$(cut -d= -f1 $gnupglog | xargs echo export)" else - eval "$(gpg-agent --enable-ssh-support --daemon)" + eval "$(gpg-agent --enable-ssh-support --daemon)" fi -# Play a startup sound -#/usr/bin/ogg123 -q $HOME/.fvwm/sounds/Startup.ogg & - -# Set the wallpaper(s) for all screens -# - awesome 3 calls nitrogen -#/usr/bin/nitrogen --restore & - -# Preload KDE daemons -#/usr/bin/kdeinit4 & - -# Systray if needed -# - awesome 3 has its own systray -#/usr/bin/stalonetray -bg '#1a1a1a' -geometry 124x24+1156+776 --sticky --window-layer top & -#/usr/bin/trayer --edge top --align right --widthtype pixel --heighttype pixel --height 16 \ -# --width 70 --expand false --transparent true --alpha 0 --tint 0x3f3f3f & - # Start the GNU Emacs daemon -/usr/bin/emacs --daemon & +[ -e "/tmp/emacs$UID/server" ] || /usr/bin/emacs --daemon & # Xwrits reminds you to take wrist breaks and avoid RSI -/usr/bin/xwrits typetime=40 clock breakclock top \ - ready-picture=$HOME/.xwrits/ready.gif rest-picture=$HOME/.xwrits/rest.gif warning-picture=$HOME/.xwrits/warning.gif & +/usr/bin/xwrits typetime=45 clock breakclock top ready-picture="$HOME/.xwrits/ready.gif" \ + rest-picture="$HOME/.xwrits/rest.gif" warning-picture="$HOME/.xwrits/warning.gif" & # Open a terminal emulator on the first tag # - resume the old screen session or start a new one @@ -139,16 +98,16 @@ fi # {{{ Window manager selection case $1 in twm) - exec twm - ;; + exec twm + ;; fvwm) - exec fvwm2 - ;; + exec fvwm2 + ;; kde) - exec startkde - ;; + exec startkde + ;; *) - exec awesome - ;; + exec awesome + ;; esac # }}} -- cgit v1.2.3