From 1b419139a9ba67ddcf1b77cb806b6437794264f5 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 3 Feb 2017 22:03:44 -0600 Subject: [PATCH] tons of stuff for lightdm integration --- env/wm/bspwmrc | 7 ++++++- env/wm/sxhkdrc | 3 ++- env/x/xinitrc | 3 ++- env/x/xloadresources | 40 +++++++++++++++++++++------------------- env/x/xprofile | 27 ++++++++++++++++++++------- env/x/xresources | 10 ++++------ scripts/get_x_fonts.sh | 4 ++-- xsession-launch.bash | 11 +++++++++++ 8 files changed, 68 insertions(+), 37 deletions(-) create mode 100755 xsession-launch.bash diff --git a/env/wm/bspwmrc b/env/wm/bspwmrc index 7177d8a..7792164 100755 --- a/env/wm/bspwmrc +++ b/env/wm/bspwmrc @@ -1,12 +1,17 @@ #!/usr/bin/env sh -source "$DOTFILES_PATH/variables.bash" +source "$HOME/.dotfiles/variables.bash" if [ -e "$BSPWM_STATE" ] ; then bspc wm -l "$BSPWM_STATE" rm "$BSPWM_STATE" fi +# start the bar if we want it +if [ "$BAR_ON_XINIT" -eq 1 ]; then + "$BAR_PATH/start.bash" & +fi + source "$DOTFILES_PATH/env/wm/bspwm_config" source "$DOTFILES_PATH/scripts/get_color.sh" source "$DOTFILES_PATH/scripts/get_x_fonts.sh" diff --git a/env/wm/sxhkdrc b/env/wm/sxhkdrc index 46c8e1c..b824584 100755 --- a/env/wm/sxhkdrc +++ b/env/wm/sxhkdrc @@ -170,7 +170,8 @@ super + space # lock the desktop super + ctrl + shift + l - $SHELL -c '$DOTFILES_PATH/env/x/screensaver/lock.sh' + dm-tool lock + # $SHELL -c '$DOTFILES_PATH/env/x/screensaver/lock.sh' # spawn gui file explorer super + e diff --git a/env/x/xinitrc b/env/x/xinitrc index 625d9a1..262678f 100644 --- a/env/x/xinitrc +++ b/env/x/xinitrc @@ -1,5 +1,7 @@ #!/bin/sh +echo "xstartup: XINIT" >> "$HOME/.xstartup_log" + if [ -f "$HOME/.xprofile" ]; then source "$HOME/.xprofile" fi @@ -18,5 +20,4 @@ unclutter & compton & exec "$DOTFILES_PATH/env/wm/wmstart" -# exec budgie-desktop diff --git a/env/x/xloadresources b/env/x/xloadresources index 56c6f79..08d28ac 100644 --- a/env/x/xloadresources +++ b/env/x/xloadresources @@ -1,40 +1,42 @@ #!/usr/bin/env bash -userresources=$HOME/.Xresources -usercolors=$HOME/.Xresources.colors -userenv=$HOME/.Xresources.env -usermodmap=$HOME/.Xmodmap -sysresources=/etc/X11/xinit/.Xresources -sysmodmap=/etc/X11/xinit/.Xmodmap +userresources="$HOME/.Xresources" +usercolors="$HOME/.Xresources.colors" +userenv="$HOME/.Xresources.env" +usermodmap="$HOME/.Xmodmap" +sysresources="/etc/X11/xinit/.Xresources" +sysmodmap="/etc/X11/xinit/.Xmodmap" -if [ -f $sysresources ]; then - xrdb -merge $sysresources >/dev/null 2>&1 +echo "xstartup: resources $userresources $userenv" >> "$HOME/.xstartup_log" + +if [ -f "$sysresources" ]; then + xrdb -merge "$sysresources" >/dev/null 2>&1 fi -if [ -f $sysmodmap ]; then - xmodmap $sysmodmap >/dev/null 2>&1 +if [ -f "$sysmodmap" ]; then + xmodmap "$sysmodmap" >/dev/null 2>&1 fi if [ -f "$userresources" ]; then - xrdb -merge "$userresources" >/dev/null 2>&1 + xrdb -merge "$userresources" >/dev/null 2>&1 fi if [ -f "$usercolors" ]; then - xrdb -merge "$usercolors" >/dev/null 2>&1 + xrdb -merge "$usercolors" >/dev/null 2>&1 fi if [ -f "$userenv" ]; then - xrdb -merge "$userenv" >/dev/null 2>&1 + xrdb -merge "$userenv" >/dev/null 2>&1 fi if [ -f "$usermodmap" ]; then - xmodmap "$usermodmap" >/dev/null 2>&1 + xmodmap "$usermodmap" >/dev/null 2>&1 fi -if [ -d /etc/X11/xinit/xinitrc.d ] ; then - for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do - [ -x "$f" ] && . "$f" - done - unset f +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 diff --git a/env/x/xprofile b/env/x/xprofile index da74392..c5081d5 100644 --- a/env/x/xprofile +++ b/env/x/xprofile @@ -1,19 +1,29 @@ #!/bin/sh -if [ -f ~/.fehbg ]; then - ~/.fehbg & +source "$HOME/.dotfiles/variables.bash" + +echo '' > "$HOME/.xstartup_log" +echo "xstartup: $DOTFILES_PATH" >> "$HOME/.xstartup_log" + +if [ -f "$HOME/.fehbg" ]; then + "$HOME/.fehbg" & fi -source "$DOTFILES_PATH/env/x/xloadresources" -source "$DOTFILES_PATH/variables.bash" +if [ -f "$DOTFILES_PATH/env/x/xloadresources" ]; then + source "$DOTFILES_PATH/env/x/xloadresources" +fi + +if [ -f "$DOTFILES_PATH/variables.bash" ]; then + source "$DOTFILES_PATH/variables.bash" +fi # keyrepeat settings xset r rate 250 80 & # no screen blanking -xset -dpms & -xset s noblank & -xset s off & +# xset -dpms & +# xset s noblank & +# xset s off & if [ -d "/usr/lib/nvidia" ]; then export LD_LIBRARY_PATH=/usr/lib/nvidia @@ -22,3 +32,6 @@ fi if [ -f "$HOME/.xprofile.env" ]; then source "$HOME/.xprofile.env" fi + +unclutter & +compton & diff --git a/env/x/xresources b/env/x/xresources index 53ff7dc..6705983 100755 --- a/env/x/xresources +++ b/env/x/xresources @@ -17,10 +17,10 @@ !#define primaryfont xft:Monaco-11 !#define primaryletterspace -1 -*font: primaryfont -*faceName: primaryfont -*boldFont: primaryfont -*letterSpace: primaryletterspace +*font: xft:xos4 Terminus-10 +*faceName: xft:xos4 Terminus-10 +*boldFont: xft:xos4 Terminus-10 +*letterSpace: 0 *scrollBar: false *cursorUnderline: true *cursorBlink: true @@ -29,8 +29,6 @@ *utf8: 2 *scaleHeight: 1 -emacs.font: emacspfont - *depth: 32 URxvt.internalBorder: 24 diff --git a/scripts/get_x_fonts.sh b/scripts/get_x_fonts.sh index bb3b24f..daabe42 100644 --- a/scripts/get_x_fonts.sh +++ b/scripts/get_x_fonts.sh @@ -5,8 +5,8 @@ if [ -a "$HOME/.Xresources.env" ]; then XRES_FILE="$HOME/.Xresources.env" fi -PRIMARY_FONT_XRESOURCES=$(grep "^#define primaryfont xft:" "$XRES_FILE" | grep -v "/\*" | head -n 1) -export PRIMARY_FONT_FAMILY_WITH_SIZE=${PRIMARY_FONT_XRESOURCES:24} +PRIMARY_FONT_XRESOURCES=$(grep "^\*font: xft:" "$XRES_FILE" | grep -v "/\*" | head -n 1) +export PRIMARY_FONT_FAMILY_WITH_SIZE=${PRIMARY_FONT_XRESOURCES:11} export PRIMARY_FONT_FAMILY=$(echo $PRIMARY_FONT_FAMILY_WITH_SIZE | sed 's/\-.*//') export PRIMARY_FONT_SIZE=$(echo $PRIMARY_FONT_FAMILY_WITH_SIZE | sed 's/.*\-//') diff --git a/xsession-launch.bash b/xsession-launch.bash new file mode 100755 index 0000000..7f80dd2 --- /dev/null +++ b/xsession-launch.bash @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd) +source "$DIR/variables.bash" + +export DOTFILES_PATH="$DOTFILES_PATH" + +# source "$DOTFILES_PATH/env/x/xloadresources" + +bspwm +