This repository has been archived by the owner on Oct 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
keybindings.go
145 lines (126 loc) · 6.09 KB
/
keybindings.go
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
package main
import (
"os"
"os/exec"
"sync"
)
const (
MAP = "map"
NORMAL = "normal"
MAPP = "map-pointer"
SPAWN = "spawn"
RIVERCTL = "riverctl"
)
var config, _ = os.UserConfigDir()
// mouseBindings function ﳑ Bindings for mouse
func mouseBindings(mwg *sync.WaitGroup) {
allCMDs := []*exec.Cmd{
exec.Command(RIVERCTL, MAPP, NORMAL, "Super", "BTN_LEFT", "move-view"),
exec.Command(RIVERCTL, MAPP, NORMAL, "Super", "BTN_RIGHT", "resize-view"),
}
runner(allCMDs)
mwg.Done()
}
// keyBindings function ﳑ setting bindings for keyboard
func keyBindings(mwg *sync.WaitGroup) {
// Default Apps
term := "kitty"
// browser := "vieb --proxy-server=\"localhost:7890\""
browser := "qutebrowser"
launcher := "rofi -show drun"
// launcher := "onagre"
netman := "networkmanager_dmenu"
passManager := "rofi-rbw"
clipboardManager := "clipman pick -t rofi"
favoClipboard := "favo $(wl-paste)"
favoRofi := `awk '{print $1"|"$2" "$3" "$4" "$5}' ~/notes/bm.md | rofi -dmenu -display-column-separator "\|" -display-columns 2 | awk -F "|" '{print $1}' | wl-copy`
editor := "zoxofi"
// List of Keybinings
allCMDs := []*exec.Cmd{
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "R", SPAWN, config+"/river/init"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "Return", SPAWN, term),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "W", SPAWN, browser),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "D", SPAWN, launcher),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "N", SPAWN, netman),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "P", SPAWN, passManager),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "V", SPAWN, clipboardManager),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "B", SPAWN, favoRofi),
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Shift", "B", SPAWN, favoClipboard),
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Shift", "Return", SPAWN, editor),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "n", SPAWN, editor),
// view focus control
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "J", "focus-view", "next"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "K", "focus-view", "previous"),
// bump focused view to the top of the stack
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "Space", "zoom"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "Q", "close"),
// output focus control
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "Period", "focus-output", "next"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "Comma", "focus-output", "previous"),
// send view to output
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Shift", "Period", "send-to-output", "next"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Shift", "Comma", "send-to-output", "previous"),
// resize the main ratio of rivertile
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "H", "send-layout-cmd", "rivertile", "main-ratio -0.05"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "L", "send-layout-cmd", "rivertile", "main-ratio +0.05"),
// change the amount of views in main in rivertile
// exec.Command(RIVERCTL, MAP, NORMAL, "Super+Shift", "H", "rivertile", "main-count +1"),
// exec.Command(RIVERCTL, MAP, NORMAL, "Super+Shift", "L", "rivertile", "main-count -1"),
// exec.Command(RIVERCTL, MAP, NORMAL, "Super+Shift", "H","send-layout-cmd", "rivertile", "main-location top"),
// exec.Command(RIVERCTL, MAP, NORMAL, "Super+Shift", "L","send-layout-cmd", "rivertile", "main-location left"),
// // move views
// exec.Command(RIVERCTL, MAP, NORMAL, "Super+Alt", "H", "move", "left", "100"),
// exec.Command(RIVERCTL, MAP, NORMAL, "Super+Alt", "J", "move", "down", "100"),
// exec.Command(RIVERCTL, MAP, NORMAL, "Super+Alt", "K", "move", "up", "100"),
// exec.Command(RIVERCTL, MAP, NORMAL, "Super+Alt", "L", "move", "right", "100"),
//
// snap views
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Alt+Control", "H", "snap", "left"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Alt+Control", "J", "snap", "down"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Alt+Control", "K", "snap", "up"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Alt+Control", "L", "snap", "right"),
// move views
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Alt+Shift", "H", "resize", "horizontal -100"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Alt+Shift", "J", "resize", "vertical 100"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Alt+Shift", "K", "resize", "vertical -100"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Alt+Shift", "L", "resize", "horizontal 100"),
// toggle layouts
exec.Command(RIVERCTL, MAP, NORMAL, "Super+Shift", "F", "toggle-float"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "F", "toggle-fullscreen"),
// Change layout orientation
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "Up", "send-layout-cmd", "rivertile", "main-location top"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "Right", "send-layout-cmd", "rivertile", "main-location right"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "Down", "send-layout-cmd", "rivertile", "main-location bottom"),
exec.Command(RIVERCTL, MAP, NORMAL, "Super", "Left", "send-layout-cmd", "rivertile", "main-location left"),
// media keys
exec.Command(RIVERCTL, MAP, NORMAL, "None", "XF86AudioMedia", SPAWN, "playerctl play-pause"),
exec.Command(RIVERCTL, MAP, NORMAL, "None", "XF86AudioPlay", SPAWN, "playerctl play-pause"),
exec.Command(RIVERCTL, MAP, NORMAL, "None", "XF86AudioPrev", SPAWN, "playerctl previous"),
exec.Command(RIVERCTL, MAP, NORMAL, "None", "XF86AudioNext", SPAWN, "playerctl next"),
// volume keys
exec.Command(
RIVERCTL,
MAP,
NORMAL,
"None",
"XF86AudioRaiseVolume",
SPAWN,
"pactl set-sink-volume @DEFAULT_SINK@ +5%",
),
exec.Command(
RIVERCTL,
MAP,
NORMAL,
"None",
"XF86AudioLowerVolume",
SPAWN,
"pactl set-sink-volume @DEFAULT_SINK@ -5%",
),
exec.Command(RIVERCTL, MAP, NORMAL, "None", "XF86AudioMute", SPAWN, "pactl set-sink-mute @DEFAULT_SINK@ toggle"),
// brightness keys
exec.Command(RIVERCTL, MAP, NORMAL, "None", "XF86MonBrightnessUp", SPAWN, "brightnessctl s 5+"),
exec.Command(RIVERCTL, MAP, NORMAL, "None", "XF86MonBrightnessDown", SPAWN, "brightnessctl s 5-"),
}
runner(allCMDs)
mwg.Done()
}