annotate bin/setup-X.sh @ 751:753b1c2bd64c

match is NOT POSIX
author Jeff Hammel <k0scist@gmail.com>
date Tue, 30 Jun 2015 15:35:34 -0700
parents 637c9fac3f8d
children b7d5b0dee9d1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
360
d0da972238d0 adding program to setup X
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/bin/bash
d0da972238d0 adding program to setup X
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
503
dfd5357403aa moar betterer
Jeff Hammel <jhammel@mozilla.com>
parents: 502
diff changeset
3 ### daemons
dfd5357403aa moar betterer
Jeff Hammel <jhammel@mozilla.com>
parents: 502
diff changeset
4 # nm-applet: network manager
dfd5357403aa moar betterer
Jeff Hammel <jhammel@mozilla.com>
parents: 502
diff changeset
5 # gkrellm: system monitor
dfd5357403aa moar betterer
Jeff Hammel <jhammel@mozilla.com>
parents: 502
diff changeset
6 # diodon: clipboard manager
531
42d3418e9154 .bashrc bin/setup-X.sh
Jeff Hammel <jhammel@mozilla.com>
parents: 503
diff changeset
7 # arbtt-capture: arbitrary time tracker
42d3418e9154 .bashrc bin/setup-X.sh
Jeff Hammel <jhammel@mozilla.com>
parents: 503
diff changeset
8 # x-tile: window tiling
42d3418e9154 .bashrc bin/setup-X.sh
Jeff Hammel <jhammel@mozilla.com>
parents: 503
diff changeset
9 # To add: qamixer (well, some mixer); gnome-activity journal
42d3418e9154 .bashrc bin/setup-X.sh
Jeff Hammel <jhammel@mozilla.com>
parents: 503
diff changeset
10 for i in nm-applet gkrellm diodon arbtt-capture x-tile
360
d0da972238d0 adding program to setup X
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 do
503
dfd5357403aa moar betterer
Jeff Hammel <jhammel@mozilla.com>
parents: 502
diff changeset
12 if which ${i}
360
d0da972238d0 adding program to setup X
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 then
562
8d28fce0a6d6 detect scripts; namely x-tile
Jeff Hammel <jhammel@mozilla.com>
parents: 552
diff changeset
14 if ! pidof -x ${i}
360
d0da972238d0 adding program to setup X
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 then
503
dfd5357403aa moar betterer
Jeff Hammel <jhammel@mozilla.com>
parents: 502
diff changeset
16 echo "not running: $i"
360
d0da972238d0 adding program to setup X
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 ${i} &
d0da972238d0 adding program to setup X
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 fi
d0da972238d0 adding program to setup X
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 fi
378
0e99d3a68066 notes to self....that didnt quite do what we wanted :(
Jeff Hammel <jhammel@mozilla.com>
parents: 360
diff changeset
20 done
0e99d3a68066 notes to self....that didnt quite do what we wanted :(
Jeff Hammel <jhammel@mozilla.com>
parents: 360
diff changeset
21
0e99d3a68066 notes to self....that didnt quite do what we wanted :(
Jeff Hammel <jhammel@mozilla.com>
parents: 360
diff changeset
22 # TODO: add workspace specific programs
496
f783b7d4516b bin/setup-X.sh
Jeff Hammel <jhammel@mozilla.com>
parents: 495
diff changeset
23
497
2e51a55d303d bin/setup-X.sh
Jeff Hammel <jhammel@mozilla.com>
parents: 496
diff changeset
24 # ssh-add
2e51a55d303d bin/setup-X.sh
Jeff Hammel <jhammel@mozilla.com>
parents: 496
diff changeset
25 if [[ `ssh-add -l` != *id_?sa* ]]
2e51a55d303d bin/setup-X.sh
Jeff Hammel <jhammel@mozilla.com>
parents: 496
diff changeset
26 then
573
1e1db18fb7fa STUB: bin/setup-X.sh
Jeff Hammel <k0scist@gmail.com>
parents: 562
diff changeset
27 GUI_SSH_ASKPASS=/usr/bin/ksshaskpass
1e1db18fb7fa STUB: bin/setup-X.sh
Jeff Hammel <k0scist@gmail.com>
parents: 562
diff changeset
28 if [[ -e "${GUI_SSH_ASKPASS}" ]]
497
2e51a55d303d bin/setup-X.sh
Jeff Hammel <jhammel@mozilla.com>
parents: 496
diff changeset
29 then
573
1e1db18fb7fa STUB: bin/setup-X.sh
Jeff Hammel <k0scist@gmail.com>
parents: 562
diff changeset
30 SSH_ASKPASS=${GUI_SSH_ASKPASS} ssh-add
576
637c9fac3f8d STUB: bin/setup-X.sh
Jeff Hammel <k0scist@gmail.com>
parents: 574
diff changeset
31 elif [[ -n "$PS1" ]]
574
00f5e55cbce8 elif+then
Jeff Hammel <k0scist@gmail.com>
parents: 573
diff changeset
32 then
573
1e1db18fb7fa STUB: bin/setup-X.sh
Jeff Hammel <k0scist@gmail.com>
parents: 562
diff changeset
33 # http://www.cyberciti.biz/faq/linux-unix-bash-check-interactive-shell/
1e1db18fb7fa STUB: bin/setup-X.sh
Jeff Hammel <k0scist@gmail.com>
parents: 562
diff changeset
34
1e1db18fb7fa STUB: bin/setup-X.sh
Jeff Hammel <k0scist@gmail.com>
parents: 562
diff changeset
35 echo "not running ssh-add: PS1 not found"
552
Jeff Hammel <jhammel@mozilla.com>
parents: 531
diff changeset
36 else
573
1e1db18fb7fa STUB: bin/setup-X.sh
Jeff Hammel <k0scist@gmail.com>
parents: 562
diff changeset
37 ssh-add # interactive terminal
497
2e51a55d303d bin/setup-X.sh
Jeff Hammel <jhammel@mozilla.com>
parents: 496
diff changeset
38 fi
2e51a55d303d bin/setup-X.sh
Jeff Hammel <jhammel@mozilla.com>
parents: 496
diff changeset
39 fi