-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup-hook
executable file
·92 lines (74 loc) · 2.25 KB
/
startup-hook
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
#
# xmonad "startup hook" script. This gets run after xmonad is initialized,
# via the startupHook facility provided by xmonad. It's useful for
# running any programs which you want to use within xmonad but
# which don't need to be initialized before xmonad is running.
#
# Author: David Brewer
# Repository: https://github.com/davidbrewer/xmonad-ubuntu-conf
#
# TRAY ICON SOFTWARE
#
# Network manager, so we don't have to configure wifi at the command line.
if [ -z "$(pgrep nm-applet)" ] ; then
nm-applet --sm-disable &
fi
#
# APPLICATION LAUNCHER
#
# Use gnome do as our app launcher. (-s: don't display until requested)
if [ -z "$(pgrep gnome-do)" ] ; then
gnome-do -s &
fi
/usr/sbin/setxkbmap -option ctrl:nocaps
xsetroot -solid black
killall stalonetray
if [ -z "$(pgrep stalonetray)" ] ; then
stalonetray --icon-gravity E \
--geometry 6x1-0+0 \
--max-geometry 10x1-0+0 \
--background '#223333' \
--skip-taskbar \
--icon-size 16 \
--kludges force_icons_size \
--window-strut none 2>&1 >/dev/null &
fi
zsh -ic "/usr/bin/emacs --daemon"
##
# I now use envoy and pam to do this at login
#
# if [ -z "$(pgrep gpg-agent)" ] ; then
# gpg-agent --enable-ssh-support --daemon > ~/.gpg-agent-init
# source ~/.gpg-agent-init
# fi
if [ -z "$(pgrep xscreensaver)" ] ; then
xscreensaver -no-splash &
fi
if [ -z "$(pgrep udiskie)" ] ; then
udiskie --tray &
fi
if [ -z "$(pgrep clementine)" ] ; then
clementine -y &
fi
# On login, we unlock the ssh keychain so we're not prompted for
# passphrases later. We pipe /dev/null to ssh-add to make it realize
# it's not running in a terminal. Otherwise, it won't launch the prompt.
#
# If you don't use the ssh keychain you may not want this. Commented
# by default as it is assumed many users will not want this feature.
export SSH_ASKPASS="/usr/bin/ssh-askpass"
cat /dev/null | ssh-add &
xrandr | grep -q 'HDMI1 connected'
r=$?
if [ 0 -eq r ]
then
# ~/.xmonad/xrandr-dualhead-bigger-vertical.sh
fi
xrandr | grep -q 'VGA1 connected'
r=$?
if [ 0 -eq r ]
then
# xrandr --output HDMI1 --off
# xrandr --output VGA1 --mode 1280x1024 --left-of LVDS1 --rotate left --output LVDS1 --rotate normal
fi