#! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/x [[ $(uname) == "Linux" ]] || return alias invert='xcalib -a -i' alias xterm='TMUX='' SHELL=tmux xterm -fullscreen' x-no-login () { sudo systemctl set-default multi-user.target } xh () { DISPLAY=":0" xdotool getwindowfocus getwindowgeometry | awk -F "x" '/Geometry/{print $2}' } depth () { xdpyinfo -d ":0" | awk '/of root/{print $5}' } xup () { xrdb ~/.Xresources } x-high-res () { xrandr -s 720x480 } x-low-res () { xrandr -s 640x480 } fix-display () { xrandr --output VGA1 --auto } do-thing-in-x () { local thing=$1 DISPLAY=":0" xdotool type $thing DISPLAY=":0" xdotool key Return sleep 1 chvt 6 } in-x () { (( $+DISPLAY )) && echo 1 || echo 0 } x-runs () { [[ $(ps -e | \grep xinit) ]] && echo 1 || echo 0 } start-x-if-not-running () { if [[ ! $(ps -e | \grep xinit) ]]; then local xdir=~/.xdir [[ ! -d $xdir ]] && mkdir $xdir xinit -- vt6 > $xdir/xout 2> $xdir/xerr fi } # xterm & tty (tmux) and Emacs kill ring interchange # see: ~/.emacs.d/emacs-init/xsel.el # ~/scripts/xi # ~/.tmux.conf alias xo='DISPLAY=":0" xsel -b -o'