aboutsummaryrefslogtreecommitdiff
path: root/.config/cow/cow.conf
blob: 234afafcf61cf02417712728383bd97941357a97 (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
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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# cow window manager configuration
#
# This file is read directly from cow(1) but every command herein can be
# sent to cow(1) via it's IPC mechanism with moocow(1).

# Global settings

# How much to move a window by when using key-bindings.
set step 5

# Set the focus policy -- can be `sloppy`, or `click`.  Note that `sloppy`
# does not imply root window focus, and perhaps this should be fixed, or
# renamed to `follows-mouse`?
set focus sloppy

# How many pixels before a window is snapped.
set snap_distance 12

# Hide the pointer after this many milliseconds without input.  Zero disables
# pointer hiding.
set cursor.hide_timeout 4000

# Reserve an area on the screen.  Can be reserved.{top, bottom, left, right}
set reserved.top 10
set reserved.left 10
set reserved.right 10
set reserved.bottom 10

# Default decoration profile.
decor -d default border.width 5 
decor -d default border.style fvwm
# decor -d default border.corner_length 20
decor -d default titlebar.height 22
# decor -d default titlebar.position top
decor -d default titlebar.font 'GoMono Nerd Font Mono 10'
decor -d default icon.enabled true
decor -d default icon.size 64
# icon.image defaults to CoW's installed icon.
# decor -d default icon.background 0x465457
# decor -d default icon.foreground 0xFFFFFF
# decor -d default icon.title_relief true
decor -d default titlebar.enabled true
decor -d default titlebar.button.1.vector 5 25x40@1 25x60@1 75x60@0 75x40@0 25x40@1
decor -d default titlebar.button.1.action 'winops -c'
decor -d default titlebar.button.2.vector 4 50x75@1 25x25@1 75x25@1 50x75@0
decor -d default titlebar.button.2.action 'winops -i'
decor -d default titlebar.button.0.vector 4 50x25@1 75x75@0 25x75@0 50x25@1
decor -d default titlebar.button.0.action 'window-maximize -T'
decor -a default

# Theme packs can define decor profiles in separate files, with image paths
# relative to that theme file.  For example:
#
# include ~/.config/cow/themes/steel/theme.conf
# decor -a steel
#
# See examples/themes/steel for a theme which uses SVG images for borders,
# titlebars, tabs, and a titlebar button.

# Container tab strip styling (optional overrides).
#
# By default, active tabs use the titlebar's base colour and inactive tabs
# use the darkened (sunken) variant, with the titlebar's fg colour for all
# labels so that text is readable regardless of background darkness.
#
# Uncomment and adjust to use distinct colours per-tab state:
# container.tab.active_colour 0x3434E0
# container.tab.fg_active 0xFFFFFF
# Uncomment to restore the classic sunken bevel on inactive tabs:
# container.tab.sunken true

# Squeeze Titlebars.
#
# Similar to what CTWM used to allow, a squeeze titlebar is one whose length
# is shortened to match the window title length.  The remaining space is not
# part of the window.
#
# For example:
#
titlebar.squeeze natural
titlebar.squeeze.justify left
#
# Other justify options are right, centre
# titlebar.squeeze fixed can be used as well to give a slightly larger
# titlebar.

# The colour to use for the background (globally across all outputs).
set output.colour.background 0x3B05A6

# Default window decoration (applies to all windows).
#
# Note that the colour options are still in hex, but are prefixed with `0x` to
# disambiguate them from comments.
#
# Here. the window is styled by gicing each border a different colour, and the
# handles (corners) a different colour as well.
#
# Inactive windows all have a grey (0xCDC9C9) colour.  Note as well that
# specifying the colour for `border.inactive` oe `border.active` in this way
# sets the colour for all components, and are inherited.  For example:
#
# Set the default colour of inactive windows:
#
#     border.inactive = 0xCDC9C9
#     border.inactive.n = 0xFF00FF
#
# This would set the all components of the inactive window to grey, and style
# just the north border as magenta,

decor -d global-on-map border.style fvwm
decor -d global-on-map border.active.image none
decor -d global-on-map border.inactive.image none
decor -d global-on-map border.active.gradient HGradient 0x458588 0x83a598
decor -d global-on-map border.inactive.gradient HGradient 0xa89984 0xebdbb2
decor -d global-on-map titlebar.active_gradient HGradient 0x458588 0x83a598
decor -d global-on-map titlebar.inactive_gradient HGradient 0xa89984 0xebdbb2
decor -d global-on-map container.tab.active_gradient HGradient 0x458588 0x83a598
decor -d global-on-map container.tab.inactive_gradient HGradient 0xa89984 0xebdbb2

rule -g -Ton-map -nglobal-on-map decor -a global-on-map

# Module chrome example.  Sparse decor profiles are applied as overlays, so
# this keeps the active theme colours/images and only removes cowiconman's
# frame chrome.
#
# decor -d cowiconman-chrome border.width 0
# decor -d cowiconman-chrome border.handles false
# decor -d cowiconman-chrome titlebar.enabled false
# rule -g -Ton-map -ncowiconman-chrome -s %cowiconman decor -a cowiconman-chrome

# The restart rule allows for general cleanup.  The `exec` command will always
# run in this config on (re)start, so not doing things such as killing conky
# or waybar will mean more than one instance will run.
# rule -g -T on-restart -n cleanup \
#             exec killall waybar \; \
#             exec killall conky \; \
#             exec killall pasystray

# Window placement policy.  Can also be "centre", or "undermouse".
set placement undermouse

# Set the desk policy.  Can be "global" where all screens share the same
# desktop, or "per-output" where desks are unique to their outputs and each
# output can be changed independently from one another.
#
# The default is `global`
set desktop-configuration per-output

# Virtual page grid.  Anything greater than 1x1 enables paging; each desk
# is then a `cols x rows` grid of pages navigated with the `scroll` command
# (and optionally with edge_scroll for cursor-at-edge auto-pan).
set desktop_size 1 1

# Desktop management:  cow defaults to setting up ten desks, which have a name
# of 0..9 respectively.
#
# Both the name and the number of desktops available can be altered.  For
# example, to only have five desks, set the `desks.count` settings:
#
# set desks.count 5
#
# Without any further adjustment, cow would name those desks 0..4
# respectively.
#
# To change a name of a desk, use the `desk-name` command.  For example, to
# name the first desk to 'main', use:
#
# desk-name 0 main
#
# This would set desk 0's name to 'main'.
#
# cowbar(1) can be told to use names explicitly rather than a desk number, by
# using its `-n` option.

# Smooth page transition animation (default: instant cut)
#set page_scroll_animate true
#set page_scroll_ms 200

# Edge scroll: dwell at a screen edge to switch page (default: off).
# The page switches once the cursor has been at the edge for
# edge_scroll_delay_ms milliseconds.  No-op directions (already at
# the page-grid boundary) don't arm.
#
# If this is disabled, it's recommended to setup key bindings to switch pages.
set edge_scroll true
set edge_scroll_delay_ms 300

# Raise on focus: raise window when focused (default: on).
set raise_on_focus true

# Desk switching.
bind L+0 desk -d 0
bind L+1 desk -d 1
bind L+2 desk -d 2
bind L+3 desk -d 3
bind L+4 desk -d 4
bind L+5 desk -d 5
bind L+6 desk -d 6
bind L+7 desk -d 7
bind L+8 desk -d 8
bind L+9 desk -d 9
bind L+bracketright desk -n
bind L+bracketleft desk -p

# Send window to desk
bind LS+0 window-move -k 0
bind LS+1 window-move -k 1
bind LS+2 window-move -k 2
bind LS+3 window-move -k 3
bind LS+4 window-move -k 4
bind LS+5 window-move -k 5
bind LS+6 window-move -k 6
bind LS+7 window-move -k 7
bind LS+8 window-move -k 8
bind LS+9 window-move -k 9

# Desk collection.  This will show windows on the specified desk (the current
# output is implied).  When this happens, these "collected" windows can be
# moved resized, etc.  When the desk is uncollected (this command acts as a
# toggle), the windows go back to their original desk, and their geometries
# are restored.
#
# This gives a handy-way of glancing at other windows without having to make
# them sticky, for example.
bind LA+0 desk -c 0
bind LA+1 desk -c 1
bind LA+2 desk -c 2
bind LA+3 desk -c 3
bind LA+4 desk -c 4
bind LA+5 desk -c 5
bind LA+6 desk -c 6
bind LA+7 desk -c 7
bind LA+8 desk -c 8
bind LA+9 desk -c 9

# Window operations.  -c close, -r raise, -l lower, etc.
bind LS+a winops -c

# -s sticks to desks, -S sticks to pages.  Combine the two for window
# stickiness over everything.
bind L+s winops -sS
bind A+up winops -r
bind A+down winops -l
bind L+m window-maximize -T
bind C+Return window-expand -T
bind C+i winops -i

# Focus windows, next/prev.
bind A+Tab focus -nw -F 'self.current_output'
bind AS+Tab focus -pw -F 'self.current_output' 

# Move (see the `step` setting) -r after bind is for auto repeat
bind -r LS+Up window-move -d up
bind -r LS+Down window-move -d down
bind -r LS+Left window-move -d left
bind -r LS+Right window-move -d right

# Move (snap to nearest edge / cross monitor)
bind L+Up window-move -nw -d up
bind L+Down window-move -nw -d down
bind L+Left window-move -nw -d left
bind L+Right window-move -nw -d right

# Centre the window and focus.
bind L+c script {
    window-move -c
    focus -w
}

# Resize
bind LA+Up window-resize -s -d up
bind LAS+Up window-resize -g -d up
bind LA+Down window-resize -g -d down
bind LAS+Down window-resize -s -d down
bind LA+Left window-resize -s -d left
bind LAS+Left window-resize -g -d left
bind LA+Right window-resize -g -d right
bind LAS+Right window-resize -s -d right

# Session
bind LCA+q quit

# Custom bindings to run commands.
bind L+Return exec foot
bind L+d exec fuzzel 

# Power menu
bind LS+p exec sh "$HOME/.local/bin/power-menu-fuzzel.sh"

# Emoji menu
bind LS+z exec sh "$HOME/.local/bin/emoji-menu.sh"

# Take a screenshot of the focused output
bind 0+Print exec sh "$HOME/.local/bin/screenshot.sh"

# Take a screenshot of the focused window
bind S+Print exec sh "$HOME/.local/bin/screenshot.sh focused-window"

# Take a screenshot of the selected region
bind L+Print exec sh "$HOME/.local/bin/screenshot.sh selected-region"

# Take a screenshot and save it to the clipboard
bind LS+Print exec sh "$HOME/.local/bin/screenshot.sh save-to-clipboard"

# Mouse bindings
mouse L+left   window-move
mouse L+right  window-resize
# Super+middle-drag: drag a window's titlebar onto another to containerise
# them.  Release over the target's titlebar to group; release over empty
# space completes a normal move.  Super+Shift+left is an alternative for
# environments where middle-click is unavailable (e.g. VNC).
mouse LA+left window-move -C
mouse LS+left  window-container -r

# Decoration click bindings.
#
# The primary mouse button (button 1) can be bound to actions on a window's
# decoration.  See the *ANATOMY OF A WINDOW* section in cow(1).
#
# The -2 argument makes a binding fire on a double-click.
#
# A region can carry both a single-click and a double-click binding at
# the same time.

# Single-click edges / corners: interactive resize on the matching side.
bind-decoration N  window-resize -e n
bind-decoration S  window-resize -e s
bind-decoration E  window-resize -e e
bind-decoration W  window-resize -e w
bind-decoration NE window-resize -e ne
bind-decoration NW window-resize -e nw
bind-decoration SE window-resize -e se
bind-decoration SW window-resize -e sw

# Single-click titlebar:   interactive move.
# Double-click titlebar:   shade / unshade.
bind-decoration titlebar     window-move
bind-decoration -2 titlebar  window-shade -d titlebar

# Example overrides (commented out):
#bind-decoration titlebar     window-maximize -m       # left-click maximises
#bind-decoration -2 NE        winops -c                # NE double-click closes

# Container bindings
# Super+G: group focused window with the next window in stacking order.
# Works without a mouse -- useful in VNC or keyboard-only environments.
bind L+g window-container -a
# Super+Shift+G: remove the focused window from its container.
bind LS+g window-container -r
# Super+Tab / Super+Shift+Tab: cycle tabs within the focused container.
bind L+Tab   window-container -n
bind LS+Tab  window-container -p
# Super+Ctrl+Tab / Super+Ctrl+Shift+Tab: reorder tabs within the container.
bind LC+Tab  window-container -N
bind LCS+Tab window-container -P

# Rules

# Make mpv appear on top and become sticky
rule -g -n mpv -T on-map -s %mpv script {
      winops -sS
      winops -L =top
      window-resize -w 640 -h 360
      window-move -x 1265 -y 705
}

exec sh "$HOME/.config/cow/after-start.sh"

# Clipboard persistence (retain clipboard content after an app closes):
#exec wl-clip-persist --clipboard regular

# Menus
#
# Define menus with menu-add, then bind them to mouse buttons or keys.

# Blue 3D menu appearance.
# Solid colours are the fallback/base colours.  Gradient values use:
#   none | HGradient <colour> <colour> | VGradient <colour> <colour>
menu-style bg                 0x174f9f
menu-style fg                 0xffffff
menu-style title.bg           0x0f3977
menu-style title.fg           0xffffff
menu-style separator          0x082653
menu-style bg.gradient        VGradient 0x2b6fc4 0x123f84
menu-style title.bg.gradient  VGradient 0x1d5ba8 0x0b2f68
menu-style border.width       2
menu-style padding.x          8
menu-style padding.y          3
menu-style title.underlines   2
menu-style automatic.hotkeys  true

# Sub-menu: send window to a desk.
menu-add SendToDesk "Send to Desk"  title
menu-add SendToDesk "Desk 0"        "window-move -k 0"
menu-add SendToDesk "Desk 1"        "window-move -k 1"
menu-add SendToDesk "Desk 2"        "window-move -k 2"
menu-add SendToDesk "Desk 3"        "window-move -k 3"
menu-add SendToDesk "Desk 4"        "window-move -k 4"
menu-add SendToDesk "Desk 5"        "window-move -k 5"
menu-add SendToDesk "Desk 6"        "window-move -k 6"

# Window operations menu.
menu-add WindowOps  "Window"        title
menu-add WindowOps  "Move"          "window-move"
menu-add WindowOps  "Resize"        "window-resize"
menu-add WindowOps  "Maximise"      "window-maximize"
menu-add WindowOps  "Shade North"   "window-shade -d n"
menu-add WindowOps  -               -
menu-add WindowOps  "Send To Desk"  "popup SendToDesk"
menu-add WindowOps  -               -
menu-add WindowOps  "Iconify"       "winops -i"
menu-add WindowOps  "Close"         "winops -c"

# Root menu.
menu-add RootMenu   "cow"           title
menu-add RootMenu   "Foot"         "exec foot"
menu-add RootMenu   -               -
menu-add RootMenu   "Window Ops"    "popup-pick WindowOps"
menu-add RootMenu   -               -
menu-add RootMenu   "Restart"       "exec moocow exec cow"
menu-add RootMenu   "Quit"          "quit"

# Mouse bindings for menus.
# Left-click on the root window → root menu.
root-mouse 0+left   "menu-show RootMenu"
#
# If a window menu is not invoked from a known window context, use
# pick-window so the selected menu action targets the picked window.
# bind M+w "pick-window menu-show WindowOps"

# Keyboard navigation while a menu is open.
# Bind standard arrow/enter/escape keys to menu navigation.
# These are no-ops when no menu is open.
# cow bind format: <modifiers>+<XKB keysym name>  (0 = no modifier)
bind 0+Up     menu-key up
bind 0+Down   menu-key down
bind 0+Left   menu-key left
bind 0+Right  menu-key right
bind 0+Return menu-key select
bind 0+Escape menu-key close
bind 0+a      menu-key a
bind 0+b      menu-key b
bind 0+c      menu-key c
bind 0+d      menu-key d
bind 0+e      menu-key e
bind 0+f      menu-key f
bind 0+g      menu-key g
bind 0+h      menu-key h
bind 0+i      menu-key i
bind 0+j      menu-key j
bind 0+k      menu-key k
bind 0+l      menu-key l
bind 0+m      menu-key m
bind 0+n      menu-key n
bind 0+o      menu-key o
bind 0+p      menu-key p
bind 0+q      menu-key q
bind 0+r      menu-key r
bind 0+s      menu-key s
bind 0+t      menu-key t
bind 0+u      menu-key u
bind 0+v      menu-key v
bind 0+w      menu-key w
bind 0+x      menu-key x
bind 0+y      menu-key y
bind 0+z      menu-key z
bind 0+0      menu-key 0
bind 0+1      menu-key 1
bind 0+2      menu-key 2
bind 0+3      menu-key 3
bind 0+4      menu-key 4
bind 0+5      menu-key 5
bind 0+6      menu-key 6
bind 0+7      menu-key 7
bind 0+8      menu-key 8
bind 0+9      menu-key 9