Skip to content

Instantly share code, notes, and snippets.

@DelusionalLogic
Created October 25, 2015 22:45
Show Gist options
  • Save DelusionalLogic/47c492462c306d05c974 to your computer and use it in GitHub Desktop.
Save DelusionalLogic/47c492462c306d05c974 to your computer and use it in GitHub Desktop.
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
# Here bspwm is kept as default
session=${1:-bspwm}
case $session in
awesome ) exec awesome;;
bspwm ) exec bspwm;;
catwm ) exec catwm;;
cinnamon ) exec cinnamon-session;;
dwm ) exec dwm;;
enlightenment ) exec enlightenment_start;;
ede ) exec startede;;
fluxbox ) exec startfluxbox;;
gnome ) exec gnome-session;;
gnome-classic ) exec gnome-session --session=gnome-classic;;
i3|i3wm ) exec i3;;
icewm ) exec icewm-session;;
jwm ) exec jwm;;
kde ) exec startkde;;
mate ) exec mate-session;;
monster|monsterwm ) exec monsterwm;;
notion ) exec notion;;
openbox ) exec openbox-session;;
unity ) exec unity;;
xfce|xfce4 ) exec startxfce4;;
xmonad ) exec xmonad;;
wmutil ) exec /home/delusional/wmutil-session;;
# No known session, try to run it as command
*) exec $1;;
esac
#!/bin/bash
echo "HELLO WORLD"
sxhkd &
urxvt &
#! /bin/bash
#
# wmutil-session
#
# This script is a session launcher for wmutil.
# It is based on similar scripts included with Openbox.
if [ -n "$1" ]; then
echo "Usage: wmutil-session"
echo
exit 1
fi
# Multi-user support:
state_prefix=${XDG_CACHE_HOME:-"$HOME/.cache"}
mkdir -p "${state_prefix}"
if [ ! -d "${state_prefix}" ]; then
echo "wmutil-session: cache directory ‘${state_prefix}‘ is missing."
echo
exit 1
elif [ ! -w "${state_prefix}" ]; then
echo "wmutil-session: cache directory ‘${state_prefix}‘ is not writable."
echo
exit 1
fi
state_path=$(mktemp -d "${state_prefix}/wmutil-session.XXXXXX")
if [ $? -ne 0 ]; then
echo "wmutil-session: failed to create state directory ‘${state_path}‘."
echo
exit 1
fi
# Trap: make sure everything started in ~/.config/wmutil/autostart is
# signalled when this script exits or dies. Also clean up $state_path.
function on_exit {
for child in $(jobs -p); do
jobs -p | grep -q $child && kill $child
done
# Extra paranoia
[[ -d "${state_path}" && -w "${state_path}" ]] && rm -rf -- "${state_path}"
}
trap on_exit EXIT SIGHUP SIGINT SIGTERM
# Environment and autostart:
source_these=(
"/etc/profile"
"${HOME}/.profile"
"${XDG_CONFIG_HOME:-"$HOME/.config"}/wmutil/autostart"
)
for file in "${source_these[@]}"; do
[ -r "${file}" ] && . "${file}"
done
# Launch sxhkd:
sleep 10
xwait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment