blob: f9f46d74080d0bdd74eabd0ff4d1eea7669ae60c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
#!/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
|