-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfvwmConfig
executable file
·1005 lines (882 loc) · 36.5 KB
/
fvwmConfig
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
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
##############################################################################
################################################################################
#### YetAnotherLevelUp (YALU), an FVWM Configuration ####
#### ~ Jonathan Heathcote ####
#### ~ September 2009 - Present ####
#### ~ GNU GPLv3 ####
################################################################################
##############################################################################
#
# fvwmConfig:
# The main FVWM configuration file. Make FVWM load this config file to start
# YALU. YALU requires the following programs in order to run:
# * FVWM 2.4 or greater
# * Python 2.4-2.6
# * GNU Screen
# * Zenity
# * dmenu
# * stalonetray
# * xload
# As a performance-enhancement for machines running over a network this file
# has been designed as one big file (segmented by the large banners) rather
# than a number of smaller files where possible (and not wholeley
# inapropriate). While this considerably improves startup performance it may
# cause a minor readability/navigation issue so my apologies for that.
################################################################################
# Prepare FVWM and environment variables #
# Set some really basic settings which are needed to make FVWM behave #
# correctly and set up various important environment variables (including the#
# user's settings). #
################################################################################
### Fix numlock 'issue' ###
# Fvwm treats numlock as a modifier so unless it is ignored, turning it on
# will cause keyboard and mouse bindings not to work when numlock is on.
IgnoreModifiers 2
### Set click-and-hold delay ###
ClickTime 250
### Set the YALU instalation directory ###
# This location is used to load/reffer to all files used by YALU and can be
# changed if the user desires not to keep the yalu directory here for some
# reason.
SetEnv YALU "$[HOME]/.yalu"
### Set the YALU directory containing per-user settings ###
SetEnv LocalYALU "$[HOME]/.yalu"
### Set the default shell to the yalu wrapper to enable custom working dirs ###
ExecUseShell "$[YALU]/bin/yaluShell"
### Load the default settings (to be overridden by user) ###
PipeRead "$[YALU]/bin/yaluConfig.py printAllDefaults"
### Load user configuration ###
Read "$[LocalYALU]/yaluConfig"
### Set the path for icons ###
# Note that here images are limited to a user-specified file type, this means
# that if the user's FVWM install doesn't support PNG they can simply choose
# to use XPM all the time (or if it does, reap the benefits of smoother icons)
# Usage:
# setIconSet [icon set name]
DestroyFunc setIconSet
AddToFunc setIconSet
+ I ImagePath $[YALU]/themes/$0/icons;.$[yaluImageType]
+ I ImagePath +:$[YALU]/icons/;.$[yaluImageType]
DestroyFunc setImageType
AddToFunc setImageType I setIconSet
### Clean up default functions ###
DestroyFunc StartFunction
DestroyFunc InitFunction
DestroyFunc RestartFunction
DestroyFunc ExitFunction
### Enable FvwmCommands ###
AddToFunc StartFunction "I" Module FvwmCommandS
################################################################################
# Utility Functions #
# Functions which are intended to be re-used (rather than just generate one #
# specific menu for instance) #
################################################################################
### Clear the execHistory list ###
DestroyFunc clearExecHistory
AddToFunc clearExecHistory
+ I Exec echo -n > "$[YALU]/yaluExec_history"
### Set window button icon ###
# Because to propperly over-ride the icon used by a window in fvwm you need to
# clear the icon and then set the three different states for that button this
# function is there to automate it. It will set a given window button to use a
# particular icon name appended with Button or ButtonGrey as apropriate.
# Usage:
# setButtonIcon buttonID imageName
DestroyFunc setButtonIcon
AddToFunc setButtonIcon
+ I ButtonStyle $0 Pixmap "clear"
+ I AddButtonStyle $0 ActiveUp Pixmap "$1Button"
+ I AddButtonStyle $0 ActiveDown Pixmap "$1Button"
+ I AddButtonStyle $0 Inactive Pixmap "$1ButtonGrey"
### Present an editor for the launcher ###
# Presently this just launches a text editor, in the future this could be a
# propper menu editing utility.
DestroyFunc editLauncher
AddToFunc editLauncher
+ I YaluExec $[yaluEditor] "$[YALU]/menu"
### Only carry out action if not dragged ###
# Useful if you only want a particular command to be executed when the user
# clicks and doesn't drag away (e.g. on a window button)
# Usage:
# abortOnDrag [Fvwm Commands]
DestroyFunc abortOnDrag
AddToFunc abortOnDrag
+ C $*
+ M Nop
### Sort icons after command ###
# Will execute a command and then afterwards re-arange iconified windows.
# Useful if your action is likely to mess them up (e.g. closing one)
# Usage:
# doAndRearangeIcons [Fvwm Commands]
DestroyFunc doAndRearangeIcons
AddToFunc doAndRearangeIcons
+ I $*
+ I rearangeIcons
### Rearanges iconfied windows neatly ###
# Note that this actually slightly delays the action to ensure that any
# actions carried out previously which might have effected the iconified
# windows positions can complete first.
DestroyFunc rearangeIcons
AddToFunc rearangeIcons
+ I Schedule 100 All (CurrentPage,Iconic) RecaptureWindow
### De-iconify window ###
# De-iconify a window and warp the cursor to it ready to use
DestroyFunc unIconify
AddToFunc unIconify
+ I Iconify False
+ I WarpToWindow 50% 50%
+ I rearangeIcons
# As above but place the window out of the way somewhere rather than its
# original position.
DestroyFunc unIconifyToSpace
AddToFunc unIconifyToSpace
+ I Iconify False
+ I PlaceAgain
+ I rearangeIcons
### Move and navigate to a different page/desktop ###
# Carries out all the needed functions to raise, move a window to another
# page/desk and then follow it.
# Usage (eg):
# moveAndGoTo Page 0p -1p
# moveAndGoTo Desk 1 0 0 1
DestroyFunc moveAndGoTo
AddToFunc moveAndGoTo
+ I Raise
+ I MoveTo$*
+ I Goto$*
### Window Flinging ###
# 'Flinging' a window moves it to a particular screen-edge and then maximizes
# it along that edge. Animated!
# (Note that windows are de-maximised first to work-around the fvwm behavior
# bug of not changing the proportions of already-maximised windows)
AddToFunc flingRight
+ I Maximize False
+ I Maximize True 0 100
+ I AnimatedMove -0 0 Warp
AddToFunc flingLeft
+ I Maximize False
+ I Maximize True 0 100
+ I AnimatedMove 0 0 Warp
AddToFunc flingUp
+ I Maximize False
+ I Maximize True 100 0
+ I AnimatedMove 0 0 Warp
AddToFunc flingDown
+ I Maximize False
+ I Maximize True 100 0
+ I AnimatedMove 0 -0 Warp
### Window 'throwing' ###
# 'Throwing' a window simply moves it to the screen edge in the specified
# direction. Animated!
AddToFunc throwRight
+ I AnimatedMove -0 w Warp
AddToFunc throwLeft
+ I AnimatedMove 0 w Warp
AddToFunc throwUp
+ I AnimatedMove w 0 Warp
AddToFunc throwDown
+ I AnimatedMove w -0 Warp
### Set the style for a category of windows ###
# Usage:
# setGroupStyle [group] [fvwm style commands]
DestroyFunc setGroupStyle
AddToFunc setGroupStyle
+ I setGroupStyle$*
DestroyFunc setGroupStyleEditor
AddToFunc setGroupStyleEditor
+ I Style "gvim" $*
+ I Style "Emacs" $*
+ I Style "Nedit" $*
+ I Style "Kate" $*
+ I Style "Gedit" $*
DestroyFunc setGroupStyleTerminal
AddToFunc setGroupStyleTerminal
+ I Style "xterm" $*
+ I Style "Gnome-terminal" $*
+ I Style "Konsole" $*
+ I Style "aterm" $*
+ I Style "eterm" $*
+ I Style "rxvt" $*
DestroyFunc setGroupStyleBrowser
AddToFunc setGroupStyleBrowser
+ I Style "Firefox" $*
+ I Style "Iceweasel" $*
+ I Style "Navigator" $*
+ I Style "Konqueror" $*
+ I Style "Epiphany" $*
+ I Style "Google-chrome" $*
+ I Style "Chromium" $*
+ I Style "Opera" $*
DestroyFunc setGroupStyleChat
AddToFunc setGroupStyleChat
+ I Style "Skype" $*
+ I Style "amsn" $*
+ I Style "Pidgin" $*
+ I Style "Konversation" $*
+ I Style "Kopete" $*
+ I Style "Empathy" $*
+ I Style "xchat" $*
+ I Style "irssi" $*
DestroyFunc setGroupStyleMultimedia
AddToFunc setGroupStyleMultimedia
+ I Style "vlc" $*
+ I Style "Rhythmbox" $*
+ I Style "Amarok" $*
+ I Style "Totem" $*
+ I Style "xine" $*
+ I Style "mplayer" $*
+ I Style "Kaffeine" $*
+ I Style "Noatun" $*
+ I Style "KPlayer" $*
DestroyFunc setGroupStyleGraphics
AddToFunc setGroupStyleGraphics
+ I Style "inkscape" $*
+ I Style "gimp" $*
+ I Style "kriter" $*
+ I Style "kpaint" $*
+ I Style "gpaint" $*
+ I Style "fspot" $*
+ I Style "Picassa" $*
+ I Style "gphoto" $*
### External Command Wrappers ###
# (Re)generates dynamic menus using the yaluMenu script.
# Usage:
# YaluMenu [menuName]
# If no menu name is specified, all menus are regenerated
DestroyFunc YaluMenu
AddToFunc YaluMenu
+ I PipeRead "$[YALU]/bin/yaluMenu.py $*"
# Set a particular option in the user's configuration using the yaluConfig
# script.
# Usage:
# YaluConfig optionName newValue
DestroyFunc YaluConfig
AddToFunc YaluConfig
+ I Exec exec "$[YALU]/bin/yaluConfig.py" $*
# Same as the above but does not get passed a new value, instead it prompts
# the user to enter a value in a zenity-powered textbox. The window contains a
# prompt including your message and the option's default value. The
# current-option is pre-entered into the text-area.
# Usage:
# YaluConfigGUI optionName prompt
DestroyFunc YaluConfigGUI
AddToFunc YaluConfigGUI
+ I Exec exec "$[YALU]/bin/yaluConfigGUI" $*
### Execute an external program and catch the output ###
# This command functions like Exec however it places the command in a screen
# session so that the user can later view/interact with its stdin/out/err. It
# also further wraps the program in a script which keeps the shell alive for a
# short time after the command exits so the user can determine the exit status
# or take-over the shell.
# Usage:
# YaluExec command [command's options]
# Note: You should not prepend with exec (like you might normally with Exec)
# as this is taken care of by the script.
# Note: You can't do any shell operations (such as piping or redirecting) like
# you can with exec.
DestroyFunc YaluExec
AddToFunc YaluExec
+ I Exec exec "$[YALU]/bin/yaluExec" $*
### Wallpaper Management ###
# [Todo: Syntax guide]
DestroyFunc YaluWallpaper
AddToFunc YaluWallpaper
+ I Exec exec "$[YALU]/bin/yaluWallpaper" $*
### Working Directory Management###
# [Todo: Syntax guide]
DestroyFunc YaluWorkingDir
AddToFunc YaluWorkingDir
+ I Exec exec "$[YALU]/bin/yaluWorkingDir" $*
### Window Colour Management ###
# [Todo: Syntax guide]
DestroyFunc YaluWindowColour
AddToFunc YaluWindowColour
+ I Exec exec "$[YALU]/bin/yaluWindowColour" $*
# This function is expected by yaluConfig however it doesn't need to do
# anything
DestroyFunc setDelayExitTime
AddToFunc setDelayExitTime I Nop
################################################################################
# Pager #
# Provides a pager to show desks and pages to the user, nothing particularly #
# special here. #
################################################################################
# This is wrapped in a function so that it can be easily re-loaded when (for
# instance) the number of pages changes.
DestroyFunc setPager
AddToFunc setPager
+ I KillModule FvwmPager yaluPager # Kill any old pages started by YALU
+ I Module FvwmPager yaluPager 0 $[yaluDesks]
+ I *yaluPager: Back black
+ I *yaluPager: Fore grey20
+ I *yaluPager: Columns 1 # Desks are shown vertically
+ I *yaluPager: Geometry +0-0 # Place at the bottom-left of the screen
+ I *yaluPager: LabelsBelow # Desk labels underneath
+ I Style yaluPager Sticky,NoHandles,NoTitle,color grey/black
# The pager is loaded by the paging and desk functions
################################################################################
# Tray #
# Provides a tray containing a clock, system tray and load monitor #
################################################################################
DestroyFunc setTray
AddToFunc setTray
+ I KillModule FvwmButtons yaluButtons # Close any old instances
+ I Module FvwmButtons yaluButtons
+ I *yaluButtons: Back black
+ I *yaluButtons: Fore white
+ I *yaluButtons: BoxSize smart # Auto-resize
+ I *yaluButtons: Columns # Horizontal stacking
+ I *yaluButtons: Rows 1
+ I *yaluButtons: Geometry 500x24-0-0 # Maximum size
+ I *yaluButtons: Frame 0 # Invisible border
# Load monitor
+ I *yaluButtons: (1x1, Swallow "xload"\
"Exec exec xload -fg $fg -bg $bg -update 1 -nolabel -geometry -3000-3000")
# Trayer (For Sys-tray icons)
+ I *yaluButtons: (3x1, Swallow (UseOld, NoClose, Kill, NoHints) "stalonetray" \
"Exec exec stalonetray -geometry 1x1-3000-3000 -bg $bg --no-shrink --icon-gravity W --dockapp-mode --kludges force_icons_size"\
Right)
# A simple clock
+ I *yaluButtons: (1x1, Swallow (UseOld) "xclock" \
"Exec exec xclock -geometry -3000-3000 -digital -brief -bg $bg -fg $fg -norender -padding 0"\
Right)
+ I Style yaluButtons Sticky,NoHandles,NoTitle,NeverFocus
# Load the tray
setTray
################################################################################
# Desks and Pages #
# Control the number of pages and desks available to the user. #
################################################################################
# The following functions set (or re-set) the various options as specified in
# the config file.
# The number of desks
DestroyFunc setDesks
AddToFunc setDesks
+ I setPagingKeys # Update the limits on keyboard shortcuts
+ I setPager # Re-load the pager
# Number of pages per desk
DestroyFunc setPages
AddToFunc setPages
+ I DesktopSize $[yaluDeskWidth]x$[yaluDeskHeight]
+ I setPager # Re-load the pager
# Functions required by yaluConfig
DestroyFunc setDeskHeight
AddToFunc setDeskHeight I setPages
DestroyFunc setDeskWidth
AddToFunc setDeskWidth I setPages
# The % of the screen to jump when the mouse moves off the edge
DestroyFunc setEdgeJump
AddToFunc setEdgeJump
+ I EdgeScroll $[yaluEdgeJumpWidth] $[yaluEdgeJumpHeight]
setEdgeJump
DestroyFunc setEdgeJumpWidth
AddToFunc setEdgeJumpWidth I setEdgeJump
DestroyFunc setEdgeJumpHeight
AddToFunc setEdgeJumpHeight I setEdgeJump
# How long must the user hold their mouse next to the screen edge before it
# jumps to the next desktop
DestroyFunc setEdgeResistDelay
AddToFunc setEdgeResistDelay
+ I EdgeResistance $[yaluEdgeResistDelay] $[yaluSnapDistance]
### Load the relevent settings ###
setPages
setDesks
setEdgeJump
#setEdgeResistDelay # Applied when setting window snapping
################################################################################
# Window behaviour #
# Control the way windows interact and are placed #
################################################################################
# Placement Mode
DestroyFunc setPlaceMode
AddToFunc setPlaceMode
+ I Style * $[yaluPlaceMode]
setPlaceMode
# Focus Mode
DestroyFunc setFocusMode
AddToFunc setFocusMode I Style (AcceptsFocus) $[yaluFocusMode]
setFocusMode
# Window snapping
DestroyFunc setSnapDistance
AddToFunc setSnapDistance
+ I Style * SnapAttraction $[yaluSnapDistance] SameType
+ I setEdgeResistDelay
setSnapDistance
# Don't show grids when moving/resizing windows (i.e. show window contents)
OpaqueMoveSize unlimited
Style * ResizeOpaque
# Alt-drag
DestroyFunc altDrag
AddToFunc altDrag
+ M Move
Mouse 1 A M altDrag
# Alt-resize
DestroyFunc altResize
AddToFunc altResize
+ M $[yaluResizeCorner]
+ M Resize
Mouse 3 A M altResize
# Required function by yaluConfig -- doesn't need to do anything
DestroyFunc setResizeCorner
AddToFunc setResizeCorner I Nop
# Auto-Raise
DestroyFunc setAutoRaise
AddToFunc setAutoRaise
+ I KillModule FvwmAuto
+ I FvwmAuto $[yaluAutoRaise] "Silent Raise"
setAutoRaise
################################################################################
# Inteligent Tiling #
# Add tiling-wm like functionality to YALU like auto-fitting a window to a #
# space on screen. #
################################################################################
DestroyFunc InteliTile
AddToFunc InteliTile
+ I PipeRead "$[YALU]/bin/yaluInteliTile.py init $[vp.width] $[vp.height]"
+ I Iconify True
+ I All (CurrentPage,!Iconic,Visible,!yaluPager,!yaluButtons) \
PipeRead "$[YALU]/bin/yaluInteliTile.py add $[yaluInteliTileID] $[w.x] $[w.y] $[w.width] $[w.height]"
+ I Iconify False
+ I PipeRead "$[YALU]/bin/yaluInteliTile.py $* $[yaluInteliTileID] $[w.x] $[w.y] $[w.width] $[w.height]"
################################################################################
# Window Buttons #
# What buttons should windows have and how should they look/act #
################################################################################
### Top Right (Close) ###
Mouse 1 2 N abortOnDrag Close # Left-Click: Close
Mouse 1 2 4 abortOnDrag Delete # Super+Left-Click: Delete
Mouse 1 2 C abortOnDrag Destroy # Ctl+Left-Click: Destroy
### Top Right (Maximize) ###
# A function which will inteli-place if held, do nothing if dragged and
# maximize if clicked.
DestroyFunc maximiseComplexAction
AddToFunc maximiseComplexAction
+ C Maximize $0 $1
+ M Nop
+ H InteliTile $2
# Left-Click: Maximize, Hold: InteliTile
Mouse 1 4 N maximiseComplexAction 100 100 place
# Left-Click: Wide Maximize, Hold: InteliTile Wide
Mouse 2 4 N maximiseComplexAction 100 0 widePlace
# Left-Click: Maximize Tall, Hold: InteliTile Tall
Mouse 3 4 N maximiseComplexAction 0 100 tallPlace
### Top Right (Iconify) ###
Mouse 1 6 N abortOnDrag Iconify # Left-Click: Iconify
Mouse 3 6 N abortOnDrag WindowShade # Right-Click: Shade
### Title Bar ###
# Make window Sticky
Mouse 2 T N Stick # Middle-Click
# Re-Place the window somewhere convenient on the screen
Mouse 3 T N PlaceAgain Anim # Right-Click
# Show iconified windows
DestroyFunc titlebarBehaviour
AddToFunc titlebarBehaviour
+ M Move
+ H showIcons
+ D Lower
+ C Raise
Mouse 1 T N titlebarBehaviour # Hold-down mouse
### Window Icon (Top Left) ###
# Show the application's icon
ButtonStyle 1 MiniIcon
# Show The Window Menu
Mouse 0 1 N Menu windowMenu # Click
################################################################################
# Menus #
# Define each of the different menus that can be used. #
################################################################################
DestroyFunc reloadAllMenus
AddToFunc reloadAllMenus
+ I ### Define the basic behaviour of menus ###
+ I MenuStyle * AutomaticHotkeys # Generate hotkeys where undefined
+ I
+ I ### Generate all dynamic menus ###
+ I YaluMenu
+ I
+ I ### YALU Configuration Menu ###
+ I DestroyMenu yaluConfiguration
+ I AddToMenu yaluConfiguration "YALU Configuration" Title
+ I + "%wallpaper%Set Wallpaper" YaluWallpaper setGUI
+ I + "%workingDir%Working Directory" Popup workingDirectoryConfig
+ I + "" Nop
+ I + "%programs%&Programs" Popup programs
+ I + "%windows%&Windows" Popup windows
+ I + "%pagesAndDesks%Paging and &Desks" Popup pagingAndDesks
+ I + "%theme%&Theme" Popup theme
+ I + "" Nop
+ I + "%fvwm%&FVWM Menu" Popup MenuFvwmRoot
+ I + "" Nop
+ I + "%restart%&Restart" Restart
+ I + "%quit%&Quit" Quit
+ I
+ I ### Working Directory Config ###
+ I DestroyMenu workingDirectoryConfig
+ I AddToMenu workingDirectoryConfig "Set Working Directory" Title
+ I + "For this page" YaluWorkingDir page GUI
+ I + "For this desk" YaluWorkingDir desk GUI
+ I + "For everything" YaluWorkingDir all GUI
+ I
+ I ### Programs (Config) Menu ###
+ I DestroyFunc generatePrograms
+ I AddToFunc generatePrograms
+ I + I DestroyMenu programs
+ I + I AddToMenu programs "Program Configuration" Title
+ I + I + DynamicPopupAction generatePrograms
+ I + I + "View Program &Output (Super+F4)" Popup execOutput
+ I + I + "Keep program output for..." Popup DelayExitTimeConfig
+ I + I + "" Nop
+ I + I + "Edit &Launcher" editLauncher
+ I + I + "Change &Terminal Program ($[yaluTerminal])" Popup TerminalConfig
+ I + I + "Change Text &Editor ($[yaluEditor])" Popup EditorConfig
+ I + I + "Change &Web Browser ($[yaluBrowser])" Popup BrowserConfig
+ I + I + "" Nop
+ I + I + "Program Usage &History (Super+F3)" Popup execHistory
+ I + I + "&Sort History By..." Popup execHistoryTypeConfig
+ I + I + "%clearHistory%&Clear History" clearExecHistory
+ I generatePrograms
+ I
+ I ### Windows (Config) Menu ###
+ I DestroyMenu windows
+ I AddToMenu windows "Window Configuration" Title
+ I + "Window Placement" Popup placeModeConfig
+ I + "Window Snapping" Popup snapDistanceConfig
+ I + "Window Focus Mode" Popup focusModeConfig
+ I + "" Nop
+ I + "Auto-Raise" Popup autoRaiseConfig
+ I + "" Nop
+ I + "Alt-Resize Corner" Popup resizeCornerConfig
+ I
+ I ### Paging/Desk (Config) Menu ###
+ I DestroyMenu pagingAndDesks
+ I AddToMenu pagingAndDesks "Paging and Desk Configuration" Title
+ I + "Number of Desks" Popup desksConfig
+ I + "" Nop
+ I + "%horizontalPages%Horizontal Pages Per Desk" Popup deskWidthConfig
+ I + "%verticalPages%Vertical Pages Per Desk" Popup deskHeightConfig
+ I + "" Nop
+ I + "%horizontalEdgeSize%Horizontal Screen Edge Jump Size" Popup edgeJumpWidthConfig
+ I + "%verticalEdgeSize%Vertical Screen Edge Jump Size" Popup edgeJumpHeightConfig
+ I + "Edge Jump Delay" Popup edgeResistDelayConfig
+ I
+ I ### Theme (Config) Menu ###
+ I DestroyMenu theme
+ I AddToMenu theme "Theme Configuration" Title
+ I + "Select Theme" Popup themeConfig
+ I + "Theme Configuration" Popup ThisThemeMenu
+ I + "" Nop
+ I + "Colourize Windows by Category" Popup WindowTypeColoursConfig
+ I
+ I ### Window Menu ###
+ I DestroyFunc buildWindowMenu
+ I AddToFunc buildWindowMenu
+ I + I DestroyMenu windowMenu
+ I + I AddToMenu windowMenu
+ I + I + DynamicPopupAction buildWindowMenu
+ I + I + "%close%Close" Popup windowClose
+ I + I + "Maximize" Popup windowMaximize
+ I + I + "Fill Space" Popup windowInteliTile
+ I + I + "Iconify (Alt+F2)" Iconify
+ I + I + "" Nop
+ I + I + "Shade/Unshade (Alt+Shift+F2)" WindowShade
+ I + I + "Stick/Unstick (Alt+Shift+F1)" Stick
+ I + I + "" Nop
+ I + I + "Move To Page" Popup windowMovePage
+ I + I + "Move To Desk" Popup windowMoveDesk
+ I + I + "" Nop
+ I + I + "Throw Window" Popup windowThrow
+ I + I + "Fling Window" Popup windowFling
+ I + I + "" Nop
+ I + I + "Raise (Alt+Space)" Raise
+ I + I + "Lower (Ctrl+Alt+Space)" Lower
+ I + I + "" Nop
+ I + I + "Place Window Again (Alt+F9)" PlaceAgain Anim
+ I + I + "Redraw Window (Alt+F10)" RefreshWindow
+ I + I + "" Nop
+ I + I + "Set colour for all $[w.name] windows" Popup windowNameColour
+ I + I + "Set colour for all $[w.class] windows" Popup windowClassColour
+ I + I + "" Nop
+ I + I + "Window Information" Module FvwmIdent
+ I + I DestroyMenu windowNameColour
+ I + I AddToMenu windowNameColour
+ I + I + "%defaultColour%System Default" YaluWindowColour "$[w.name]" clear
+ I + I + "%pickColour%Pick Colour" YaluWindowColour "$[w.name]"
+ I + I DestroyMenu windowClassColour
+ I + I AddToMenu windowClassColour
+ I + I + "%defaultColour%System Default" YaluWindowColour "$[w.class]" clear
+ I + I + "%pickColour%Pick Colour" YaluWindowColour "$[w.class]"
+ I buildWindowMenu
+ I
+ I DestroyMenu windowClose
+ I AddToMenu windowClose
+ I + "%close%Close (Alt+F4)" Close
+ I + "%delete%Delete (Alt+Super+F4)" Delete
+ I + "%destroy%Destroy (Alt+Shift+Super+F4)" Destroy
+ I
+ I DestroyMenu windowMaximize
+ I AddToMenu windowMaximize
+ I + "%maximize%Maximize (Alt+F3)" Maximize
+ I + "%tallMaximize%Tall Maximize (Alt+Shift+F3)" Maximize 0 100
+ I + "%wideMaximize%Wide Maximize (Alt+Super+F3)" Maximize 100 0
+ I
+ I DestroyMenu windowInteliTile
+ I AddToMenu windowInteliTile
+ I + "%inteliTitle%Fill Space (Alt+F5)" InteliTile place
+ I + "%tallInteliTitle%Fill Vertical Space (Alt+Shift+F3)" InteliTile tallPlace
+ I + "%wideInteliTitle%Fill Horizontal Space (Alt+Super+F3)" InteliTile widePlace
+ I
+ I DestroyMenu windowMovePage
+ I AddToMenu windowMovePage
+ I + "%pageLast%Move To Last Page (Ctrl+Alt+Super+Tab)" moveAndGoTo Page prev
+ I + "" Nop
+ I + "%pageRight%Move Right (Ctrl+Alt+Super+Right)" moveAndGoTo Page +1p 0p
+ I + "%pageLeft%Move Left (Ctrl+Alt+Super+Left)" moveAndGoTo Page -1p 0p
+ I + "%pageUp%Move Up (Ctrl+Alt+Super+Up)" moveAndGoTo Page 0p -1p
+ I + "%pageDown%Move Down (Ctrl+Alt+Super+Down)" moveAndGoTo Page 0p +1p
+ I
+ I DestroyMenu windowMoveDesk
+ I AddToMenu windowMoveDesk
+ I + "%pageLast%Move To Previous Desk (Ctrl+Alt+Super+Tab)" moveAndGoTo Desk prev 0 $[yaluDesks]
+ I + "" Nop
+ I + "%deskNext%Move Next (Ctrl+Alt+Shift+Super+Right)" moveAndGoTo Desk 1 0 0 $[yaluDesks]
+ I + "%deskPrev%Move Prev (Ctrl+Alt+Shift+Super+Left)" moveAndGoTo Desk -1 0 0 $[yaluDesks]
+ I
+ I DestroyMenu windowFling
+ I AddToMenu windowFling
+ I + "%flingRight%Fling Right (Ctrl+Shift+Right)" flingRight
+ I + "%flingLeft%Fling Left (Ctrl+Shift+Left)" flingLeft
+ I + "%flingUp%Fling Up (Ctrl+Shift+Up)" flingUp
+ I + "%flingDown%Fling Down (Ctrl+Shift+Down)" flingDown
+ I
+ I DestroyMenu windowThrow
+ I AddToMenu windowThrow
+ I + "%throwRight%Throw Right (Alt+Super+Right)" throwRight
+ I + "%throwLeft%Throw Left (Alt+Super+Left)" throwLeft
+ I + "%throwUp%Throw Up (Alt+Super+Up)" throwUp
+ I + "%throwDown%Throw Down (Alt+Super+Down)" throwDown
### Set Desktop Shortcuts ###
DestroyFunc desktopLeftClick
AddToFunc desktopLeftClick
+ C Menu launcher
+ M Menu launcher
+ H Menu execOutput
Mouse 1 R N desktopLeftClick # Left-click Launcher, Hold: exec output
Mouse 2 R N Menu yaluConfiguration # Middle-click YALU Config
Mouse 3 R N Menu execHistory # Right-click Program History
# These functions are expected by yaluConfig but they need not do anything
DestroyFunc setExecHistoryType
AddToFunc setExecHistoryType I Nop
DestroyFunc setTerminal
AddToFunc setTerminal I YaluMenu launcher
DestroyFunc setBrowser
AddToFunc setBrowser I YaluMenu launcher
DestroyFunc setEditor
AddToFunc setEditor I YaluMenu launcher
#reloadAllMenus # Done by setTheme
################################################################################
# Mouse Gestures #
# Set mouse gestures to use throughout the system #
################################################################################
# Super+click Mouse-gestures
Mouse 0 A 4 StrokeFunc EchoSequence DrawMotion StrokeWidth 3
################################################################################
# Keyboard Shortcuts #
# Set keyboard shortcuts for useful actions. #
################################################################################
### Menus ###
# Launcher
Key F1 A 4 Menu launcher # Super+F1
# YALU Configuration Menu
Key F2 A 4 Menu yaluConfiguration # Super+F2
# Application History List
Key F3 A 4 Menu execHistory # Super+F3
# YaluExec output viewer menu
Key F4 A 4 Menu execOutput # Super+F4
### General ###
# dmenu
Key Space A 4 Exec exec "$[YALU]/bin/yaluDmenu" # Super+Space show dmenu
# Window List
Key Tab A M WindowList # Alt+Tab
# Paging function preparation
DestroyFunc setPagingKeys
# Page Navigation
AddToFunc setPagingKeys
+ I Key Tab A CM GotoPage prev # Toggle, Ctrl+Alt+Tab
+ I Key Right A CM GotoPage +1p 0p # Ctrl+Alt+Right
+ I Key Left A CM GotoPage -1p 0p # Ctrl+Alt+Left
+ I Key Up A CM GotoPage 0p -1p # Ctrl+Alt+Up
+ I Key Down A CM GotoPage 0p +1p # Ctrl+Alt+Down
# Page-Move
AddToFunc setPagingKeys
+ I Key Tab A CM4 moveAndGoTo Page prev # Toggle, Ctrl+Super+Alt+Tab
+ I Key Right A CM4 moveAndGoTo Page +1p 0p # Ctrl+Super+Alt+Right
+ I Key Left A CM4 moveAndGoTo Page -1p 0p # Ctrl+Super+Alt+Left
+ I Key Up A CM4 moveAndGoTo Page 0p -1p # Ctrl+Super+Alt+Up
+ I Key Down A CM4 moveAndGoTo Page 0p 1p # Ctrl+Super+Alt+Down
# Desktop Navigation
AddToFunc setPagingKeys
+ I Key Tab A CMS GotoDesk prev 0 $[yaluDesks] # Toggle, Ctrl+Shift+Alt+Tab
+ I Key Right A CMS GotoDesk 1 0 0 $[yaluDesks] # Ctrl+Shift+Alt+Right
+ I Key Left A CMS GotoDesk -1 0 0 $[yaluDesks] # Ctrl+Shift+Alt+Left
+ I Key Down A CMS GotoDesk 1 0 0 $[yaluDesks] # Ctrl+Shift+Alt+Down
+ I Key Up A CMS GotoDesk -1 0 0 $[yaluDesks] # Ctrl+Shift+Alt+Up
# Desk-Move
AddToFunc setPagingKeys
+ I Key Tab A CMS4 moveAndGoTo Desk prev 0 $[yaluDesks] # Toggle, Ctrl+Shift+Alt+Tab
+ I Key Right A CMS4 moveAndGoTo Desk 1 0 0 $[yaluDesks] # Ctrl+Shift+Alt+Right
+ I Key Left A CMS4 moveAndGoTo Desk -1 0 0 $[yaluDesks] # Ctrl+Shift+Alt+Left
+ I Key Up A CMS4 moveAndGoTo Desk -1 0 0 $[yaluDesks] # Ctrl+Shift+Alt+Up
+ I Key Down A CMS4 moveAndGoTo Desk 1 0 0 $[yaluDesks] # Ctrl+Shift+Alt+Down
# Focus Direction
AddToFunc setPagingKeys
+ I Key Right A 4 Direction East (AcceptsFocus,CurrentDesk) WarpToWindow 50% 50% # Super+Right
+ I Key Left A 4 Direction West (AcceptsFocus,CurrentDesk) WarpToWindow 50% 50% # Super+Left
+ I Key Up A 4 Direction North (AcceptsFocus,CurrentDesk) WarpToWindow 50% 50% # Super+Up
+ I Key Down A 4 Direction South (AcceptsFocus,CurrentDesk) WarpToWindow 50% 50% # Super+Down
# Flinging and Throwing Functions
AddToFunc bindFlingAndThrow
+ I Key $0 A C4 fling$0
+ I Key $0 A M4 throw$0
bindFlingAndThrow Right
bindFlingAndThrow Left
bindFlingAndThrow Up
bindFlingAndThrow Down
setPagingKeys
### Window Control ###
# Show The Window Menu
Key F1 A M Menu windowMenu # Alt+F1
# Close
Key F4 A M Close # Graceful Close, Alt+F4
Key F4 A M4 Delete # Forceful Close, Alt+Super+F4
Key F4 A SM4 Destroy # Force-Close, Shift+Alt+Super+F4
# Maximize
Key F3 A M Maximize # Toggle, Alt+F3
Key F3 A SM Maximize 0 100 # Toggle Tall, Shift+Alt+F3
Key F3 A M4 Maximize 100 0 # Toggle Wide, Super+Alt+F3
# InteliTile
# Largest Space, Alt+F5
Key F5 A M InteliTile place
# Tallest Space, Shift+Alt+F5
Key F5 A SM InteliTile tallPlace
# Widest Space, Super+Alt+F5
Key F5 A M4 InteliTile widePlace
# Iconify
Key F2 A M Iconify # Alt+F2
# Shade
Key F2 A SM WindowShade # Shift+Alt+F2
# Raise/Lower Window
Key Space A M Raise # Alt+Space
Key Space A CM Lower # Ctrl+Alt+Space
# Sticky window
Key F1 A SM Stick # Shift+Alt+F1
# Re-place window
Key F9 A M PlaceAgain Anim # Alt+F9
# Re-place all windows
Key F9 A SM All (AcceptsFocus,CurrentPage) PlaceAgain Anim # Shift+Alt+F9
# Re-draw window
Key F10 A M RefreshWindow # Alt+F10
### System Tray and Pager ###
DestroyFunc doToTrayAndPager
AddToFunc doToTrayAndPager
+ I All (yaluButtons) $*
+ I All (yaluPager) $*
# Super+Alt+Space To Raise
Key Space A M4 doToTrayAndPager Raise
# Ctl+Super+Alt+Space To Lower
Key Space A CM4 doToTrayAndPager Lower
################################################################################
# Iconified Window Behaviour #
# Control what happens to iconified windows when the user clicks on them. #
################################################################################
### Appearence ###
Style * IconBox 800x600+0+0
Style * StickyIcon
### Click Behaviour ###
DestroyFunc mouseUnIconify
AddToFunc mouseUnIconify
+ C unIconify # Click to open
+ M Nop
+ H unIconifyToSpace # Hold down to open into a spare space
Mouse 1 I N mouseUnIconify
### Space/Return to open ###
Key Space I N unIconify
Key Return I N unIconify
### Ctl+Return to open into a space ###
Key Return I C unIconifyToSpace
### Close Icon ###
Mouse 3 I N doAndRearangeIcons Close # Right-Click
Key Delete I N doAndRearangeIcons Close # Delete
### Delete Icon ###
Mouse 3 I 4 doAndRearangeIcons Delete # Super-Right-Click
Key Delete I 4 doAndRearangeIcons Delete # Super+Delete
### Destroy Icon ###
Mouse 3 I C doAndRearangeIcons Destroy # Ctrl-Right-Click
Key Delete I C doAndRearangeIcons Destroy # Super+Delete
### Raise and Cycle through icons ###
DestroyFunc showIcons
AddToFunc showIcons
+ I All (CurrentPage,Iconic) Raise # Shift+Alt+Space
+ I Next (CurrentPage,Iconic) WarpToWindow # Shift+Alt+Space
Key Space A SM showIcons # Shift+Alt+Space
### Lower Icons ###
Key Space A CSM All (CurrentPage,Iconic) Lower # Ctrl+Shift+Alt+Space
Key Escape I N All (CurrentPage,Iconic) Lower # Escape (on an icon)
### Middle click to force a rearange (kindof debugging feature) ###
Mouse 2 I N rearangeIcons
################################################################################
# Page/Desk Specific Behaviour #
# Set up any behaviours that are specific to each desk and page. #
################################################################################
### Setup Environment on page/desk change ###
DestroyFunc onPageChange
AddToFunc onPageChange
# Remember old values (so wallpaper doesn't need to be changed if the same)
+ I SetEnv yaluOldDesk $[yaluDesk]
+ I SetEnv yaluOldPageX $[yaluPageX]
+ I SetEnv yaluOldPageY $[yaluPageY]
# Store new values in exernally accesaable variable
+ I SetEnv yaluDesk $[desk.n]
+ I SetEnv yaluPageX $[page.nx]
+ I SetEnv yaluPageY $[page.ny]
# Run the wallpaper manager
+ I YaluWallpaper
### Use FvwmBacker to monitor when desk/page changes
AddToFunc setDeskSpecificBehaviour
+ I Module FvwmBacker
+ I *FvwmBacker: Command (Desk *, Page * *) onPageChange
# Initialise the wallpaper manager
+ I YaluWallpaper init
setDeskSpecificBehaviour
################################################################################
# Themeing #
# Provide a system to allow the user to easily customize the theme of YALU. #
################################################################################
### Load the theme ###
DestroyFunc setTheme
AddToFunc setTheme
# Load theme file
+ I Read "$[yaluTheme]"
# Reload all menus (with new icons)
+ I reloadAllMenus
# Set default window colours
+ I Style * HilightColorset 0
+ I Style * Colorset 1
# Set colour for application types
+ I $[yaluWindowTypeColours] setGroupStyle Editor HilightColorset 10
+ I $[yaluWindowTypeColours] setGroupStyle Editor Colorset 11
+ I $[yaluWindowTypeColours] setGroupStyle Terminal HilightColorset 12
+ I $[yaluWindowTypeColours] setGroupStyle Terminal Colorset 13
+ I $[yaluWindowTypeColours] setGroupStyle Browser HilightColorset 14
+ I $[yaluWindowTypeColours] setGroupStyle Browser Colorset 15
+ I $[yaluWindowTypeColours] setGroupStyle Chat HilightColorset 16
+ I $[yaluWindowTypeColours] setGroupStyle Chat Colorset 17
+ I $[yaluWindowTypeColours] setGroupStyle Multimedia HilightColorset 18
+ I $[yaluWindowTypeColours] setGroupStyle Multimedia Colorset 19
+ I $[yaluWindowTypeColours] setGroupStyle Graphics HilightColorset 20
+ I $[yaluWindowTypeColours] setGroupStyle Graphics Colorset 21
# Set colours specified by user
+ I $[yaluWindowTypeColours] userColours
### Allow user-configuration of window type colouring ###
DestroyFunc setWindowTypeColours