#!/usr/bin/env bash # # ~/.xinitrc -- execute commands before starting X # # On my P43s, run X on NVIDIA if required. Requires gpu-select. # https://github.com/manu-mannattil/gpu-select [[ -f /etc/gpu-select/state ]] && { gpu=$(~/.location [[ -f "$HOME/.location" ]] && { loc=$(sed '/^\s*#/d /^\s*$/d s/\s*#.*$// s/^\s*//' "$HOME/.location" | head -n 1) redshift -l "$loc" & } # Set the background color. bgcolor="#333333" if command -v hsetroot &>/dev/null then # Compton doesn't work with xsetroot. # https://github.com/chjj/compton/issues/162 hsetroot -solid "$bgcolor" else xsetroot -solid "$bgcolor" fi # Use dunst for notifications. dunst & # Control computer usage. xwrits top clock breakclock mouse=5 & # A compositor is required with newer Intel driver. picom & # Since updating to Debian 10.10, launching the WM using dbus-launch # seems to be required to have a nonempty $DBUS_SESSION_BUS_ADDRESS. # Without this, several applications (evince, inkscape, etc.) wait 25 # seconds (some hard-coded time related to D-Bus) before showing their # GUI. case "$DE" in i3) exec dbus-launch --exit-with-session --sh-syntax i3 ;; openbox) # Use tint2 for the taskbar, systray, etc. tint2 & exec dbus-launch --exit-with-session --sh-syntax openbox ;; *) echo >&2 "${0##*/}: DE must be either 'i3' or 'openbox'" exit 1 ;; esac