From 6f638e5aaa109b4ce629037ca916c943cfa0b4e0 Mon Sep 17 00:00:00 2001 From: natemaia Date: Tue, 28 Aug 2018 21:46:36 -0700 Subject: [PATCH] Simplify xinit --- home/.xinitrc | 27 +++++++-------------------- home/.xprofile | 3 +-- home/.zprofile | 14 -------------- 3 files changed, 8 insertions(+), 36 deletions(-) diff --git a/home/.xinitrc b/home/.xinitrc index 7aec520d..e4dca6a9 100755 --- a/home/.xinitrc +++ b/home/.xinitrc @@ -2,14 +2,8 @@ # this file is executed when calling startx -# set session below, or in console run: startx ~/.xinitrc SESSION - -# session to run if none passed as first arg ($1) -session="${1:-openbox}" - -# set environment wm for use in scripts -WM="${session%-session}" -export WM="${WM#start}" +# session to run +session="openbox-session" # default arch xinit scripts if [ -d /etc/X11/xinit/xinitrc.d ]; then @@ -22,16 +16,9 @@ fi [ -f /etc/X11/xinit/.Xmodmap ] && xmodmap /etc/X11/xinit/.Xmodmap [ -f ~/.Xmodmap ] && xmodmap ~/.Xmodmap [ -f ~/.Xresources ] && xrdb -merge ~/.Xresources -[ -f ~/.xprofile ] && source ~/.xprofile +[ -f ~/.xprofile ] && . ~/.xprofile -# do NOT put commands below the exec lines -case $session in - dwm) exec dwm ;; - bsp|bspwm) exec bspwm ;; - i3|i3wm|i3-gaps) exec i3 ;; - gnome|gnome-session) exec gnome-session ;; - xfce|xfce4|startxfce4) exec startxfce4 ;; - openbox|openbox-session) exec openbox-session ;; - cinnamon|cinnamon-session) exec cinnamon-session ;; - *) exec "$session" # Unknown, try running it -esac +# don't put commands below the exec line + +# launch the session + exec $session diff --git a/home/.xprofile b/home/.xprofile index b667d001..090deb58 100644 --- a/home/.xprofile +++ b/home/.xprofile @@ -11,12 +11,11 @@ # restore the background nitrogen --restore & +# allow pressing super alone to simulate two key presses if [[ $session == 'dwm' ]]; then - # allow pressing super alone to simulate Alt-p ksuperkey -e 'Super_L=Alt_L|p' & ksuperkey -e 'Super_R=Alt_L|p' & else - # allow pressing super alone to simulate Alt-p ksuperkey -e 'Super_L=Alt_L|F1' & ksuperkey -e 'Super_R=Alt_L|F1' & fi diff --git a/home/.zprofile b/home/.zprofile index 2f549ea7..d67c775e 100644 --- a/home/.zprofile +++ b/home/.zprofile @@ -1,19 +1,5 @@ # .zprofile # sourced by zsh when used as a login shell -# Uncomment the below example for multiple sessions -# -# using Ctrl-Alt-F2 will switch you to tty2, and i3 will be started -# using Ctrl-Alt-F1 will switch back to tty1 and openbox -# -# if [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]]; then -# exec startx ~/.xinitrc openbox -# elif [[ -z $DISPLAY && $XDG_VTNR -eq 2 ]]; then -# exec startx ~/.xinitrc i3 -# fi - - # automatically run startx when logging in on tty1 -# comment this out if using the above example - [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx -- vt1 &>/dev/null