Mon, 12 Jun 2017 17:20:38 -0400
smarter jk maps
377 | 1 | #!/bin/sh |
1 | 2 | # Simple autostart file for i3-wm, you can execute it from i3 config with |
377 | 3 | # exec $HOME/.i3/auto-start |
1 | 4 | # |
43
958afe229467
just urxvt. use notify-send
Meredith Howard <mhoward@roomag.org>
parents:
29
diff
changeset
|
5 | # xdotool and notify-send must be installed. On BSD use jot instead of |
1 | 6 | # seq or install seq from ports. |
7 | ||
8 | # Max seconds to wait until the process is up | |
9 | MAXWAIT=10 | |
10 | ||
11 | # Start the given command and wait until it's visible | |
12 | StartProg() | |
13 | { | |
377 | 14 | "$@" & # Handle arguments with whitspaces |
15 | mypid=$! # Pid of last background process | |
16 | echo "Waiting on ${mypid}: $@" | |
17 | for i in `seq $MAXWAIT` # count from 1 to MAXWAIT | |
18 | do | |
19 | if xdotool search --onlyvisible --pid $mypid; then | |
20 | return 0 | |
21 | fi | |
22 | sleep 1 | |
23 | done | |
24 | notify-send "Error on executing: $@" | |
1 | 25 | } |
26 | ||
27 | StartProgName() | |
28 | { | |
377 | 29 | "$@" & # Handle arguments with whitspaces |
30 | mypid=$! # Pid of last background process | |
31 | echo "Waiting on $1: $@" | |
32 | for i in `seq $MAXWAIT` # count from 1 to MAXWAIT | |
33 | do | |
34 | if xdotool search --onlyvisible --name $1; then | |
35 | return 0 | |
36 | fi | |
37 | sleep 1 | |
38 | done | |
39 | notify-send "Error on executing: $@" | |
1 | 40 | } |
41 | ||
55
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
42 | WaitProgName() |
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
43 | { |
377 | 44 | echo "Waiting on $1" |
45 | for i in `seq $MAXWAIT` # count from 1 to MAXWAIT | |
46 | do | |
47 | if xdotool search --onlyvisible --name $1; then | |
48 | return 0 | |
49 | fi | |
50 | sleep 1 | |
51 | done | |
52 | notify-send "Error waiting on $1: $@" | |
55
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
53 | } |
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
54 | |
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
55 | WaitClassName() |
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
56 | { |
377 | 57 | echo "Waiting on window class $1" |
58 | for i in `seq $MAXWAIT` # count from 1 to MAXWAIT | |
59 | do | |
60 | if xdotool search --onlyvisible --class $1; then | |
61 | return 0 | |
62 | fi | |
63 | sleep 1 | |
64 | done | |
65 | notify-send "Error waiting on $1: $@" | |
55
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
66 | } |
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
67 | |
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
68 | |
1 | 69 | # ### --- emacs --- ### |
70 | # StartProg emacs | |
71 | # | |
72 | # ### --- ding ---- ### | |
73 | # StartProg ding | |
74 | # i3-msg border none | |
75 | # | |
76 | # # make right half bigger | |
77 | # i3-msg resize grow left 16 px or 16 ppt | |
78 | # | |
79 | # # build container | |
80 | # i3-msg split v | |
81 | # sleep 1 | |
82 | # | |
83 | # ### --- terminal --- ### | |
84 | # StartProg rxvt | |
85 | # | |
86 | # # Make Terminal bigger and Ding smaller | |
87 | # i3-msg resize grow up 32 px or 32 ppt | |
88 | # | |
89 | # ### --------------------------------- tab START--- ### | |
90 | # ### ---------------------------------------------- ### | |
91 | # i3-msg split v | |
92 | # i3-msg layout tabbed | |
93 | # | |
94 | # ### --- gnome-commander --- ### | |
95 | # StartProg gnome-commander | |
96 | # | |
97 | # ### --- chromium --- ### | |
98 | # StartProg chromium | |
99 | # | |
100 | # ### --- pdf --- ### | |
101 | # StartProg evince "~/Dokumente/Haskell/Haskell.pdf" | |
102 | # ### ---------------------------------------------- ### | |
103 | # ### ---------------------------------- tab END --- ### | |
104 | # | |
105 | # ### --- new terminal left under emacs --- ### | |
106 | # i3-msg focus left | |
107 | # i3-msg split v | |
108 | # StartProg rxvt | |
109 | # | |
110 | # # terminal without border and make it smaller | |
111 | # i3-msg border none | |
112 | # i3-msg resize shrink up 32 px or 32 ppt | |
113 | # | |
114 | ||
55
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
115 | # StartProg urxvt |
43
958afe229467
just urxvt. use notify-send
Meredith Howard <mhoward@roomag.org>
parents:
29
diff
changeset
|
116 | # i3-msg 'split h' |
958afe229467
just urxvt. use notify-send
Meredith Howard <mhoward@roomag.org>
parents:
29
diff
changeset
|
117 | # StartProgName gvim |
958afe229467
just urxvt. use notify-send
Meredith Howard <mhoward@roomag.org>
parents:
29
diff
changeset
|
118 | # i3-msg 'focus left; split v' |
958afe229467
just urxvt. use notify-send
Meredith Howard <mhoward@roomag.org>
parents:
29
diff
changeset
|
119 | # StartProg urxvt |
958afe229467
just urxvt. use notify-send
Meredith Howard <mhoward@roomag.org>
parents:
29
diff
changeset
|
120 | # i3-msg 'resize shrink height 20 px or 20 ppt' |
1 | 121 | |
55
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
122 | if [ -r ~/.i3/auto-start.local ]; then |
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
123 | . .i3/auto-start.local |
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
124 | fi |
fe505cd6be19
Add some funcs, hand off to auto-start.local
Meredith Howard <mhoward@roomag.org>
parents:
51
diff
changeset
|
125 | |
1 | 126 | exit 0 |