about summary refs log tree commit diff stats
path: root/README
blob: b4fde501384219f90bccb506287dbf4dfb7b8d68 (plain) (blame)
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
dwm - dynamic window manager
============================
dwm is an extremely fast, small, and dynamic window manager for X.


Requirements
------------
In order to build dwm you need the Xlib header files.


Installation
------------
Edit config.mk to match your local setup (dwm is installed into
the /usr/local namespace by default).

Afterwards enter the following command to build and install dwm (if
necessary as root):

    make clean install


Running dwm
-----------
Add the following line to your .xinitrc to start dwm using startx:

    exec dwm

In order to connect dwm to a specific display, make sure that
the DISPLAY environment variable is set correctly, e.g.:

    DISPLAY=foo.bar:1 exec dwm

(This will start dwm on display :1 of the host foo.bar.)

In order to display status info in the bar, you can do something
like this in your .xinitrc:

    while true
    do
        echo `date` `uptime | sed 's/.*,//'`
        sleep 1
    done | dwm


Configuration
-------------
The configuration of dwm is done by creating a custom config.h
and (re)compiling the source code.
99'>^
e25474154 ^
c8bebe92e ^
731c6f908 ^
c8bebe92e ^













c39e20297 ^



c8bebe92e ^
9c99973ff ^
c8bebe92e ^












9c99973ff ^

c8bebe92e ^

731c6f908 ^
740527813 ^
94d1aa510 ^




89f9772f1 ^
731c6f908 ^
c8bebe92e ^
e25474154 ^
c8bebe92e ^
e25474154 ^
731c6f908 ^
c8bebe92e ^
dd806cafa ^
c8bebe92e ^
731c6f908 ^
2df9b442c ^
5e15dec17 ^
2df9b442c ^





5506e8491 ^
b961e47bf ^
5e839d50b ^
a7911addf ^
dbf9117c5 ^
a639824e5 ^
1e6aef62b ^
8d3966923 ^
cabbcd411 ^
87815cbdf ^
b3cecddd6 ^
8ef66b973 ^
a8edf67a2 ^
9c4a60193 ^
adf8eea4d ^
f04d21f27 ^
5e368f363 ^
f7f3a25be ^
3308d2658 ^
762ade117 ^
8d1a5dc8e ^
33814cf63 ^
399c5e38b ^
6baca5869 ^
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

 
                            
                                         






                                                   
      
                                     
 
                                                                               
                                                           
                            
 

                   
 

                                                            
 

                                   
 
                                       
                             













                                                                          



                                                                        
             
                                                                        












                                                                              

                                                                      

                 
                                                           
 




                                                                   
                                      
                                  
                                
 
                                  
            
                                  
                                  
 
                     
                                                 
                                                     
                                            





                                 
                          
                              
                                     
                                           
                          
                          
                         
                              
                                 
                                  
                               
                           
                                        
                                
                            
                                 
                                      
                                       
                                               
                            
                                        
                           
                                 
                            
#
#
#           The Nim Compiler
#        (c) Copyright 2015 Andreas Rumpf
#
#    See the file "copying.txt", included in this
#    distribution, for details about the copyright.
#

# This module handles the conditional symbols.

import
  strtabs, platform, strutils, idents

# We need to use a StringTableRef here as defined symbols are always guaranteed
# to be style insensitive. Otherwise hell would break lose.
var gSymbols: StringTableRef

const
  catNone = "false"

proc defineSymbol*(symbol: string, value: string = "true") =
  gSymbols[symbol] = value

proc undefSymbol*(symbol: string) =
  gSymbols[symbol] = catNone

proc isDefined*(symbol: string): bool =
  if gSymbols.hasKey(symbol):
    result = gSymbols[symbol] != catNone
  elif cmpIgnoreStyle(symbol, CPU[targetCPU].name) == 0:
    result = true
  elif cmpIgnoreStyle(symbol, platform.OS[targetOS].name) == 0:
    result = true
  else:
    case symbol.normalize
    of "x86": result = targetCPU == cpuI386
    of "itanium": result = targetCPU == cpuIa64
    of "x8664": result = targetCPU == cpuAmd64
    of "posix", "unix":
      result = targetOS in {osLinux, osMorphos, osSkyos, osIrix, osPalmos,
                            osQnx, osAtari, osAix,
                            osHaiku, osVxWorks, osSolaris, osNetbsd,
                            osFreebsd, osOpenbsd, osDragonfly, osMacosx,
                            osAndroid}
    of "linux":
      result = targetOS in {osLinux, osAndroid}
    of "bsd":
      result = targetOS in {osNetbsd, osFreebsd, osOpenbsd, osDragonfly}
    of "emulatedthreadvars":
      result = platform.OS[targetOS].props.contains(ospLacksThreadVars)
    of "msdos": result = targetOS == osDos
    of "mswindows", "win32": result = targetOS == osWindows
    of "macintosh": result = targetOS in {osMacos, osMacosx}
    of "sunos": result = targetOS == osSolaris
    of "littleendian": result = CPU[targetCPU].endian == platform.littleEndian
    of "bigendian": result = CPU[targetCPU].endian == platform.bigEndian
    of "cpu8": result = CPU[targetCPU].bit == 8
    of "cpu16": result = CPU[targetCPU].bit == 16
    of "cpu32": result = CPU[targetCPU].bit == 32
    of "cpu64": result = CPU[targetCPU].bit == 64
    of "nimrawsetjmp":
      result = targetOS in {osSolaris, osNetbsd, osFreebsd, osOpenbsd,
                            osDragonfly, osMacosx}
    else: discard

proc isDefined*(symbol: PIdent): bool = isDefined(symbol.s)

proc lookupSymbol*(symbol: string): string =
  result = if isDefined(symbol): gSymbols[symbol] else: nil

proc lookupSymbol*(symbol: PIdent): string = lookupSymbol(symbol.s)

iterator definedSymbolNames*: string =
  for key, val in pairs(gSymbols):
    if val != catNone: yield key

proc countDefinedSymbols*(): int =
  result = 0
  for key, val in pairs(gSymbols):
    if val != catNone: inc(result)

proc initDefines*() =
  gSymbols = newStringTable(modeStyleInsensitive)
  defineSymbol("nimrod") # 'nimrod' is always defined
  # for bootstrapping purposes and old code:
  defineSymbol("nimhygiene")
  defineSymbol("niminheritable")
  defineSymbol("nimmixin")
  defineSymbol("nimeffects")
  defineSymbol("nimbabel")
  defineSymbol("nimcomputedgoto")
  defineSymbol("nimunion")
  defineSymbol("nimnewshared")
  defineSymbol("nimrequiresnimframe")
  defineSymbol("nimparsebiggestfloatmagic")
  defineSymbol("nimalias")
  defineSymbol("nimlocks")
  defineSymbol("nimnode")
  defineSymbol("nimnomagic64")
  defineSymbol("nimvarargstyped")
  defineSymbol("nimtypedescfixed")
  defineSymbol("nimKnowsNimvm")
  defineSymbol("nimArrIdx")
  defineSymbol("nimImmediateDeprecated")
  defineSymbol("nimNewShiftOps")
  defineSymbol("nimDistros")
  defineSymbol("nimHasCppDefine")
  defineSymbol("nimGenericInOutFlags")
  when false: defineSymbol("nimHasOpt")
  defineSymbol("nimNoArrayToCstringConversion")
  defineSymbol("nimNewRoof")
  defineSymbol("nimHasRunnableExamples")
  defineSymbol("nimNewDot")
  defineSymbol("nimHasNilChecks")
  defineSymbol("nimSymKind")