-
Notifications
You must be signed in to change notification settings - Fork 165
/
start-xmonad
executable file
·113 lines (91 loc) · 3.75 KB
/
start-xmonad
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
#
# xmonad startup script. Intended to be run from an xsession configuration
# to run xmonad and some associated programs.
#
# Author: David Brewer
# Repository: https://github.com/davidbrewer/xmonad-ubuntu-conf
#
# KLUDGES AND WORKAROUNDS
#
# Clear xmonad.state before starting xmonad -- otherwise this causes weird
# issues, especially when going between single screen and multi-screen
rm -f ~/.xmonad/xmonad.state
#
# GENERAL INITIALIZATION
#
# Identify the home of our gtkrc file, important for setting styles of
# gtk-based applications
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
# Load X resources (fixes some font issues)
xrdb -merge .Xresources
# Start compositing to support transparency. You can omit this
# if you prefer not to use any transparency, but it is likely to cause
# ugly black fringing with some programs such as synapse that expect
# transparency support.
xcompmgr -n &
#
# SCREEN CONFIGURATION
#
# Default icon slot size for tray icons...
# We can adjust this parameter if necessary depending on the
# screen we end up using, to avoid gaps between xmobar and stalonetray.
# Note that right now we use the same size either way, the need for this
# varies depending on your screen!
STALONETRAY_SLOT_SIZE=29
# We handle our screen configuration using xrandr. You are likely to want to
# edit this section to match the specific demands of your setup. The below
# setup is for a Lenovo W520 laptop that sometimes has an external monitor
# hooked up via either VGA or DVI, positioned to the left of the laptop.
#
# Note that you can run xrandr at the command line to get a list of your
# connected screens and find out what names you should use to refer to them.
# Activate primary screen
xrandr --output LVDS-1-1 --auto --primary
# If we find that a screen is connected via VGA, activate it and position it
# to the left of the primary screen.
xrandr | grep 'VGA-1 connected' | ifne xrandr --output VGA-1 --auto --left-of LVDS-1-1
# If we find that a screen is connected via Display Port, activate it and position it
# to the left of the primary screen.
xrandr | grep 'DP-1 connected' | ifne xrandr --output DP-1 --auto --left-of LVDS-1-1
# If we find a screen connected via Display Port, make it the primary screen
# and deactivate the built-in screen... also adjust size of icons
#DP_1_CONNECTED=`xrandr | grep 'DP-1 connected'`
#if [ -n "$DP_1_CONNECTED" ]; then
# xrandr --output LVDS-1-1 --off
# xrandr --output DP-1 --auto --primary
# STALONETRAY_SLOT_SIZE=29
#fi
#
# LOAD SCREEN BACKGROUNDS
#
# To set your backgrounds, run nitrogren /path/to/images
nitrogen --restore &
#
# STARTUP ICON TRAY
#
# We are using stalonetray to create a small icon tray at the
# top right of the screen. You are likely to want to tweak the
# size of the icons and the width of the tray based upon the
# size of your screen and your xmobar configuration. The goal is
# to make stalonetray look like it is part of xmobar.
#
# Edit configuration in ~/.xmonad/stalonetrayrc if needed.
# The one option we set here is the slot size, which you can vary
# depending on your screen setup with STALONETRAY_SLOT_SIZE as shown above
stalonetray \
-c ~/.xmonad/stalonetrayrc \
--slot-size $STALONETRAY_SLOT_SIZE \
&
# Run the gnome-keyring-daemon to avoid issues you otherwise may encounter
# when using gnome applications which expect access to the keyring, such
# as Empathy. This prevents prompts you may otherwise get for invalid
# certificates and the like.
gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh
# Remap caps lock to left control. This is not strictly speaking
# xmonad related, but it's handy if you're a vim user.
setxkbmap -option 'ctrl:nocaps'
# Change the default X cursor away from the "X"
xsetroot -cursor_name left_ptr
# Now, finally, start xmonad
exec xmonad