#!/bin/sh # uleft, uright, ukill, ufull, unext - start & kill urxvt with # preferred geometry. the terminals persist when their shells exit # (they just start a new one). # any arguments passed to this script are passed thru to urxvt. # Deja Vu Sans Mono with intel or nouveau: #GLEFT="96x53+0+0" #GRIGHT="88x53+968+0" #GFULL="185x53+0+0" # Deja Vu Sans Mono with nvidia: #GLEFT="87x54+0+0" #GRIGHT="80x54+968+0" #GFULL="167x54+0+0" # JetBrains Mono NL with nvidia: #GLEFT="104x49+0+0" #GRIGHT="80x49+1050+0" #GFULL="185x49+0+0" # JetBrains Mono NL with nvidia, multihead #GLEFT="104x51+1280+0" #GRIGHT="101x51+2222+0" #GFULL="205x51-71+0" # Before my Dell widescreen monitor died: #GLEFT="101x49+1280+0" #GRIGHT="90x49+2295+0" #GFULL="191x49+1280+0" GLEFT="80x57+1920+0" GRIGHT="80x57+2720+0" GFULL="160x57+1920+0" CLEFT="-bg #000a00" CRIGHT="-bg #0a0000" CFULL="" murder_shell() { # kill the shell that called the shell that's running this script kill $( ps -o ppid --no-headers $( ps -o ppid --no-headers $$ ) ) exit 0 } get_next_geom() { # lets this script alternate between starting left and right terminals if [ ! -e ~/.uleftright ] || grep -q right ~/.uleftright; then G=$GLEFT echo left > ~/.uleftright else G=$GRIGHT echo right > ~/.uleftright fi echo "$G" } case "$0" in *kill*) murder_shell ;; *left*) G=$GLEFT; C="$CLEFT" ;; *full*) G=$GFULL; C="$CFULL" ;; *next*) G=$( get_next_geom ) ;; *) G=$GRIGHT; C="$CRIGHT" ;; esac urxvt -g "$G" $C "$@" -e sh -c "while true; do bash -login; done" &>/dev/null & disown