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
|
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# derived from sxmo_hook_contextmenu.sh
# Copyright 2024 Zach DeCook
setComms(){
activewmclass="$1"
activetitle="$2"
if ! test "$activewmclass"; then
json="$(hyprctl -j -i 0 activewindow)"
activewmclass="$(printf "%s" "$json" | jq -r .class)"
activetitle="$(printf "%s" "$json" | jq -r .title)"
fi
WMNAME="$activewmclass $activetitle"
echo "$WMNAME"
case "$activewmclass" in
*mpv*)
# MPV
#pause seekbw seekfw volu vold
#speedup speeddown
#screenshot loopmark info seekinfo
c="' ','Left','Right','0','9','BracketRight','BracketLeft','s','l','i','o'"
WINNAME=Mpv
;;
*feh*)
# Feh
CHOICES="
$icon_arr Next ^ 1 ^ sxmo_type -k Space
$icon_arl Previous ^ 1 ^ sxmo_type -k BackSpace
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k up
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k down
$icon_exp Zoom to fit ^ 1 ^ sxmo_type -k slash
$icon_shr Zoom to fill ^ 1 ^ sxmo_type '!'
$icon_rol Rotate ^ 1 ^ sxmo_type -k less
$icon_ror Rotate ^ 1 ^ sxmo_type -k greater
$icon_a2y Flip ^ 1 ^ sxmo_type -k underscore
$icon_a2x Mirror ^ 1 ^ sxmo_type -k bar
$icon_inf Toggle filename ^ 1 ^ sxmo_type d
"
WINNAME=Feh
;;
*sxiv*)
# Sxiv
CHOICES="
$icon_arr Next ^ 1 ^ sxmo_type -k Space
$icon_arl Previous ^ 1 ^ sxmo_type -k BackSpace
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k equal
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k minus
$icon_rol Rotate ^ 1 ^ sxmo_type -k less
$icon_ror Rotate ^ 1 ^ sxmo_type -k greater
$icon_a2y Flip ^ 1 ^ sxmo_type -k question
$icon_a2x Mirror ^ 1 ^ sxmo_type -k bar
$icon_grd Thumbnail ^ 0 ^ sxmo_type -k Return
"
WINNAME=Sxiv
;;
*imv*)
# imv
CHOICES="
$icon_arr Next ^ 1 ^ sxmo_type -k Right
$icon_arl Previous ^ 1 ^ sxmo_type -k Left
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k i
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k minus
$icon_exp Zoom to fit ^ 1 ^ sxmo_type -k r
$icon_ror Rotate ^ 1 ^ sxmo_type -M ctrl r
$icon_inf Toggle filename ^ 1 ^ sxmo_type -k d
"
WINNAME=Imv
;;
*kasts*)
CHOICES="
$icon_mus Audio ^ 0 ^ sxmo_audio.sh
$icon_bth Bluetooth ^ 0 ^ sxmo_bluetoothmenu.sh
"
WINNAME="Kasts"
;;
*sthotkeys*)
# St hotkeys
CHOICES="
Send Ctrl-C ^ 0 ^ sxmo_type -M Ctrl -k c
Send Ctrl-Z ^ 0 ^ sxmo_type -M Ctrl -k z
Send Ctrl-L ^ 0 ^ sxmo_type -M Ctrl -k l
Send Ctrl-D ^ 0 ^ sxmo_type -M Ctrl -k d
Send Ctrl-A ^ 0 ^ sxmo_type -M Ctrl -k a
Send Ctrl-B ^ 0 ^ sxmo_type -M Ctrl -k b
Send ESC:w ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k w -k Return
Send ESC:wq ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k w -k q -k Return
Send ESC:wq! ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k q -k exclam -k Return
"
WINNAME=St
;;
*foot*|*st*|Terminal|*terminal*|org.gnome.vte.application|*alacritty*)
# These git commands only launch the editor.
case "$WMNAME" in
*"git add"*|*"git bugreport"*|*"git commit"*|*"git merge"*|*"git notes"*|*"git rebase"*|*"git replace"*|*"git send-email"*|*"git svn"*)
WMNAME="$WMCLASS $EDITOR"
;;
esac
# First we try to handle the app running inside the terminal:
case " $WMNAME " in
*" vi "*|*" vim "*|*" vis "*|*" nvim "*|*neovim*|*kakoune*)
#Vim in foot
CHOICES="
$icon_cls Save and Quit ^ 0 ^ sxmo_type -k Escape -s 300 ':wq' -k Return
$icon_sav Save ^ 0 ^ sxmo_type -k Escape -s 300 ':w' -k Return
$icon_cls Quit without saving ^ 0 ^ sxmo_type -k Escape -s 300 ':q!' -k Return
$icon_aru Scroll up ^ 1 ^ sxmo_type -M Ctrl u
$icon_ard Scroll down ^ 1 ^ sxmo_type -M Ctrl d
$icon_trm Command prompt ^ 0 ^ sxmo_type -k Escape -s 300 ':'
$icon_pst Paste Selection ^ 0 ^ sxmo_type -k Escape -s 300 -k quotedbl -k asterisk -k p
$icon_pst Paste Clipboard ^ 0 ^ sxmo_type -k Escape -s 300 -k quotedbl -k plus -k p
$icon_fnd Search ^ 0 ^ sxmo_type -k Escape -s 300 /
$icon_arr Next buffer ^ 1 ^ sxmo_type -k Escape -s 300 ':bn' -k Return
$icon_arl Previous buffer ^ 1 ^ sxmo_type -k Escape -s 300 ':bp' -k Return
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=Vim
;;
*nano*)
#Nano in foot
CHOICES="
$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
$icon_sav Save ^ 0 ^ sxmo_type -M Ctrl o
$icon_cls Quit ^ 0 ^ sxmo_type -M Ctrl x
$icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl u
$icon_itm Type complete ^ 0 ^ sxmo_type -M Shift -M Ctrl u
$icon_cpy Copy complete ^ 0 ^ sxmo_type -M Shift -M Ctrl i
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=Nano
;;
*micro*)
#Micro
c="'Prior','Next','<alt>Comma','<alt>Period','<ctrl>s','<ctrl>q','<ctrl>f','<ctrl>p','<ctrl>n','<ctrl>e','<ctrl>c','<ctrl>v','<ctrl>z','<ctrl>y'"
CHOICES="
$icon_prv Previous Tab ^ 1 ^ sxmo_type -M Alt , -m Alt
$icon_nxt Next Tab ^ 1 ^ sxmo_type -M Alt . -m Alt
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=Micro
;;
*tuir*)
#tuir (reddit client) in foot
CHOICES="
$icon_aru Previous ^ 1 ^ sxmo_type k
$icon_ard Next ^ 1 ^ sxmo_type j
$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
$icon_ret Open ^ 0 ^ sxmo_type o
$icon_arl Back ^ 0 ^ sxmo_type h
$icon_arr Comments ^ 0 ^ sxmo_type l
$icon_edt Post ^ 0 ^ sxmo_type c
$icon_rld Refresh ^ 0 ^ sxmo_type r
$icon_cls Quit ^ 0 ^ sxmo_type q
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=tuir
;;
*w3m*)
#w3m
CHOICES="
$icon_arl Back ^ 1 ^ sxmo_type b
$icon_glb Goto URL ^ 1 ^ sxmo_type u
$icon_arr Next Link ^ 1 ^ sxmo_type -k Tab
$icon_arl Previous Link ^ 1 ^ sxmo_type -M Shift -k Tab
$icon_tab Open tab ^ 0 ^ sxmo_type t
$icon_cls Close tab ^ 0 ^ sxmo_type -M Ctrl q
$icon_itm Next tab ^ 1 ^ sxmo_type -k braceRight
$icon_itm Previous tab ^ 1 ^ sxmo_type -k braceLeft
$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=w3m
;;
*ncmpcpp*)
#ncmpcpp
CHOICES="
$icon_lst Playlist ^ 0 ^ sxmo_type 1
$icon_fnd Browser ^ 0 ^ sxmo_type 2
$icon_fnd Search ^ 0 ^ sxmo_type 3
$icon_nxt Next track ^ 0 ^ sxmo_type -k greater
$icon_prv Previous track ^ 0 ^ sxmo_type -k less
$icon_pau Pause ^ 0 ^ sxmo_type p
$icon_stp Stop ^ 0 ^ sxmo_type s
$icon_rld Toggle repeat ^ 0 ^ sxmo_type r
$icon_sfl Toggle random ^ 0 ^ sxmo_type z
$icon_itm Toggle consume ^ 0 ^ sxmo_type R
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=ncmpcpp
;;
*aerc*)
#aerc
c="'Up','Down','<shift>a','<ctrl>p','<ctrl>n','<ctrl>j','<ctrl>k','<shift>o'"
WINNAME=aerc
;;
*less*|*"git blame"*|*"git diff"*|*"git grep"*|*"git help"*|*"git log"*|*"git stash"*|*"git tag"*|*"git var"*)
#less
c="'q','Prior','Next'"
CHOICES="
$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +
$icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus
"
WINNAME=less
;;
*git*)
# git am, branch, config, tag (and other commands which launch both).
CHOICES="
$icon_fil ${PAGER:-less} menu ^ 0 ^ sxmo_appmenu.sh '$WMCLASS ${PAGER:-less}'
$icon_edt $EDITOR menu ^ 0 ^ sxmo_appmenu.sh '$WMCLASS $EDITOR'
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=git
;;
*senpai*)
c="'Prior','Next','<alt>Left','<alt>Right','F7','F8','<ctrl>c'"
WINNAME=senpai
;;
*weechat*)
#weechat
CHOICES="
$icon_msg Hotlist Next ^ 1 ^ sxmo_type -M Alt a
$icon_arl History Previous ^ 1 ^ sxmo_type -M Alt -k Less
$icon_arr History Next ^ 1 ^ sxmo_type -M Alt -k Greater
$icon_trm Buffer ^ 0 ^ sxmo_type '/buffer '
$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=weechat
;;
*cmus*)
# cmus
# requires `:set set_term_title=false` in cmus to match the application
CHOICES="
$icon_itm Play ^ 0 ^ cmus-remote -p
$icon_pau Pause ^ 0 ^ cmus-remote -u
$icon_stp Stop ^ 0 ^ cmus-remote -s
$icon_nxt Next track ^ 0 ^ cmus-remote -n
$icon_prv Previous track ^ 0 ^ cmus-remote -r
$icon_rld Toggle repeat ^ 0 ^ cmus-remote -R
$icon_sfl Toggle random ^ 0 ^ cmus-remote -S
$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
"
WINNAME=cmus
;;
*iamb*)
CHOICES="
$icon_aru Page Up ^ 1 ^ sxmo_type.sh -k Escape -M Ctrl -k b
$icon_tab Toggle Selection ^ 0 ^ sxmo_type.sh -k Escape -M Ctrl -k W m
$icon_ard Page Down ^ 1 ^ sxmo_type.sh -k Escape -M Ctrl -k f
$icon_ret Reply To Message ^ 0 ^ sxmo_type.sh -k Escape :reply -k Return
$icon_tab New Tab ^ 0 ^ sxmo_type.sh -k Escape :tab rooms -k Return
$icon_arl Previous Tab ^ 0 ^ sxmo_type.sh -k Escape :tabp -k Return
$icon_arr Next Tab ^ 0 ^ sxmo_type.sh -k Escape :tabn -k Return
$icon_cls Close Tab ^ 0 ^ sxmo_type.sh -k Escape :tabclose -k Return
$icon_win Split View ^ 0 ^ sxmo_type.sh -k Escape :split -k Return
$icon_win Split View Vertical ^ 0 ^ sxmo_type.sh -k Escape :vsplit -k Return
$icon_msg Direct Messages ^ 0 ^ sxmo_type.sh -k Escape :dms -k Return
$icon_grp Rooms ^ 0 ^ sxmo_type.sh -k Escape :rooms -k Return
$icon_glb Spaces ^ 0 ^ sxmo_type.sh -k Escape :spaces -k Return
$icon_sav Download ^ 0 ^ sxmo_type.sh -k Escape :download -k Return
$icon_cls Close View/Quit ^ 0 ^ sxmo_type.sh -k Escape :quit -k Return
"
WINNAME=iamb
;;
*)
# Now we fallback to the default terminal menu
case "$activewmclass" in
*st*)
STSELMODEON="$(
printf %s "$XPROPOUT" | grep -E '^_ST_SELMODE.+=' | cut -d= -f2 | tr -d ' '
)"
CHOICES="
$icon_itm Type complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k u
$icon_cpy Copy complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k i
$icon_itm Selmode $(
[ "$STSELMODEON" = 1 ] &&
printf %b "$icon_ton" ||
printf %b "$icon_tof"
printf %b '^ 0 ^ sxmo_type -M Ctrl -M Shift -k s'
)
$([ "$STSELMODEON" = 1 ] && echo 'Copy selection ^ 0 ^ sxmo_type -M Ctrl -M Shift -k c')
$icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl -M Shift -k v
$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl -M Shift -k Prior
icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -M Shift -k Next
icon_aru Scroll up ^ 1 ^ sxmo_type -M Ctrl -M Shift -k b
icon_ard Scroll down ^ 1 ^ sxmo_type -M Ctrl -M Shift -k f
icon_a2x Invert ^ 1 ^ sxmo_type -M Ctrl -M Shift -k x
icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
"
WINNAME=St
;;
*foot*)
CHOICES="
$icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c
$icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v
$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +
$icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus
$icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -k Prior
$icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -k Next
$icon_lnk URL Mode ^ 0 ^ sxmo_type -M Shift -M Ctrl -k u
$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
$icon_fnd Search Field ^ 0 ^ sxmo_type -M Ctrl -M Shift -k r
$icon_aru Search Back ^ 0 ^ sxmo_type -M Ctrl -k r
$icon_ard Search Forward ^ 0 ^ sxmo_type -M Ctrl -k s
$icon_itm Search Extend ^ 0 ^ sxmo_type -M Ctrl -k w
"
WINNAME=Foot
;;
*terminal*|org.gnome.vte.application|Terminal)
c="'Left','Down','Up','Right','<ctrl>c','<ctrl>z','<ctrl>l','<ctrl>d','<ctrl>a','<ctrl>b'"
WINNAME=Terminal
;;
*alacritty*)
CHOICES="
$icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c
$icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v
icon_vim VI Mode ^ 0 ^ sxmo_type -M Ctrl -M Shift -k Space
icon_fnd Search Forward ^ 0 ^ sxmo_type -M Ctrl -M Shift -k f
icon_fnd Search Backward ^ 0 ^ sxmo_type -M Ctrl -M Shift -k b
icon_aru Search Previous ^ 0 ^ sxmo_type -k Enter
icon_ard Search Next ^ 0 ^ sxmo_type -M Shift -k Enter
icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
"
WINNAME=Alacritty
;;
esac
esac
;;
*okular*)
# Okular
CHOICES="
icon_cfg Touch $(
sxmo_wm.sh inputevent touchscreen | grep -q on && \
printf %b "$icon_ton ^ 0 ^ sxmo_wm.sh inputevent touchscreen off" || \
printf %b "$icon_tof ^ 0 ^ sxmo_wm.sh inputevent touchscreen on"
)
icon_cfg Fullscreen ^ 0 ^ sxmo_type -k Ctrl -k Shift -k F
icon_cfg Menubar ^ 0 ^ sxmo_type -k Ctrl -k M
icon_cfg Toolbars ^ 0 ^ sxmo_type -k F7
"
WINNAME=Xournal
;;
*xournal*)
# Xournalpp
CHOICES="
$icon_cfg Touch $(
sxmo_wm.sh inputevent touchscreen | grep -q on && \
printf %b "$icon_ton ^ 0 ^ sxmo_wm.sh inputevent touchscreen off" || \
printf %b "$icon_tof ^ 0 ^ sxmo_wm.sh inputevent touchscreen on"
)
icon_flt Open ^ 0 ^ sxmo_type -k Ctrl -k o
$icon_zmi Zoom ^ 1 ^ sxmo_type -k Ctrl -k plus
$icon_zmo Zoom ^ 1 ^ sxmo_type -k Ctrl -k minus
$icon_zmi Next Page ^ 1 ^ sxmo_type -k Next
$icon_zmo Prev Page ^ 1 ^ sxmo_type -k Prior
$icon_cfg Menubar ^ 0 ^ sxmo_type -k F10
$icon_cfg Toolbars ^ 0 ^ sxmo_type -k F9
$icon_cfg SXMO Bar ^ 0 ^ sxmo_wm.sh togglebar
"
WINNAME=Xournal
;;
*zathura*)
# Zathura
CHOICES="
$icon_flt Open ^ 0 ^ sxmo_type -k o
$icon_zmi Zoom ^ 1 ^ sxmo_type -k plus
$icon_zmo Zoom ^ 1 ^ sxmo_type -k minus
$icon_arl History ^ 1 ^ sxmo_type -M Ctrl -k o
$icon_arr History ^ 1 ^ sxmo_type -M Ctrl -k i
$icon_cfg Invert ^ 0 ^ sxmo_type -M Ctrl -k r
$icon_flt Index ^ 0 ^ sxmo_type -k Tab
$icon_cfg Fit ^ 0 ^ sxmo_type -k a
$icon_cfg Width mode ^ 0 ^ sxmo_type -k s
"
WINNAME=Zathura
;;
*netsurf*)
# Netsurf
CHOICES="
$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus
$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
"
WINNAME=Netsurf
;;
*surf*)
# Surf
CHOICES="
$icon_glb Navigate ^ 0 ^ sxmo_type -M Ctrl g
$icon_lnk Link Menu ^ 0 ^ sxmo_type -M Ctrl d
$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
$icon_fnd Search Page ^ 0 ^ sxmo_type -M Ctrl f
$icon_fnd Find Next ^ 0 ^ sxmo_type -M Ctrl n
$icon_zmi Zoom ^ 1 ^ sxmo_type -M Shift -M Ctrl k
$icon_zmo Zoom ^ 1 ^ sxmo_type -M Shift -M Ctrl j
$icon_aru Scroll ^ 1 ^ sxmo_type -M Shift -k Space
$icon_ard Scroll ^ 1 ^ sxmo_type -k Space
$icon_itm JS Toggle ^ 1 ^ sxmo_type -M Shift -M Ctrl s
$icon_arl History ^ 1 ^ sxmo_type -M Ctrl h
$icon_arr History ^ 1 ^ sxmo_type -M Ctrl l
$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r
"
WINNAME=Surf
;;
*falkon*)
# Falkon
CHOICES="
$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
$icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl t
$icon_win New Window ^ 0 ^ sxmo_type -M Ctrl n
$icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w
$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus
$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
$icon_win Home ^ 0 ^ sxmo_type -M Alt -k Home
$icon_zmo Full Screen ^ 0 ^ sxmo_type -k F11
$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r
"
WINNAME=Falkon
;;
*firefox*|*navigator*)
# Firefox
CHOICES="
$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
$icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl t
$icon_win New Window ^ 0 ^ sxmo_type -M Ctrl n
$icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w
$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus
$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
$icon_win Home ^ 0 ^ sxmo_type -M Alt -k Home
$icon_zmo Full Screen ^ 0 ^ sxmo_type -k F11
$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r
"
WINNAME=Firefox
;;
*krita*)
# Krita
CHOICES="
icon_fnd Open ^ 0 ^ sxmo_type -M Ctrl o
icon_sav Save ^ 0 ^ sxmo_type -M Ctrl s
icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl v
icon_del Delete ^ 0 ^ sxmo_type -k Delete
icon_win Select ^ 0 ^ sxmo_type -M Ctrl r
icon_modem_disabled Deselect ^ 0 ^ sxmo_type -M Ctrl -M Shift a
icon_wn2 Crop ^ 0 ^ sxmo_type c
icon_flt Fill ^ 0 ^ sxmo_type f
icon_modem_connected Gradient ^ 0 ^ sxmo_type g
icon_dof HSV Adjust ^ 0 ^ sxmo_type -M Ctrl u
icon_cls Close Image ^ 0 ^ sxmo_type -M Ctrl w
"
WINNAME=Krita
;;
*vimb*)
CHOICES="
$icon_glb Navigate ^ 0 ^ sxmo_type -k Escape o
$icon_zmi Zoom ^ 1 ^ sxmo_type -k Escape zi
$icon_zmo Zoom ^ 1 ^ sxmo_type -k Escape zo
$icon_arl History ^ 1 ^ sxmo_type -M Ctrl o
$icon_arr History ^ 1 ^ sxmo_type -M Ctrl i
$icon_rld Refresh ^ 0 ^ sxmo_type -k Escape r
"
WINNAME=Vimb
;;
*geopard*)
# Geopard
CHOICES="
$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
icon_pls New Tab ^ 0 ^ sxmo_type -M Ctrl t
icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w
icon_bok Open Bookmarks ^ 0 ^ sxmo_type -M Ctrl b
icon_pls Add Bookmark ^ 0 ^ sxmo_type -M Ctrl d
$icon_edt Edit Bookmarks ^ 0 ^ sxmo_terminal.sh $EDITOR ~/.local/share/geopard/bookmarks.gemini
$icon_zmi Increase Font Size ^ 1 ^ sxmo_type -M Ctrl -k plus
$icon_zmo Decrease Font Size ^ 1 ^ sxmo_type -M Ctrl -k minus
$icon_arl History Back ^ 1 ^ sxmo_type -M Alt -k Left
$icon_arr History Forward ^ 1 ^ sxmo_type -M Alt -k Right
$icon_fnd URL Bar ^ 0 ^ sxmo_type -k F6
$icon_rld Refresh ^ 0 ^ sxmo_type -k F6 -k Return
"
WINNAME=Geopard
;;
*lagrange*)
# Lagrange
CHOICES="
$icon_mnu Toggle sidebar ^ 0 ^ sxmo_type -M Shift -M Ctrl p
$icon_bok Open bookmarks ^ 0 ^ sxmo_type -M Ctrl l && sxmo_type 'about:bookmarks' -k Return
$icon_pls Add bookmark ^ 0 ^ sxmo_type -M Ctrl d
$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k equal
$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
$icon_aru Parent dir ^ 1 ^ sxmo_type -M Alt -k Up
$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
$icon_rld Refresh ^ 0 ^ sxmo_type -M Ctrl r
"
WINNAME=Lagrange
;;
org.gnome.Maps)
c="'<ctrl>equal','<ctrl>minus','<ctrl><shift>F','<ctrl>f','<ctrl>r','<ctrl>d','<ctrl>l'"
WINNAME=Maps
;;
*mepo*)
# Mepo
# The choices / hotkeys for the contextmenu are generated through mepo's
# own scripting to be in congruence since the same menu can be launched
# via mepo's UI as well, this compatibility is available as of mepo 0.4
CHOICES="$(mepo_ui_central_menu.sh menuoptions | awk -F^ '{ print $1 "^ 0 ^ sxmo_type" $3 }')"
WINNAME=Mepo
;;
*foxtrot*)
# Foxtrot GPS
CHOICES="
$icon_zmi Zoom ^ 1 ^ sxmo_type i
$icon_zmo Zoom ^ 1 ^ sxmo_type o
$icon_itm Panel Toggle ^ 1 ^ sxmo_type m
$icon_itm GPSD Toggle ^ 1 ^ sxmo_type a
"
WINNAME=Maps
;;
*badwolf*)
# Badwolf Browser
CHOICES="
$icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl -k t
$icon_cls Close Tab ^ 0 ^ sxmo_type -M Alt -k d
$icon_fnd Reset Zoom ^ 0 ^ sxmo_type -M Ctrl -k 0
$icon_arr History ^ 1 ^ sxmo_type -M Ctrl ]
$icon_arl History ^ 1 ^ sxmo_type -M Ctrl [
$icon_arr Next Tab ^ 1 ^ sxmo_type -M Alt -k Right
$icon_arl Previous Tab ^ 1 ^ sxmo_type -M Alt -k Left
$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl -k r
$icon_fnd Search ^ 0 ^ sxmo_type -M Shift -M Ctrl -k f
$icon_arr Next (Search) ^ 0 ^ sxmo_type -M Shift -M Ctrl -k g
$icon_arl Previous (Search) ^ 0 ^ sxmo_type -M Shift -M Ctrl -M Shift -k g
$icon_flt URL Bar ^ 0 ^ sxmo_type -M Shift -M Ctrl l
$icon_fnd Open Web Inspector ^ 0 ^ sxmo_type -k F12
"
WINNAME=Badwolf
;;
*acme*)
# Acme
CHOICES="
icon_mse 2 (Right) [2s delay] ^ 0 ^ sleep 2 && xdotool click 3
icon_mse 3 (Middle) [2s delay] ^ 0 ^ sleep 2 && xdotool click 2
$icon_itm Autocomplete ^ 0 ^ sxmo_type.sh -M Ctrl -k f
$icon_exp Select Last Typed Text ^ 0 ^ sxmo_type.sh -M Escape
icon_del Delete To Start Of Line ^ 0 ^ sxmo_type.sh -M Ctrl -k U
$icon_arl Move To Start Of Line ^ 0 ^ sxmo_type.sh -M Ctrl -k A
$icon_arr Move To End Of Line ^ 0 ^ sxmo_type.sh -M Ctrl -k E
"
WINNAME=Acme
;;
*mupdf*)
# Mupdf
CHOICES="
$icon_nxt Next Page ^ 0 ^ sxmo_type -k Space
$icon_prv Previous Page ^ 0 ^ sxmo_type -k b
icon_chk Mark Page ^ 0 ^ sxmo_type -k m
$icon_ret Pop To Last Mark ^ 0 ^ sxmo_type -k t
$icon_zmi Zoom In ^ 1 ^ sxmo_type -k +
$icon_zmo Zoom Out ^ 1 ^ sxmo_type -k -
$icon_fnd Fit Width ^ 0 ^ sxmo_type -k W
$icon_fnd Fit Height ^ 0 ^ sxmo_type -k H
$icon_fnd Zoom To Fit ^ 0 ^ sxmo_type -k Z
$icon_fnd Reset Zoom ^ 0 ^ sxmo_type -k z
$icon_rol Rotate Counterclockwise ^ 0 ^ sxmo_type -k [
$icon_ror Rotate Clockwise ^ 0 ^ sxmo_type -k ]
$icon_fnd Search ^ 0 ^ sxmo_type -k /
"
WINNAME=Mupdf
;;
*tabbed*)
# Tabbed
CHOICES="
$icon_tab New Tab ^ 0 ^ sxmo_type.sh -M Ctrl -M Shift -M Enter
$icon_arl Previous Tab ^ 1 ^ sxmo_type.sh -M Ctrl -M Shift -k h
$icon_arr Next Tab ^ 1 ^ sxmo_type.sh -M Ctrl -M Shift -k l
$icon_arl Move Tab Left ^ 1 ^ sxmo_type.sh -M Ctrl -M Shift -k j
$icon_arr Move Tab Right ^ 1 ^ sxmo_type.sh -M Ctrl -M Shift -k k
$icon_mnu Menu Prompt ^ 0 ^ sxmo_type.sh -M Ctrl -k U0060
$icon_cls Close Tab ^ 0 ^ sxmo_type.sh -M Ctrl -k q
"
WINNAME=Tabbed
;;
esac
if ! test "$c"; then
test "$WINNAME" && printf "%b\n" "$WINNAME"
c="$(printf "%b\n" "$CHOICES" |grep sxmo_type|sed "s/sxmo_type[^ ]* \(\S\)$/'\1'/g"|
sed "s/sxmo_type[^ ]* -k \(\S\+\)$/'\1'/g"|
sed "s/sxmo_type[^ ]* -M Ctrl \(\S\)$/'<ctrl>\1'/ig"|
sed "s/sxmo_type[^ ]* -M Ctrl -k \(\S\+\)$/'<ctrl>\1'/ig"|
sed "s/sxmo_type[^ ]* -k Ctrl -k \(\S\+\)$/'<ctrl>\1'/ig"|
sed "s/sxmo_type[^ ]* -M Ctrl \(\S\) -m Ctrl$/'<ctrl>\1'/ig"|
sed "s/sxmo_type[^ ]* -M Ctrl -k \(\S\+\) -m Ctrl$/'<ctrl>\1'/ig"|
sed "s/sxmo_type[^ ]* -M Shift \(\S\)$/'<shift>\1'/g"|
sed "s/sxmo_type[^ ]* -M Shift -k \(\S\+\)$/'<shift>\1'/g"|
sed "s/sxmo_type[^ ]* -M Shift -M Ctrl \(\S\)$/'<ctrl><shift>\1'/ig"|
sed "s/sxmo_type[^ ]* -M Shift -M Ctrl -k \(\S\+\)$/'<ctrl><shift>\1'/ig"|
sed "s/sxmo_type[^ ]* -M Ctrl -M Shift \(\S\)$/'<ctrl><shift>\1'/ig"|
sed "s/sxmo_type[^ ]* -M Ctrl -M Shift -k \(\S\+\)$/'<ctrl><shift>\1'/ig"|
sed "s/sxmo_type[^ ]* -k Ctrl -k Shift -k \(\S\+\)$/'<ctrl><shift>\1'/ig"|
sed "s/sxmo_type[^ ]* -M Shift -M Ctrl -M Shift -k g/<ctrl><shift>g/g"|
sed "s/sxmo_type[^ ]* -M Ctrl -M Shift -M \(Enter\)$/'<ctrl><shift>\1'/ig"|
sed "s/sxmo_type[^ ]* -M Alt \(\S\)$/'<alt>\1'/g"|
sed "s/sxmo_type[^ ]* -M Alt -k \(\S\+\)$/'<alt>\1'/g"|
sed "s/sxmo_type[^ ]* -M Alt \(\S\) -m Alt$/'<alt>\1'/g"|
sed "s/sxmo_type[^ ]* -M Alt -k \(\S\+\) -m Alt$/'<alt>\1'/g" |grep -v sxmo_type | grep -o "'[^']\+'$"|tr "\n" ,|sed 's/,$//g')"
fi
test "$c" && printf %s"\n" "$c"
test "$c" &&
gsettings set sm.puri.phosh.osk.Terminal shortcuts "[$c]"
}
if test "$1" = "--watch"; then
socat -U - UNIX-CONNECT:"$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" |stdbuf -o0 grep 'activewindow>>' | while read -r line;
do
c=""
CHOICES=""
WINNAME=""
win="$(printf %s "$line" |cut -d '>' -f3 |cut -d , -f1)"
tit=$(printf %s "$line" |cut -d , -f2)
setComms "$win" "$tit"
done
else
setComms "$@"
fi
|