STARTWayland, basically all my dotfiles + wayland equivalent to xinit
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
startw/conf/home/xinitrc

154 lines
4.5 KiB

5 years ago
#!/bin/sh
# Start an X11 session
5 years ago
# Variable definitions
STARTW_ROOT=${HOME}/.local/share/startw
DOTS_ROOT=${STARTW_ROOT}/conf
5 years ago
STARTX_LOG_FILE=${STARTW_ROOT}/"err-x11-$(date +%F).log"
5 years ago
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
4 years ago
userresources=${HOME}/.Xresources
5 years ago
# 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
#
# USER CONFIGURATION
#
5 years ago
# Remove broken links
find -L "$HOME" -maxdepth 1 -type l -delete
find -L "$HOME/.config" -maxdepth 1 -type l -delete
5 years ago
# The conf folder contains two subfolders home
# 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
5 years ago
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
ln -sf "$f" "$HOME/.$(basename "$f")"
done
for f in "$DOTS_ROOT"/config/* ; do
# 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
ln -sf "$f" "$HOME/.config/"
done
#
# SET ENVIRONMENT VARIABLES
#
# Disable less history
export LESSHISTFILE="-"
# Use gtk2 themes for Qt applications
export QT_QPA_PLATFORMTHEME="gtk2"
# Fix java applications for tiling WMs
export _JAVA_AWT_WM_NONREPARENTING=1
# Set the hardware acceleration driver
export LIBVA_DRIVER_NAME=radeonsi
export VDPAU_DRIVER=radeonsi
4 years ago
#aco is enabled by default
#export RADV_PERFTEST=aco
export MOZ_X11_EGL=1
# Set the default interface used by wpa_cli
export WPA_CLI_INTERFACE=wlp2s0
# Set the editor
4 years ago
export EDITOR=micro
export VISUAL=micro
# 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
5 years ago
xdg-user-dirs-update 2>&1 | "$STARTW_ROOT"/addts >> "$STARTX_LOG_FILE" &
# 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
export WGETRC="$XDG_CONFIG_HOME"/wget/wgetrc
export GOPATH="$XDG_DATA_HOME"/go
export WINEPREFIX="$XDG_DATA_HOME"/wineprefixes/default
export ABDUCO_SOCKET_DIR="$XDG_CACHE_HOME"/abduco
export GRIPHOME="$XDG_CONFIG_HOME"/grip
export INPUTRC="$XDG_CONFIG_HOME"/inputrc
export HISTFILE="$XDG_DATA_HOME"/bash/history
export WEECHAT_HOME="$XDG_CONFIG_HOME"/weechat
export TERMINFO="$XDG_DATA_HOME"/terminfo
export TERMINFO_DIRS="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo
userresources="$XDG_CONFIG_HOME"/X11/Xresources
usermodmap="$XDG_CONFIG_HOME"/X11/Xmodmap
#export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
# Set user script dir
export SCRIPT_DIR="$XDG_CONFIG_HOME"/scripts
# Wallpaer
5 years ago
export WALLPAPER="$HOME/Pictures/walls/sculptor.png"
# Lock screen config
export XSECURELOCK_SAVER=saver_mpv
export XSECURELOCK_LIST_VIDEOS_COMMAND="echo ~/Videos/bounce.mkv"
#
# XORG CONFIGURATION
#
# 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
xsetroot -cursor_name left_ptr &
4 years ago
setxkbmap it,gb -option grp:lctrl_lwin_toggle
xrandr --dpi 130
# Set middle mouse scrolling for ps2 trackball
xinput --set-prop 'GASIA PS2toUSB Adapter Mouse' 'libinput Scroll Method Enabled' 0, 0, 1
5 years ago
#
# LAUNCH APPLICATIONS
#
5 years ago
if ! pgrep -x "devmon" > /dev/null
then
devmon 2>&1 | "$STARTW_ROOT"/addts >> "$STARTX_LOG_FILE" &
5 years ago
fi
4 years ago
nitrogen --restore 2>/dev/null
xset s on
4 years ago
xset s 600/660
5 years ago
#
5 years ago
# START WINDOW MANAGER
#
4 years ago
# Statusbar
status &
hkd &
# Is it time to get those christmas feels?
if [ "$(date +'%c=m')" = "12" ]; then
xsnow &
fi
sbl -r
while true; do dwm 2> ~/.dwm.log; done