.i3/auto-start

Fri, 13 Jun 2014 10:34:30 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Fri, 13 Jun 2014 10:34:30 -0400
branch
mhoward-lt
changeset 48
692d2b9c7958
parent 46
fe410dc840a6
child 58
b88790409ef3
permissions
-rwxr-xr-x

add private bin/ to path, run urxvtd and xcompmgr always if available

1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 #! /bin/sh
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3 # Simple autostart file for i3-wm, you can execute it from i3 config with
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 # exec $HOME/bin/auto-start-for-i3
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 #
46
fe410dc840a6 add .xsessionrc.local
Meredith Howard <mhoward@roomag.org>
parents: 34
diff changeset
6 # xdotool and notify-send must be installed. On BSD use jot instead of
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 # seq or install seq from ports.
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10 # Max seconds to wait until the process is up
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11 MAXWAIT=10
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 # Start the given command and wait until it's visible
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 StartProg()
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 {
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
16 "$@" & # Handle arguments with whitspaces
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
17 mypid=$! # Pid of last background process
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
18 echo "Waiting on ${mypid}: $@"
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
19 for i in `seq $MAXWAIT` # count from 1 to MAXWAIT
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
20 do
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
21 if xdotool search --onlyvisible --pid $mypid; then
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
22 return 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
23 fi
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
24 sleep 1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
25 done
46
fe410dc840a6 add .xsessionrc.local
Meredith Howard <mhoward@roomag.org>
parents: 34
diff changeset
26 notify-send "Error on executing: $@"
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
27 }
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
28
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
29 StartProgName()
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
30 {
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
31 "$@" & # Handle arguments with whitspaces
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
32 mypid=$! # Pid of last background process
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
33 echo "Waiting on $1: $@"
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
34 for i in `seq $MAXWAIT` # count from 1 to MAXWAIT
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
35 do
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
36 if xdotool search --onlyvisible --name $1; then
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
37 return 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
38 fi
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
39 sleep 1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
40 done
46
fe410dc840a6 add .xsessionrc.local
Meredith Howard <mhoward@roomag.org>
parents: 34
diff changeset
41 notify-send "Error on executing: $@"
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
42 }
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
43
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
44 # ### --- emacs --- ###
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
45 # StartProg emacs
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
46 #
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
47 # ### --- ding ---- ###
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
48 # StartProg ding
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
49 # i3-msg border none
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
50 #
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
51 # # make right half bigger
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
52 # i3-msg resize grow left 16 px or 16 ppt
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
53 #
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
54 # # build container
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
55 # i3-msg split v
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
56 # sleep 1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
57 #
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
58 # ### --- terminal --- ###
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
59 # StartProg rxvt
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
60 #
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
61 # # Make Terminal bigger and Ding smaller
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
62 # i3-msg resize grow up 32 px or 32 ppt
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
63 #
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
64 # ### --------------------------------- tab START--- ###
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
65 # ### ---------------------------------------------- ###
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
66 # i3-msg split v
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
67 # i3-msg layout tabbed
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
68 #
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
69 # ### --- gnome-commander --- ###
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
70 # StartProg gnome-commander
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
71 #
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
72 # ### --- chromium --- ###
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
73 # StartProg chromium
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
74 #
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
75 # ### --- pdf --- ###
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
76 # StartProg evince "~/Dokumente/Haskell/Haskell.pdf"
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
77 # ### ---------------------------------------------- ###
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
78 # ### ---------------------------------- tab END --- ###
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
79 #
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
80 # ### --- new terminal left under emacs --- ###
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
81 # i3-msg focus left
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
82 # i3-msg split v
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
83 # StartProg rxvt
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
84 #
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
85 # # terminal without border and make it smaller
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
86 # i3-msg border none
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
87 # i3-msg resize shrink up 32 px or 32 ppt
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
88 #
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
89
34
33bdbdb9ec90 Make dedicated workspace for Mail
Meredith Howard <mhoward@roomag.org>
parents: 23
diff changeset
90 ionice -c3 nice /usr/bin/icedove &
23
a61d6f99a162 Create branch mhoward-lt for host-specific stuff
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
91
34
33bdbdb9ec90 Make dedicated workspace for Mail
Meredith Howard <mhoward@roomag.org>
parents: 23
diff changeset
92 i3-msg 'workspace 2; exec urxvt'
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
93
34
33bdbdb9ec90 Make dedicated workspace for Mail
Meredith Howard <mhoward@roomag.org>
parents: 23
diff changeset
94 # i3-msg 'split h'
33bdbdb9ec90 Make dedicated workspace for Mail
Meredith Howard <mhoward@roomag.org>
parents: 23
diff changeset
95 #
33bdbdb9ec90 Make dedicated workspace for Mail
Meredith Howard <mhoward@roomag.org>
parents: 23
diff changeset
96 # StartProgName gvim
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
97
23
a61d6f99a162 Create branch mhoward-lt for host-specific stuff
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
98 # i3-msg 'focus left; split v'
a61d6f99a162 Create branch mhoward-lt for host-specific stuff
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
99 #
a61d6f99a162 Create branch mhoward-lt for host-specific stuff
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
100 # StartProg xfce4-terminal
a61d6f99a162 Create branch mhoward-lt for host-specific stuff
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
101 #
a61d6f99a162 Create branch mhoward-lt for host-specific stuff
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
102 # i3-msg 'resize shrink height 20 px or 20 ppt'
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
103
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
104 exit 0

mercurial