diff options
-rwxr-xr-x | .xsessionrc | 70 | ||||
-rwxr-xr-x | bin/xstartup | 58 |
2 files changed, 63 insertions, 65 deletions
diff --git a/.xsessionrc b/.xsessionrc index 79e31cab..e74e6727 100755 --- a/.xsessionrc +++ b/.xsessionrc @@ -1,17 +1,73 @@ #!/bin/sh -export PATH="${HOME}/bin:${PATH}" +. $HOME/.shenv + +# ---- no bell please xset b off + +# ---- keyboard settings + xset r rate 380 25 setxkbmap -option ctrl:nocaps +xmodmap ~/.xmodmaprc + +# enable numlock if using USB keyboard +lsusb | grep -q "Chicony Electronics Co., Ltd" \ + && numlockx on + +# ---- monitor settings + xset dpms 600 -xss-lock -- i3lock -t -c 000000 -n --image=$HOME/local/lock.png & -#gnome-settings-daemon & -nitrogen --restore -redshift-gtk & -nm-applet & -caffeine-indicator & + +# ---- screen locking + +# kill any other lockers that might have snuck in +pkill -u $USER light-locker +pkill -u $USER xscreensaver + +# turn over lid switch handling to logind, if needed +if which xfconf-query; then + xfconf-query -c xfce4-power-manager -n \ + -p /xfce4-power-manager/logind-handle-lid-switch \ + -t bool -s true +fi + +# ... and then hook i3lock into logind +if [ -L "$HOME/local/lock.png" ]; then + # note that i3lock needs a file in PNG format + xss-lock -- i3lock -t -c 000000 -n --image=$HOME/local/lock.png & +else + xss-lock -- i3lock -c 000000 -n & +fi + +# ---- GNOME daemons & GTK + +# Have the GNOME keyring daemon cache our GPG key passphrase for no +# more than 20 minutes. Cache time cannot be controlled for SSH keys +gsettings set org.gnome.crypto.cache gpg-cache-ttl 1200 +gsettings set org.gnome.crypto.cache gpg-cache-method 'timeout' eval $(gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh) export GNOME_KEYRING_CONTROL GNOME_KEYRING_PID GPG_AGENT_INFO SSH_AUTH_SOCK + +gnome-settings-daemon & + +# ---- clear SSH keys out of gnome-keyring-daemon when idle (per GNOME +# ---- bug #525574 it can't do this itself yet) + +pkill -u $USER idlesshclear +idlesshclear & + +# ---- audio + +if ! pgrep -u $USER pulseaudio; then + pulseaudio & +fi + +# ---- startup applications + +nitrogen --restore +redshift-gtk & # co-ords from config file +nm-applet & +caffeine-indicator & diff --git a/bin/xstartup b/bin/xstartup deleted file mode 100755 index 332b4fe8..00000000 --- a/bin/xstartup +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh - -. $HOME/.shenv - -# ---- no bell please - -xset b off - -# ---- keyboard settings - -setxkbmap -option ctrl:nocaps -xmodmap ~/.xmodmaprc -xbindkeys - -# enable numlock if using USB keyboard -lsusb | grep -q "Chicony Electronics Co., Ltd" \ - && numlockx on - -# ---- GTK settings - -# Note that at least some of these won't take effect until logging in -# again to restart services. - -# Have the GNOME keyring daemon cache our GPG key passphrase for no -# more than 20 minutes. Cache time cannot be controlled for SSH keys -gsettings set org.gnome.crypto.cache gpg-cache-ttl 1200 -gsettings set org.gnome.crypto.cache gpg-cache-method 'timeout' - -# ---- clear SSH keys out of gnome-keyring-daemon when idle (per GNOME -# ---- bug #525574 it can't do this itself yet) - -pkill -u $USER idlesshclear -idlesshclear & - -# ---- screen locking - -# first replace light-locker with xscreensaver -pkill light-locker -pgrep -u "$USER" xscreensaver || xscreensaver & - -# turn over lid switch handling to logind -xfconf-query -c xfce4-power-manager -n \ - -p /xfce4-power-manager/logind-handle-lid-switch \ - -t bool -s true - -# ... and then use xss-lock to make sure the screen still gets locked -xss-lock -- xscreensaver-command -lock & - -# ---- other stuff to launch - -redshift-gtk -l 53.57:1.5 -t 6500:3700 & -caffeine-indicator & -firefox & -emacs --daemon - -# ---- fire up my window manager - -#exec xmonad --replace |