X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/03bc64c4e89dadccb97ce8d1e22477ab8b7210dc..3cec048120c6d59a3f8916078f8f6a99d3e70025:/base/.xinitrc diff --git a/base/.xinitrc b/base/.xinitrc old mode 100755 new mode 100644 index ed72b5e..30db18b --- a/base/.xinitrc +++ b/base/.xinitrc @@ -1,45 +1,53 @@ -#!/bin/sh +#!/bin/zsh +# using zsh to load .zshenv (eg. for PATH) but file is sh-compatible -sysmodmap=/usr/local/etc/X11/xinit/.Xmodmap -sysresources=/usr/local/etc/X11/xinit/.Xresources -usermodmap="$HOME/.Xmodmap" -userresources="$HOME/.Xresources" +# Xorg settings +# TODO: create shim for cpp +xrdb -merge ~/.Xresources +xmodmap ~/.Xmodmap +xset r rate 290 26 & +xset m 1/1 0 & +xset s off +xset dpms 0 0 600 +find -L "${XDG_DATA_HOME:-~/share}/fonts" -mindepth 1 -maxdepth 2 -type d | while read -r x; do + [ -f "$x/fonts.dir" ] && xset +fp $x +done +xset fp rehash -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 - -# session-independent -xset r rate 290 26 -xset m 1/1 0 +# redshift, root image redon & +wall & + +# root terminal +urxvt -name TermBg1 -override-redirect -geometry x5+0--1 \ + -e tail -F /var/log/messages & +xdotool search --limit 1 --sync --classname TermBg1 windowsize --usehints 100% 6 + +# tray icons +#"$HOME/src/phwmon/phwmon.py" --mem --mem_percent --net --io --bg \#0000 & +volumeicon & + +# daemons dunst & -xautolock -time 10 -locker "$HOME/bin/l" & +mpc-notify -d & +xautolock -time 10 -locker "$HOME/bin/lck" & xbanish & -eval `ssh-agent` -# run terminal daemon -if [ -x /usr/local/bin/urxvtd ]; then +if [ -z "$TERMINAL" -a \( -x $(which -a urxvtd | head -1) \) ]; then for i in 1 2; do - # try to start client twice, once before checking for daemon and - # another after trying to start it - urxvtc -e exit + # try to start client twice, once before checking for daemon + # and another after trying to start it + urxvtc -e exit >/dev/null 2>&1 if [ $? -eq 2 ]; then # daemon not started, attempt to start once if [ $i -eq 1 ]; then urxvtd -q -o -f + else + TERMINAL=urxvt + export TERMINAL fi else - TERMINAL=/usr/local/bin/urxvtc + TERMINAL=urxvtc export TERMINAL break fi @@ -47,24 +55,17 @@ if [ -x /usr/local/bin/urxvtd ]; then unset i fi -# load any global scripts -if [ -d /usr/local/etc/X11/xinit/xinitrc.d ]; then - for f in /usr/local/etc/X11/xinit/xinitrc.d/?*.sh; do - [ -x "$f" ] && . "$f" - done - unset f -fi - -tint2 & -# sleep for tint to start -sleep 3 +# taskbar +# sleep to wait for session to start fully +(sleep 0.1 && tint2) & -# try to wait for session to start -(sleep 0.2 && [ -x "$HOME/bin/acpi_ac" ] && "$HOME/bin/acpi_ac" "0x0`sysctl -n hw.acpi.acline`") & -(sleep 1 && "$HOME/.fehbg") & -(sleep 1.5 && [ -x /usr/local/bin/conky ] && conky -c "$HOME/.conkyrc.d/dock") & +# x220t +# TODO: check hostname to load auxillary things +# TODO: reformat for linux +#(sleep 0.1 "$HOME/bin/acpi_ac" "0x0`sysctl -n hw.acpi.acline`") & -if [ ! -n "$1" ]; then +# start session +if [ -z "$1" ]; then session=i3 else session=$1