summaryrefslogtreecommitdiff
path: root/README
blob: 61683d00291b8e76d15dab08d089ac58e4c6911a (plain)
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
## Description

My customized version of no-wm written by Patrick Haller.

## Set up 

	$ # install dependecies
	$ sudo apt install xdotool unclutter autocutsel sxhkd libx11-dev \
		dmenu astyle git rxvt-unicode x11-utils x11-xserver-utils \
		xbindkeys xsel udiskie
	$ git clone https://git.yctct.com/no-wm
	$ cd no-wm
	$ make install PREFIX="$HOME"
	$ cd
	$ mkdir -p etc
	$ cp no-wm/config/Xresources ~/etc/
	$ cp no-wm/config/sxhkdrc ~/etc/
	# back up your own .xinitrc
	$ cp .xinitrc .xinitrc.bak
	$ cp no-wm/config/.xinitrc .

I use st so you probably need to change the configuration with the terminal of
your choice. 

Please let me know if you have issues with the above.

## Run

From a tty run:

	$ startx

or if you named `.xinitrc` differentely for testing, for example
`.xinitrc-no-wm`,  from tty number 1:

	$ startx ~/.xinitrc-no-wm -- :0 vt1

## Modifications

- removed `alt + f`
- changed `alt + backspace` to `alt + l`
- added a shortcut `alt + p` to open keepassxc full screen
- removed xterm from the config file (I use st)
- added geometries for st and keepassxc in ~/etc/sxhkdrc  
- added `Xresources`, `sxhkdrc and `.xinitrc` to the repository
- added udiskie to .xinitrc so devices are mounted automatically

## Links

- reload sxhkdrc https://elpa.gnu.org/packages/sxhkdrc-mode.html 

## Known issues

- st does not scale 100% of the screen display; to do so manually run 
  `xdotool search --call st windowsize 100% 100% 0 0`
- newly started window is not always in focus

## Original README
	
no-wm
	Use X11 without a window manager

components
	included
		x-alt-tab
		x-move-resize
		x-session
		x-focus-manager
	distributed with X11 
		xsel xprop xrdb xset xsetroot xwininfo
	key-daemons
		xbindkeys http://www.nongnu.org/xbindkeys/xbindkeys.html
		speckeysd http://www.jessies.org/~enh/software/x11/
		xchainkeys http://code.google.com/p/xchainkeys/
		sxhkd https://github.com/baskerville/sxhkd
		alttab https://github.com/sagb/alttab
	window-manipulators
		xdotool http://www.semicomplete.com/projects/xdotool/
		window http://www.jessies.org/~enh/software/x11/
	niceties
		unclutter http://unclutter.sourceforge.net/
		dmenu http://tools.suckless.org/dmenu/
		autocutsel http://www.nongnu.org/autocutsel/ 
	overview
		http://www.sbin.org/doc/Xlib/index_contents.html

procedure
	set up your ${HOME}/.xinitrc to be something like
		#!/bin/bash
		while ! xprop -root | grep -q Free; do sleep 1; done
		xrdb -merge ${HOME}/etc/Xresources
		xsetroot -solid black
		xset b off
		exec xterm &
		exec speckeysd ${HOME}/etc/speckeysd.conf &
		exec x-focus-manager &
		exec x-session
	and your ${HOME}/etc/speckeysd.conf to be like
		# Key names come from <X11/keysymdef.h> (remove the XK_ prefix).
		# MUST have a Tab separating the key-combo and command
		Alt-Tab	x-alt-tab
		Alt-Shift-Tab	x-alt-tab -1
		Alt-Return	x-banish push
		Alt-BackSpace	x-banish pop
		Alt-m	x-move-resize
		Alt-r	echo run | dmenu -fn 10x20 | exec bash -s
		Alt-s	surf "$( echo www.duckduckgo.com | dmenu )"
		Alt-t	urxvt & x-focus-topmost wait
		Alt-f	xdotool selectwindow windowsize 100% 100% windowmove 0 0

	then ${HOME}/etc/Xresources with the preferred window geometries
		R_x11*geometry: 1024x600+0+0
		XTerm*geometry: 1024x600+0+0
		URxvt*geometry: 1024x600+0+0
		surf*geometry: 1024x600+0+0


window managers bind orthogonals (keyboard shortcuts, window manipulation,
window decoration) which should remain separate. 

x-focus-manager is not needed when all your apps return focus properly. A
mis-behaving app can be fixed by calling x-alt-tab after it runs; however that
needs to be scripted as focus remains with a window that no longer exists.

## Troubleshooting

## Window expands past the screen

Show the size of the actual screen:

	$ xdpyinfo | grep dimensions
	dimensions:    1366x768 pixels (361x203 millimeters)

Show the id of the window that is going beyond the screen, in my case st

	$ xdotool search --class st | head -1
	8388613

Show the width and height of the window of the program in question, in my case
st, using `$(!!)` interpolate the stdout from the previous command:

	$ xwininfo -id $(!!) | grep -E 'Absolute|Width|Height'
	xwininfo -id $(xdotool search --class st | head -1) | grep -E 'Absolute|Width|Height'
	  Absolute upper-left X:  0
	  Absolute upper-left Y:  0
	  Width: 9566
	  Height: 10756

## See what X currently has in its resource database:

	$ xrdb -query | grep -i geometry
	R_x11.geometry: 1300x760+0+0
	URxvt*geometry: 1300x760+0+0
	XTerm*geometry: 1300x760+0+0
	abrowser*geometry:      1300x760+0+0

## See what the size of the screen is:

	$ xrandr | grep '*'
	1366x768      59.64*+

## See what size the window actually is, look at `Width``and `Height`:

	$ xwininfo

	xwininfo: Please select the window about which you
		  would like information by clicking the
		  mouse in that window.

	xwininfo: Window id: 0xa00005 "st"

	  Absolute upper-left X:  0
	  Absolute upper-left Y:  0
	  Relative upper-left X:  0
	  Relative upper-left Y:  0
	  Width: 1366
	  Height: 768
	  Depth: 24
	  Visual: 0x21
	  Visual Class: TrueColor
	  Border width: 0
	  Class: InputOutput
	  Colormap: 0x20 (installed)
	  Bit Gravity State: NorthWestGravity
	  Window Gravity State: NorthWestGravity
	  Backing Store State: NotUseful
	  Save Under State: no
	  Map State: IsViewable
	  Override Redirect State: no
	  Corners:  +0+0  -0+0  -0-0  +0-0
	  -geometry 194x54+0+0