parent
58bcebd6f5
commit
ad43599178
@ -1,43 +1,128 @@ |
|||||||
#!/bin/sh |
#!/bin/sh |
||||||
|
# Start an X11 session |
||||||
|
|
||||||
userresources=$HOME/.Xresources |
# Variable definitions |
||||||
usermodmap=$HOME/.Xmodmap |
STARTW_ROOT=${HOME}/.local/share/startw |
||||||
|
DOTS_ROOT=${STARTW_ROOT}/conf |
||||||
|
STARTX_LOG_FILE=${STARTW_ROOT}/"err-$(date +%F).log" |
||||||
|
userresources=${HOME}/.Xresources |
||||||
|
usermodmap=${HOME}/.Xmodmap |
||||||
sysresources=/etc/X11/xinit/.Xresources |
sysresources=/etc/X11/xinit/.Xresources |
||||||
sysmodmap=/etc/X11/xinit/.Xmodmap |
sysmodmap=/etc/X11/xinit/.Xmodmap |
||||||
|
|
||||||
|
# Boilerplate for systemd-less systems |
||||||
|
if test -z "${XDG_RUNTIME_DIR}"; then |
||||||
|
XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir |
||||||
|
export XDG_RUNTIME_DIR |
||||||
|
if ! test -d "${XDG_RUNTIME_DIR}"; then |
||||||
|
mkdir "${XDG_RUNTIME_DIR}" |
||||||
|
chmod 0700 "${XDG_RUNTIME_DIR}" |
||||||
|
fi |
||||||
|
fi |
||||||
|
|
||||||
|
# |
||||||
|
# XORG CONFIGURATION |
||||||
|
# |
||||||
|
|
||||||
# merge in defaults and keymaps |
# 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 |
||||||
|
|
||||||
if [ -f $sysresources ]; then |
# |
||||||
xrdb -merge $sysresources |
# USER CONFIGURATION |
||||||
fi |
# |
||||||
|
|
||||||
if [ -f $sysmodmap ]; then |
# Remove broken links |
||||||
xmodmap $sysmodmap |
find -L "$HOME" -maxdepth 1 -type l -delete |
||||||
fi |
find -L "$HOME/.config" -maxdepth 1 -type l -delete |
||||||
|
|
||||||
if [ -f "$userresources" ]; then |
# The conf folder contains two subfolders home |
||||||
xrdb -merge "$userresources" |
# and config, everything in the home folder will |
||||||
|
# be symlinked to $HOME as a hidden file/folder, |
||||||
|
# whereas everything in the config folder will be |
||||||
|
# symlinked to $HOME/.config as-is |
||||||
|
# Dotfiles in these folder will be ignored |
||||||
|
|
||||||
|
for f in "$DOTS_ROOT"/home/* ; do |
||||||
|
# If the filename already exists and it is not a link override it |
||||||
|
if [ -e "$HOME/.$(basename "$f")" ]; then |
||||||
|
if [ ! -L "$HOME/.$(basename "$f")" ]; then |
||||||
|
rm -rf "$HOME/.$(basename "$f")" |
||||||
|
fi |
||||||
fi |
fi |
||||||
|
ln -sf "$f" "$HOME/.$(basename "$f")" |
||||||
|
done |
||||||
|
|
||||||
if [ -f "$usermodmap" ]; then |
for f in "$DOTS_ROOT"/config/* ; do |
||||||
xmodmap "$usermodmap" |
# If the filename already exists and it is not a link override it |
||||||
|
if [ -e "$HOME/.config/$(basename "$f")" ]; then |
||||||
|
if [ ! -L "$HOME/.config/$(basename "$f")" ]; then |
||||||
|
rm -rf "$HOME/.config/$(basename "$f")" |
||||||
fi |
fi |
||||||
|
fi |
||||||
|
ln -sf "$f" "$HOME/.config/" |
||||||
|
done |
||||||
|
|
||||||
# start some nice programs |
# |
||||||
|
# SET ENVIRONMENT VARIABLES |
||||||
|
# |
||||||
|
|
||||||
if [ -d /etc/X11/xinit/xinitrc.d ] ; then |
# Fix java applications for tiling WMs |
||||||
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do |
export _JAVA_AWT_WM_NONREPARENTING=1 |
||||||
[ -x "$f" ] && . "$f" |
# Set the hardware acceleration driver |
||||||
done |
export LIBVA_DRIVER_NAME=radeonsi |
||||||
unset f |
export VDPAU_DRIVER=radeonsi |
||||||
|
# Set the default interface used by wpa_cli |
||||||
|
export WPA_CLI_INTERFACE=wlp2s0 |
||||||
|
# Set the editor |
||||||
|
export EDITOR=vis |
||||||
|
export VISUAL=vis |
||||||
|
# Application compatibility |
||||||
|
export GIO_USE_VFS="local" |
||||||
|
export GIO_USE_VOLUME_MONITOR="unix" |
||||||
|
# XDG specification variables |
||||||
|
export XDG_DATA_HOME=$HOME/.local/share |
||||||
|
export XDG_CACHE_HOME=$HOME/.cache |
||||||
|
export XDG_CONFIG_HOME=$HOME/.config |
||||||
|
export XDG_DOCUMENTS_DIR="$HOME/Documents" |
||||||
|
export XDG_DOWNLOAD_DIR="$HOME/Downloads" |
||||||
|
export XDG_MUSIC_DIR="$HOME/Music" |
||||||
|
export XDG_PICTURES_DIR="$HOME/Pictures" |
||||||
|
export XDG_VIDEOS_DIR="$HOME/Videos" |
||||||
|
# Clean home directory |
||||||
|
export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc |
||||||
|
export ATOM_HOME="$XDG_DATA_HOME"/atom |
||||||
|
export BASH_COMPLETION_USER_FILE="$XDG_CONFIG_HOME"/bash-completion/bash_completion |
||||||
|
export CARGO_HOME="$XDG_DATA_HOME"/cargo |
||||||
|
# Set user script dir |
||||||
|
export SCRIPT_DIR="$XDG_CONFIG_HOME"/scripts |
||||||
|
# Wallpaer |
||||||
|
export WALLPAPER="$HOME/Pictures/walls/waves.jpg" |
||||||
|
|
||||||
|
# |
||||||
|
# LAUNCH APPLICATIONS |
||||||
|
# |
||||||
|
|
||||||
|
if ! pgrep -x "devmon" > /dev/null |
||||||
|
then |
||||||
|
devmon 2>&1 | "$STARTW_ROOT"/addts >> "$STARTX_LOG_FILE" & |
||||||
fi |
fi |
||||||
|
./.fehbg |
||||||
|
polybar -r vantagev1 & |
||||||
|
#dhcpcd-gtk & |
||||||
|
|
||||||
xsetroot -cursor_name left_ptr & |
xsetroot -cursor_name left_ptr & |
||||||
setxkbmap it |
setxkbmap it |
||||||
# set in xresources |
# set in xresources |
||||||
xrandr --dpi 157 |
xrandr --dpi 157 |
||||||
./.fehbg |
|
||||||
polybar -r vantagev1 & |
# |
||||||
#dhcpcd-gtk & |
# START COMPOSITOR |
||||||
devmon & |
# |
||||||
exec bspwm |
|
||||||
|
# create a log file |
||||||
|
touch "$STARTX_LOG_FILE" |
||||||
|
|
||||||
|
exec bspwm 2>&1 | "$STARTW_ROOT"/addts >> "$STARTX_LOG_FILE" |
Loading…
Reference in new issue