-
Notifications
You must be signed in to change notification settings - Fork 11
/
prefs.js
1667 lines (1453 loc) · 62.7 KB
/
prefs.js
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
/**
* AATWS - Advanced Alt-Tab Window Switcher
* Prefs
*
* @author GdH <G-dH@github.com>
* @copyright 2021-2024
* @license GPL-3.0
*/
'use strict';
import Gtk from 'gi://Gtk';
import * as Settings from './src/settings.js';
import * as OptionsFactory from './src/optionsFactory.js';
import { ExtensionPreferences } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
import { Actions } from './src/enum.js';
// gettext
let _;
function _getActionList() {
return [
[_('Do Nothing'), Actions.NONE],
[_('Close Switcher Popup'), Actions.HIDE],
[_('Select Next/Previous'), Actions.SELECT_ITEM],
[_('Activate'), Actions.ACTIVATE],
[_('Switch Workspace'), Actions.SWITCH_WS],
[_('Open New Window'), Actions.NEW_WINDOW],
[_('Show / Preview'), Actions.SHOW],
[_('Open Context Menu'), Actions.MENU],
[_('Switch Filter Mode'), Actions.SWITCH_FILTER],
[_('Toggle Single App Mode'), Actions.SINGLE_APP],
[_('Toggle Switcher Mode'), Actions.SWITCHER_MODE],
[_('Close/Quit Selected'), Actions.CLOSE_QUIT],
[_('Force Quit Selected App'), Actions.KILL],
[_('Move Selected to Current WS/Monitor'), Actions.MOVE_TO_WS],
[_('Toggle Fullscreen on Empty WS'), Actions.FS_ON_NEW_WS],
[_('Toggle Minimize'), Actions.MINIMIZE],
[_('Sort Windows by Applications'), Actions.GROUP_APP],
[_('Sort Current Monitor First'), Actions.CURRENT_MON_FIRST],
[_('Create Window Thumbnail (requires WTMB extension)'), Actions.THUMBNAIL],
[_('Open Preferences'), Actions.PREFS],
];
}
export default class AATWS extends ExtensionPreferences {
_getPageList() {
const itemFactory = new OptionsFactory.ItemFactory(this.opt);
const options = this._getOptions(itemFactory);
const pageList = [
{
title: _('Common'),
iconName: 'preferences-system-symbolic',
optionList: this._getCommonOptionList(options),
},
{
title: _('Window Switcher'),
iconName: 'focus-windows-symbolic',
optionList: this._getWindowOptionList(options),
},
{
title: _('App Switcher'),
iconName: 'view-app-grid-symbolic',
optionList: this._getAppOptionList(options),
},
{
title: _('Dash Mode'),
iconName: 'user-bookmarks-symbolic',
optionList: this._getDockOptionList(options),
},
{
title: _('Hotkeys'),
iconName: 'input-keyboard-symbolic',
optionList: this._getHotkeysOptionList(itemFactory),
},
{
title: _('Mouse'),
iconName: 'input-mouse-symbolic',
optionList: this._getMouseOptionList(options),
},
{
title: _('Misc'),
iconName: 'preferences-other-symbolic',
optionList: this._getMiscOptionList(options),
},
{
title: _('About'),
iconName: 'preferences-system-details-symbolic',
optionList: this._getAboutOptionList(itemFactory),
},
];
return pageList;
}
fillPreferencesWindow(window) {
const Me = {
metadata: this.metadata,
gSettings: this.getSettings(),
_: this.gettext.bind(this),
};
Me.opt = new Settings.Options(Me);
this.opt = Me.opt;
_ = Me._;
OptionsFactory.AdwPrefs.getFilledWindow(window, this._getPageList());
window.set_search_enabled(true);
window.set_default_size(840, 800);
window.connect('close-request', () => {
this.opt.destroy();
this.opt = null;
});
}
_getCommonOptionList(options) {
const o = options;
const optionList = [
o.Behavior,
// ---------------
o.Position,
o.DefaultMonitor,
o.ShowImmediately,
o.SearchModeDefault,
o.SyncFilter,
o.WraparoundSelector,
o.HoverSelectsItem,
o.DelayShowingSwitcher,
o.InteractiveIndicators,
o.ShowIfNoWin,
o.SecondTabSwitchFilter,
// ---------------
o.AppearanceCommon,
o.WsThumbnails,
o.Theme,
o.OverlayTitle,
o.TooltipLabelScale,
o.ShowDirectActivation,
o.ShowStatus,
o.SingleAppPreviewSize,
// ---------------
o.Input,
o.RememberInput,
];
return optionList;
}
_getWindowOptionList(options) {
const o = options;
const optionList = [
o.Controls,
o.ShortcutWin,
o.Behavior,
o.DefaultFilterWin,
o.DefaultSortingWin,
o.DefaultGrouping,
o.DistinguishMinimized,
o.SkipMinimized,
o.MinimizedLast,
o.IncludeModals,
o.SearchAllWindows,
o.SearchApplications,
// ---------------
o.AppearanceWin,
o.ShowWindowTitle,
o.ShowWorkspaceIndex,
o.WindowPreviewSize,
o.WindowIconSize,
];
return optionList;
}
_getAppOptionList(options) {
const o = options;
const optionList = [
o.Controls,
o.ShortcutApp,
o.Behavior,
o.DefaultFilterApp,
o.DefaultSortingApp,
o.RaiseFirstWinOnly,
o.ResultsLimit,
o.SearchPrefRunning,
o.IncludeFavorites,
o.IncludeShowAppsIcon,
// ---------------
o.AppearanceApp,
o.ShowAppTitle,
o.ShowWinCounter,
o.HideWinCounterForSingleWindow,
o.AppIconSize,
];
return optionList;
}
_getDockOptionList(options) {
const o = options;
const optionList = [
o.HotEdge,
o.HotEdgePosition,
o.HotEdgeFullScreen,
o.HotEdgeMode,
o.HotEdgeMonitor,
o.HotEdgePressure,
o.HotEdgeWidth,
// ---------------
o.Super,
o.SuperKeyMode,
o.EnableSuper,
o.SuperDoublePress,
// ---------------
o.DashMode,
o.AutomaticallyReverseOrder,
o.PointerOutTimeout,
o.ActivateOnHide,
o.MousePointerPosition,
o.AnimationTimeFactor,
// ---------------
o.DashAppSwitcher,
o.DashActivateToSingle,
o.DashAppStableOrder,
o.DashAppIncludeFavorites,
o.DashAppIncludeShowAppsIcon,
// ---------------
o.Dash,
o.ShowDash,
];
return optionList;
}
_getMiscOptionList(options) {
const o = options;
const optionList = [
o.WindowManager,
o.AlwaysActivateFocused,
// ---------------
o.Workspace,
o.ShowWsSwitcherPopup,
];
return optionList;
}
_getMouseOptionList(options) {
const o = options;
const optionList = [
o.Common,
o.PrimaryBackground,
o.SecondaryBackground,
o.MiddleBackground,
o.ScrollBackground,
o.PrimaryOutside,
o.SecondaryOutside,
o.MiddleOutside,
o.ScrollOutside,
// ---------------
o.WindowSwitcher,
o.ScrollWinItem,
o.PrimaryWinItem,
o.SecondaryWinItem,
o.MiddleWinItem,
// ---------------
o.AppSwitcher,
o.ScrollAppItem,
o.PrimaryAppItem,
o.SecondaryAppItem,
o.MiddleAppItem,
];
return optionList;
}
// option item
// item[label, widget]
// ////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////
_getOptions(itemFactory) {
const optDict = {};
const actionList = _getActionList();
optDict.Behavior = itemFactory.getRowWidget(
_('Behavior')
);
optDict.Position = itemFactory.getRowWidget(
_('Placement'),
_('Specifies the screen location for the switcher pop-up'),
itemFactory.newDropDown(),
'switcherPopupPosition',
[
[_('Top'), 1],
[_('Center'), 2],
[_('Bottom'), 3],
]
);
optDict.DefaultMonitor = itemFactory.getRowWidget(
_('Default Monitor'),
_('Determines the screen on which the switcher pop-up will be displayed'),
itemFactory.newDropDown(),
'switcherPopupMonitor',
[
[_('Primary Monitor'), 1],
[_('Monitor with focused window'), 2],
[_('Monitor with mouse pointer'), 3],
]
);
optDict.SyncFilter = itemFactory.getRowWidget(
_('Synchronize Filter Mode'),
_('Enables shared filter mode between Window and App switchers. Switching the switcher mode will no longer reset the filter mode to the default for each'),
itemFactory.newSwitch(),
'switcherPopupSyncFilter'
);
optDict.ShowImmediately = itemFactory.getRowWidget(
_('Show Selected Window'),
_('Instantly displays the selected window in its original size upon switcher selection. Choose between a preview clone or raising the original window including switching workspaces if needed'),
itemFactory.newDropDown(),
'switcherPopupPreviewSelected',
[
[_('Disable'), 1],
[_('Show Preview'), 2],
// [_('Show Window'), 3],
]
);
optDict.SearchModeDefault = itemFactory.getRowWidget(
_('Search Mode as Default'),
_('Immediately enables type-to-search functionality upon switcher pop-up. Use hotkeys while holding down the Shift key'),
itemFactory.newSwitch(),
'switcherPopupStartSearch'
);
optDict.WraparoundSelector = itemFactory.getRowWidget(
_('Wraparound Selector'),
_('Selection seamlessly cycles from the last item to the first and vice versa'),
itemFactory.newSwitch(),
'switcherPopupWrap'
);
optDict.HoverSelectsItem = itemFactory.getRowWidget(
_('Hover to Select'),
_('Automatically selects a switcher item when the mouse pointer hovers over it'),
itemFactory.newSwitch(),
'switcherPopupHoverSelect'
);
optDict.InteractiveIndicators = itemFactory.getRowWidget(
_('Interactive Indicators'),
_('Indicators and front icon respond to mouse clicks, enabling specific actions. The workspace indicator moves the window to the current workspace, the app icon and window counter toggle single app mode. "Always on Top", "Always on Visible Workspace" and "App Menu" icons appear upon hover'),
itemFactory.newSwitch(),
'switcherPopupInteractiveIndicators'
);
optDict.ShowIfNoWin = itemFactory.getRowWidget(
_('Show Favorite Apps When No Window Open'),
_('If no normal window is open, AATWS can show you a list of favorite applications pinned to dash instead, allowing you to (search and) launch a new one'),
itemFactory.newSwitch(),
'switcherPopupShowIfNoWin'
);
optDict.SecondTabSwitchFilter = itemFactory.getRowWidget(
_('Press Tab Again to Switch Filter'),
_("This option enables switching the filter to a less restrictive mode when there is only one item in the list and you press a tab key again, so you don't need to use the hotkey for switching the filter"),
itemFactory.newSwitch(),
'switcherPopupSecondTabSwitchFilter'
);
optDict.Content = itemFactory.getRowWidget(
_('Content')
);
optDict.OverlayTitle = itemFactory.getRowWidget(
_('Tooltip Titles'),
_('The switcher pop-up displays the full title of the selected item as a caption, positioned above or below as needed'),
itemFactory.newDropDown(),
'switcherPopupTooltipTitle',
[
[_('Disable'), 1],
[_('Show Above/Below Item'), 2],
[_('Show Centered'), 3],
]
);
let tooltipScaleAdjustment = new Gtk.Adjustment({
upper: 300,
lower: 50,
step_increment: 5,
page_increment: 5,
});
const tooltipScale = itemFactory.newScale(tooltipScaleAdjustment);
tooltipScale.add_mark(120, Gtk.PositionType.TOP, null);
optDict.TooltipLabelScale = itemFactory.getRowWidget(
_('Tooltip Title Scale'),
_('Adjusts font size for app/window titles'),
tooltipScale,
'switcherPopupTooltipLabelScale'
);
optDict.ShowDirectActivation = itemFactory.getRowWidget(
_('Show Hotkeys F1-F12 for Direct Activation'),
_('The hotkeys will work even if this option is disabled'),
itemFactory.newSwitch(),
'switcherPopupHotKeys'
);
optDict.ShowStatus = itemFactory.getRowWidget(
_('Show Status'),
_('Displays a label at the bottom left of the pop-up, indicating the current filter, grouping, and sorting modes'),
itemFactory.newSwitch(),
'switcherPopupStatus'
);
optDict.AppearanceCommon = itemFactory.getRowWidget(
_('Appearance and Content')
);
let singlePrevSizeAdjustment = new Gtk.Adjustment({
upper: 512,
lower: 64,
step_increment: 8,
page_increment: 32,
});
const singleAppPrevSizeScale = itemFactory.newScale(singlePrevSizeAdjustment);
singleAppPrevSizeScale.add_mark(96, Gtk.PositionType.TOP, null);
singleAppPrevSizeScale.add_mark(128, Gtk.PositionType.TOP, null);
singleAppPrevSizeScale.add_mark(192, Gtk.PositionType.TOP, null);
singleAppPrevSizeScale.add_mark(256, Gtk.PositionType.TOP, null);
singleAppPrevSizeScale.add_mark(384, Gtk.PositionType.TOP, null);
optDict.SingleAppPreviewSize = itemFactory.getRowWidget(
_('Single App Preview Size (px)'),
null,
singleAppPrevSizeScale,
'singleAppPreviewSize'
);
let popupTimeoutAdjustment = new Gtk.Adjustment({
upper: 400,
lower: 0,
step_increment: 10,
page_increment: 100,
});
const popupTimeoutScale = itemFactory.newScale(popupTimeoutAdjustment);
popupTimeoutScale.add_mark(100, Gtk.PositionType.TOP, null);
optDict.DelayShowingSwitcher = itemFactory.getRowWidget(
_('Delay Switcher Display (ms)'),
_('Introduces a delay before showing the pop-up to prevent disturbance for fast Alt+Tab users. Note that even with a delay set to 0, there may still be some lag as the switcher pop-up builds, dependent on your system and the number of items'),
popupTimeoutScale,
'switcherPopupTimeout'
);
optDict.WsThumbnails = itemFactory.getRowWidget(
_('Show Workspace Thumbnails'),
_('AATWS displays workspace thumbnails above or below the switcher, allowing you to preview their content, drag and drop windows between workspaces and switch workspaces with the mouse. Additionally, you can reorder the current workspace using (Ctrl or Shift)+Scroll or Ctrl+Page Up/Down'),
itemFactory.newDropDown(),
'switcherWsThumbnails',
[
[_('Disable'), 0],
[_('Show'), 1],
[_('Show in Dash Mode Only'), 2],
]
);
optDict.Theme = itemFactory.getRowWidget(
_('Color Style'),
_('The "Default" option corresponds to the current Shell theme, and "Follow System Color Style" switches between AATWS Dark and Light styles based on the current GNOME color style (available in GNOME 42 and higher)'),
itemFactory.newDropDown(),
'switcherPopupTheme',
[
[_('Default'), 0],
[_('AATWS Dark'), 1],
[_('AATWS Light'), 2],
[_('Follow System Color Style'), 3],
[_('Follow System Color Style - Inverted'), 4],
]
);
// ----------------------------------------------
optDict.Super = itemFactory.getRowWidget(
_('Super (Windows) Key')
);
optDict.SuperKeyMode = itemFactory.getRowWidget(
_('Super Key Action'),
_('Press and release the Super key (default overlay-key, remappable in Gnome Tweaks) to open the App or Window switcher. The default mode preserves system behavior'),
itemFactory.newDropDown(),
'superKeyMode',
[
[_('Default'), 1],
[_('App Switcher'), 2],
[_('Window Switcher'), 3],
]
);
const enableSuperSwitch = itemFactory.newSwitch();
optDict.EnableSuper = itemFactory.getRowWidget(
_('Enable Super as Hotkey (Experimental)'),
_('Enables closing the switcher with a Super key press and activates "Double Super Key Press" option Note: This option may cause brief stuttering in animations/videos when using Super key to open/close the switcher. This does not affect the usual Alt/Super+Tab experience'),
enableSuperSwitch,
'enableSuper'
);
const superDoublePressSwitch = itemFactory.newDropDown();
optDict.SuperDoublePress = itemFactory.getRowWidget(
_('Double Super Key Press (needs previous option enabled)'),
_('Initial double press of the Super key (or key set as Window Action Key) will trigger the selected action'),
superDoublePressSwitch,
'superDoublePressAction',
[
[_('Default'), 1],
[_('Toggle Switcher Mode'), 2],
[_('Open Activities Overview'), 3],
[_('Open App Grid Overview'), 4],
[_('Activate Previous Window'), 5],
]
);
superDoublePressSwitch.set_sensitive(this.opt.get('enableSuper'));
enableSuperSwitch.connect('notify::active', widget => {
superDoublePressSwitch.set_sensitive(widget.active);
});
optDict.HotEdge = itemFactory.getRowWidget(
_('Hot Edge')
);
optDict.HotEdgePosition = itemFactory.getRowWidget(
_('Hot Edge Position'),
_('Hot edge activates the App or Window switcher when the mouse pointer applies pressure to the edge of the monitor'),
itemFactory.newDropDown(),
'hotEdgePosition',
[
[_('Disabled'), 0],
[_('Top'), 1],
[_('Bottom'), 2],
]
);
optDict.HotEdgeFullScreen = itemFactory.getRowWidget(
_('Enable Hot Edge in Fullscreen Mode'),
_('Disable this option if, for instance, you are playing fullscreen games where triggering the switcher popup is undesirable'),
itemFactory.newSwitch(),
'hotEdgeFullScreen'
);
optDict.HotEdgeMode = itemFactory.getRowWidget(
_('Hot Edge Action'),
_('Default switcher mode for Hot Edge trigger.'),
itemFactory.newDropDown(),
'hotEdgeMode',
[
[_('App Switcher'), 0],
[_('Window Switcher'), 1],
]
);
optDict.HotEdgeMonitor = itemFactory.getRowWidget(
_('Hot Edge Monitor'),
_('Specifies whether the hot edge is set for the primary monitor only or for all active monitors'),
itemFactory.newDropDown(),
'hotEdgeMonitor',
[
[_('Primary'), 0],
[_('All'), 1],
]
);
const hotPressureAdjustment = new Gtk.Adjustment({
upper: 500,
lower: 0,
step_increment: 10,
page_increment: 50,
});
const hotPressureScale = itemFactory.newScale(hotPressureAdjustment);
hotPressureScale.add_mark(100, Gtk.PositionType.TOP, null);
optDict.HotEdgePressure = itemFactory.getRowWidget(
_('Hot Edge Pressure Threshold'),
_('Adjusts the pressure the mouse pointer needs to apply to trigger the hot edge'),
hotPressureScale,
'hotEdgePressure'
);
const hotWidthAdjustment = new Gtk.Adjustment({
upper: 100,
lower: 10,
step_increment: 5,
page_increment: 10,
});
const hotWidthScale = itemFactory.newScale(hotWidthAdjustment);
hotWidthScale.add_mark(50, Gtk.PositionType.TOP, null);
optDict.HotEdgeWidth = itemFactory.getRowWidget(
_('Hot Edge Width'),
_('Adjusts the width of the hot edge barrier as a percentage of the screen width'),
hotWidthScale,
'hotEdgeWidth'
);
optDict.Dash = itemFactory.getRowWidget(
_('Dash')
);
optDict.ShowDash = itemFactory.getRowWidget(
_('Dash Visibility'),
_('Manages the visibility of the Dash in the Activities overview. You can disable the Dash if you are using AATWS instead'),
itemFactory.newDropDown(),
'showDash',
[
[_('Leave Unchanged'), 0],
[_('Show'), 1],
[_('Hide'), 2],
]
);
optDict.Input = itemFactory.getRowWidget(
_('Keyboard Layout')
);
optDict.RememberInput = itemFactory.getRowWidget(
_('Remember Keyboard'),
_('AATWS can remember the keyboard layout you set with the Shift + Enter shortcut. Note: This option may significantly slow down window switching, as changing the input source is slow in GNOME Shell'),
itemFactory.newSwitch(),
'rememberInput'
);
// ////////////////////////////////////////////////
// Window Switcher options
optDict.Controls = itemFactory.getRowWidget(
_('Controls')
);
optDict.ShortcutWin = itemFactory.getRowWidget(
_('Keyboard Shortcuts'),
_('AATWS replaces the default window switcher popups. Set keyboard shortcuts in GNOME Settings app > Keyboard > Keyboard Shortcuts > "Switch windows" and "Switch windows of an application."'),
itemFactory.newLabel()
);
optDict.Behavior = itemFactory.getRowWidget(
_('Behavior')
);
optDict.DefaultFilterWin = itemFactory.getRowWidget(
_('Default Filter'),
_('Specifies the filter for windows that should appear in the list. The filter can also be changed on the fly using a hotkey'),
itemFactory.newDropDown(),
'winSwitcherPopupFilter',
[
[_('All'), 1],
[_('Current Workspace'), 2],
[_('Current Monitor'), 3],
]
);
optDict.DefaultSortingWin = itemFactory.getRowWidget(
_('Default Sorting'),
_('Determines the order in which the list of windows should be sorted'),
itemFactory.newDropDown(),
'winSwitcherPopupSorting',
[
[_('Most Recently Used'), 1],
[_('Stable Sequence'), 2],
[_('Stable - Current First'), 3],
]
);
optDict.DefaultGrouping = itemFactory.getRowWidget(
_('Default Grouping'),
_('Groups windows in the list based on the selected key'),
itemFactory.newDropDown(),
'winSwitcherPopupOrder',
[
[_('None'), 1],
[_('Current Monitor First'), 2],
[_('Applications'), 3],
[_('Workspaces'), 4],
]
);
optDict.DistinguishMinimized = itemFactory.getRowWidget(
_('Distinguish Minimized Windows'),
_('Fades the front icon of a minimized window item for distinction'),
itemFactory.newSwitch(),
'winMarkMinimized'
);
const skipMinimizedBtn = itemFactory.newSwitch();
optDict.SkipMinimized = itemFactory.getRowWidget(
_('Skip Minimized Windows'),
_('Excludes minimized windows from the list. Note: This option also impacts the App switcher.'),
skipMinimizedBtn,
'winSkipMinimized'
);
skipMinimizedBtn.connect('notify::active', () => {
minimizedLastBtn.set_sensitive(!skipMinimizedBtn.active);
});
const minimizedLastBtn = itemFactory.newSwitch();
minimizedLastBtn.set_sensitive(!this.opt.get('winSkipMinimized'));
optDict.MinimizedLast = itemFactory.getRowWidget(
_('Minimized Windows Last'),
_('Places minimized windows at the end of the list, aligning with the default behavior in GNOME Shell.'),
minimizedLastBtn,
'winMinimizedLast'
);
optDict.IncludeModals = itemFactory.getRowWidget(
_('Include Modal Windows'),
_('Modal windows, such as dialogs, are usually attached to their parent window, and focusing on the parent window also focuses their modal window, but not always'),
itemFactory.newSwitch(),
'winIncludeModals'
);
optDict.SearchAllWindows = itemFactory.getRowWidget(
_('Search All Windows'),
_('Automatically switches filter mode (if possible) when no results are found for the currently selected filter mode'),
itemFactory.newSwitch(),
'winSwitcherPopupSearchAll'
);
optDict.SearchApplications = itemFactory.getRowWidget(
_('Search Applications'),
_('Searches for installed applications to launch new ones when no window matches the specified search query'),
itemFactory.newSwitch(),
'winSwitcherPopupSearchApps'
);
optDict.Content = itemFactory.getRowWidget(
_('Content')
);
optDict.ShowWindowTitle = itemFactory.getRowWidget(
_('Show Window Titles'),
_('Displays window titles (ellipsized if needed) under each window item in the switcher list'),
itemFactory.newDropDown(),
'winSwitcherPopupTitles',
[
[_('Enabled'), 1],
[_('Disabled'), 2],
[_('Single App Mode only'), 3],
]
);
optDict.ShowWorkspaceIndex = itemFactory.getRowWidget(
_('Show Workspace Index'),
_('Adds a label with the corresponding workspace index over each window thumbnail'),
itemFactory.newSwitch(),
'winSwitcherPopupWsIndexes'
);
optDict.AppearanceWin = itemFactory.getRowWidget(
_('Appearance')
);
const popupSizeAdjustment = new Gtk.Adjustment({
upper: 512,
lower: 32,
step_increment: 8,
page_increment: 32,
});
const popupSizeScale = itemFactory.newScale(popupSizeAdjustment);
popupSizeScale.add_mark(64, Gtk.PositionType.TOP, null);
popupSizeScale.add_mark(128, Gtk.PositionType.TOP, null);
popupSizeScale.add_mark(192, Gtk.PositionType.TOP, null);
popupSizeScale.add_mark(256, Gtk.PositionType.TOP, null);
popupSizeScale.add_mark(384, Gtk.PositionType.TOP, null);
optDict.WindowPreviewSize = itemFactory.getRowWidget(
_('Window Preview Size (px)'),
null,
popupSizeScale,
'winSwitcherPopupPreviewSize'
);
let popupIconSizeAdjustment = new Gtk.Adjustment({
upper: 512,
lower: 0,
step_increment: 8,
page_increment: 32,
});
const iconSizeScale = itemFactory.newScale(popupIconSizeAdjustment);
iconSizeScale.add_mark(32, Gtk.PositionType.TOP, null);
iconSizeScale.add_mark(48, Gtk.PositionType.TOP, null);
iconSizeScale.add_mark(64, Gtk.PositionType.TOP, null);
iconSizeScale.add_mark(96, Gtk.PositionType.TOP, null);
iconSizeScale.add_mark(128, Gtk.PositionType.TOP, null);
iconSizeScale.add_mark(192, Gtk.PositionType.TOP, null);
iconSizeScale.add_mark(256, Gtk.PositionType.TOP, null);
iconSizeScale.add_mark(384, Gtk.PositionType.TOP, null);
optDict.WindowIconSize = itemFactory.getRowWidget(
_('Window Icon Size (px)'),
null,
iconSizeScale,
'winSwitcherPopupIconSize'
);
// //////////////////////////////////////////////////////////////////////
// App Switcher options
// group title already defined in the window section
// optDict.Controls = itemFactory.getRowWidget(
// _('Controls')
// );
optDict.ShortcutApp = itemFactory.getRowWidget(
_('Keyboard Shortcut'),
_('AATWS replaces the default app switcher popup. Set keyboard shortcut in GNOME Settings app > Keyboard > Keyboard Shortcuts > "Switch applications"'),
itemFactory.newLabel()
);
// optDict.Behavior = itemFactory.getRowWidget(
// _('Behavior')
// );
optDict.DefaultFilterApp = itemFactory.getRowWidget(
_('Default Filter'),
_('Specifies the filter for apps that should appear in the list. The filter can also be changed on the fly using a hotkey'),
itemFactory.newDropDown(),
'appSwitcherPopupFilter',
[
[_('All'), 1],
[_('Current Workspace'), 2],
[_('Current Monitor'), 3],
]
);
optDict.DefaultSortingApp = itemFactory.getRowWidget(
_('Default Sorting'),
_('Determines the order in which the list of apps should be sorted'),
itemFactory.newDropDown(),
'appSwitcherPopupSorting',
[
[_('Most Recently Used'), 1],
[_('Stable Sequence'), 2],
]
);
optDict.RaiseFirstWinOnly = itemFactory.getRowWidget(
_('Raise First Window Only'),
_('When activating a running app, only its most recently used window is raised, rather than rising all app windows above windows of other apps'),
itemFactory.newSwitch(),
'appSwitcherPopupRaiseFirstOnly'
);
optDict.SearchPrefRunning = itemFactory.getRowWidget(
_('Prioritize Running Apps'),
_('The search engine will give priority to running applications'),
itemFactory.newSwitch(),
'appSwitcherPopupSearchPrefRunning'
);
let popupAppLimitAdjustment = new Gtk.Adjustment({
upper: 30,
lower: 5,
step_increment: 1,
page_increment: 1,
});
optDict.ResultsLimit = itemFactory.getRowWidget(
_('Max Number of Search Results'),
_('Specifies the maximum number of results that can be shown in the switcher'),
itemFactory.newSpinButton(popupAppLimitAdjustment),
'appSwitcherPopupResultsLimit'
);
optDict.Content = itemFactory.getRowWidget(
_('Content')
);
optDict.ShowAppTitle = itemFactory.getRowWidget(
_('Show App Names'),
_('Displays the name of the application under each app icon in the list'),
itemFactory.newSwitch(),
'appSwitcherPopupTitles'
);
optDict.IncludeFavorites = itemFactory.getRowWidget(
_('Include Favorite (Pinned) Apps'),
_('Include favorite apps pinned to Dash, even when not running, allowing you to use the switcher as an app launcher'),
itemFactory.newSwitch(),
'appSwitcherPopupFavoriteApps'
);
optDict.IncludeShowAppsIcon = itemFactory.getRowWidget(
_('Include Show Apps Icon'),
_('Adds a button to access application grid'),
itemFactory.newSwitch(),
'appSwitcherPopupIncludeShowAppsIcon'
);
const showWinCounterSwitch = itemFactory.newSwitch();
optDict.ShowWinCounter = itemFactory.getRowWidget(
_('Show Window Counter'),
_('Adds a label with the number of windows opened by each app corresponding to the current filter mode.'),
showWinCounterSwitch,
'appSwitcherPopupWinCounter'
);
const hideWinCounterForSingleWindowSwitch = itemFactory.newSwitch();
optDict.HideWinCounterForSingleWindow = itemFactory.getRowWidget(
_('Hide Window Counter For Single-Window Apps'),
_('Hides the number of windows of an app if there is just a single window open for that app.'),
hideWinCounterForSingleWindowSwitch,
'appSwitcherPopupHideWinCounterForSingleWindow'
);
hideWinCounterForSingleWindowSwitch.set_sensitive(this.opt.get('appSwitcherPopupWinCounter'));
showWinCounterSwitch.connect('notify::active', widget => {
hideWinCounterForSingleWindowSwitch.set_sensitive(widget.active);
});
optDict.AppearanceApp = itemFactory.getRowWidget(
_('Appearance')
);
let popupAppIconSizeAdjustment = new Gtk.Adjustment({
upper: 512,
lower: 32,
step_increment: 8,
page_increment: 32,
});
const appIconSizeScale = itemFactory.newScale(popupAppIconSizeAdjustment);
appIconSizeScale.add_mark(48, Gtk.PositionType.TOP, null);
appIconSizeScale.add_mark(64, Gtk.PositionType.TOP, null);
appIconSizeScale.add_mark(96, Gtk.PositionType.TOP, null);
appIconSizeScale.add_mark(128, Gtk.PositionType.TOP, null);
appIconSizeScale.add_mark(192, Gtk.PositionType.TOP, null);
appIconSizeScale.add_mark(256, Gtk.PositionType.TOP, null);
appIconSizeScale.add_mark(384, Gtk.PositionType.TOP, null);
optDict.AppIconSize = itemFactory.getRowWidget(
_('App Icon Size (px)'),
null,
appIconSizeScale,
'appSwitcherPopupIconSize'
);
// //////////////////////////////////////////////////////////////////////////////////////////////
optDict.DashAppSwitcher = itemFactory.getRowWidget(
_('App Switcher')
);
optDict.DashAppIncludeFavorites = itemFactory.getRowWidget(
_('Include Favorite (Pinned) Apps'),
_('Include favorite apps pinned to Dash regardless the App switcher settings'),
itemFactory.newSwitch(),
'switcherPopupExtAppFavorites'
);
optDict.DashAppIncludeShowAppsIcon = itemFactory.getRowWidget(
_('Include Show Apps Icon'),
_('Adds a button to access application grid'),
itemFactory.newSwitch(),
'switcherPopupExtAppShowAppsIcon'
);
optDict.DashAppStableOrder = itemFactory.getRowWidget(
_('Stable Sequence'),
_('Show app switcher items in stable order, as they are in the default Dash'),
itemFactory.newSwitch(),
'switcherPopupExtAppStable'
);
optDict.DashActivateToSingle = itemFactory.getRowWidget(
_('Show App Windows Instead of Direct Activation'),
_('Choose between immediate activation of the clicked app (activated by a mouse button set to Activate Item) or switch to the window list to access other available windows (based on the current filter setting)'),
itemFactory.newDropDown(),
'appSwitcherPopupShowWinsOnActivate',
[
[_('Disable'), 0],
[_('Focused Apps'), 1],
[_('Focused Multi-Window Apps'), 2],
]
);
optDict.DashMode = itemFactory.getRowWidget(
_('Dash Mode Options (AATWS opened using a hot edge or Super key)')
);
optDict.AutomaticallyReverseOrder = itemFactory.getRowWidget(