forked from davidbrewer/xmonad-ubuntu-conf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
start-xmonad
executable file
·102 lines (83 loc) · 3.35 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
#!/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
#
# 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
#
# 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 --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
# If we find that a screen is connected via DVI, 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
#
# 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.
#
# Line by line, the options used by default below mean:
# - icons should be aligned with the "East" or right side of the tray
# - the width of the tray should be 5 icons wide by one icon tall, and it
# should be located 0 pixels from the right of the screen (-0) and 0 pixels
# from the top of the screen (+0).
# - By setting our maximum geometry to the same thing, the tray will not grow.
# - The background color of the tray should be black.
# - This program should not show up in any taskbar.
# - Icons should be set to size "24".
# - Kludges argument of "force_icons_size" forces all icons to really, truly
# be the size we set.
# - window-strut "none" means windows are allowed to cover the tray. In
# other words, trust xmonad to handle this part.
#
stalonetray \
--icon-gravity E \
--geometry 5x1-0+0 \
--max-geometry 5x1-0+0 \
--background '#000000' \
--skip-taskbar \
--icon-size 24 \
--kludges force_icons_size \
--window-strut none \
&
# 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
# Now, finally, start xmonad
exec xmonad