diff options
-rwxr-xr-x | xsession.dot.link | 108 | ||||
-rwxr-xr-x | xsessionrc.dot.link | 92 |
2 files changed, 90 insertions, 110 deletions
diff --git a/xsession.dot.link b/xsession.dot.link deleted file mode 100755 index 8daea19..0000000 --- a/xsession.dot.link +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -# -# .xsession: set basic X11 environment -# - -# Avoid duplicate initialization -if [ "$XSESSION_SOURCED" == "true" ]; then - exit -fi - -# Background image -BACKGROUND="" - -# Session applications -PROGRAMS="xconky" - -# OS Version -OSVERSION="`cut -d . -f 1 /etc/debian_version`" - -# Hostname -HOSTNAME="`cat /etc/hostname`" - -# Make sure to load the profile -. $HOME/.profile - -# Start xscreensaver -if [ -e "/usr/bin/xscreensaver" ]; then - xscreensaver -no-splash & -fi - -# Custom -if [ -e "$HOME/.custom/xsession" ]; then - . $HOME/.custom/xsession -fi - -# Set background -if [ "$BACKGROUND" == "all" ]; then - feh --bg-scale --randomize $HOME/.config/themes/backgrounds/* -elif [ ! -z "$BACKGROUND" ] && [ "$BACKGROUND" != "unset" ]; then - #Esetroot -scale $HOME/.config/themes/backgrounds/$BACKGROUND - feh --bg-scale $HOME/.config/themes/backgrounds/$BACKGROUND -elif [ "$BACKGROUND" != "unset" ]; then - xsetroot -solid black -fi - -# Set window manager -if [ -z "$WINDOW_MANAGER" ]; then - WINDOW_MANAGER='awesome' -fi - -# Additional applications depending on the machine type -if laptop-detect; then - PROGRAMS="$PROGRAMS xwicd" -else - PROGRAMS="$PROGRAMS" -fi - -# Start session applications -for program in $PROGRAMS; do - $program & -done - -# Apply custom keyboard configuration -if [ -f "$HOME/.Xmodmaps/$HOSTNAME" ]; then - xmodmap $HOME/.Xmodmaps/$HOSTNAME - - # Why xmodmap has to run twice to some changes take place? - # https://faq.i3wm.org/question/558/xmodmap-loading/ - # https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/700309 - xmodmap $HOME/.Xmodmaps/$HOSTNAME -fi - -# Fix mumble configuration, which varies depending on machine audio -if [ -f "$HOME/.config/Mumble/Mumble-$HOSTNAME.conf" ]; then - ( - cd $HOME/.config/Mumble - mv Mumble.conf Mumble-$HOSTNAME.conf.backup - ln -s Mumble-$HOSTNAME.conf Mumble.conf - ) -fi - -# Clipboard management -# See http://mutelight.org/subtleties-of-the-x-clipboard -#if which autocutsel &> /dev/null; then -# autocutsel -fork & -# autocutsel -selection PRIMARY -fork & -#fi -if which parcellite &> /dev/null; then - parcellite -n & -fi - -# Execute window manager -if [ "$OSVERSION" != "6" ]; then - # See https://bugzilla.redhat.com/show_bug.cgi?id=783568 - # https://bugs.launchpad.net/ubuntu/+source/gnome-keyring/+bug/932177 - # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=653011 - # https://bugzilla.gnome.org/show_bug.cgi?id=660240 - #unset GNOME_KEYRING_PID - #unset GNOME_KEYRING_CONTROL - #eval $(gnome-keyring-daemon --start --components=pkcs11,gpg,secrets) - eval $(gnome-keyring-daemon --start --components=pkcs11,secrets) - - # Start window manager - $WINDOW_MANAGER -fi - -# Avoid duplicate initialization -export XSESSION_SOURCED="true" diff --git a/xsessionrc.dot.link b/xsessionrc.dot.link index 502ac35..c35afc8 100755 --- a/xsessionrc.dot.link +++ b/xsessionrc.dot.link @@ -1,12 +1,100 @@ #!/bin/bash # -# .xsessionrc: wrapper for xsession +# .xsession: set basic X11 environment # +# Background image +BACKGROUND="" + +# Session applications +PROGRAMS="xconky" + # OS Version OSVERSION="`cut -d . -f 1 /etc/debian_version`" +# Hostname +HOSTNAME="`cat /etc/hostname`" + +# Make sure to load the profile +. $HOME/.profile + +# Start xscreensaver +if [ -e "/usr/bin/xscreensaver" ]; then + xscreensaver -no-splash & +fi + +# Custom +if [ -e "$HOME/.custom/xsession" ]; then + . $HOME/.custom/xsession +fi + +# Set background +if [ "$BACKGROUND" == "all" ]; then + feh --bg-scale --randomize $HOME/.config/themes/backgrounds/* +elif [ ! -z "$BACKGROUND" ] && [ "$BACKGROUND" != "unset" ]; then + #Esetroot -scale $HOME/.config/themes/backgrounds/$BACKGROUND + feh --bg-scale $HOME/.config/themes/backgrounds/$BACKGROUND +elif [ "$BACKGROUND" != "unset" ]; then + xsetroot -solid black +fi + +# Set window manager +if [ -z "$WINDOW_MANAGER" ]; then + WINDOW_MANAGER='awesome' +fi + +# Additional applications depending on the machine type +if laptop-detect; then + PROGRAMS="$PROGRAMS xwicd" +else + PROGRAMS="$PROGRAMS" +fi + +# Start session applications +for program in $PROGRAMS; do + $program & +done + +# Apply custom keyboard configuration +if [ -f "$HOME/.Xmodmaps/$HOSTNAME" ]; then + xmodmap $HOME/.Xmodmaps/$HOSTNAME + + # Why xmodmap has to run twice to some changes take place? + # https://faq.i3wm.org/question/558/xmodmap-loading/ + # https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/700309 + xmodmap $HOME/.Xmodmaps/$HOSTNAME +fi + +# Fix mumble configuration, which varies depending on machine audio +if [ -f "$HOME/.config/Mumble/Mumble-$HOSTNAME.conf" ]; then + ( + cd $HOME/.config/Mumble + mv Mumble.conf Mumble-$HOSTNAME.conf.backup + ln -s Mumble-$HOSTNAME.conf Mumble.conf + ) +fi + +# Clipboard management +# See http://mutelight.org/subtleties-of-the-x-clipboard +#if which autocutsel &> /dev/null; then +# autocutsel -fork & +# autocutsel -selection PRIMARY -fork & +#fi +if which parcellite &> /dev/null; then + parcellite -n & +fi + # Execute window manager if [ "$OSVERSION" != "6" ]; then - . $HOME/xsession + # See https://bugzilla.redhat.com/show_bug.cgi?id=783568 + # https://bugs.launchpad.net/ubuntu/+source/gnome-keyring/+bug/932177 + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=653011 + # https://bugzilla.gnome.org/show_bug.cgi?id=660240 + #unset GNOME_KEYRING_PID + #unset GNOME_KEYRING_CONTROL + #eval $(gnome-keyring-daemon --start --components=pkcs11,gpg,secrets) + eval $(gnome-keyring-daemon --start --components=pkcs11,secrets) + + # Start window manager + $WINDOW_MANAGER fi |