#!/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" GLEFT="101x49+1280+0" GRIGHT="90x49+2295+0" GFULL="191x49+1280+0" 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 ;; *full*) G=$GFULL ;; *next*) G=$( get_next_geom ) ;; *) G=$GRIGHT ;; esac urxvt -g "$G" "$@" -e sh -c "while true; do bash -login; done" &>/dev/null & disown