summaryrefslogtreecommitdiffhomepage
path: root/xmobar.cabal
blob: dfa75a8b79c68093fec821f75348a538498ef9e0 (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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
name:               xmobar
version:            0.28.1
homepage:           http://xmobar.org
synopsis:           A Minimalistic Text Based Status Bar
description: 	    Xmobar is a minimalistic text based status bar.
                    .
                    Inspired by the Ion3 status bar, it supports similar
                    features, like dynamic color management, output templates,
                    and extensibility through plugins.
category:           System
license:            BSD3
license-file:       license
author:             Andrea Rossato and Jose A. Ortega Ruiz
maintainer:         Jose A. Ortega Ruiz <jao@gnu.org>
bug-reports:        https://github.com/jaor/xmobar/issues
cabal-version:      >= 1.8
build-type:         Simple

extra-source-files: readme.md, changelog.md,
                    samples/padding-icon.sh,
                    samples/xmobar.config, samples/xmonadpropwrite.hs
                    samples/Plugins/helloworld.config,
                    samples/Plugins/HelloWorld.hs

source-repository head
  type:      git
  location:  git://github.com/jaor/xmobar.git
  branch:    master

flag with_xft
  description: Use Xft to render text. UTF-8 support included.
  default: False

flag with_utf8
  description: With UTF-8 support.
  default: True

flag with_inotify
  description: inotify support (modern Linux only). Required for the Mail and MBox plugins.
  default: False

flag with_iwlib
  description: Wireless info support. Required for the Wireless plugin, needs iwlib installed.
  default: False

flag with_mpd
  description: MPD support. Needs libmpd installed.
  default: False

flag all_extensions
  description: Includes all optional extensions.
  default: False

flag with_alsa
  description: Use alsa-mixer to get the volume from soundcards.
  default: False

flag with_datezone
  description: Enables localized date support.
  default: False

flag with_mpris
  description: MPRIS v1, v2 support.
  default: False

flag with_dbus
  description: Publish a service on the session bus for controlling xmobar.
  default: False

flag with_xpm
  description: Enable usage of xpm for icons.
  default: False

flag with_threaded
  description: Use threaded runtime.
  default: False

flag with_rtsopts
  description: Use -with-rtsopts=-V0 to reduce wakeups.
  default: True

flag with_uvmeter
  description: UVMeter only useful to australians.
  default: False

flag with_weather
  description: Enable weather plugin.
  default: True

flag with_conduit
  description: Use http-conduits for weather data, used only if with_weather.
  default: False

library
    hs-source-dirs:  src/lib

    exposed-modules: Xmobar,
                     Xmobar.Config,
                     Xmobar.Actions,
                     Xmobar.Commands,
                     Xmobar.Runnable,
                     Xmobar.Plugins,
                     Xmobar.Plugins.BufferedPipeReader,
                     Xmobar.Plugins.CommandReader,
                     Xmobar.Plugins.Date,
                     Xmobar.Plugins.EWMH,
                     Xmobar.Plugins.PipeReader,
                     Xmobar.Plugins.MarqueePipeReader,
                     Xmobar.Plugins.StdinReader,
                     Xmobar.Plugins.XMonadLog,
                     Xmobar.Plugins.Kbd,
                     Xmobar.Plugins.Locks,
                     Xmobar.Plugins.Monitors,
                     Xmobar.Plugins.Monitors.Batt,
                     Xmobar.Plugins.Monitors.Common,
                     Xmobar.Plugins.Monitors.CoreCommon,
                     Xmobar.Plugins.Monitors.CoreTemp,
                     Xmobar.Plugins.Monitors.CpuFreq,
                     Xmobar.Plugins.Monitors.Cpu,
                     Xmobar.Plugins.Monitors.Disk,
                     Xmobar.Plugins.Monitors.Mem,
                     Xmobar.Plugins.Monitors.MultiCpu,
                     Xmobar.Plugins.Monitors.Net,
                     Xmobar.Plugins.Monitors.Swap,
                     Xmobar.Plugins.Monitors.Thermal,
                     Xmobar.Plugins.Monitors.ThermalZone,
                     Xmobar.Plugins.Monitors.Top,
                     Xmobar.Plugins.Monitors.Uptime,
                     Xmobar.Plugins.Monitors.Bright,
                     Xmobar.Plugins.Monitors.CatInt

    other-modules: Xmobar.Localize,
                   Xmobar.Parsers,
                   Xmobar.Utils,
                   Xmobar.StatFS,
                   Xmobar.X11.Types,
                   Xmobar.X11.XUtil,
                   Xmobar.X11.Bitmap,
                   Xmobar.X11.EventLoop,
                   Xmobar.X11.ColorCache,
                   Xmobar.X11.Window,
                   Xmobar.X11.Draw,
                   Xmobar.Signal,
                   Xmobar.Environment

    extra-libraries: Xrandr Xrender

    ghc-options: -funbox-strict-fields -Wall -fno-warn-unused-do-bind

    build-depends:
      base >= 4.9.1.0 && < 4.13,
      containers,
      regex-compat,
      process,
      old-locale,
      bytestring,
      directory,
      unix,
      time,
      filepath,
      transformers,
      X11 >= 1.6.1,
      mtl >= 2.1 && < 2.3,
      parsec == 3.1.*,
      stm >= 2.3 && < 2.6,
      async

    if impl(ghc < 8.0.2)
       -- Disable building with GHC before 8.0.2.
       -- Due to a cabal bug, do not use buildable: False,
       -- but instead give it an impossible constraint.
       -- See: https://github.com/haskell-infra/hackage-trustees/issues/165
       build-depends: unsupported-ghc-version > 1 && < 1

    if flag(with_threaded)
       -- -threaded is a workaround for 100% CPU busy loop
       -- (http://hackage.haskell.org/trac/ghc/ticket/4934).
       -- See also comments in https://github.com/jaor/xmobar/pull/36
       ghc-options: -threaded
       cpp-options: -DTHREADED_RUNTIME

    if flag(with_xft) || flag(all_extensions)
       build-depends: utf8-string >= 0.3 && < 1.1, X11-xft >= 0.2 && < 0.4
       other-modules: Xmobar.X11.MinXft
       cpp-options: -DXFT

    if flag(with_utf8) || flag(all_extensions)
       build-depends: utf8-string >= 0.3 && < 1.1
       cpp-options: -DUTF8

    if flag(with_inotify) || flag(all_extensions)
       build-depends: hinotify >= 0.3 && < 0.5
       exposed-modules: Xmobar.Plugins.Mail, Xmobar.Plugins.MBox
       cpp-options: -DINOTIFY

    if flag(with_iwlib) || flag(all_extensions)
       extra-libraries: iw
       build-depends: iwlib >= 0.1.0 && < 0.2
       exposed-modules: Xmobar.Plugins.Monitors.Wireless
       cpp-options: -DIWLIB

    if flag(with_mpd) || flag(all_extensions)
       build-depends: libmpd >= 0.9.0.6
       exposed-modules: Xmobar.Plugins.Monitors.MPD
       cpp-options: -DLIBMPD

    if flag(with_alsa) || flag(all_extensions)
       build-depends: alsa-mixer > 0.2.0.2
       build-depends: alsa-core == 0.5.*,
                      process >= 1.4.3.0
       exposed-modules: Xmobar.Plugins.Monitors.Volume
                        Xmobar.Plugins.Monitors.Alsa
       cpp-options: -DALSA

    if flag(with_datezone) || flag(all_extensions)
       build-depends: timezone-olson == 0.1.*, timezone-series == 0.1.*
       exposed-modules: Xmobar.Plugins.DateZone
       cpp-options: -DDATEZONE

    if flag(with_mpris) || flag(all_extensions)
       build-depends: dbus >= 1
       exposed-modules: Xmobar.Plugins.Monitors.Mpris
       cpp-options: -DMPRIS

    if flag(with_dbus) || flag(all_extensions)
       build-depends: dbus >= 1
       other-modules: Xmobar.IPC.DBus
       cpp-options: -DDBUS

    if flag(with_xpm) || flag(all_extensions)
       extra-libraries: Xpm
       other-modules: Xmobar.XPMFile
       cpp-options: -DXPM

    if flag(with_weather) || flag(all_extensions)
       build-depends: HTTP >= 4000.2.4
       exposed-modules: Xmobar.Plugins.Monitors.Weather
       cpp-options: -DWEATHER
       if flag(with_conduit)
          -- use http-conduit  instead of simple-http
          build-depends: http-conduit, http-types
          cpp-options: -DHTTP_CONDUIT

    if flag(with_uvmeter) && flag(with_conduit)
       exposed-modules: Xmobar.Plugins.Monitors.UVMeter
       build-depends: http-conduit, http-types
       cpp-options: -DUVMETER

executable xmobar
    hs-source-dirs:     src/app
    main-is:            Main.hs
    other-modules:      Paths_xmobar, Configuration
    build-depends:      base,
                        containers,
                        async,
                        X11,
                        directory,
                        filepath,
                        unix,
                        parsec,
                        parsec-numbers >= 0.1.0,
                        xmobar

    ghc-options: -funbox-strict-fields -Wall -fno-warn-unused-do-bind

    if flag(with_rtsopts)
       ghc-options: -with-rtsopts=-V0

    if flag(with_threaded)
       -- -threaded is a workaround for 100% CPU busy loop
       -- (http://hackage.haskell.org/trac/ghc/ticket/4934).
       -- See also comments in https://github.com/jaor/xmobar/pull/36
       ghc-options: -threaded
       cpp-options: -DTHREADED_RUNTIME

test-suite XmobarTest
  type:           exitcode-stdio-1.0
  hs-source-dirs: src/lib, test
  main-is:        Spec.hs
  build-depends: base,
                 containers,
                 regex-compat,
                 process,
                 old-locale,
                 bytestring,
                 directory,
                 unix,
                 time,
                 filepath,
                 transformers,
                 X11,
                 mtl,
                 parsec,
                 parsec-numbers,
                 stm,
                 async,
                 temporary,
                 hspec == 2.*,
                 xmobar

  other-modules: Plugins.Monitors.CommonSpec

  if flag(with_alsa) || flag(all_extensions)
      build-depends: alsa-mixer > 0.2.0.2,
                     alsa-core == 0.5.*,
                     process >= 1.4.3.0
      other-modules: Xmobar.Plugins.Monitors.Volume
                     Xmobar.Plugins.Monitors.Alsa
                     Plugins.Monitors.AlsaSpec
                     Xmobar.Commands
                     Xmobar.Plugins
                     Xmobar.Plugins.Monitors.Common
                     Xmobar.Signal
                     Xmobar.Utils
      cpp-options: -DALSA