Compare commits
95 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
cbfe1a4141 | ||
![]() |
d44247affb | ||
![]() |
4f1adbc358 | ||
![]() |
a362d704c2 | ||
![]() |
6e2631aa3c | ||
![]() |
4bcdcdea6a | ||
![]() |
f9d7cba452 | ||
![]() |
fb0c476c7f | ||
![]() |
afd7ec47bf | ||
![]() |
06ba71fa67 | ||
![]() |
539d916ae3 | ||
![]() |
6d49644151 | ||
![]() |
4a3877a5fa | ||
![]() |
12efd46dd7 | ||
![]() |
e255cb6727 | ||
![]() |
8e0828aa3b | ||
![]() |
ecbf8a7aed | ||
![]() |
93743cc4c5 | ||
![]() |
34dee0e9ef | ||
![]() |
261befaf7f | ||
![]() |
5410895d0a | ||
![]() |
319b506260 | ||
![]() |
6a8de98bbd | ||
![]() |
9aaac4f356 | ||
![]() |
e9911f3de8 | ||
![]() |
d76dcc9682 | ||
![]() |
6a32f41de4 | ||
![]() |
273d0e2ee4 | ||
![]() |
ce9b137c13 | ||
![]() |
dab65cd8f0 | ||
![]() |
50d53ba77f | ||
![]() |
a285e7ebe9 | ||
![]() |
231060ee5b | ||
![]() |
f693312dce | ||
![]() |
6d2dd55a96 | ||
![]() |
46430e3ec6 | ||
![]() |
d1d020ff80 | ||
![]() |
bc04c87042 | ||
![]() |
dc31e28e16 | ||
![]() |
30a9529940 | ||
![]() |
7c9887237b | ||
![]() |
a090725633 | ||
![]() |
1e694aa65f | ||
![]() |
7f771cb5da | ||
![]() |
20e73a060b | ||
![]() |
3cbb2efa4b | ||
![]() |
39aef1be43 | ||
![]() |
e526dfdda0 | ||
![]() |
c321e51a8f | ||
![]() |
43b4ae3986 | ||
![]() |
8eb14ee96a | ||
![]() |
b76154d046 | ||
![]() |
6fa0ec8ddd | ||
![]() |
c924d91440 | ||
![]() |
e9edc4891c | ||
![]() |
015faa4491 | ||
![]() |
844f03ebc1 | ||
![]() |
2663bfc574 | ||
![]() |
93743a6fa2 | ||
![]() |
74ef2b3a8f | ||
![]() |
b5854eec66 | ||
![]() |
06b235d4ea | ||
![]() |
98d530921f | ||
![]() |
d40fc42e15 | ||
![]() |
78a0d993c4 | ||
![]() |
51f14984d7 | ||
![]() |
096556ef1a | ||
![]() |
26d2acd0fd | ||
![]() |
be09586239 | ||
![]() |
ef238dc94d | ||
![]() |
24e42c1c8a | ||
![]() |
b9d3ddd7c0 | ||
![]() |
1f70fde0e2 | ||
![]() |
07e1d44e7d | ||
![]() |
5f83fa9ba5 | ||
![]() |
a6b318ef87 | ||
![]() |
02aa99f301 | ||
![]() |
36b4264135 | ||
![]() |
4b737f61bf | ||
![]() |
8e11cd0dc4 | ||
![]() |
1b0a2680f6 | ||
![]() |
87d7589d7d | ||
![]() |
d499e338ab | ||
![]() |
3458246fbf | ||
![]() |
75ac498c9d | ||
![]() |
8723fb549b | ||
![]() |
f952c9e569 | ||
![]() |
d62e42ed12 | ||
![]() |
72d5dc7a8f | ||
![]() |
fc84732fd0 | ||
![]() |
cf2353b5a6 | ||
![]() |
fab67177b3 | ||
![]() |
4b51013380 | ||
![]() |
e7d66d36ee | ||
![]() |
3045a424b9 |
@@ -1,5 +0,0 @@
|
||||
partial modifier_keys
|
||||
xkb_symbols "swap_lalt_lctrl" {
|
||||
replace key <LALT> { [ Control_L, Control_L ] };
|
||||
replace key <LCTL> { [ Alt_L, Meta_L ] };
|
||||
};
|
@@ -1,781 +0,0 @@
|
||||
// Template
|
||||
//
|
||||
// ONE_LEVEL_CTRL
|
||||
// Base
|
||||
// Shift
|
||||
// Alt
|
||||
// Shift Alt
|
||||
// Control
|
||||
// Shift Control
|
||||
// Super
|
||||
// Shift Super
|
||||
// Control Alt
|
||||
// Super Control
|
||||
// Super Alt
|
||||
// Super Control Alt
|
||||
//
|
||||
// replace key <KEY> {
|
||||
// type[Group1]= "ONE_LEVEL_CTRL",
|
||||
// symbols[Group1]= [
|
||||
// Base,
|
||||
// Alt,
|
||||
// Shift Alt,
|
||||
// Control,
|
||||
// Shift Control,
|
||||
// Super,
|
||||
// Shift Super,
|
||||
// Control Alt,
|
||||
// Super Control",
|
||||
// Super Alt,
|
||||
// Super Control Alt
|
||||
// ],
|
||||
// actions[Group1]= [
|
||||
// NoAction(),
|
||||
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Mod1),
|
||||
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Mod1+Shift),
|
||||
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Control),
|
||||
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Control+Shift),
|
||||
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Super),
|
||||
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Super+Shift),
|
||||
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Control+Alt),
|
||||
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Super+Control),
|
||||
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Super+Mod1),
|
||||
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Control+Mod1)
|
||||
// ]
|
||||
// };
|
||||
hidden partial modifier_keys
|
||||
xkb_symbols "swapescape" {
|
||||
key <CAPS> { [ Escape ] };
|
||||
key <ESC> { [ Caps_Lock ] };
|
||||
};
|
||||
hidden partial modifier_keys
|
||||
xkb_symbols "caps_escape" {
|
||||
key <CAPS> { [ Escape ] };
|
||||
};
|
||||
hidden partial modifier_keys
|
||||
xkb_symbols "caps_shiftlock" {
|
||||
replace key <CAPS> { [ Shift_Lock ] };
|
||||
modifier_map Shift { Shift_Lock };
|
||||
};
|
||||
hidden partial modifier_keys
|
||||
xkb_symbols "caps_none" {
|
||||
key <CAPS> { [ VoidSymbol ] };
|
||||
};
|
||||
default partial xkb_symbols "mac_levelssym" {
|
||||
// // Minimize window Cmd + H = Alt + F9
|
||||
// // 2 caveats
|
||||
// // 1 Cmd + H may not pass through on VMs
|
||||
// // 2 may cause conflicts with apps
|
||||
// replace key <AC06> {
|
||||
// type[Group1]= "ONE_LEVEL_CTRL",
|
||||
// symbols[Group1]= [
|
||||
// h,
|
||||
// H,
|
||||
// h,
|
||||
// H,
|
||||
// h
|
||||
// ],
|
||||
// actions[Group1]= [
|
||||
// NoAction(),
|
||||
// NoAction(),
|
||||
// NoAction(),
|
||||
// NoAction(),
|
||||
// RedirectKey(key=<AC06>,modifiers=Super,clearmods=Control)
|
||||
// ]
|
||||
// };
|
||||
// Maximize Window Ctrl + Cmd + F = Alt+F10
|
||||
// Also maps Option + Cmd + F to Control+H for Replace - Sublime
|
||||
// AD03=e,E
|
||||
// AC01=a,A
|
||||
// Ctrl + A - Beginning of Line
|
||||
replace key <AC01> {
|
||||
type[Group1]= "ONE_LEVEL_SUPER",
|
||||
symbols[Group1]= [
|
||||
// Base
|
||||
a,
|
||||
// Shift
|
||||
A,
|
||||
// Super
|
||||
NoSymbol,
|
||||
// Shift Super
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<HOME>,clearmods=Super),
|
||||
RedirectKey(key=<HOME>,clearmods=Super)
|
||||
]
|
||||
};
|
||||
// Ctrl + E - End of Line
|
||||
replace key <AD03> {
|
||||
type[Group1]= "ONE_LEVEL_SUPER",
|
||||
symbols[Group1]= [
|
||||
// Base
|
||||
e,
|
||||
// Shift
|
||||
E,
|
||||
// Super
|
||||
NoSymbol,
|
||||
// Shift Super
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<END>,clearmods=Super),
|
||||
RedirectKey(key=<END>,clearmods=Super)
|
||||
]
|
||||
};
|
||||
replace key <AC04> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
// Base
|
||||
f,
|
||||
// Shift
|
||||
F,
|
||||
// Alt
|
||||
f,
|
||||
// Shift Alt
|
||||
F,
|
||||
// Control
|
||||
f,
|
||||
// Shift Control
|
||||
F,
|
||||
// Super
|
||||
f,
|
||||
// Shift Super
|
||||
F,
|
||||
// Control Alt
|
||||
h
|
||||
// Super Control
|
||||
// ,F10 // Default maximize
|
||||
// // Nothing // KDE maximize
|
||||
// Super Alt
|
||||
// Super Control Alt
|
||||
],
|
||||
actions[Group1]= [
|
||||
// Base
|
||||
NoAction(),
|
||||
// Shift
|
||||
NoAction(),
|
||||
// Alt
|
||||
NoAction(),
|
||||
// Shift Alt
|
||||
NoAction(),
|
||||
// Control
|
||||
NoAction(),
|
||||
// Shift Control
|
||||
NoAction(),
|
||||
// Super
|
||||
NoAction(),
|
||||
// Shift Super
|
||||
NoAction(),
|
||||
// Control Alt
|
||||
RedirectKey(key=<AC06>,clearmods=Mod1)
|
||||
// Super Control - Fullscreen
|
||||
// ,RedirectKey(key=<FK10>,modifiers=Mod1,clearmods=Super+Control) // Default maximize
|
||||
// // Nothing // KDE maximize
|
||||
// Super Alt
|
||||
// Super Control Alt
|
||||
]
|
||||
};
|
||||
// Close App Cmd + Q = Alt + F4
|
||||
replace key <AD01> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
// Base
|
||||
q,
|
||||
// Shift
|
||||
Q,
|
||||
// Alt
|
||||
q,
|
||||
// Shift Alt
|
||||
Q,
|
||||
// Control
|
||||
F4
|
||||
],
|
||||
actions[Group1]= [
|
||||
// Base
|
||||
NoAction(),
|
||||
// Shift
|
||||
NoAction(),
|
||||
// Alt
|
||||
NoAction(),
|
||||
// Shift Alt
|
||||
NoAction(),
|
||||
// Control
|
||||
RedirectKey(key=<FK04>,modifiers=Mod1,clearmods=Control)
|
||||
]
|
||||
};
|
||||
// Show Desktop Cmd + F3 = Super + D
|
||||
replace key <FK03> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
// Base
|
||||
F3,
|
||||
// Shift
|
||||
F3,
|
||||
// Alt
|
||||
F3,
|
||||
// Shift Alt
|
||||
F3,
|
||||
// Control
|
||||
d
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<AC03>,modifiers=Super,clearmods=Control)
|
||||
]
|
||||
};
|
||||
// Fix the G key for Sublime Text
|
||||
replace key <AC05> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
// Base
|
||||
g,
|
||||
// Shift
|
||||
G,
|
||||
// Alt
|
||||
g,
|
||||
// Shift Alt
|
||||
G,
|
||||
// Control
|
||||
g,
|
||||
// Shift Control
|
||||
G,
|
||||
// Super
|
||||
NoSymbol,
|
||||
// Shift Super
|
||||
NoSymbol,
|
||||
// Control Alt
|
||||
g,
|
||||
// Super Control
|
||||
g,
|
||||
// Super Alt
|
||||
g,
|
||||
// Super Control Alt
|
||||
g
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
// Pass G Normally
|
||||
RedirectKey(key=<AC05>),
|
||||
RedirectKey(key=<AC05>),
|
||||
// Find Next
|
||||
RedirectKey(key=<FK03>,clearmods=Control),
|
||||
// Find Previous
|
||||
RedirectKey(key=<FK03>,clearmods=Control),
|
||||
// Sublime Goto Line
|
||||
RedirectKey(key=<AC05>,modifiers=Control,clearmods=Super),
|
||||
NoAction(),
|
||||
// Sublime Quick Find
|
||||
RedirectKey(key=<FK03>,clearmods=Mod1),
|
||||
// Sublime Select All Matches
|
||||
RedirectKey(key=<FK03>,modifiers=Mod1,clearmods=Super+Control),
|
||||
NoAction(),
|
||||
NoAction()
|
||||
]
|
||||
};
|
||||
// LEFT to Begin Line or Beginning of word
|
||||
replace key <LEFT> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
// Base
|
||||
Left,
|
||||
// Shift
|
||||
Left,
|
||||
// Alt
|
||||
Left,
|
||||
// Shift Alt
|
||||
Left,
|
||||
// Control
|
||||
NoSymbol,
|
||||
// Shift Control
|
||||
NoSymbol,
|
||||
// Super
|
||||
Left
|
||||
],
|
||||
actions[Group1]= [
|
||||
// Base
|
||||
NoAction(),
|
||||
// Shift
|
||||
NoAction(),
|
||||
// Alt - Wordwise
|
||||
RedirectKey(key=<LEFT>,mods=Control,clearmods=Mod1),
|
||||
// Shift Alt
|
||||
RedirectKey(key=<LEFT>,mods=Control,clearmods=Mod1),
|
||||
// Control
|
||||
RedirectKey(key=<HOME>,clearmods=Control),
|
||||
// Shift Control
|
||||
RedirectKey(key=<HOME>,clearmods=Control),
|
||||
// Super - Change workspace
|
||||
NoAction()
|
||||
]
|
||||
};
|
||||
|
||||
// Right to End of Line or end of word
|
||||
replace key <RGHT> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
// Base
|
||||
Right,
|
||||
// Shift
|
||||
Right,
|
||||
// Alt
|
||||
Right,
|
||||
// Shift Alt
|
||||
Right,
|
||||
// Control
|
||||
NoSymbol,
|
||||
// Shift Control
|
||||
NoSymbol,
|
||||
// Super
|
||||
Right
|
||||
],
|
||||
actions[Group1]= [
|
||||
// Base
|
||||
NoAction(),
|
||||
// Shift
|
||||
NoAction(),
|
||||
// Alt - Wordwise
|
||||
RedirectKey(key=<RGHT>,mods=Control,clearmods=Mod1),
|
||||
// Shift Alt
|
||||
RedirectKey(key=<RGHT>,mods=Control,clearmods=Mod1),
|
||||
// Control
|
||||
RedirectKey(key=<END>,clearmods=Control),
|
||||
// Shift Control
|
||||
RedirectKey(key=<END>,clearmods=Control),
|
||||
// Super - Change workspace
|
||||
NoAction()
|
||||
]
|
||||
};
|
||||
|
||||
//Up to Mac Home
|
||||
replace key <UP> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
// Base
|
||||
Up,
|
||||
// Shift
|
||||
Up,
|
||||
// Alt
|
||||
Up,
|
||||
// Shift Alt
|
||||
Up,
|
||||
// Control
|
||||
NoSymbol,
|
||||
// Shift Control
|
||||
NoSymbol,
|
||||
// Super
|
||||
Up,
|
||||
// Shift Super
|
||||
Up
|
||||
],
|
||||
actions[Group1]= [
|
||||
// Base
|
||||
NoAction(),
|
||||
// Shift
|
||||
NoAction(),
|
||||
// Alt - Wordwise
|
||||
RedirectKey(key=<UP>,clearmods=Mod1),
|
||||
// Shift Alt
|
||||
// RedirectKey(key=<UP>), // Chromebook multicursor
|
||||
RedirectKey(key=<UP>,clearmods=Mod1), // Default multicursor
|
||||
// Control
|
||||
RedirectKey(key=<HOME>),
|
||||
// Shift Control
|
||||
RedirectKey(key=<HOME>),
|
||||
// Super - Wordwise - Sublime?
|
||||
RedirectKey(key=<PGUP>,clearmods=Super),
|
||||
// Shift Super
|
||||
RedirectKey(key=<UP>,modifiers=Mod1,clearmods=Super)
|
||||
]
|
||||
};
|
||||
|
||||
// Down to Mac End
|
||||
replace key <DOWN> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
// Base
|
||||
Down,
|
||||
// Shift
|
||||
Down,
|
||||
// Alt
|
||||
Down,
|
||||
// Shift Alt
|
||||
Down,
|
||||
// Control
|
||||
NoSymbol,
|
||||
// Shift Control
|
||||
NoSymbol,
|
||||
// Super
|
||||
Down,
|
||||
// Shift Super
|
||||
Down
|
||||
],
|
||||
actions[Group1]= [
|
||||
// Base
|
||||
NoAction(),
|
||||
// Shift
|
||||
NoAction(),
|
||||
// Alt - Wordwise
|
||||
RedirectKey(key=<DOWN>,clearmods=Mod1),
|
||||
// Shift Alt
|
||||
RedirectKey(key=<DOWN>,clearmods=Mod1),
|
||||
// Control
|
||||
RedirectKey(key=<END>),
|
||||
// Shift Control
|
||||
RedirectKey(key=<END>),
|
||||
// Super - Wordwise - Sublime?
|
||||
RedirectKey(key=<PGDN>,clearmods=Super),
|
||||
// Shift Super
|
||||
RedirectKey(key=<DOWN>,modifiers=Mod1,clearmods=Super)
|
||||
]
|
||||
};
|
||||
// Alt BKSP to DELETE
|
||||
replace key <BKSP> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
BackSpace,
|
||||
BackSpace,
|
||||
BackSpace
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<DELE>,clearmods=Mod1)
|
||||
]
|
||||
};
|
||||
// // Full Print Screen
|
||||
// // GalliumOS
|
||||
// replace key <AE03> {
|
||||
// type[Group1]= "ONE_LEVEL_CTRL",
|
||||
// symbols[Group1]= [ 3, 3, 3, F5 ],
|
||||
// actions[Group1]= [ NoAction(), NoAction(), NoAction(), RedirectKey(key=<FK05>,clearmods=Shift) ]
|
||||
// };
|
||||
// // Region Print Screen
|
||||
// // GalliumOS
|
||||
// replace key <AE04> {
|
||||
// type[Group1]= "ONE_LEVEL_CTRL",
|
||||
// symbols[Group1]= [ 4, 4, 4, F5 ],
|
||||
// actions[Group1]= [ NoAction(), NoAction(), NoAction(), RedirectKey(key=<FK05>) ]
|
||||
// };
|
||||
// // Full Print Screen
|
||||
// // Standard Ubuntu
|
||||
// replace key <AE03> {
|
||||
// type[Group1]= "ONE_LEVEL_CTRL",
|
||||
// symbols[Group1]= [ 3, 3, 3, F5 ],
|
||||
// actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<PRSC>,clearmods=Shift+Control) ]
|
||||
// };
|
||||
// // Region Print Screen
|
||||
// // Standard Ubuntu
|
||||
// replace key <AE04> {
|
||||
// type[Group1]= "ONE_LEVEL_CTRL",
|
||||
// symbols[Group1]= [ 4, 4, 4, F5 ],
|
||||
// actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<PRSC>,clearmods=Control) ]
|
||||
// };
|
||||
};
|
||||
partial xkb_symbols "mac_appcycle_chromebook" {
|
||||
// Cycle App and In App Tab Switching
|
||||
replace key <TAB> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Tab,
|
||||
Tab,
|
||||
Tab,
|
||||
Tab,
|
||||
backslash,
|
||||
backslash,
|
||||
NoSymbol,
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
// Alt
|
||||
Redirect(key=<TAB>,mods=Control,clearmods=Mod1),
|
||||
// Alt + Shift
|
||||
Redirect(key=<TAB>,mods=Control,clearmods=Mod1),
|
||||
// Control
|
||||
Redirect(key=<BKSL>),
|
||||
// Control+Shift
|
||||
Redirect(key=<BKSL>),
|
||||
// Super
|
||||
NoAction(),
|
||||
// Super + Shift
|
||||
NoAction()
|
||||
]
|
||||
};
|
||||
};
|
||||
partial xkb_symbols "mac_appcycle" {
|
||||
// Cycle App and In App Tab Switching
|
||||
key <FK13> { [ F13 ] };
|
||||
key <FK14> { [ F14 ] };
|
||||
replace key <TAB> {
|
||||
type[Group1]= "ONE_LEVEL_CMD",
|
||||
symbols[Group1]= [
|
||||
Tab,
|
||||
Tab,
|
||||
F14,
|
||||
F13,
|
||||
NoSymbol,
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
// Base
|
||||
NoAction(),
|
||||
// Shift
|
||||
NoAction(),
|
||||
// Control + Shift
|
||||
Redirect(key=<FK14>),
|
||||
// Control
|
||||
Redirect(key=<FK13>),
|
||||
// Super
|
||||
Redirect(key=<TAB>,mods=Control,clearmods=Mod4+Super),
|
||||
// Super + Shift
|
||||
Redirect(key=<TAB>,mods=Control,clearmods=Mod4+Super)
|
||||
]
|
||||
};
|
||||
};
|
||||
partial xkb_symbols "mac_browsers_chromebook" {
|
||||
// Cycle App and In App Tab Switching
|
||||
replace key <TAB> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Tab,
|
||||
Tab,
|
||||
NoSymbol,
|
||||
NoSymbol,
|
||||
backslash,
|
||||
backslash,
|
||||
NoSymbol,
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
// Alt
|
||||
Redirect(key=<PGDN>,mods=Control,clearmods=Mod1),
|
||||
// Alt + Shift
|
||||
Redirect(key=<PGUP>,mods=Control,clearmods=Mod1+Shift),
|
||||
// Control
|
||||
Redirect(key=<BKSL>),
|
||||
// Control+Shift
|
||||
Redirect(key=<BKSL>),
|
||||
// Super
|
||||
NoAction(),
|
||||
// Super + Shift
|
||||
NoAction()
|
||||
]
|
||||
};
|
||||
//Up to Mac Home
|
||||
replace key <UP> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Up,
|
||||
Up,
|
||||
Up,
|
||||
Up,
|
||||
NoSymbol,
|
||||
NoSymbol,
|
||||
Up
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
// Wordwise
|
||||
RedirectKey(key=<UP>,clearmods=Mod1),
|
||||
RedirectKey(key=<UP>,clearmods=Mod1),
|
||||
RedirectKey(key=<HOME>),
|
||||
RedirectKey(key=<HOME>),
|
||||
// Wordwise - Sublime?
|
||||
RedirectKey(key=<PGUP>,clearmods=Super),
|
||||
RedirectKey(key=<UP>,modifiers=Mod1,clearmods=Super)
|
||||
]
|
||||
};
|
||||
// Down to Mac End
|
||||
replace key <DOWN> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Down,
|
||||
Down,
|
||||
Down,
|
||||
Down,
|
||||
NoSymbol,
|
||||
NoSymbol,
|
||||
Down
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
// Wordwise
|
||||
RedirectKey(key=<DOWN>,clearmods=Mod1),
|
||||
RedirectKey(key=<DOWN>,clearmods=Mod1),
|
||||
RedirectKey(key=<END>),
|
||||
RedirectKey(key=<END>),
|
||||
// Wordwise - Sublime?
|
||||
RedirectKey(key=<PGDN>,clearmods=Super),
|
||||
RedirectKey(key=<DOWN>,modifiers=Mod1,clearmods=Super)
|
||||
]
|
||||
};
|
||||
// Alt BKSP to DELETE
|
||||
replace key <BKSP> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
BackSpace,
|
||||
BackSpace,
|
||||
BackSpace
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<DELE>,clearmods=Mod1)
|
||||
]
|
||||
};
|
||||
};
|
||||
partial xkb_symbols "mac_browsers" {
|
||||
// Cycle App and In App Tab Switching
|
||||
key <FK13> { [ F13 ] };
|
||||
key <FK14> { [ F14 ] };
|
||||
replace key <TAB> {
|
||||
type[Group1]= "ONE_LEVEL_CMD",
|
||||
symbols[Group1]= [
|
||||
Tab,
|
||||
Tab,
|
||||
F14,
|
||||
F13,
|
||||
NoSymbol,
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
Redirect(key=<FK14>),
|
||||
Redirect(key=<FK13>),
|
||||
Redirect(key=<PGDN>,mods=Control,clearmods=Mod4+Super),
|
||||
Redirect(key=<PGUP>,mods=Control,clearmods=Mod4+Super+Shift)
|
||||
]
|
||||
};
|
||||
//Up to Mac Home
|
||||
replace key <UP> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Up,
|
||||
Up,
|
||||
Up,
|
||||
Up,
|
||||
NoSymbol,
|
||||
NoSymbol,
|
||||
Up
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
// Wordwise
|
||||
RedirectKey(key=<UP>,clearmods=Mod1),
|
||||
RedirectKey(key=<UP>,clearmods=Mod1),
|
||||
RedirectKey(key=<HOME>),
|
||||
RedirectKey(key=<HOME>),
|
||||
// Wordwise - Sublime?
|
||||
RedirectKey(key=<PGUP>,clearmods=Super),
|
||||
RedirectKey(key=<UP>,modifiers=Mod1,clearmods=Super)
|
||||
]
|
||||
};
|
||||
// Down to Mac End
|
||||
replace key <DOWN> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Down,
|
||||
Down,
|
||||
Down,
|
||||
Down,
|
||||
NoSymbol,
|
||||
NoSymbol,
|
||||
Down
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
// Wordwise
|
||||
RedirectKey(key=<DOWN>,clearmods=Mod1),
|
||||
RedirectKey(key=<DOWN>,clearmods=Mod1),
|
||||
RedirectKey(key=<END>),
|
||||
RedirectKey(key=<END>),
|
||||
// Wordwise - Sublime?
|
||||
RedirectKey(key=<PGDN>,clearmods=Super),
|
||||
RedirectKey(key=<DOWN>,modifiers=Mod1,clearmods=Super)
|
||||
]
|
||||
};
|
||||
// Alt BKSP to DELETE
|
||||
replace key <BKSP> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
BackSpace,
|
||||
BackSpace,
|
||||
BackSpace
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<DELE>,clearmods=Mod1)
|
||||
]
|
||||
};
|
||||
};
|
||||
partial xkb_symbols "mac_chrome" {
|
||||
// Back Button
|
||||
replace key <LEFT> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Left,
|
||||
Left,
|
||||
NoSymbol,
|
||||
NoSymbol,
|
||||
Left
|
||||
],
|
||||
actions[Group1]= [
|
||||
// Base
|
||||
NoAction(),
|
||||
// Shift
|
||||
NoAction(),
|
||||
// Alt
|
||||
RedirectKey(key=<FK18>),
|
||||
// Alt
|
||||
RedirectKey(key=<FK18>),
|
||||
// Control
|
||||
RedirectKey(key=<LEFT>,modifiers=Mod1,clearmods=Control)
|
||||
]
|
||||
};
|
||||
// Forwards Button
|
||||
replace key <RGHT> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
// Base
|
||||
Right,
|
||||
// Shift
|
||||
Right,
|
||||
// Alt
|
||||
NoSymbol,
|
||||
// Shift Alt
|
||||
NoSymbol,
|
||||
// Control
|
||||
Right
|
||||
],
|
||||
actions[Group1]= [
|
||||
// Base
|
||||
NoAction(),
|
||||
// Shift
|
||||
NoAction(),
|
||||
// Alt
|
||||
RedirectKey(key=<FK18>),
|
||||
// Shift Alt
|
||||
RedirectKey(key=<FK18>),
|
||||
// Control
|
||||
RedirectKey(key=<RGHT>,modifiers=Mod1,clearmods=Control)
|
||||
]
|
||||
};
|
||||
};
|
@@ -1,210 +0,0 @@
|
||||
default partial xkb_symbols "mac_apple" {
|
||||
key <LWIN> {
|
||||
repeat= no,
|
||||
type= "ONE_LEVEL",
|
||||
symbols[Group1]= [ Control_L ],
|
||||
actions[group1]=[ SetMods(modifiers=Control+Shift) ]
|
||||
};
|
||||
key <RWIN> {
|
||||
repeat= no,
|
||||
type= "ONE_LEVEL",
|
||||
symbols[Group1]= [ Control_R ],
|
||||
actions[group1]=[ SetMods(modifiers=Control+Shift) ]
|
||||
};
|
||||
};
|
||||
partial xkb_symbols "mac_win" {
|
||||
key <LALT> {
|
||||
repeat= no,
|
||||
type= "ONE_LEVEL",
|
||||
symbols[Group1]= [ Hyper_L ],
|
||||
actions[group1]=[ SetMods(modifiers=Shift+Control) ]
|
||||
};
|
||||
key <RALT> {
|
||||
repeat= no,
|
||||
type= "ONE_LEVEL",
|
||||
symbols[Group1]= [ Hyper_R ],
|
||||
actions[group1]=[ SetMods(modifiers=Shift+Control) ]
|
||||
};
|
||||
};
|
||||
partial xkb_symbols "mac_global" {
|
||||
// // Minimize Window Cmd + H = Alt+F9
|
||||
// replace key <AC06> {
|
||||
// type[Group1]= "ONE_LEVEL_CTRL",
|
||||
// symbols[Group1]= [
|
||||
// h,
|
||||
// H,
|
||||
// H
|
||||
// ],
|
||||
// actions[Group1]= [
|
||||
// NoAction(),
|
||||
// NoAction(),
|
||||
// RedirectKey(key=<AC06>,modifiers=Super,clearmods=Control+Shift)
|
||||
// ]
|
||||
// };
|
||||
|
||||
//
|
||||
// Some sort of glitch occurs on shifting F while this segment is active
|
||||
// it is like the Control key is being held down when it isn't.
|
||||
//
|
||||
// // Maximize Window Ctrl + Cmd + F = Alt+F10
|
||||
// replace key <AC04> {
|
||||
// type[Group1]= "ONE_LEVEL_CTRL",
|
||||
// symbols[Group1]= [
|
||||
// f,
|
||||
// F,
|
||||
// F
|
||||
// ],
|
||||
// actions[Group1]= [
|
||||
// // Base
|
||||
// NoAction(),
|
||||
// // Shift
|
||||
// NoAction(),
|
||||
// // Ctrl + Shift
|
||||
// RedirectKey(key=<FK10>,modifiers=Mod1,clearmods=Control+Shift)
|
||||
// ]
|
||||
// };
|
||||
|
||||
// Close App Cmd + Q = Alt + F4
|
||||
replace key <AD01> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
q,
|
||||
Q,
|
||||
F4
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<FK04>,modifiers=Mod1,clearmods=Control+Shift)
|
||||
]
|
||||
};
|
||||
|
||||
// Show Desktop Cmd + F3 = Super + D
|
||||
replace key <FK03> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
F3,
|
||||
F3,
|
||||
D
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<AC03>,modifiers=Super,clearmods=Control+Shift)
|
||||
]
|
||||
};
|
||||
|
||||
// Cycle App and In App Tab Switching
|
||||
key <FK13> { [ F13 ] };
|
||||
key <FK14> { [ F14 ] };
|
||||
|
||||
replace key <TAB> {
|
||||
type[Group1]= "ONE_LEVEL_CMD",
|
||||
symbols[Group1]= [
|
||||
Tab,
|
||||
Tab,
|
||||
// F13 // Default cmdtab
|
||||
// F13 // KDE cmdtab
|
||||
// Right // Elementary ecmdtab
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
// Redirect(key=<FK13>) // Default cmdtab
|
||||
// Redirect(key=<FK13>,clearmods=Shift) // KDE cmdtab
|
||||
// Redirect(key=<RGHT>,mods=Control+Shift,clearmods=Mod4+Super) // Elementary cmdtab
|
||||
]
|
||||
};
|
||||
|
||||
// Page Up
|
||||
replace key <UP> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Up,
|
||||
Up,
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<PGUP>,clearmods=Shift+Control)
|
||||
]
|
||||
};
|
||||
|
||||
// Page Down
|
||||
replace key <DOWN> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Down,
|
||||
Down,
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<PGDN>,clearmods=Shift+Control)
|
||||
]
|
||||
};
|
||||
// HOME
|
||||
replace key <LEFT> {
|
||||
type[Group1]= "ONE_LEVEL_CMD",
|
||||
symbols[Group1]= [
|
||||
Left,
|
||||
Left,
|
||||
NoSymbol,
|
||||
Left
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<HOME>,clearmods=Shift+Control),
|
||||
RedirectKey(key=<LEFT>,mods=Super,clearmods=Control)
|
||||
]
|
||||
};
|
||||
// END
|
||||
replace key <RGHT> {
|
||||
type[Group1]= "ONE_LEVEL_CMD",
|
||||
symbols[Group1]= [
|
||||
Right,
|
||||
Right,
|
||||
NoSymbol,
|
||||
Right
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<END>,clearmods=Shift+Control),
|
||||
RedirectKey(key=<RGHT>,mods=Super,clearmods=Control)
|
||||
]
|
||||
};
|
||||
// Full Print Screen
|
||||
// Standard Ubuntu
|
||||
replace key <AE03> {
|
||||
type[Group1]= "ONE_LEVEL_CMD",
|
||||
symbols[Group1]= [
|
||||
3,
|
||||
numbersign,
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<PRSC>,clearmods=Shift+Control)
|
||||
]
|
||||
};
|
||||
// Region Print Screen
|
||||
// Standard Ubuntu
|
||||
replace key <AE04> {
|
||||
type[Group1]= "ONE_LEVEL_CMD",
|
||||
symbols[Group1]= [
|
||||
4,
|
||||
dollar,
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<PRSC>,clearmods=Control)
|
||||
]
|
||||
};
|
||||
};
|
@@ -1,100 +0,0 @@
|
||||
default partial xkb_symbols "mac_levelssym" {
|
||||
key <LALT> {
|
||||
repeat= no,
|
||||
type= "ONE_LEVEL",
|
||||
symbols[Group1]= [ Hyper_L ],
|
||||
actions[group1]=[ SetMods(modifiers=Shift+Control) ]
|
||||
};
|
||||
key <RALT> {
|
||||
repeat= no,
|
||||
type= "ONE_LEVEL",
|
||||
symbols[Group1]= [ Hyper_R ],
|
||||
actions[group1]=[ SetMods(modifiers=Shift+Control) ]
|
||||
};
|
||||
// Page Up
|
||||
replace key <UP> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Up,
|
||||
Up,
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<PGUP>,clearmods=Shift+Control)
|
||||
]
|
||||
};
|
||||
// Page Down
|
||||
replace key <DOWN> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Down,
|
||||
Down,
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<PGDN>,clearmods=Shift+Control)
|
||||
]
|
||||
};
|
||||
// HOME
|
||||
replace key <LEFT> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Left,
|
||||
Left,
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<HOME>,clearmods=Shift+Control)
|
||||
]
|
||||
};
|
||||
// END
|
||||
replace key <RGHT> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
Right,
|
||||
Right,
|
||||
NoSymbol
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<END>,clearmods=Shift+Control)
|
||||
]
|
||||
};
|
||||
// Full Print Screen
|
||||
// GalliumOS
|
||||
replace key <AE03> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
3,
|
||||
numbersign,
|
||||
F5
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<FK05>,clearmods=Shift)
|
||||
]
|
||||
};
|
||||
// Region Print Screen
|
||||
// GalliumOS
|
||||
replace key <AE04> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [
|
||||
4,
|
||||
dollar,
|
||||
F5
|
||||
],
|
||||
actions[Group1]= [
|
||||
NoAction(),
|
||||
NoAction(),
|
||||
RedirectKey(key=<FK05>)
|
||||
]
|
||||
};
|
||||
};
|
@@ -1,53 +0,0 @@
|
||||
default partial xkb_types "addmac_levels" {
|
||||
Virtual_modifiers Super;
|
||||
type "ONE_LEVEL_CTRL" {
|
||||
modifiers = Shift+Mod1+Super+Control;
|
||||
map[Shift] = Level2;
|
||||
map[Mod1] = Level3;
|
||||
map[Shift+Mod1] = Level4;
|
||||
map[Control] = Level5;
|
||||
map[Shift+Control] = Level6;
|
||||
map[Super] = Level7;
|
||||
map[Shift+Super] = Level8;
|
||||
map[Mod1+Control] = 9;
|
||||
map[Super+Control] = 10;
|
||||
map[Super+Mod1] = 11;
|
||||
map[Super+Mod1+Control] = 12;
|
||||
level_name[Level1] = "Base";
|
||||
level_name[Level2] = "Shift";
|
||||
level_name[Level3] = "Alt";
|
||||
level_name[Level4] = "Shift Alt";
|
||||
level_name[Level5] = "Control";
|
||||
level_name[Level6] = "Shift Control";
|
||||
level_name[Level7] = "Super";
|
||||
level_name[Level8] = "Shift Super";
|
||||
level_name[9] = "Control Alt";
|
||||
level_name[10] = "Super Control";
|
||||
level_name[11] = "Super Alt";
|
||||
level_name[12] = "Super Control Alt";
|
||||
};
|
||||
type "ONE_LEVEL_CMD" {
|
||||
modifiers = Shift+Control+Super;
|
||||
map[Shift] = Level2;
|
||||
map[Shift+Control] = Level3;
|
||||
map[Control] = Level4;
|
||||
map[Super] = Level5;
|
||||
map[Shift+Super] = Level6;
|
||||
level_name[Level1] = "Base";
|
||||
level_name[Level2] = "Shift";
|
||||
level_name[Level3] = "Control Shift";
|
||||
level_name[Level4] = "Control";
|
||||
level_name[Level5] = "Super";
|
||||
level_name[Level6] = "Super Shift";
|
||||
};
|
||||
type "ONE_LEVEL_SUPER" {
|
||||
modifiers = Shift+Super;
|
||||
map[Shift] = Level2;
|
||||
map[Super] = Level3;
|
||||
map[Shift+Super] = Level4;
|
||||
level_name[Level1] = "Base";
|
||||
level_name[Level2] = "Shift";
|
||||
level_name[Level3] = "Super";
|
||||
level_name[Level4] = "Super Shift";
|
||||
};
|
||||
};
|
@@ -1,53 +0,0 @@
|
||||
default partial xkb_types "addmac_levels" {
|
||||
Virtual_modifiers Super;
|
||||
type "ONE_LEVEL_CTRL" {
|
||||
modifiers = Shift+Mod1+Super+Control;
|
||||
map[Shift] = Level2;
|
||||
map[Shift+Control] = Level3;
|
||||
// map[Mod1] = Level4;
|
||||
map[Shift+Mod1] = Level5;
|
||||
map[Control] = Level6;
|
||||
map[Super] = Level7;
|
||||
map[Shift+Super] = Level8;
|
||||
map[Mod1+Control] = 9;
|
||||
map[Super+Control] = 10;
|
||||
map[Super+Mod1] = 11;
|
||||
map[Super+Mod1+Control] = 12;
|
||||
level_name[Level1] = "Base";
|
||||
level_name[Level2] = "Shift";
|
||||
level_name[Level3] = "Shift Control";
|
||||
// level_name[Level4] = "Alt";
|
||||
level_name[Level5] = "Shift Alt";
|
||||
level_name[Level6] = "Control";
|
||||
level_name[Level7] = "Super";
|
||||
level_name[Level8] = "Shift Super";
|
||||
level_name[9] = "Control Alt";
|
||||
level_name[10] = "Super Control";
|
||||
level_name[11] = "Super Alt";
|
||||
level_name[12] = "Super Control Alt";
|
||||
};
|
||||
type "ONE_LEVEL_CMD" {
|
||||
modifiers = Shift+Control+Super;
|
||||
map[Shift] = Level2;
|
||||
map[Shift+Control] = Level3;
|
||||
map[Control] = Level4;
|
||||
map[Super] = Level5;
|
||||
map[Shift+Super] = Level6;
|
||||
level_name[Level1] = "Base";
|
||||
level_name[Level2] = "Shift";
|
||||
level_name[Level3] = "Control Shift";
|
||||
level_name[Level4] = "Control";
|
||||
level_name[Level5] = "Super";
|
||||
level_name[Level6] = "Super Shift";
|
||||
};
|
||||
type "ONE_LEVEL_SUPER" {
|
||||
modifiers = Shift+Super;
|
||||
map[Shift] = Level2;
|
||||
map[Super] = Level3;
|
||||
map[Shift+Super] = Level4;
|
||||
level_name[Level1] = "Base";
|
||||
level_name[Level2] = "Shift";
|
||||
level_name[Level3] = "Super";
|
||||
level_name[Level4] = "Super Shift";
|
||||
};
|
||||
};
|
253
README.md
@@ -5,22 +5,174 @@
|
||||
|
||||
[](https://github.com/rbreaves/kinto/releases/latest)
|
||||
|
||||
\- Type in Linux & Windows like it's a Mac. \-
|
||||
\- Linux & Windows with Mac-style shortcut keys. \-
|
||||
|
||||
Seamless copy and paste with all apps and terminals. The zero effort solution.
|
||||
|
||||
v1.2 Release - Kinto now includes a system tray and simple wizard to setup the install with minimal effort.
|
||||
|
||||
Kinto is powered by [xkeysnail](https://github.com/mooz/xkeysnail) for Linux & by [Autohotkey](https://github.com/Lexikos/AutoHotkey_L) for Windows 10.
|
||||
|
||||
### [Table of Contents ](#Table-of-Contents)
|
||||
|
||||
## Donations
|
||||
|
||||
If you like or appreciate this project then please consider donating.
|
||||
|
||||
|**Wishlists**|[Amazon](https://smile.amazon.com/hz/wishlist/ls/3EVXR21VFKD9Z?ref_=wl_share)|[Adafruit](https://www.adafruit.com/wishlists/515932)|[eBay](https://www.ebay.com/mye/myebay/WatchList?custom_list_id=636668138019)|
|
||||
|---|---|---|---|
|
||||
|
||||
If you would like to send me a keyboard directly then please reach out to me over [twitter](https://twitter.com/gbit86) and send me a DM.
|
||||
|
||||
## How to install (Linux)
|
||||
|
||||
Video Tutorial: [Install Kinto.sh for Linux in less than a minute](https://www.youtube.com/watch?v=kd4al45XD1g)
|
||||
|
||||
[Linux Requirements](#What-does-Kinto-require)
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/10969616/97070698-179c4500-15a0-11eb-8064-c03aa7f4d4a5.png" width="75%">
|
||||
|
||||
1. clone this repo
|
||||
```
|
||||
git clone https://github.com/rbreaves/kinto.git
|
||||
cd kinto
|
||||
```
|
||||
2. Install python3 (If needed)
|
||||
|
||||
Debian or Ubuntu 16.04 or 18.04
|
||||
```
|
||||
sudo apt update
|
||||
sudo apt install python3
|
||||
```
|
||||
|
||||
3. Run the script, press 1 or 2 keys and you are done.
|
||||
```
|
||||
./setup.py
|
||||
```
|
||||
|
||||
**Troubleshoot**
|
||||
|
||||
If the wizard does not appear then either type in "kinto.sh" in your application overview search bar or run this following command.
|
||||
```
|
||||
~/.config/kinto/gui/kinto-gui.py
|
||||
```
|
||||
|
||||
**Issues with Numpad?**
|
||||
|
||||
Try toggling numlock on & off (clear key on official mac keyboards). If it still does not work then restart the Kinto service and try toggling the numlock/clear key again, it will likely work after that. #369
|
||||
|
||||
**Uninstall Kinto**
|
||||
|
||||
```
|
||||
./setup.py -r
|
||||
```
|
||||
|
||||
**Other tips**
|
||||
|
||||
If you want a global menu app similar to what mac users have then I strongly recommend Ubuntu Budgie as it has the Vala Appmenu built in and ready for activation. Short of that Vala-AppMenu can be installed in various distros, mileage will vary. If you try to activate it in the latest 20.xx releases with XFCE then you may need to run the following commands.
|
||||
|
||||
```
|
||||
sudo apt install xfce4-appmenu-plugin vala-panel-appmenu-common
|
||||
xfconf-query -c xsettings -p /Gtk/Modules -n -t string -s "appmenu-gtk-module"
|
||||
```
|
||||
|
||||
## How to Install (Windows)
|
||||
|
||||
Video Tutorial: [How to Install Kinto.sh on Windows 10](https://youtu.be/sRk8A8krz40)
|
||||
|
||||
[Windows 10 Requirements](#Kinto-for-Windows-10-Requirements)
|
||||
|
||||
1. Open Powershell (Right click and Run as Administrator)
|
||||
|
||||
2. clone this repo
|
||||
```
|
||||
git clone https://github.com/rbreaves/kinto.git
|
||||
cd kinto
|
||||
```
|
||||
3. Install - Select keyboard type
|
||||
```
|
||||
py setup.py
|
||||
```
|
||||
|
||||
4. How to make Kinto stay visible in system tray (optional)
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/10969616/85195077-2f338c00-b295-11ea-8aa3-e6aa06a9a279.png" width="50%" height="50%">
|
||||
<img src="https://user-images.githubusercontent.com/10969616/85195079-30fd4f80-b295-11ea-8bcd-257990b77dcb.png" width="50%" height="50%">
|
||||
<img src="https://user-images.githubusercontent.com/10969616/85195082-322e7c80-b295-11ea-8c81-320dab424c3c.png" width="50%" height="50%">
|
||||
|
||||
**Uninstall Kinto**
|
||||
|
||||
```
|
||||
py setup.py
|
||||
```
|
||||
|
||||
Select Uninstall
|
||||
|
||||
## How to use in Remote Desktop Solutions
|
||||
|
||||
RDP fully works as long as the entire keyboard input is being captured. RDP had been working for awhile with Windows but as of 2/14/2021 Linux is now supported and potentially macOS as well. VNC & other protocols may work, but is likely most dependent on how the keyboard input is captured on the computer running the client.
|
||||
|
||||
|Program|Src/Remote Client ⇒|Dst/Remote Server|Works? |Notes|
|
||||
|---|---|---|---|---|
|
||||
|Official MS RDP (mstsc.exe)| ❖Windows ⇒| ❖Windows | ✅ Yes| |
|
||||
|Official MS RDP| ChromeOS 87+⇒| ❖Windows | ✅ Yes|May work on earlier versions as well, if they support Android apps|
|
||||
|Remmina| 🐧Linux*/ChromeOS 87+⇒| ❖Windows | ✅ Yes|*Use hover menu to enable "Grab all keyboard events"|
|
||||
|FreeRDP| 🐧Linux/ChromeOS 87+⇒| ❖Windows | ✅ Yes | |
|
||||
|FreeRDP| 🍎macOS⇒| ❖Windows | ✅ Yes| [FreeRDP for macOS](#FreeRDP-for-macOS)|
|
||||
|Remote Desktop Manager Free|🍎iOS⇒| ❖Windows | ✅ Yes| |
|
||||
|Jump Desktop (RDP)| 🍎macOS*/iOS ⇒| ❖Windows | ✅ Yes|*Preferences -> Keyboard -> Disable "Key Conversions", Enabled "Send macOS Shortcuts" under Keyboard shortcuts|
|
||||
|Official MS RDP| 🍎macOS⇒| ❖Windows | ❌ No|Initial Cmd key press not being passed|
|
||||
|Remote Desktop Manager Free| 🍎macOS⇒| ❖Windows | ❌ No|Initial Cmd key press not being passed|
|
||||
|Royal TSX Client| 🍎macOS⇒| ❖Windows | ❌ No|Initial Cmd key press not being passed|
|
||||
|Official MS RDP| 🍎🤖iOS/Android⇒| ❖Windows | ❌ No|No workaround atm|
|
||||
|
||||
## FreeRDP for macOS
|
||||
|
||||
1. Install [brew.sh](https://brew.sh).
|
||||
|
||||
```/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"```
|
||||
|
||||
2. Install XQuartz (x11/xorg)
|
||||
|
||||
```brew install --cask xquartz```
|
||||
|
||||
3. log off and back on.
|
||||
4. Install FreeRDP
|
||||
|
||||
```brew install freerdp```
|
||||
|
||||
5. Disable [NLA](https://kb.parallels.com/en/123661), if it is enabled on the destination.
|
||||
6. Run command to access machine
|
||||
Note: 192.168.x.x = Your IP.
|
||||
|
||||
```xfreerdp /u:your_username /v:192.168.x.x /cert-ignore /auto-reconnect-max-retries:0 /f +clipboard -decorations```
|
||||
|
||||
7. Click on XQuartz -> Preferences and set these checkmarks so that fullscreen can work, may need to quit it and re-run the xfreerdp command from step 6.
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/10969616/108144025-68bfcf80-708e-11eb-96cc-2930b7b1694a.png" width="50%">
|
||||
|
||||
More info here
|
||||
https://medium.com/idomongodb/macos-rdp-to-a-windows-machine-1e0f52f777b
|
||||
|
||||
## Jump Desktop for macOS
|
||||
|
||||
Screenshots of how to configure Jump Desktop for macOS users accessing a Windows PC with Kinto installed. I apologize that it is not a free RDP client - BUT it does work, and at $15 it is reasonable if you plan to use it frequently.
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/10969616/107990246-a2fb7500-6f99-11eb-8c19-0a9b538b996f.png" width="25%">
|
||||
<img src="https://user-images.githubusercontent.com/10969616/107990265-a8f15600-6f99-11eb-9922-bbcfa0b92031.png" width="50%">
|
||||
<img src="https://user-images.githubusercontent.com/10969616/107990256-a68efc00-6f99-11eb-9f31-575ed6016944.png" width="50%">
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
[What does this do exactly?](#What-does-this-do-exactly)
|
||||
|
||||
[What's different from other remappers?](#Whats-different)
|
||||
|
||||
[How to install (Linux)](#How-to-install-Linux)
|
||||
|
||||
[How to install (Windows)](#How-to-install-Windows)
|
||||
|
||||
[What does this do exactly?](#What-does-this-do-exactly)
|
||||
|
||||
[What's different from other remappers?](#Whats-different)
|
||||
|
||||
[What does Kinto require?](#What-does-Kinto-require)
|
||||
|
||||
[Shortcut Creation](#Shortcut-Creation)
|
||||
@@ -71,71 +223,6 @@ If your OS and macOS have similar functionality on the system level, but only di
|
||||
|
||||
Additionally, if you are using a cross-platform app and if it happens to have a few shortcut keys that differ then that can very easily be added to either the kinto.py or kinto.ahk configuration files which on Windows is located here `~/.kinto/kinto.ahk` and on Linux it can be found here `~/.config/kinto/kinto.py`. More info can be found here [Shortcut Creation](#Shortcut-Creation)
|
||||
|
||||
## How to install (Linux)
|
||||
|
||||
Video Tutorial: [Install Kinto.sh for Linux in less than a minute](https://www.youtube.com/watch?v=kd4al45XD1g)
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/10969616/97070698-179c4500-15a0-11eb-8064-c03aa7f4d4a5.png" width="75%">
|
||||
|
||||
1. clone this repo
|
||||
```
|
||||
git clone https://github.com/rbreaves/kinto.git
|
||||
cd kinto
|
||||
```
|
||||
2. Install python3 (If needed)
|
||||
|
||||
Debian or Ubuntu 16.04 or 18.04
|
||||
```
|
||||
sudo apt update
|
||||
sudo apt install python3
|
||||
```
|
||||
|
||||
3. Run the script, press 1 or 2 keys and you are done.
|
||||
```
|
||||
./setup.py
|
||||
```
|
||||
|
||||
Troubleshoot
|
||||
|
||||
If the wizard does not appear then either type in "kinto.sh" in your application overview search bar or run this following command.
|
||||
```
|
||||
~/.config/kinto/gui/kinto-gui.py
|
||||
```
|
||||
|
||||
To Uninstall Kinto
|
||||
|
||||
```
|
||||
./setup.py -r
|
||||
```
|
||||
|
||||
## How to Install (Windows)
|
||||
|
||||
Video Tutorial: [How to Install Kinto.sh on Windows 10](https://youtu.be/sRk8A8krz40)
|
||||
|
||||
1. Open Powershell (Right click and Run as Administrator)
|
||||
|
||||
2. clone this repo
|
||||
```
|
||||
git clone https://github.com/rbreaves/kinto.git
|
||||
cd kinto
|
||||
```
|
||||
3. Install - Select keyboard type
|
||||
```
|
||||
py setup.py
|
||||
```
|
||||
|
||||
4. How to make Kinto stay visible in system tray (optional)
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/10969616/85195077-2f338c00-b295-11ea-8aa3-e6aa06a9a279.png" width="50%" height="50%">
|
||||
<img src="https://user-images.githubusercontent.com/10969616/85195079-30fd4f80-b295-11ea-8bcd-257990b77dcb.png" width="50%" height="50%">
|
||||
<img src="https://user-images.githubusercontent.com/10969616/85195082-322e7c80-b295-11ea-8c81-320dab424c3c.png" width="50%" height="50%">
|
||||
|
||||
To Uninstall Kinto - Select Uninstall
|
||||
|
||||
```
|
||||
py setup.py
|
||||
```
|
||||
|
||||
## What does Kinto require?
|
||||
|
||||
- Python
|
||||
@@ -155,6 +242,9 @@ Other programs that will be installed when you run ./setup.py
|
||||
- Strawberry Perl
|
||||
|
||||
Note: Sublime Text users should disable screen rotation hotkeys as they will interfere with multi-cursor and possibly other combos. See https://windowsloop.com/disable-screen-rotation-keyboard-shortcut/ for details.
|
||||
|
||||
You may also want to disable the Xbox Game Bar so that Win+G or other shortcuts will not interfer with any of your remaps. Start menu -> Game bar shortcuts -> toggle Off.
|
||||
|
||||
## Shortcut Creation
|
||||
|
||||
[Linux Shortcut Creation (Xkeysnail)](#Linux-Xkeysnail)
|
||||
@@ -339,10 +429,26 @@ I'd appreciate any help from people with non-US based keyboards, to help ensure
|
||||
|
||||
Yet another keyboard remapping tool for X environment
|
||||
|
||||
[libinput-gestures](https://github.com/bulletmark/libinput-gestures)
|
||||
Three finger gesture or other type of gestures for desktop switching or other features within a Linux distro. More info here for quickly setting it up. Make sure you logoff after setting your user to access input. https://www.reddit.com/r/GalliumOS/comments/5lgrxe/psa_multitouch_gestures_on_galliumos/
|
||||
|
||||
[Interception](https://gitlab.com/interception/linux/tools)
|
||||
|
||||
Another low level key remapper, not as easily configurable as Xkeysnail, but does not rely on X11.
|
||||
|
||||
[Wincent](https://github.com/wincent/wincent) by Greg Hurrell
|
||||
|
||||
Dot files and configurations that may help those that want mac-style shortcut keys that work under Wayland, or w/o x11.
|
||||
[Vim #102: macOS keyboard bindings on Linux](https://www.youtube.com/watch?v=TBqTHesnzkI)
|
||||
|
||||
[mac-precision-touchpad](https://github.com/imbushuo/mac-precision-touchpad) by imbushuo
|
||||
|
||||
Windows 10 touchpad to precision touchpad driver
|
||||
|
||||
[macOS-cursors-for-Windows](https://github.com/antiden/macOS-cursors-for-Windows) by antiden
|
||||
|
||||
macOS cursors for Windows
|
||||
|
||||
[fusuma](https://github.com/iberianpig/fusuma) by iberianpig
|
||||
|
||||
Multitouch gestures with libinput driver on Linux
|
||||
@@ -351,10 +457,11 @@ Multitouch gestures with libinput driver on Linux
|
||||
|
||||
Linux driver for Facetime HD on macbooks
|
||||
|
||||
[Fluent Terminal - Windows only](https://github.com/felixse/FluentTerminal) by felixse
|
||||
[Windows Terminal Preview](https://aka.ms/terminal-preview) by Microsoft
|
||||
|
||||
The best Terminal app built for Windows hands down. I have tried countless, but this one actually seems to get everything right, despite the lack of a GUI to configure all aspects of the program. Custom configurations have to be done via a json file - but given the performance and feature set I feel like it is the a decent trade off.
|
||||
|
||||
A Terminal Emulator based on UWP and web technologies.
|
||||
I will update Kinto to have custom configurations for this specific Terminal in the future. Will make seamless copy & paste, which already works, work even better (Cmd-C can still trigger sigint - but there is a fix for that that involves updating the json config).
|
||||
|
||||
[PowerToys - Windows only](https://github.com/microsoft/PowerToys) by microsoft
|
||||
|
||||
@@ -404,7 +511,7 @@ Dark & Light Theme w/ OSX controls for Elementary OS
|
||||
|
||||
Auto-detect the connected display hardware and load the appropriate X11 setup using xrandr
|
||||
|
||||
[Barrier](https://github.com/debauchee/barrier) by debauchee
|
||||
[Barrier](https://github.com/debauchee/barrier) by debauchee (Note: Does not appear to work with Kinto v1.2+, may work w/ Kinto v1.1?)
|
||||
|
||||
Open-source KVM software
|
||||
|
||||
|
@@ -1,86 +0,0 @@
|
||||
{"defaultapps":[{
|
||||
"name":"term",
|
||||
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty" ]
|
||||
}],
|
||||
"defaulttypes":["windows","mac","chromebook"],
|
||||
"defaults":[{
|
||||
"id": 1,
|
||||
"name":"Windows",
|
||||
"type":"windows",
|
||||
"active": false,
|
||||
"description":"Standard Windows 104 Keyboards",
|
||||
"gui":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen",
|
||||
"term":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY 2>&1 | grep -v XF86FullScreen",
|
||||
"xkb_symbols_gui":"+altwin(ctrl_alt_win)+mac_gui(mac_levelssym)+mac_gui(mac_appcycle)",
|
||||
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term(mac_win)+mac_term(mac_global)",
|
||||
"xkb_types_gui":"+mac_gui(addmac_levels)",
|
||||
"xkb_types_term":"+mac_term(addmac_levels)"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name":"Mac - hid driver (Recommended - Also supports Windows keyboards)",
|
||||
"type":"mac",
|
||||
"active": false,
|
||||
"description":"Standard Mac Keyboards with Apple driver",
|
||||
"gui":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen",
|
||||
"term":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY 2>&1 | grep -v XF86FullScreen",
|
||||
"xkb_symbols_gui":"+altwin(ctrl_alt_win)+mac_gui(mac_levelssym)+mac_gui(mac_appcycle)",
|
||||
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term(mac_win)+mac_term(mac_global)",
|
||||
"xkb_types_gui":"+mac_gui(addmac_levels)",
|
||||
"xkb_types_term":"+mac_term(addmac_levels)",
|
||||
"hack": "echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd;echo 'options hid_apple swap_opt_cmd=1' | sudo tee -a /etc/modprobe.d/hid_apple.conf;sudo update-initramfs -u -k all"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name":"Mac Only (VMs & non-official Apple keyboards)",
|
||||
"type":"mac",
|
||||
"active": true,
|
||||
"description":"Standard Mac Keyboards",
|
||||
"gui":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen",
|
||||
"term":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY 2>&1 | grep -v XF86FullScreen",
|
||||
"xkb_symbols_gui":"+ctrl(swap_lwin_lctl)+ctrl(swap_rwin_rctl)+mac_gui(mac_levelssym)+mac_gui(mac_appcycle)",
|
||||
"xkb_symbols_term":"+altwin(alt_super_win)+mac_term(mac_apple)+mac_term(mac_global)",
|
||||
"xkb_types_gui":"+mac_gui(addmac_levels)",
|
||||
"xkb_types_term":"+mac_term(addmac_levels)"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"name":"Chromebook (xfce)",
|
||||
"type":"chromebook",
|
||||
"active": false,
|
||||
"description":"Standard Chromebook Keyboards",
|
||||
"gui":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen",
|
||||
"term":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY 2>&1 | grep -v XF86FullScreen",
|
||||
"xkb_symbols_gui":"+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)+mac_gui(mac_appcycle_chromebook)",
|
||||
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term_chromebook(mac_levelssym)",
|
||||
"xkb_types_gui":"+mac_gui(addmac_levels)",
|
||||
"xkb_types_term":"+mac_term(addmac_levels)"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"name":"Chromebook (xfce) - Windows",
|
||||
"type":"chromebook",
|
||||
"active": false,
|
||||
"description":"Chromebook with Windows 104 Keyboard",
|
||||
"gui":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen; setxkbmap -device $usbid -option altwin:ctrl_alt_win",
|
||||
"term":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY 2>&1 | grep -v XF86FullScreen",
|
||||
"fallbackgui":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen",
|
||||
"xkb_symbols_gui":"+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)+mac_gui(mac_appcycle_chromebook)",
|
||||
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term_chromebook(mac_levelssym)",
|
||||
"xkb_types_gui":"+mac_gui(addmac_levels)",
|
||||
"xkb_types_term":"+mac_term(addmac_levels)"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"name":"Chromebook (xfce) - Mac",
|
||||
"type":"chromebook",
|
||||
"active": false,
|
||||
"description":"Chromebook with Mac Keyboard",
|
||||
"gui":"setxkbmap -option;setxkbmap -option ctrl:swap_lwin_lctl; xkbcomp -w0 -i $internalid -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen",
|
||||
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY 2>&1 | grep -v XF86FullScreen",
|
||||
"xkb_symbols_gui":"+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)+mac_gui(mac_appcycle_chromebook)",
|
||||
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term_chromebook(mac_levelssym)",
|
||||
"xkb_types_gui":"+mac_gui(addmac_levels)",
|
||||
"xkb_types_term":"+mac_term(addmac_levels)"
|
||||
}]
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
systemctl --user stop keyswap >/dev/null 2>&1
|
||||
systemctl --user disable keyswap >/dev/null 2>&1
|
||||
systemctl --user stop keyswap.timer >/dev/null 2>&1
|
||||
systemctl --user disable keyswap.timer >/dev/null 2>&1
|
||||
mkdir -p ~/.config/systemd/user
|
||||
mkdir -p ~/.config/autostart
|
||||
cp ./system-config/keyswap.service ~/.config/systemd/user/keyswap.service
|
||||
cp ./system-config/kinto.desktop ~/.config/autostart/kinto.desktop
|
||||
cp ./system-config/keyswap.timer ~/.config/systemd/user/keyswap.timer
|
||||
cp ./kintox11/binary/kintox11 ~/.config/kinto/kintox11
|
||||
cp ./system-config/xactive.sh ~/.config/kinto/xactive.sh
|
||||
cp ./system-config/caret_status.sh ~/.config/kinto/caret_status.sh
|
||||
cp ./system-config/cleanup.sh ~/.config/kinto/cleanup.sh
|
||||
cp ./system-config/.firefox-nw ~/.config/kinto/.firefox-nw
|
||||
sed -i "s/{username}/`whoami`/g" ~/.config/systemd/user/keyswap.service
|
||||
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/systemd/user/keyswap.service
|
||||
# if [ "${#DISPLAY}" -gt 2 ]
|
||||
# then
|
||||
sed -i "s/#Environment/Environment/g" ~/.config/systemd/user/keyswap.service
|
||||
# fi
|
||||
systemctl --user daemon-reload
|
||||
sed -i "s/ExecStart=/ExecStart=${swapcmd}/g" ~/.config/systemd/user/keyswap.service
|
||||
systemctl --user enable keyswap.timer
|
||||
systemctl --user start keyswap
|
@@ -1,5 +0,0 @@
|
||||
CFLAGS=-g $(shell pkg-config --cflags json-c xmu)
|
||||
LDFLAGS=-g $(shell pkg-config --libs json-c xmu)
|
||||
|
||||
all:
|
||||
$(CC) kintox11.c $(CFLAGS) $(LDFLAGS) -lm -lpthread -o kintox11
|
@@ -1,694 +0,0 @@
|
||||
// -*- coding:utf-8-unix; mode:c; -*-
|
||||
// Kinto x11 command line
|
||||
/*
|
||||
Reference material
|
||||
get the active window on X window system
|
||||
http://k-ui.jp/blog/2012/05/07/get-active-window-on-x-window-system/
|
||||
*/
|
||||
// To compile without static libraries
|
||||
// gcc kintox11.c -lX11 -lXmu -ljson-c
|
||||
//
|
||||
// To compile with static library json-c
|
||||
// Make sure archive with object files exist ar -t /usr/local/lib/libjson-c.a
|
||||
// gcc -L/usr/local/lib/ kintox11.c -ljson-c -lXmu -lXt -lX11 -O2 -o kintox11
|
||||
//
|
||||
|
||||
#define _GNU_SOURCE 1
|
||||
#include <pthread.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <X11/Xlib.h> // `apt-get install libx11-dev`
|
||||
#include <X11/Xmu/WinUtil.h> // `apt-get install libxmu-dev`
|
||||
#include <json-c/json.h> // `apt install libjson-c-dev`
|
||||
#include <sys/select.h>
|
||||
#include <math.h>
|
||||
#include <sys/time.h>
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#elif _POSIX_C_SOURCE >= 199309L
|
||||
#include <time.h> // for nanosleep
|
||||
#else
|
||||
#include <unistd.h> // for usleep
|
||||
#endif
|
||||
|
||||
const char *eventNames[34] = {"None","KeyPress","KeyRelease","ButtonPress","ButtonRelease","MotionNotify","EnterNotify","LeaveNotify","FocusIn","FocusOut","KeymapNotify","Expose","GraphicsExpose","NoExpose","VisibilityNotify","CreateNotify","DestroyNotify","UnmapNotify","MapNotify","MapRequest","ReparentNotify","ConfigureNotify","ConfigureRequest","ResizeRequest","CirculateNotify","CirculateRequest","PropertyNotify","SelectionClear","SelectionRequest","SelectionNotify","ColormapNotify","ClientMessage","MappingNotify"};
|
||||
|
||||
#define NUM_THREADS 2
|
||||
typedef struct threadArgs * ThreadArgs;
|
||||
struct threadArgs{
|
||||
char *run_onInput;
|
||||
char *run_offInput;
|
||||
};
|
||||
|
||||
long long timeInMilliseconds(void) {
|
||||
struct timeval tv;
|
||||
|
||||
gettimeofday(&tv,NULL);
|
||||
return (((long long)tv.tv_sec)*1000)+(tv.tv_usec/1000);
|
||||
}
|
||||
|
||||
bool debug;
|
||||
bool input_check = 0;
|
||||
long long int event_ts;
|
||||
int last_event;
|
||||
|
||||
Display* d;
|
||||
Window w;
|
||||
XEvent e;
|
||||
|
||||
// cross-platform sleep function
|
||||
void sleep_ms(int milliseconds) {
|
||||
#ifdef WIN32
|
||||
Sleep(milliseconds);
|
||||
#elif _POSIX_C_SOURCE >= 199309L
|
||||
struct timespec ts;
|
||||
ts.tv_sec = milliseconds / 1000;
|
||||
ts.tv_nsec = (milliseconds % 1000) * 1000000;
|
||||
nanosleep(&ts, NULL);
|
||||
#else
|
||||
usleep(milliseconds * 1000);
|
||||
#endif
|
||||
}
|
||||
|
||||
char *trimwhitespace(char *str){
|
||||
char *end;
|
||||
// Trim leading space
|
||||
while(isspace((unsigned char)*str)) str++;
|
||||
if(*str == 0) // All spaces?
|
||||
return str;
|
||||
// Trim trailing space
|
||||
end = str + strlen(str) - 1;
|
||||
while(end > str && isspace((unsigned char)*end)) end--;
|
||||
// Write new null terminator character
|
||||
end[1] = '\0';
|
||||
return str;
|
||||
}
|
||||
|
||||
int check_caret(){
|
||||
int caretint;
|
||||
char * fpname;
|
||||
fpname = malloc(sizeof(char)*20);
|
||||
strcpy(fpname,"/tmp/kinto/caret");
|
||||
if( access( fpname, F_OK ) != -1 ) {
|
||||
char *buffer = NULL;
|
||||
size_t size = 0;
|
||||
FILE *fp = fopen(fpname, "r");
|
||||
if (fp == NULL){
|
||||
return (0);
|
||||
}
|
||||
fseek(fp, 0, SEEK_END);
|
||||
size = ftell(fp);
|
||||
rewind(fp);
|
||||
buffer = malloc((size + 1) * sizeof(*buffer));
|
||||
fread(buffer, size, 1, fp);
|
||||
buffer[size] = '\0';
|
||||
trimwhitespace(buffer);
|
||||
caretint = atoi(buffer);
|
||||
fclose(fp);
|
||||
if(caretint == 1){
|
||||
// printf("caret: %s\n", buffer);
|
||||
return 1;
|
||||
}
|
||||
// printf("found nothing\n");
|
||||
return 0;
|
||||
}
|
||||
else{
|
||||
// printf("file %s does not exist\n",fpname);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void *inputToggle(void *argStruct) {
|
||||
ThreadArgs args = argStruct;
|
||||
|
||||
char * onInput;
|
||||
char * offInput;
|
||||
onInput = malloc(sizeof(char)*400);
|
||||
offInput = malloc(sizeof(char)*400);
|
||||
onInput = args->run_onInput;
|
||||
offInput = args->run_offInput;
|
||||
|
||||
Bool ran_onInput = 0;
|
||||
|
||||
while(input_check){
|
||||
if(check_caret() && ran_onInput == 0){
|
||||
if(debug == true){
|
||||
printf("run_onInput: %s\n",onInput);
|
||||
}
|
||||
system(onInput);
|
||||
ran_onInput = 1;
|
||||
}
|
||||
else if(!check_caret() && ran_onInput == 1){
|
||||
if(debug == true){
|
||||
printf("run_offInput: %s\n",offInput);
|
||||
}
|
||||
system(offInput);
|
||||
ran_onInput = 0;
|
||||
}
|
||||
sleep_ms(100);
|
||||
}
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
void *nextPlease(void *threadid) {
|
||||
long tid;
|
||||
tid = (long)threadid;
|
||||
|
||||
// printf("Next Please Thread ID, %ld\n", tid);
|
||||
|
||||
// Reference http://www.rahul.net/kenton/xproto/xevents_errors.html
|
||||
// event type 17 - DestroyNotify
|
||||
// event type 18 - UnmapNotify
|
||||
// event type 22 - ConfigureNotify
|
||||
// Dismiss the following events by initiating another XNextEvent
|
||||
XNextEvent(d, &e);
|
||||
while(e.type != ConfigureNotify || (e.type == ConfigureNotify && last_event == ConfigureNotify && timeInMilliseconds()-event_ts < 419)){
|
||||
XNextEvent(d, &e);
|
||||
}
|
||||
// Unset input thread
|
||||
input_check = 0;
|
||||
last_event = e.type;
|
||||
|
||||
if(debug == true){
|
||||
printf(" event: %s %d\n",eventNames[e.type-1],e.type);
|
||||
printf(" duration: %lldms\n",timeInMilliseconds()-event_ts);
|
||||
}
|
||||
event_ts = timeInMilliseconds();
|
||||
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
char * append(char * string1, char * string2){
|
||||
char * result = NULL;
|
||||
asprintf(&result, "%s,%s", string1, string2);
|
||||
return result;
|
||||
}
|
||||
|
||||
static int wait_fd(int fd, double seconds){
|
||||
struct timeval tv;
|
||||
fd_set in_fds;
|
||||
FD_ZERO(&in_fds);
|
||||
FD_SET(fd, &in_fds);
|
||||
tv.tv_sec = trunc(seconds);
|
||||
tv.tv_usec = (seconds - trunc(seconds))*1000000;
|
||||
return select(fd+1, &in_fds, 0, 0, &tv);
|
||||
}
|
||||
|
||||
Bool xerror = False;
|
||||
|
||||
int in_int(int a[],int size,int item){
|
||||
int i,pos=-1;
|
||||
for(i=0;i< size;i++)
|
||||
{
|
||||
if(a[i]==item)
|
||||
{
|
||||
pos=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
||||
int in(const char **arr, int len, char *target) {
|
||||
int i;
|
||||
for(i = 0; i < len; i++) {
|
||||
if(strncmp(arr[i], target, strlen(target)) == 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int strcicmp(char const *a, char const *b){
|
||||
for (;; a++, b++) {
|
||||
int d = tolower((unsigned char)*a) - tolower((unsigned char)*b);
|
||||
if (d != 0 || !*a)
|
||||
return d;
|
||||
}
|
||||
}
|
||||
|
||||
Display* open_display(){
|
||||
int i;
|
||||
Display* d = XOpenDisplay(NULL);
|
||||
for (i = 0; i < 60; i++) {
|
||||
if(d == NULL){
|
||||
printf("fail to open X server display...\n");
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
sleep(1);
|
||||
}
|
||||
if(d == NULL){
|
||||
printf("fail to open X server display for 1 minute...\n");
|
||||
printf("Kintox11 is now exiting...\n");
|
||||
exit(1);
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
int handle_error(Display* display, XErrorEvent* error){
|
||||
printf("X11 error: type=%d, serial=%lu, code=%d\n",
|
||||
error->type, error->serial, (int)error->error_code);
|
||||
xerror = True;
|
||||
return 1;
|
||||
}
|
||||
|
||||
Window get_focus_window(Display* d, int etype, char const *eventName, char const *current_app, bool debug){
|
||||
Window w;
|
||||
int revert_to;
|
||||
|
||||
if(debug == true){
|
||||
printf("\n get focus window\n");
|
||||
}
|
||||
|
||||
if(!(etype == DestroyNotify || etype == UnmapNotify)) {
|
||||
XGetInputFocus(d, &w, &revert_to); // see man
|
||||
if(debug == true){
|
||||
printf(" -%s: event: %d, window_id: %ld\n",current_app,etype,w);
|
||||
}
|
||||
}
|
||||
|
||||
if(xerror){
|
||||
printf("*Error getting focused window, e.type: %d, current_app: %s\n",etype,current_app);
|
||||
exit(1);
|
||||
}else if(w == None){
|
||||
printf("*no focus window, e.type: %d, current_app: %s\n",etype,current_app);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
// get the top window.
|
||||
// a top window have the following specifications.
|
||||
// * the start window is contained the descendent windows.
|
||||
// * the parent window is the root window.
|
||||
Window get_top_window(Display* d, Window start, int etype, char const *eventName, char const *current_app, bool debug){
|
||||
Window w = start;
|
||||
Window parent = start;
|
||||
Window root = None;
|
||||
Window *children;
|
||||
unsigned int nchildren;
|
||||
Status s;
|
||||
char * ws;
|
||||
char * wstr;
|
||||
ws = malloc(sizeof(char)*4096);
|
||||
wstr = malloc(sizeof(char)*100);
|
||||
// strcpy(wstr,"test,");
|
||||
|
||||
if(debug == true){
|
||||
printf("\n get top window\n");
|
||||
}
|
||||
// Checking for Destroy and Unmap Notify events here too
|
||||
// Sometimes they still get passed through and if so need
|
||||
// to be ignored or XQueryTree will cause a segmentation fault
|
||||
while (parent != root && parent != 0 && !(etype == DestroyNotify || etype == UnmapNotify)) {
|
||||
w = parent;
|
||||
|
||||
s = XQueryTree(d, w, &root, &parent, &children, &nchildren); // see man
|
||||
|
||||
sprintf(wstr, "%ld", w);
|
||||
if ((ws != NULL) && (ws[0] == '\0')) {
|
||||
strcpy(ws,wstr);
|
||||
}
|
||||
else{
|
||||
ws = append(ws, wstr);
|
||||
}
|
||||
|
||||
if (s)
|
||||
XFree(children);
|
||||
|
||||
if(xerror){
|
||||
printf("*fail to get top window: %ld, e.type: %d, current_app: %s\n",w,etype,current_app);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(debug == true){
|
||||
printf(" -%s: event: %d, window_id: %s\n",current_app,etype,ws);
|
||||
}
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
// search a named window (that has a WM_STATE prop)
|
||||
// on the descendent windows of the argment Window.
|
||||
Window get_named_window(Display* d, Window start, int etype, char const *eventName, char const *current_app, bool debug){
|
||||
Window w;
|
||||
|
||||
if(debug == true){
|
||||
printf("\n get named window\n");
|
||||
}
|
||||
// printf("getting named window ... ");
|
||||
w = XmuClientWindow(d, start); // see man
|
||||
|
||||
if(debug == true){
|
||||
printf(" -%s: event: %d, window_id: %ld\n\n",current_app,etype,w);
|
||||
}
|
||||
// if(w == start)
|
||||
// printf("fail\n");
|
||||
// printf("success (window: %d)\n", (int) w);
|
||||
return w;
|
||||
}
|
||||
|
||||
const char * str_window_class(Display* d, Window w, char *prior_app ){
|
||||
Status s;
|
||||
XClassHint* class;
|
||||
|
||||
class = XAllocClassHint(); // see man
|
||||
if(xerror){
|
||||
// printf("ERROR: XAllocClassHint\n");
|
||||
}
|
||||
|
||||
s = XGetClassHint(d, w, class); // see man
|
||||
if(xerror || s){
|
||||
char * app_class;
|
||||
app_class = malloc(sizeof(char)*100);
|
||||
strcpy(app_class,class->res_class);
|
||||
// printf("\tname: %s\n\tclass: %s\n", class->res_name, class->res_class);
|
||||
return app_class;
|
||||
}else{
|
||||
// char * error_msg;
|
||||
// error_msg = malloc(sizeof(char)*50);
|
||||
// strcpy(error_msg, "ERROR: XGetClassHint");
|
||||
return prior_app;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
|
||||
XInitThreads();
|
||||
|
||||
if(argc < 2){
|
||||
debug = false;
|
||||
}
|
||||
if(argc > 1 && (strcmp(argv[1], "-d") == 0 || strcmp(argv[1], "--debug") == 0 )){
|
||||
debug = true;
|
||||
printf("Running in debug mode\n");
|
||||
}
|
||||
|
||||
FILE *fp;
|
||||
char buffer[10240];
|
||||
struct json_object *parsed_json, *config, *config_obj,
|
||||
*config_obj_name, *config_obj_run, *config_obj_run_oninput,
|
||||
*config_obj_run_offinput, *config_obj_de, *config_obj_appnames,
|
||||
*appnames_obj, *init, *de, *de_obj, *de_obj_id, *de_obj_active,
|
||||
*de_obj_run, *de_obj_runterm,*de_obj_rungui;
|
||||
|
||||
int arraylen;
|
||||
int appnames_len, init_len, de_len, config_de_len;
|
||||
int system(const char *command);
|
||||
|
||||
size_t i,n,r;
|
||||
|
||||
printf("Importing user_config.json...\n");
|
||||
fp = fopen("user_config.json","r");
|
||||
fread(buffer, 10240, 1, fp);
|
||||
fclose(fp);
|
||||
|
||||
parsed_json = json_tokener_parse(buffer);
|
||||
|
||||
config = json_object_object_get(parsed_json, "config");
|
||||
init = json_object_object_get(parsed_json, "init");
|
||||
de = json_object_object_get(parsed_json, "de");
|
||||
|
||||
arraylen = json_object_array_length(config);
|
||||
init_len = json_object_array_length(init);
|
||||
de_len = json_object_array_length(de);
|
||||
|
||||
const char *name_array[arraylen];
|
||||
const char *run_array[arraylen];
|
||||
const char *run_oninput_array[arraylen];
|
||||
const char *run_offinput_array[arraylen];
|
||||
int init_array[init_len];
|
||||
|
||||
int de_id_array[de_len];
|
||||
Bool de_active_array[de_len];
|
||||
const char *de_run_array[de_len];
|
||||
const char *de_runterm_array[de_len];
|
||||
const char *de_rungui_array[de_len];
|
||||
|
||||
// Grab all de variable info needed
|
||||
for (i = 0; i < de_len; i++) {
|
||||
de_obj = json_object_array_get_idx(de, i);
|
||||
de_obj_id = json_object_object_get(de_obj, "id");
|
||||
de_id_array[i] = json_object_get_int(de_obj_id);
|
||||
de_obj_active = json_object_object_get(de_obj, "active");
|
||||
de_active_array[i] = json_object_get_int(de_obj_active);
|
||||
de_obj_run = json_object_object_get(de_obj, "run");
|
||||
de_run_array[i] = json_object_get_string(de_obj_run);
|
||||
de_obj_runterm = json_object_object_get(de_obj, "run_term");
|
||||
de_runterm_array[i] = json_object_get_string(de_obj_runterm);
|
||||
de_obj_rungui = json_object_object_get(de_obj, "run_gui");
|
||||
de_rungui_array[i] = json_object_get_string(de_obj_rungui);
|
||||
// printf("de_run_array[%ld]: %s\n",i,de_run_array[i]);
|
||||
}
|
||||
// de ends
|
||||
|
||||
int appnames_max = 0;
|
||||
int config_de_max = 0;
|
||||
|
||||
for (i = 0; i < arraylen; i++) {
|
||||
config_obj = json_object_array_get_idx(config, i);
|
||||
config_obj_appnames = json_object_object_get(config_obj, "appnames");
|
||||
config_obj_de = json_object_object_get(config_obj, "de");
|
||||
|
||||
appnames_len = json_object_array_length(config_obj_appnames);
|
||||
if (appnames_len > appnames_max){
|
||||
appnames_max = appnames_len;
|
||||
}
|
||||
config_de_len = json_object_array_length(config_obj_de);
|
||||
if(config_de_len > config_de_max){
|
||||
config_de_max = config_de_len;
|
||||
}
|
||||
}
|
||||
|
||||
const char *appnames_array[arraylen][appnames_max];
|
||||
int config_de_array[arraylen][config_de_max];
|
||||
|
||||
for (i = 0; i < arraylen; i++) {
|
||||
config_obj = json_object_array_get_idx(config, i);
|
||||
|
||||
config_obj_name = json_object_object_get(config_obj, "name");
|
||||
config_obj_run = json_object_object_get(config_obj, "run");
|
||||
config_obj_run_oninput = json_object_object_get(config_obj, "run_onInput");
|
||||
config_obj_run_offinput = json_object_object_get(config_obj, "run_offInput");
|
||||
|
||||
name_array[i] = json_object_get_string(config_obj_name);
|
||||
run_array[i] = json_object_get_string(config_obj_run);
|
||||
run_oninput_array[i] = json_object_get_string(config_obj_run_oninput);
|
||||
run_offinput_array[i] = json_object_get_string(config_obj_run_offinput);
|
||||
// printf("%s\n%s\n", json_object_get_string(config_obj_name), json_object_get_string(config_obj_run));
|
||||
|
||||
config_obj_appnames = json_object_object_get(config_obj, "appnames");
|
||||
appnames_len = json_object_array_length(config_obj_appnames);
|
||||
for (n = 0; n < appnames_len; n++) {
|
||||
// printf("name_array[i]: %s\n",name_array[i]);
|
||||
if(!strcicmp(name_array[i], "gui")){
|
||||
appnames_array[i][n] = NULL;
|
||||
// printf("%s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
|
||||
}
|
||||
else{
|
||||
appnames_array[i][n] = json_object_get_string(json_object_array_get_idx(config_obj_appnames, n));
|
||||
//printf("%s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
|
||||
}
|
||||
}
|
||||
if(appnames_max > appnames_len){
|
||||
for (n = appnames_len; n < appnames_max; n++){
|
||||
appnames_array[i][n] = NULL;
|
||||
//printf("%s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
|
||||
}
|
||||
}
|
||||
|
||||
config_obj_de = json_object_object_get(config_obj, "de");
|
||||
config_de_len = json_object_array_length(config_obj_de);
|
||||
for (n = 0; n < config_de_max; n++) {
|
||||
if(n < config_de_len){
|
||||
// printf("de value: %d\n",json_object_get_int(json_object_array_get_idx(config_obj_de, n)));
|
||||
config_de_array[i][n] = json_object_get_int(json_object_array_get_idx(config_obj_de, n));
|
||||
}
|
||||
else{
|
||||
// printf("de -1 value: %d\n",json_object_get_int(json_object_array_get_idx(config_obj_de, n)));
|
||||
config_de_array[i][n] = -1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
printf("Data from user_config.json imported successfully.\n");
|
||||
|
||||
for (i = 0; i < init_len; i++) {
|
||||
init_array[i] = json_object_get_int(json_object_array_get_idx(init, i));
|
||||
int de_id_idx = in_int(de_id_array, de_len, init_array[i]);
|
||||
printf("Running init command: %s\n",de_run_array[de_id_idx]);
|
||||
system(de_run_array[de_id_idx]);
|
||||
}
|
||||
|
||||
char *name;
|
||||
|
||||
// for XmbTextPropertyToTextList
|
||||
setlocale(LC_ALL, ""); // see man locale
|
||||
|
||||
d = open_display();
|
||||
XSelectInput(d, DefaultRootWindow(d), SubstructureNotifyMask);
|
||||
XSetErrorHandler(handle_error);
|
||||
|
||||
char * run_normal;
|
||||
char * run_onInput;
|
||||
char * run_offInput;
|
||||
char * prior_app;
|
||||
char * current_app;
|
||||
char * prior_category;
|
||||
char * current_category;
|
||||
run_onInput = malloc(sizeof(char)*400);
|
||||
run_offInput = malloc(sizeof(char)*400);
|
||||
run_normal = malloc(sizeof(char)*400);
|
||||
prior_app = malloc(sizeof(char)*100);
|
||||
current_app = malloc(sizeof(char)*100);
|
||||
prior_category = malloc(sizeof(char)*100);
|
||||
current_category = malloc(sizeof(char)*100);
|
||||
strcpy(prior_app,"none");
|
||||
strcpy(prior_category,"none");
|
||||
|
||||
int remap_bool = 2;
|
||||
|
||||
printf("Starting keyswap...\n");
|
||||
|
||||
// get active window
|
||||
w = get_focus_window(d, 0, eventNames[0], current_app, debug);
|
||||
w = get_top_window(d, w, 0, eventNames[0], current_app, debug);
|
||||
w = get_named_window(d, w, 0, eventNames[0], current_app, debug);
|
||||
|
||||
// XFetchName(d, w, &name);
|
||||
// printf("window:%#x name:%s\n", w, name);
|
||||
printf("First window name: %s \n\n",str_window_class(d, w,prior_app));
|
||||
|
||||
int breakouter;
|
||||
last_event=0;
|
||||
event_ts = timeInMilliseconds();
|
||||
|
||||
for (;;)
|
||||
{
|
||||
strcpy(current_app,str_window_class(d, w,prior_app));
|
||||
int category_idx;
|
||||
// printf("current: %s\n",current_app);
|
||||
breakouter = 0;
|
||||
|
||||
// Cycle through category name array
|
||||
// printf("%d\n",arraylen);
|
||||
for(i = 0; i < arraylen; ++i){
|
||||
// Cycle through the maximum App name array in each category
|
||||
for(n = 0; n < appnames_max; ++n){
|
||||
if (appnames_array[i][n] != NULL){
|
||||
// printf("%s\n",appnames_array[i][n]);
|
||||
if(strcicmp(appnames_array[i][n], current_app) == 0){
|
||||
strcpy(current_category,name_array[i]);
|
||||
category_idx = i;
|
||||
// printf("Match found: %s: %s\n",current_category,current_app);
|
||||
breakouter = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(i == arraylen-1 && breakouter==0){
|
||||
// printf("No match found, default to gui");
|
||||
strcpy(current_category,"gui");
|
||||
category_idx = in(name_array, arraylen, current_category);
|
||||
// printf("Match found: %s: %s\n",current_category,current_app);
|
||||
break;
|
||||
}
|
||||
else if(appnames_array[i][n] == NULL){
|
||||
break;
|
||||
}
|
||||
if(breakouter==1){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(strcicmp(prior_category, current_category) != 0){
|
||||
// printf("prior: %s, current: %s\n",prior_category,current_category);
|
||||
// printf("%d,%d,%d,%d\n",strcicmp(prior_category, "gui"),strcicmp(current_category, "firefox"),strcicmp(current_category, "gui"),strcicmp(prior_category, "firefox"));
|
||||
// printf("%d,%d\n",(strcicmp(prior_category, "gui") != 0 && strcicmp(prior_category, "firefox") != 0),(strcicmp(current_category, "gui") != 0 && strcicmp(current_category, "firefox") != 0));
|
||||
printf("%s: %s\n",current_category,current_app);
|
||||
// Make sure we're not switching between 2 GUI keymaps
|
||||
// Firefox & Standard GUI apps
|
||||
// strcicmp returns 0 for matches, <>0 for non-match
|
||||
if((strcicmp(prior_category, "gui") != 0 && strcicmp(prior_category, "firefox") != 0) || (strcicmp(current_category, "gui") != 0 && strcicmp(current_category, "firefox") != 0)){
|
||||
if(debug == true){
|
||||
printf("run: %s\n",run_array[category_idx]);
|
||||
}
|
||||
system(run_array[category_idx]);
|
||||
}
|
||||
strcpy(run_normal,run_array[category_idx]);
|
||||
strcpy(run_onInput,run_oninput_array[category_idx]);
|
||||
strcpy(run_offInput,run_offinput_array[category_idx]);
|
||||
system(run_offInput);
|
||||
for(r = 0; r < config_de_max; r++){
|
||||
if(config_de_array[category_idx][r] != -1){
|
||||
int de_id_idx = in_int(de_id_array, de_len, config_de_array[category_idx][r]);
|
||||
if(strcicmp(current_category, "term") == 0){
|
||||
if(debug == true){
|
||||
printf("Running de term command: %s\n",de_runterm_array[de_id_idx]);
|
||||
}
|
||||
system(de_runterm_array[de_id_idx]);
|
||||
}
|
||||
else{
|
||||
if(debug == true){
|
||||
printf("Running de gui command: %s\n",de_rungui_array[de_id_idx]);
|
||||
}
|
||||
system(de_rungui_array[de_id_idx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(strcicmp(prior_app, current_app) != 0){
|
||||
int indent = strlen(current_category)+2;
|
||||
printf("%*c%s\n", indent, ' ',current_app);
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
|
||||
strcpy(prior_app,current_app);
|
||||
strcpy(prior_category,current_category);
|
||||
|
||||
if(strlen(run_onInput) > 0){
|
||||
input_check = 1;
|
||||
}
|
||||
else{
|
||||
input_check = 0;
|
||||
}
|
||||
|
||||
pthread_t threads[NUM_THREADS];
|
||||
int rc;
|
||||
int i;
|
||||
ThreadArgs args = (ThreadArgs)malloc(sizeof(struct threadArgs));
|
||||
args->run_onInput = run_onInput;
|
||||
args->run_offInput = run_offInput;
|
||||
for( i = 0; i < NUM_THREADS; i++ ) {
|
||||
|
||||
if(i==0){
|
||||
rc = pthread_create(&threads[i], NULL, inputToggle, args);
|
||||
}
|
||||
else{
|
||||
rc = pthread_create(&threads[i], NULL, nextPlease, (void *)&i);
|
||||
}
|
||||
if (rc) {
|
||||
printf("Error:unable to create thread, %d\n", rc);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
// wait for threads to close before continuing
|
||||
for (int i = 0; i < NUM_THREADS; i++) {
|
||||
pthread_join(threads[i], NULL);
|
||||
}
|
||||
|
||||
w = get_focus_window(d, e.type, eventNames[e.type-1], current_app, debug);
|
||||
w = get_top_window(d, w, e.type, eventNames[e.type-1], current_app, debug);
|
||||
w = get_named_window(d, w, e.type, eventNames[e.type-1], current_app, debug);
|
||||
}
|
||||
}
|
@@ -1,631 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import json, time, os, sys, subprocess, shlex, platform
|
||||
from shutil import copyfile
|
||||
from subprocess import PIPE, Popen
|
||||
from prekinto import *
|
||||
|
||||
homedir = os.path.expanduser("~")
|
||||
kintotype = 0
|
||||
|
||||
def windows_setup():
|
||||
keymaps = ["Apple keyboard standard", "Windows keyboard standard","Chromebook","IBM - No Super/Win","Uninstall"]
|
||||
for index, item in enumerate(keymaps):
|
||||
print(" %i. %s" % (index+1, item))
|
||||
default = 0
|
||||
while not int(default) in range(1,len(keymaps)+1):
|
||||
default = int(input("\nPlease enter your desired keymap (1 - " + str(len(keymaps)) + ") : "))
|
||||
print("")
|
||||
# Short DOS path notation
|
||||
path= cmdline('echo ''%cd%''')[:-1]
|
||||
if default > 0 and default < 5:
|
||||
print("Will now install chocolatey and autohotkey with elevated privileges...")
|
||||
print("This install will fail if you are not running with elevated privileges")
|
||||
os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"')
|
||||
print("Copying autohotkey combinations for Terminals & Editors...")
|
||||
os.system('copy /Y "' + path + '\\windows\\kinto.ahk" "' + path + '\\windows\\kinto-new.ahk"')
|
||||
if default < 3:
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Default)(?!( - ST2CODE))(.*)/$2$3$5/g" .\\windows\\kinto-new.ahk')
|
||||
if default == 1:
|
||||
kbtype = "mac"
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
elif default == 2:
|
||||
kbtype = "win"
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
elif default == 5:
|
||||
print("Removing any old registry keys from prior versions...")
|
||||
p = subprocess.Popen(['powershell.exe', "Remove-ItemProperty -Path HKLM:'SYSTEM\CurrentControlSet\Control\Keyboard Layout' -Name 'Scancode Map' -ErrorAction SilentlyContinue"], stdout=sys.stdout)
|
||||
print("Removing Kinto from Startup folder...")
|
||||
os.system("(del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\") 2> nul")
|
||||
os.system('(del "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs") 2> nul')
|
||||
print("Ending any running Kinto tasks...")
|
||||
os.system("(taskkill /IM autohotkey.exe) 2> nul")
|
||||
print("Removing Kinto from users profile directory...")
|
||||
os.system('(rd /s /q "%userprofile%\\.kinto") 2> nul')
|
||||
print("")
|
||||
print("Uninstall of Kinto is Complete.")
|
||||
if default == 3:
|
||||
kbtype = "chrome"
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Chromebook)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers/CB)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
if default == 3 or default == 4:
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB/IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
if default == 4:
|
||||
kbtype = "ibm"
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers/CB/IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
if default > 0 and default < 5:
|
||||
stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC)
|
||||
print("\nWill now install Ubuntu Termimnal Theme as default...")
|
||||
os.system('regedit "' + path + '\\windows\\theme_ubuntu.reg"')
|
||||
os.system('robocopy "'+ path + '\\assets" "%userprofile%\\.kinto\\assets" /E')
|
||||
if (stvscode and (default > 0 or default < 3)):
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Default - ST2CODE)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
elif (stvscode and (default == 3 or default == 4 )):
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB/IBM - ST2CODE)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
os.system('copy /Y "' + path + '\\windows\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"')
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/{kbtype}/' + kbtype + '/g" "%userprofile%\\.kinto\\kinto-start.vbs"')
|
||||
os.system('copy /Y "' + path + '\\windows\\usb.vbs" "%userprofile%\\.kinto\\usb.vbs"')
|
||||
os.system('copy /Y "' + path + '\\windows\\detectUSB.ahk" "%userprofile%\\.kinto\\detectUSB.ahk"')
|
||||
os.system('mklink "%userprofile%\\Start Menu\\Programs\\Startup\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"')
|
||||
os.system('copy /Y "'+ path + '\\windows\\NoShell.vbs" "%userprofile%\\.kinto\\NoShell.vbs"')
|
||||
os.system('copy /Y "'+ path + '\\windows\\toggle_kb.bat" "%userprofile%\\.kinto\\toggle_kb.bat"')
|
||||
os.system('copy /Y "'+ path + '\\windows\\kinto-new.ahk" "%userprofile%\\.kinto\\kinto.ahk"')
|
||||
os.system("del /f .\\windows\\kinto-new.ahk")
|
||||
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\" 2> nul")
|
||||
userpath = cmdline('cmd /c for %A in ("%userprofile%") do @echo %~sA')[:-1]
|
||||
print('Starting... "' + userpath + '\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs"')
|
||||
os.system('"' + userpath + '\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs"')
|
||||
# # print("\nPlease log off and back on for changes to take full effect.")
|
||||
print("If using WSL then please remember to right click on title bar -> Properties -> Edit Options -> Use Ctrl+Shift+C/V as Copy/Paste and enable it.")
|
||||
else:
|
||||
os.system("(del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\") 2> nul")
|
||||
|
||||
def cmdline(command):
|
||||
process = Popen(
|
||||
args=command,
|
||||
stdout=PIPE,
|
||||
universal_newlines=True,
|
||||
shell=True
|
||||
)
|
||||
return process.communicate()[0]
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
print("\nYou are detected as running Windows.")
|
||||
windows_setup()
|
||||
sys.exit()
|
||||
|
||||
check_x11 = cmdline("(env | grep -i x11 || loginctl show-session \"$XDG_SESSION_ID\" -p Type) | awk -F= '{print $2}'").strip()
|
||||
|
||||
if len(check_x11) == 0:
|
||||
if os.name != 'nt':
|
||||
print("You are not using x11, please logout and back in using x11/Xorg")
|
||||
sys.exit()
|
||||
else:
|
||||
print("\nYou are detected as running Windows.")
|
||||
windows_setup()
|
||||
sys.exit()
|
||||
|
||||
distro = cmdline("awk -F= '$1==\"NAME\" { print $2 ;}' /etc/os-release").replace('"','').strip().split(" ")[0]
|
||||
dename = cmdline("./system-config/dename.sh").replace('"','').strip().split(" ")[0].lower()
|
||||
|
||||
run_pkg = ""
|
||||
|
||||
def requirements(pkgm):
|
||||
print(bcolors.CYELLOW2 + "You need to install some packages, " +run_pkg+ ", for Kinto to fully remap browsers during input focus.\n" + bcolors.ENDC)
|
||||
print("sudo " + pkgm + " " + run_pkg + "\n")
|
||||
run_install = yn_choice(bcolors.CYELLOW2 + "Would you like to run it now? (Will require sudo privileges.)\n" + bcolors.ENDC)
|
||||
if(run_install):
|
||||
os.system("sudo " + pkgm + run_pkg)
|
||||
print("\n")
|
||||
|
||||
def install_ibus():
|
||||
global distro
|
||||
print(bcolors.CYELLOW2 + "You need to set IBus as the default Input Method for full word-wise support and re-run this installer.\n" + bcolors.ENDC)
|
||||
print(bcolors.CYELLOW2 + "Confirm the IBus Setup by saying Yes and then closing the window.\n" + bcolors.ENDC)
|
||||
print("ibus-setup\n")
|
||||
print("im-config -n ibus or im-chooser\n")
|
||||
run_install = yn_choice(bcolors.CYELLOW2 + "Would you like to run it now? (Will require logoff and logon.)\n" + bcolors.ENDC)
|
||||
if(run_install):
|
||||
if distro=="fedora":
|
||||
os.system("ibus-setup")
|
||||
os.system("im-chooser")
|
||||
print("\n")
|
||||
print("IBus needs to have Input Method set to your language.")
|
||||
print("im-chooser needs IBus to be selected & closed.")
|
||||
input("Will need to log off and back on for it take effect...")
|
||||
else:
|
||||
os.system("ibus-setup")
|
||||
os.system("im-config -n ibus")
|
||||
print("\n")
|
||||
input("IBus has been set as the default Input Method.\nPress any key to exit and re-run after logoff & logon...")
|
||||
sys.exit()
|
||||
|
||||
def setShortcuts():
|
||||
global distro
|
||||
distroVersion = cmdline("awk -F= '$1==\"VERSION_ID\" { print $2 ;}' /etc/os-release").replace('"','').strip()
|
||||
|
||||
print("\nIf Kinto is already running it will be stopped...")
|
||||
print("If you cancel the installer you can re-run Kinto via\n systemctl --user start keyswap")
|
||||
|
||||
cmdline("systemctl --user stop keyswap")
|
||||
print("\nDetected " + distro + " " + distroVersion.strip() + " DE: " + dename + "\n")
|
||||
addhotkeys = yn_choice("\nDo you want to apply system level shortcuts?")
|
||||
if(addhotkeys):
|
||||
distro = distro.lower()
|
||||
if dename == "gnome" or dename == "mate" or dename == "budgie":
|
||||
cmdline('dconf dump /org/gnome/desktop/wm/keybindings/ > keybindings_`date +"%Y.%m.%d-%s"`.conf')
|
||||
cmdline('dconf dump /org/gnome/mutter/keybindings/ > mutter_`date +"%Y.%m.%d-%s"`.conf')
|
||||
if(kintotype == 1):
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications \"['<Primary>Tools','<Alt>Tab']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward \"['<Primary><Shift>Tools','<Alt><Shift>Tab']\"")
|
||||
else:
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications \"['<Primary>F13','<Primary><Shift>F13','<Alt>Tab']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward \"['<Primary>F14','<Primary><Shift>F14','<Alt><Shift>Tab']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
|
||||
#
|
||||
# Leaving run dialog disabled for now
|
||||
# Too slow on appearing, compared to the app menu
|
||||
#
|
||||
# if dename != "budgie":
|
||||
cmdline("gsettings reset org.gnome.desktop.wm.keybindings panel-main-menu")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
# else:
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Alt>F1']\"")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-run-dialog \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
cmdline("gsettings set org.gnome.shell.keybindings toggle-application-view \"['LaunchB']\"")
|
||||
if dename != "mate":
|
||||
cmdline("gsettings set org.gnome.mutter overlay-key ''")
|
||||
if (distro == "ubuntu" and dename == "gnome") or (distro == "ubuntu" and dename == "budgie") or (distro == "linux" and dename == "mate") or (distro == "ubuntu" and dename == "mate"):
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up \"['<Super>Up','<Super>Left']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down \"['<Super>Down','<Super>Right']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right ['']")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
|
||||
cmdline("gsettings reset org.gnome.desktop.wm.keybindings panel-main-menu")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
elif distro == "pop!_os" and dename == "gnome":
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings close \"['<Alt>F4','<Super>w']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings toggle-maximized \"['<Alt>F10','<Primary><Super>Up']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
|
||||
cmdline("gsettings reset org.gnome.desktop.wm.keybindings panel-main-menu")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up \"['<Super>Up','<Super>Left']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down \"['<Super>Down','<Super>Right']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right ['']")
|
||||
elif distro == "elementary" and dename == "gnome":
|
||||
if(kintotype == 1):
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications \"['<Primary>Tools','<Alt>Tab']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward \"['<Primary><Shift>Tools','<Alt><Shift>Tab']\"")
|
||||
else:
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications \"['<Primary>F13','<Primary><Shift>F13','<Alt>Tab']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward \"['<Primary>F14','<Primary><Shift>F14','<Alt><Shift>Tab']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings show-desktop \"['<Super>d','<Super>Down']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings toggle-maximized \"['<Alt>F10','<Super>Up']\"")
|
||||
cmdline("gsettings reset org.gnome.desktop.wm.keybindings panel-main-menu")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Control><Shift>Space','<Super>Space']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Super>Space','<Primary>Space']\"")
|
||||
if(kintotype == 2):
|
||||
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Elementary cmdtab)/\$2\$3/g" ~/.xkb/symbols/mac_term')
|
||||
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_term')
|
||||
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Elementary cmdtab)/\$2\$3/g" ~/.xkb/symbols/mac_gui')
|
||||
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_gui')
|
||||
# elif distro == "budgie" and dename == "gnome":
|
||||
# print("Apply budgie shortcuts here")
|
||||
elif (dename == "xfce"):
|
||||
print("Applying xfce shortcuts...")
|
||||
cmdline('cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ./xfce4-keyboard-shortcuts_`date +"%Y.%m.%d-%s"`.xml')
|
||||
# Reset Show desktop
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>d" --reset')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>d" --create --type string --set "show_desktop_key"')
|
||||
# Reset App Cycle
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Alt>Tab" --reset')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Alt><Shift>Tab" --reset')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary>backslash" --create --type string --set "cycle_windows_key"')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Shift>backslash" --create --type string --set "cycle_reverse_windows_key"')
|
||||
# cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>h" --create --type string --set "hide_window_key"')
|
||||
# Don't need to undo other maps for menu
|
||||
# cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary>space" --create --type string --set "xfce4-popup-whiskermenu"')
|
||||
# cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary><Shift>space" --create --type string --set "xfce4-popup-whiskermenu"')
|
||||
cmdline('xfconf-query --reset --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary>space"')
|
||||
cmdline('xfconf-query --reset --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary><Shift>space"')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/default/<Primary>Escape" --create --type string --set "xfce4-popup-whiskermenu"')
|
||||
# Reset move to desktop shortcuts
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Home" --reset')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>End" --reset')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Left" --reset')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Right" --reset')
|
||||
os.system('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Left" --create --type string --set "move_window_prev_workspace_key"')
|
||||
os.system('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Right" --create --type string --set "move_window_next_workspace_key"')
|
||||
# Reset Change Workspace
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Left" --reset')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Right" --reset')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>Left" --create --type string --set "left_workspace_key"')
|
||||
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>Right" --create --type string --set "right_workspace_key"')
|
||||
print("\nYou may need to run these commands manually to make sure they are set, if you want to move windows between desktops.\n")
|
||||
print(' xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Left" --create --type string --set "move_window_prev_workspace_key"')
|
||||
print(' xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Right" --create --type string --set "move_window_next_workspace_key"\n')
|
||||
elif distro == "fedora" and dename == "gnome":
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings show-desktop \"['<Super>d']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up \"['<Super>Up','<Super>Left']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down \"['<Super>Down','<Super>Right']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right ['']")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
cmdline("gsettings reset org.gnome.desktop.wm.keybindings panel-main-menu")
|
||||
cmdline("gsettings set org.gnome.mutter.keybindings toggle-tiled-right \"['<Super><Alt>Right']\"")
|
||||
cmdline("gsettings set org.gnome.mutter.keybindings toggle-tiled-left \"['<Super><Alt>Left']\"")
|
||||
# org.gnome.mutter.keybindings toggle-tiled-right ['<Super>Right']
|
||||
# org.gnome.mutter.keybindings toggle-tiled-left ['<Super>Left']
|
||||
elif dename == "kde":
|
||||
# cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "krunner.desktop" --key "_launch","Alt+Space\tAlt+F2\tSearch,Alt+Space\tAlt+F2\tSearch,KRunner"')
|
||||
# Remove Alt+F3 Operations Menu - Sublimetext Select-All
|
||||
cmdline('cp ~/.config/kwinrc ./kwinrc_`date +"%Y.%m.%d-%s"`')
|
||||
cmdline('cp ~/.config/kglobalshortcutsrc ./kde_kglobalshortcutsrc_`date +"%Y.%m.%d-%s"`')
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Switch to Previous Desktop" "Meta+Left,Meta+Left,Switch to Previous Desktop"')
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Operations Menu" "none,Alt+F3,Window Operations Menu"')
|
||||
if(kintotype == 1):
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Walk Through Windows" "Ctrl+Tools,Alt+Tab,Walk Through Windows"')
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Walk Through Windows (Reverse)" "Ctrl+Shift+Tools,Alt+Shift+Backtab,Walk Through Windows (Reverse)"')
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Walk Through Windows of Current Application" "Alt+F6,none,Walk Through Windows of Current Application"')
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Walk Through Windows of Current Application (Reverse)" "Alt+Shift+F6,none,Walk Through Windows of Current Application (Reverse)"')
|
||||
else:
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Walk Through Windows" "Ctrl+F13,Alt+Tab,Walk Through Windows"')
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Walk Through Windows (Reverse)" "Ctrl+Shift+F14,Alt+Shift+Backtab,Walk Through Windows (Reverse)"')
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Walk Through Windows Alternative" "none,none,Walk Through Windows"')
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Maximize Window" "none,Meta+PgUp,Maximize Window"')
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Maximize" "Meta+Ctrl+F,Alt+F10,Maximize Window"')
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Minimize Window" "Meta+h,Meta+PgDown,Minimize Window"')
|
||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Switch to Next Desktop" "Meta+Right,Meta+Right,Switch to Next Desktop"')
|
||||
os.system('kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &')
|
||||
else:
|
||||
print('distro: ' + distro + ' de: ' + dename)
|
||||
print(bcolors.CRED2 + "A supported OS and DE was not found, you may not have full system level shortcuts installed." + bcolors.ENDC)
|
||||
print(bcolors.CRED2 + "You may want to find your DE or Window Manager settings and manually set Alt-Tab & other OS related shortcuts." + bcolors.ENDC)
|
||||
if dename == "gnome" or dename == "mate" or dename == "budgie":
|
||||
# Apply dconf update to make updates survive reboots
|
||||
cmdline('dconf dump /org/gnome/desktop/wm/keybindings/ > tempkb.conf')
|
||||
cmdline('dconf dump /org/gnome/mutter/keybindings/ > tempmt.conf')
|
||||
cmdline('dconf load /org/gnome/desktop/wm/keybindings/ < tempkb.conf')
|
||||
cmdline('dconf load /org/gnome/mutter/keybindings/ < tempmt.conf')
|
||||
cmdline('sleep 1 && rm -f ./tempkb.conf;rm -f ./tempmt.conf')
|
||||
if dename == "budgie":
|
||||
print('** Make sure to open Keyboard settings & reset "switch applications" to cmd+tab **')
|
||||
# cmdline('dconf update')
|
||||
|
||||
def Uninstall():
|
||||
print("You selected to Uninstall Kinto.\n")
|
||||
restore = yn_choice("\nYour DE is " + dename + ".\n\nY: Restore hotkeys from backup\nN: Reset OS/DE hotkeys\nWhich option would you prefer?")
|
||||
print("")
|
||||
if(restore):
|
||||
if dename == "gnome":
|
||||
print("Restoring DE hotkeys...")
|
||||
wmkeys = cmdline('ls | grep -m1 "keybinding"')
|
||||
mutterkeys = cmdline('ls | grep -m1 "mutter_"')
|
||||
if len(wmkeys) > 0:
|
||||
print('dconf load /org/gnome/desktop/wm/keybindings/ < ' + wmkeys)
|
||||
cmdline('dconf load /org/gnome/desktop/wm/keybindings/ < ' + wmkeys)
|
||||
else:
|
||||
print('Gnome Desktop keybindings backup not found...')
|
||||
if len(mutterkeys) > 0:
|
||||
print('dconf load /org/gnome/mutter/keybindings/ < ' + mutterkeys)
|
||||
cmdline('dconf load /org/gnome/mutter/keybindings/ < ' + mutterkeys)
|
||||
if len(wmkeys) > 0 or len(mutterkeys) > 0:
|
||||
print("Gnome hotkeys have been successfully restored.")
|
||||
elif dename == "kde":
|
||||
print("Restoring DE hotkeys...")
|
||||
kwinkeys = cmdline('ls | grep -m1 "kwinrc"').strip()
|
||||
kdekeys = cmdline('ls | grep -m1 "kglobalshortcutsrc"').strip()
|
||||
cmdline('cp ./' + kdekeys + ' ~/.config/kglobalshortcutsrc')
|
||||
cmdline('cp ./' + kwinkeys + ' ~/.config/kwinrc')
|
||||
elif dename == "xfce":
|
||||
print("Restoring DE hotkeys...")
|
||||
xfcekeys = cmdline('ls | grep -m1 "xfce4-keyboard"').strip()
|
||||
cmdline('cp ./' + xfcekeys + ' ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml')
|
||||
if dename == "gnome" or dename == "kde" or dename == "xfce":
|
||||
print("./uninstall.sh\n")
|
||||
subprocess.check_call(shlex.split("./uninstall.sh"))
|
||||
print("Done.")
|
||||
if dename == "kde" or dename == "xfce":
|
||||
print("Please log off and back on for your original hotkeys to take effect.")
|
||||
else:
|
||||
if dename == "gnome":
|
||||
print("Resetting DE hotkeys...\n")
|
||||
print("gsettings reset-recursively org.gnome.desktop.wm.keybindings")
|
||||
cmdline("gsettings reset-recursively org.gnome.desktop.wm.keybindings")
|
||||
print("gsettings reset-recursively org.gnome.mutter.keybindings")
|
||||
cmdline("gsettings reset-recursively org.gnome.mutter.keybindings")
|
||||
print("gsettings set org.gnome.mutter overlay-key 'super'")
|
||||
cmdline("gsettings set org.gnome.mutter overlay-key 'super'")
|
||||
cmdline('dconf dump /org/gnome/mutter/ > mutter.conf')
|
||||
cmdline('dconf load /org/gnome/mutter/ < mutter.conf')
|
||||
elif dename == "kde":
|
||||
print("Resetting DE hotkeys...\n")
|
||||
cmdline('mv ~/.config/kwinrc ~/.config/kwinrc.kinto')
|
||||
cmdline('mv ~/.config/kglobalshortcutsrc ~/.config/kglobalshortcutsrc.kinto')
|
||||
elif dename == "xfce":
|
||||
print("Resetting DE hotkeys...\n")
|
||||
cmdline('cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml')
|
||||
if dename == "gnome" or dename == "kde" or dename == "xfce":
|
||||
print("./uninstall.sh\n")
|
||||
subprocess.check_call(shlex.split("./uninstall.sh"))
|
||||
print("Done.")
|
||||
if dename == "kde" or dename == "xfce":
|
||||
print("Please log off and back on for your original DE hotkeys to take effect.")
|
||||
|
||||
def kintoImpOne():
|
||||
|
||||
check_xbind = cmdline("\\which xbindkeys 2>/dev/null").strip()
|
||||
check_xdotool = cmdline("\\which xdotool 2>/dev/null").strip()
|
||||
check_ibus = cmdline("\\which ibus-setup 2>/dev/null").strip()
|
||||
|
||||
pkgm = cmdline("\\which apt-get 2>/dev/null").strip()
|
||||
|
||||
if len(pkgm) == 0:
|
||||
pkgm = cmdline("\\which dnf 2>/dev/null").strip()
|
||||
if len(pkgm) > 0:
|
||||
pkgm += " check-update;sudo dnf install -y "
|
||||
else:
|
||||
pkgm += " install -y "
|
||||
pkgm += " update; sudo apt-get install -y "
|
||||
|
||||
if len(pkgm) == 0:
|
||||
pkgm = cmdline("\\which pacman 2>/dev/null").strip()
|
||||
if len(pkgm) > 0:
|
||||
pkgm += " -Syy; sudo pacman -S "
|
||||
|
||||
|
||||
if len(pkgm) == 0:
|
||||
print("No supported package manager found. Exiting...")
|
||||
sys.exit()
|
||||
|
||||
|
||||
runpkg = 0
|
||||
global run_pkg
|
||||
|
||||
if len(check_xbind) > 0 and len(check_xdotool) > 0 and len(check_ibus) > 0:
|
||||
print("Xbindkeys, xdotool and IBus requirement is installed.")
|
||||
if len(check_xbind) == 0:
|
||||
run_pkg = "xbindkeys"
|
||||
runpkg = 1
|
||||
if len(check_xdotool) == 0:
|
||||
run_pkg += " xdotool"
|
||||
runpkg = 1
|
||||
if len(check_ibus) == 0:
|
||||
# may differ with distro, but for now
|
||||
run_pkg += " ibus"
|
||||
runpkg = 1
|
||||
|
||||
if runpkg != 0:
|
||||
print(runpkg)
|
||||
requirements(pkgm)
|
||||
|
||||
if not os.path.exists(homedir + '/.config/ibus/bus') and cmdline("ls ~/.config/ibus/bus -1rt") == "":
|
||||
install_ibus()
|
||||
|
||||
try:
|
||||
f = open("defaults.json")
|
||||
except IOError:
|
||||
print("defaults.json file is missing. Will exit.\n")
|
||||
exit()
|
||||
f.close()
|
||||
|
||||
try:
|
||||
f = open("defaults.json")
|
||||
except IOError:
|
||||
print("defaults.json file is missing. Will exit.\n")
|
||||
exit()
|
||||
f.close()
|
||||
|
||||
try:
|
||||
f = open("user_config.json")
|
||||
except IOError:
|
||||
print("user_config.json file is missing. Will exit.\n")
|
||||
exit()
|
||||
f.close()
|
||||
|
||||
if os.path.isdir(homedir + "/.config/kinto") == False:
|
||||
os.mkdir(homedir + "/.config/kinto")
|
||||
time.sleep(0.5)
|
||||
|
||||
with open('defaults.json') as json_file:
|
||||
data = json.load(json_file)
|
||||
|
||||
|
||||
color_arr = [bcolors.CBEIGE,bcolors.CRED2,bcolors.CGREEN,bcolors.CYELLOW ]
|
||||
|
||||
print("\nKinto - Type in Linux like it's a Mac.\n")
|
||||
|
||||
kintotype = int(input(color_arr[2] +
|
||||
"1) Kinto - xkeysnail (udev/x11) - Recommended\n" + color_arr[0] +
|
||||
"2) Kinto - Original xkb/x11 implementation\n" + color_arr[3] +
|
||||
"3) Uninstall Kinto - xkeysnail\n" +
|
||||
"4) Uninstall Kinto - Original xkb\n\n"
|
||||
+ bcolors.ENDC))
|
||||
print("")
|
||||
if(kintotype == 1):
|
||||
subprocess.check_call(shlex.split("./xkeysnail_service.sh"))
|
||||
if os.path.isdir(homedir + "/.config/kinto") == True:
|
||||
setShortcuts()
|
||||
subprocess.check_call(shlex.split("./xkeysnail_service.sh budgieUpdate"))
|
||||
exit()
|
||||
|
||||
if(kintotype == 3):
|
||||
subprocess.check_call(shlex.split("./xkeysnail_service.sh uninstall"))
|
||||
exit()
|
||||
|
||||
if(kintotype == 4):
|
||||
Uninstall()
|
||||
exit()
|
||||
|
||||
kintoImpOne()
|
||||
|
||||
for index, item in enumerate(data['defaulttypes']):
|
||||
ossym = ""
|
||||
if item == "windows":
|
||||
ossym = u'\u2756'
|
||||
elif item == "mac":
|
||||
ossym = u'\u2318'
|
||||
elif item == "chromebook":
|
||||
ossym = u'\u2707'
|
||||
print("%s %i. %s %s %s" % (color_arr[index], index+1, ossym, item.capitalize(), bcolors.ENDC))
|
||||
|
||||
print("%s %i. Uninstall %s" % (color_arr[3], len(data['defaulttypes'])+1, bcolors.ENDC))
|
||||
|
||||
default = 0
|
||||
while not int(default) in range(1,len(data['defaulttypes'])+2):
|
||||
default = int(input(bcolors.CYELLOW2 + "\nPlease enter your keyboard type (1 - " + str(len(data['defaulttypes'])) + ") : " + bcolors.ENDC))
|
||||
print("")
|
||||
|
||||
if default == len(data['defaulttypes'])+1:
|
||||
Uninstall()
|
||||
exit()
|
||||
|
||||
try:
|
||||
f = open(homedir + "/.config/kinto/user_config.json")
|
||||
rewrite = yn_choice("~/.config/kinto/user_config.json already exists. Do you want to overwrite it with a new config?")
|
||||
print("")
|
||||
if(rewrite):
|
||||
copyfile("user_config.json", homedir + "/.config/kinto/user_config.json")
|
||||
else:
|
||||
exit()
|
||||
except IOError:
|
||||
pass
|
||||
copyfile("user_config.json", homedir + "/.config/kinto/user_config.json")
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
keyboardconfigs = [obj for obj in data['defaults'] if(obj['type'] == data['defaulttypes'][default-1])]
|
||||
|
||||
# for k in keyboardconfigs:
|
||||
for index, k in enumerate(keyboardconfigs):
|
||||
print(color_arr[default-1] + bcolors.BOLD + str(index+1) + '. ' + k['name'] + bcolors.ENDC)
|
||||
print(bcolors.CYELLOW2 + 'Description: ' + k['description'] + bcolors.ENDC)
|
||||
|
||||
print("")
|
||||
defaultkb = 0
|
||||
while not int(defaultkb) in range(1,len(keyboardconfigs)+1):
|
||||
defaultkb = int(input(bcolors.CYELLOW2 + "Please enter your keyboard config (1 - " + str(len(keyboardconfigs)) + ") : " + bcolors.ENDC))
|
||||
print("")
|
||||
|
||||
if 'hack' in keyboardconfigs[defaultkb-1]:
|
||||
print(bcolors.CYELLOW2 + "You have selected a keyboard config that needs the following command to be ran.\n" + bcolors.ENDC)
|
||||
print(keyboardconfigs[defaultkb-1]['hack'].replace(";", "\n") + "\n")
|
||||
runhack = yn_choice(bcolors.CYELLOW2 + "Would you like to run it now? (Will require sudo privileges. Will exit on No.)" + bcolors.ENDC)
|
||||
if(runhack):
|
||||
os.system(keyboardconfigs[defaultkb-1]['hack'])
|
||||
|
||||
# Setup the selected keyboards config
|
||||
os.system("cp -TRv ./.xkb ~/.xkb/")
|
||||
if os.path.isdir(homedir + "/.xkb/keymap") == False:
|
||||
os.mkdir(homedir + "/.xkb/keymap")
|
||||
time.sleep(0.5)
|
||||
os.system('setxkbmap -option')
|
||||
os.system('setxkbmap -print > ~/.xkb/keymap/kbd.mac.gui')
|
||||
os.system('setxkbmap -print > ~/.xkb/keymap/kbd.mac.gui.chrome')
|
||||
os.system('setxkbmap -print > ~/.xkb/keymap/kbd.mac.gui.browsers')
|
||||
os.system('setxkbmap -print > ~/.xkb/keymap/kbd.mac.term')
|
||||
time.sleep(0.5)
|
||||
|
||||
symbols_line = cmdline("cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_symbols' | cut -f1 -d:").strip()
|
||||
types_line = cmdline("cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_types' | cut -f1 -d:").strip()
|
||||
|
||||
cmdline('sed -i '' -e "' + symbols_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_gui'] + '\\"/2" ~/.xkb/keymap/kbd.mac.gui')
|
||||
cmdline('sed -i '' -e "' + types_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_types_gui'] + '\\"/2" ~/.xkb/keymap/kbd.mac.gui')
|
||||
cmdline('sed -i '' -e "' + symbols_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_term'] + '\\"/2" ~/.xkb/keymap/kbd.mac.term')
|
||||
cmdline('sed -i '' -e "' + types_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_types_term'] + '\\"/2" ~/.xkb/keymap/kbd.mac.term')
|
||||
|
||||
# Set chrome file accordingly for chromebooks or normal
|
||||
if default != 3:
|
||||
cmdline('sed -i '' -e "' + symbols_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_gui'].replace("+mac_gui(mac_levelssym)+mac_gui(mac_appcycle)","+mac_gui(mac_levelssym)+mac_gui(mac_browsers)") + '\\"/2" ~/.xkb/keymap/kbd.mac.gui.browsers')
|
||||
cmdline('sed -i '' -e "' + symbols_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_gui'].replace("+mac_gui(mac_levelssym)+mac_gui(mac_appcycle)","+mac_gui(mac_browsers)+mac_gui(mac_chrome)") + '\\"/2" ~/.xkb/keymap/kbd.mac.gui.chrome')
|
||||
else:
|
||||
# Fix multicursor in mac_gui
|
||||
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Chromebook multicursor)/\$2\$3/g" ~/.xkb/symbols/mac_gui')
|
||||
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default multicursor)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_gui')
|
||||
# Fix browsers
|
||||
cmdline('sed -i '' -e "' + symbols_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_gui'].replace("+mac_gui(mac_levelssym)+mac_gui(mac_appcycle_chromebook)","+mac_gui(mac_levelssym)+mac_gui(mac_browsers_chromebook)") + '\\"/2" ~/.xkb/keymap/kbd.mac.gui.browsers')
|
||||
cmdline('sed -i '' -e "' + symbols_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_gui'].replace("+mac_gui(mac_levelssym)+mac_gui(mac_appcycle_chromebook)","+mac_gui(mac_browsers_chromebook)+mac_gui(mac_chrome)") + '\\"/2" ~/.xkb/keymap/kbd.mac.gui.chrome')
|
||||
if dename == "kde":
|
||||
# Fix maximize shortcut
|
||||
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ KDE maximize)/\$2\$3/g" ~/.xkb/symbols/mac_gui')
|
||||
# term app switching
|
||||
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ KDE cmdtab)/\$2\$3/g" ~/.xkb/symbols/mac_term')
|
||||
else:
|
||||
# Fix maximize shortcut
|
||||
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Default maximize)/\$2\$3/g" ~/.xkb/symbols/mac_gui')
|
||||
# term app switching
|
||||
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Default cmdtab)/\$2\$3/g" ~/.xkb/symbols/mac_term')
|
||||
cmdline('sed -i '' -e "' + types_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_types_gui'] + '\\"/2" ~/.xkb/keymap/kbd.mac.gui.browsers')
|
||||
cmdline('sed -i '' -e "' + types_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_types_gui'] + '\\"/2" ~/.xkb/keymap/kbd.mac.gui.chrome')
|
||||
|
||||
setShortcuts()
|
||||
|
||||
user_file = homedir + '/.config/kinto/user_config.json'
|
||||
with open(user_file, 'r') as f:
|
||||
user_config = json.load(f)
|
||||
|
||||
onetime = yn_choice("\nOne time initialization tweaks are available. Would you like to view them?")
|
||||
print("")
|
||||
if(onetime):
|
||||
intents = [obj for obj in user_config['de'] if(obj['intent'] == "init")]
|
||||
|
||||
for index, k in enumerate(intents):
|
||||
print(color_arr[default-1] + bcolors.BOLD + str(index+1) + '. ' + k['name'] + bcolors.ENDC)
|
||||
print(bcolors.CYELLOW2 + 'Description: ' + k['description'] + bcolors.ENDC)
|
||||
print(bcolors.CYELLOW2 + 'run: ' + k['run'].replace(";", "\n") + bcolors.ENDC + '\n')
|
||||
|
||||
print(bcolors.CYELLOW2 + "Please enter your init tweak(s) (eg 1 or 1 2 3 - leave blank to skip): " + bcolors.ENDC)
|
||||
defaultinit = [int(i) for i in input().split()]
|
||||
if len(defaultinit) != 0:
|
||||
user_config['init'] = [intents[defaultinit[0]-1]['id']]
|
||||
|
||||
print("\nDynamic shortcut tweaks\n")
|
||||
|
||||
intents = [obj for obj in user_config['de'] if(obj['intent'] == "gui_term")]
|
||||
tweaks = []
|
||||
tweaks_selected = []
|
||||
|
||||
for index, k in enumerate(intents):
|
||||
print(color_arr[default-1] + bcolors.BOLD + str(index+1) + '. ' + k['name'] + bcolors.ENDC)
|
||||
print(bcolors.CYELLOW2 + 'Description: ' + k['description'] + bcolors.ENDC)
|
||||
print(bcolors.CYELLOW2 + 'run in gui mode: ' + k['run_gui'].replace(";", "\n") + bcolors.ENDC)
|
||||
print(bcolors.CYELLOW2 + 'run in terminal mode: ' + k['run_term'].replace(";", "\n") + bcolors.ENDC + '\n')
|
||||
tweaks.append(k['id'])
|
||||
|
||||
print(bcolors.CYELLOW2 + "Please enter your dynamic shortcut tweak(s) (eg 1 or 1 2 3 - leave blank to skip): " + bcolors.ENDC)
|
||||
defaultde = [int(i) for i in input().split()]
|
||||
|
||||
for d in defaultde:
|
||||
user_config['de'][tweaks[d-1]]['active'] = True
|
||||
tweaks_selected.append(tweaks[d-1])
|
||||
|
||||
if len(defaultde) != 0:
|
||||
# gui
|
||||
user_config['config'][0]['de'] = tweaks_selected
|
||||
# term
|
||||
user_config['config'][1]['de'] = tweaks_selected
|
||||
# firefox
|
||||
user_config['config'][2]['de'] = tweaks_selected
|
||||
# chrome
|
||||
user_config['config'][3]['de'] = tweaks_selected
|
||||
|
||||
user_config['config'][0]['run'] = keyboardconfigs[defaultkb-1]['gui']
|
||||
user_config['config'][1]['run'] = keyboardconfigs[defaultkb-1]['term']
|
||||
user_config['config'][2]['run'] = keyboardconfigs[defaultkb-1]['gui'].replace("kbd.mac.gui","kbd.mac.gui.browsers")
|
||||
user_config['config'][3]['run'] = keyboardconfigs[defaultkb-1]['gui'].replace("kbd.mac.gui","kbd.mac.gui.chrome")
|
||||
|
||||
os.remove(user_file)
|
||||
with open(user_file, 'w') as f:
|
||||
json.dump(user_config, f, indent=4)
|
||||
print("Saved configuration to ~/.config/kinto/user_config.json\n")
|
||||
print("Now running keyswap_service.sh to setup the keyswap service...")
|
||||
print("Keyswap will be configured to run on user login\n")
|
||||
print("You may start, stop, restart or view the status of the service with following commands\n")
|
||||
print("systemctl --user start keyswap")
|
||||
print("systemctl --user stop keyswap")
|
||||
print("systemctl --user restart keyswap")
|
||||
print("systemctl --user status keyswap")
|
||||
os.system("./keyswap_service.sh")
|
@@ -1,7 +0,0 @@
|
||||
"xdotool key --delay 0 --clearmodifiers Alt+Left"
|
||||
Control + Left + Release
|
||||
#Home + release
|
||||
|
||||
"xdotool key --delay 0 --clearmodifiers Alt+Right"
|
||||
Control + Right + Release
|
||||
#End + release
|
@@ -1,5 +0,0 @@
|
||||
"xdotool key --delay 0 --clearmodifiers Home"
|
||||
Control + Left + Release
|
||||
|
||||
"xdotool key --delay 0 --clearmodifiers End"
|
||||
Control + Right + Release
|
@@ -1,7 +0,0 @@
|
||||
#"xte 'keydown Control_L' 'key bracketleft' 'keyup Control_L'"
|
||||
"xdotool key --delay 0 --clearmodifiers Control_L+bracketleft"
|
||||
Home + Release
|
||||
|
||||
#"xte 'keydown Control_R' 'key bracketright' 'keyup Control_R'"
|
||||
"xdotool key --delay 0 --clearmodifiers Control_L+bracketright"
|
||||
End + Release
|
@@ -1 +0,0 @@
|
||||
3cd35e15350ca7dac0c3cbfce1c661f7 /usr/bin/budgie-daemon
|
@@ -1 +0,0 @@
|
||||
8660c2f8e0a9d3cff896254f6c0f9159 /usr/bin/budgie-desktop
|
@@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir -p /tmp/kinto
|
||||
|
||||
IBUSADD=$(cat ~/.config/ibus/bus/`ls ~/.config/ibus/bus -1rt | tail -n1` | awk -F'IBUS_ADDRESS=' '{print $2}' | xargs)
|
||||
dbus-monitor --address $IBUSADD "path='/org/freedesktop/IBus/Panel',interface='org.freedesktop.IBus.Panel',member='FocusOut'" 2> /dev/null | grep --line-buffered -o -P '(?<=object path \"/org/freedesktop/IBus/InputContext_).*(?=[\"])' |
|
||||
while read ln
|
||||
do
|
||||
printf '%s\n' "$ln" > /tmp/kinto/caret
|
||||
done
|
@@ -1,78 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
for pid in $(pidof -x caret_status_xkey.sh); do
|
||||
if [ $pid != $$ ]; then
|
||||
echo "[$(date)] : caret_status_xkey.sh : Process is already running with PID $pid"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
mkdir -p /tmp/kinto/xkeysnail
|
||||
echo "0" > /tmp/kinto/caret
|
||||
|
||||
millitime=`date +%s%3N`
|
||||
echo "$millitime" > /tmp/kinto/millitime
|
||||
|
||||
IBUSADD=$(cat ~/.config/ibus/bus/`ls ~/.config/ibus/bus -1rt | tail -n1` | awk -F'IBUS_ADDRESS=' '{print $2}' | xargs)
|
||||
dbus-monitor --address $IBUSADD "path='/org/freedesktop/IBus/Panel',interface='org.freedesktop.IBus.Panel',member='FocusOut'" 2> /dev/null | grep --line-buffered -o -P '(?<=object path \"/org/freedesktop/IBus/InputContext_).*(?=[\"])' |
|
||||
while read ln
|
||||
do
|
||||
newtime=`date +%s%3N`
|
||||
difftime=$(( newtime - millitime ))
|
||||
millitime="$newtime"
|
||||
echo "$millitime" > /tmp/kinto/millitime
|
||||
appname=$(xprop -id `xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)" | awk '{print $5}'` | grep "WM_CLASS(STRING)" | awk '{print substr($4,2,length($4)-2)}')
|
||||
if [ "${ln}" == "1" ]; then
|
||||
appname=$(xprop -id `xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)" | awk '{print $5}'` | grep "WM_CLASS(STRING)" | awk '{print substr($4,2,length($4)-2)}')
|
||||
if [ "${appname}" == "Firefox" ]; then
|
||||
# echo "ff ww"
|
||||
printf 'ff ww %s\n' "1" > /tmp/kinto/caret
|
||||
elif [ "${appname}" == "Chromium" ] || [ "${appname}" == "Chromium-browser" ] || [ "${appname}" == "Google-chrome" ] || [ "${appname}" == "Epiphany" ]; then
|
||||
# echo "chrome ww"
|
||||
printf 'chrome ww %s\n' "1" > /tmp/kinto/caret
|
||||
else
|
||||
echo "reset" > /tmp/kinto/caret
|
||||
fi
|
||||
else
|
||||
if [ "${appname}" == "Firefox" ]; then
|
||||
# echo "ff nw"
|
||||
printf 'ff nw\n' > /tmp/kinto/caret
|
||||
elif [ "${appname}" == "Chromium" ] || [ "${appname}" == "Chromium-browser" ] || [ "${appname}" == "Google-chrome" ] || [ "${appname}" == "Epiphany" ]; then
|
||||
# echo "chrome nw"
|
||||
printf 'chrome nw\n' > /tmp/kinto/caret
|
||||
else
|
||||
echo "reset" > /tmp/kinto/caret
|
||||
fi
|
||||
fi
|
||||
|
||||
done&
|
||||
|
||||
while (true);do
|
||||
sleep 0.2
|
||||
appname2=$(xprop -id `xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)" | awk '{print $5}'` | grep "WM_CLASS(STRING)" | awk '{print substr($4,2,length($4)-2)}')
|
||||
check=$(cat /tmp/kinto/caret)
|
||||
millitime=$(cat /tmp/kinto/millitime)
|
||||
newtime=`date +%s%3N`
|
||||
difftime=$(( newtime - millitime ))
|
||||
if (( $difftime > 200 )); then
|
||||
if [ "${check}" == "ff nw" ] && [ "${lastcheck}" != 1 ]; then
|
||||
echo "firefox no wordwise"
|
||||
# Sets new config
|
||||
perl -pi -e "s/[^\n]\s{3}(K.*)(# Chrome-nw)/ # \$1\$2/g;s/[^\n]\s{3}#\s(K.*)(# Firefox-nw)/ \$1\$2/g;s/[^\n]\s{3}(K.*)(# Beginning of Line)/ # \$1\$2/g;s/[^\n]\s{3}(K.*)(# End of Line)/ # \$1\$2/g" /tmp/kinto/xkeysnail/kinto.py 2>/dev/null
|
||||
lastcheck=1
|
||||
ww=0
|
||||
elif [ "${check}" == "chrome nw" ] && [ "${lastcheck}" != 2 ]; then
|
||||
echo "chrome no wordwise"
|
||||
# Sets new config
|
||||
perl -pi -e "s/[^\n]\s{3}(K.*)(# Firefox-nw)/ # \$1\$2/g;s/[^\n]\s{3}(K.*)(# Beginning of Line)/ # \$1\$2/g;s/[^\n]\s{3}(K.*)(# End of Line)/ # \$1\$2/g;s/[^\n]\s{3}#\s(K.*)(# Chrome-nw)/ \$1\$2/g" /tmp/kinto/xkeysnail/kinto.py 2>/dev/null
|
||||
lastcheck=2
|
||||
ww=0
|
||||
elif ([ "${check}" != "chrome nw" ] && [ "${check}" != "ff nw" ] && [ "${lastcheck}" != 3 ]) || ([ "${appname2}" != "Firefox" ] && [ "${appname2}" != "Chromium" ] && [ "${appname2}" != "Chromium-browser" ] && [ "${appname2}" != "Google-chrome" ] && [ "${appname2}" != "Epiphany" ] && [ "${check}" == "reset" ] && [ "${lastcheck}" != 3 ]); then
|
||||
echo "wordwise"
|
||||
# Sets original config
|
||||
perl -pi -e "s/[^\n]\s{3}(K.*)(# Firefox-nw)/ # \$1\$2/g;s/[^\n]\s{3}#\s(K.*)(# Beginning of Line)/ \$1\$2/g;s/[^\n]\s{3}#\s(K.*)(# End of Line)/ \$1\$2/g;s/[^\n]\s{3}(K.*)(# Chrome-nw)/ # \$1\$2/g" /tmp/kinto/xkeysnail/kinto.py 2>/dev/null
|
||||
# cp /home/ryan/.config/kinto/kinto.py /tmp/kinto/xkeysnail/kinto.py
|
||||
lastcheck=3
|
||||
fi
|
||||
fi
|
||||
done
|
@@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
setxkbmap -option
|
||||
# force command to run silently and report true
|
||||
killall xbindkeys > /dev/null 2>&1 || :
|
||||
# rm /tmp/kinto/caret
|
||||
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Alt>Tab']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "['<Shift><Alt>Tab']"
|
||||
pkill -f /.config/kinto/xactive.sh
|
@@ -1,16 +0,0 @@
|
||||
[Unit]
|
||||
Description=keyswap for Terminal and GUI
|
||||
PartOf=graphical-session.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
# eg DISPLAY=:0.0
|
||||
#Environment=DISPLAY={displayid}
|
||||
RestartSec=1
|
||||
WorkingDirectory={homedir}/.config/kinto
|
||||
ExecStart=/bin/bash -c "{homedir}/.config/kinto/xactive.sh carrots"
|
||||
ExecStop=/bin/bash {homedir}/.config/kinto/cleanup.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
@@ -1,11 +0,0 @@
|
||||
# keyswap.timer
|
||||
[Unit]
|
||||
Description=Runs the keyswap.service 5 seconds after boot up
|
||||
|
||||
[Timer]
|
||||
#OnBootSec=5s
|
||||
OnActiveSec=5s
|
||||
Unit=keyswap.service
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
@@ -1,40 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Manual keyswap
|
||||
systemtype=$1
|
||||
internalid=$2
|
||||
usbid=$3
|
||||
swapbehavior=$4
|
||||
|
||||
swapcmd_term="setxkbmap -option;setxkbmap -option altwin:swap_alt_win"
|
||||
fallbackcmd_gui=""
|
||||
if [[ "$systemtype" == "windows" || "$systemtype" == "mac" ]]; then
|
||||
swapcmd_gui="setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY"
|
||||
elif [[ "$systemtype" == "mac_only" ]]; then
|
||||
swapcmd_gui="setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY"
|
||||
# Chromebook keyboard options
|
||||
elif [[ "$swapbehavior" == "both_mac" ]]; then
|
||||
swapcmd_gui="setxkbmap -option;setxkbmap -option ctrl:swap_lwin_lctl; xkbcomp -w0 -i $internalid -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY"
|
||||
swapcmd_term="setxkbmap -option;setxkbmap -device $internalid -option 'altwin:swap_alt_win'"
|
||||
elif [[ "$swapbehavior" == "both_win" ]]; then
|
||||
swapcmd_gui="setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY; setxkbmap -device $usbid -option altwin:ctrl_alt_win"
|
||||
fallbackcmd_gui="setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY"
|
||||
elif [[ "$swapbehavior" == "none" ]]; then
|
||||
swapcmd_gui="setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY"
|
||||
fi
|
||||
|
||||
if [[ "$systemtype" == "mac_only" ]]; then
|
||||
check=`setxkbmap -query | grep -c 'alt_super_win'`
|
||||
elif [[ "$swapbehavior" == "both_win" ]]; then
|
||||
check=`setxkbmap -query | grep -q 'ctrl_alt_win'; echo $?`
|
||||
else
|
||||
check=`setxkbmap -query | grep -c 'swap_alt_win'`
|
||||
fi
|
||||
|
||||
echo $check
|
||||
if [ $check -eq 0 ]; then
|
||||
echo "internal gui to term"
|
||||
eval "$swapcmd_term"
|
||||
else
|
||||
echo "internal term to gui"
|
||||
eval "$swapcmd_gui"
|
||||
fi
|
@@ -1,8 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Name=Kinto
|
||||
GenericName=Kinto
|
||||
Comment=Make Linux Type Like it's a Mac
|
||||
Exec=/bin/bash -c "/bin/sleep 5 && /usr/bin/systemctl --user start keyswap"
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-GNOME-Autostart-enabled=true
|
@@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
# No arguments
|
||||
./kintox11
|
||||
else
|
||||
./caret_status.sh &
|
||||
./kintox11
|
||||
fi
|
@@ -1,76 +0,0 @@
|
||||
{"config":[{
|
||||
"name":"gui",
|
||||
"run":"",
|
||||
"run_onInput":"",
|
||||
"run_offInput": "killall xbindkeys > /dev/null 2>&1",
|
||||
"symbols":"",
|
||||
"types":"",
|
||||
"de":[],
|
||||
"appnames":[ "" ]
|
||||
},
|
||||
{
|
||||
"name":"term",
|
||||
"run":"",
|
||||
"run_onInput":"",
|
||||
"run_offInput": "killall xbindkeys > /dev/null 2>&1",
|
||||
"symbols":"",
|
||||
"types":"",
|
||||
"de":[],
|
||||
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal","tilix","xfce4-terminal" ]
|
||||
},
|
||||
{
|
||||
"name": "firefox",
|
||||
"run": "",
|
||||
"run_onInput": "pkill -f ~/.config/kinto/.firefox-nw",
|
||||
"run_offInput": "xbindkeys -f $HOME/.config/kinto/.firefox-nw",
|
||||
"symbols": "",
|
||||
"types": "",
|
||||
"de": [],
|
||||
"appnames": [ "Firefox" ]
|
||||
},
|
||||
{
|
||||
"name": "chrome",
|
||||
"run": "",
|
||||
"run_onInput": "xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY",
|
||||
"run_offInput": "xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui.chrome $DISPLAY",
|
||||
"symbols": "",
|
||||
"types": "",
|
||||
"de": [],
|
||||
"appnames": [ "Chromium","Chromium-browser","Google-chrome","Epiphany" ]
|
||||
}],
|
||||
"init": [],
|
||||
"detypes":["gnome2","gnome3","kde4","kde5","xfce","i3wm"],
|
||||
"de":[{
|
||||
"id": 1,
|
||||
"type": ["gnome3"],
|
||||
"active": false,
|
||||
"intent":"init",
|
||||
"name":"gnome-init",
|
||||
"description":"Gnome - Remove Superkey Overlay keybinding to Activities Overview",
|
||||
"run":"gsettings set org.gnome.mutter overlay-key ''",
|
||||
"run_term":"",
|
||||
"run_gui":""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"type": ["gnome3"],
|
||||
"active": false,
|
||||
"intent":"gui_term",
|
||||
"name":"Gnome Activities Overview",
|
||||
"description":"Cmd+Space activates Activities Overview",
|
||||
"run":"",
|
||||
"run_term":"gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Control><Shift>Space']\"",
|
||||
"run_gui":"gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Ctrl>Space']\""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"type": ["kde5"],
|
||||
"active": false,
|
||||
"intent":"init",
|
||||
"name":"kde-init",
|
||||
"description":"KDE Plasma 5 - Removes Superkey Overlay from the Launcher Menu",
|
||||
"run":"kwriteconfig5 --file ~/.config/kwinrc --group ModifierOnlyShortcuts --key Meta \"\";qdbus org.kde.KWin /KWin reconfigure",
|
||||
"run_term":"",
|
||||
"run_gui":""
|
||||
}]
|
||||
}
|
@@ -1,508 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# set about:config?filter=ui.key.menuAccessKeyFocuses
|
||||
# to false for wordwise to work in Firefox
|
||||
|
||||
typeset -l distro
|
||||
distro=$(awk -F= '$1=="NAME" { print $2 ;}' /etc/os-release)
|
||||
typeset -l dename
|
||||
dename=$(./system-config/dename.sh | cut -d " " -f1)
|
||||
|
||||
function uninstall {
|
||||
|
||||
while true; do
|
||||
read -rep $'\nPress R to restore your original shortcuts.\nPress F to reset to factory shortcuts. (f/r)\n' yn
|
||||
case $yn in
|
||||
[Ff]* ) yn="f"; break;;
|
||||
[Rr]* ) yn="r";break;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$yn" == "f" ];then
|
||||
echo "Reset to factory shortcuts"
|
||||
if [ "$dename" == "gnome" ];then
|
||||
echo "Resetting DE hotkeys..."
|
||||
echo "gsettings reset-recursively org.gnome.desktop.wm.keybindings"
|
||||
gsettings reset-recursively org.gnome.desktop.wm.keybindings
|
||||
echo "gsettings reset-recursively org.gnome.mutter.keybindings"
|
||||
gsettings reset-recursively org.gnome.mutter.keybindings
|
||||
echo "gsettings set org.gnome.mutter overlay-key 'super'"
|
||||
gsettings set org.gnome.mutter overlay-key 'super'
|
||||
dconf dump /org/gnome/mutter/ > mutter.conf
|
||||
dconf load /org/gnome/mutter/ < mutter.conf
|
||||
elif [ "$dename" == "kde" ];then
|
||||
echo "Resetting DE hotkeys..."
|
||||
mv ~/.config/kwinrc ~/.config/kwinrc.kinto
|
||||
mv ~/.config/kglobalshortcutsrc ~/.config/kglobalshortcutsrc.kinto
|
||||
elif [ "$dename" == "xfce" ];then
|
||||
echo "Resetting DE hotkeys..."
|
||||
cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
|
||||
fi
|
||||
elif [ "$yn" == "r" ]; then
|
||||
echo "Restore original user shortcuts"
|
||||
if [ "$dename" == "gnome" ]; then
|
||||
echo "Restoring DE hotkeys..."
|
||||
wmkeys=$(ls | grep -m1 "keybinding")
|
||||
mutterkeys=$(ls | grep -m1 "mutter_")
|
||||
if [[ ${#wmkeys} > 0 ]]; then
|
||||
echo "dconf load /org/gnome/desktop/wm/keybindings/ < $wmkeys"
|
||||
dconf load /org/gnome/desktop/wm/keybindings/ < "$wmkeys"
|
||||
else
|
||||
echo "Gnome Desktop keybindings backup not found..."
|
||||
fi
|
||||
if [[ ${#mutterkeys} > 0 ]]; then
|
||||
echo "dconf load /org/gnome/mutter/keybindings/ < $mutterkeys"
|
||||
dconf load /org/gnome/mutter/keybindings/ <"$mutterkeys"
|
||||
fi
|
||||
if [[ ${#wmkeys} > 0 ]] || [[ ${#mutterkeys} > 0 ]]; then
|
||||
echo "Gnome hotkeys have been successfully restored."
|
||||
fi
|
||||
elif [ "$dename" == "kde" ]; then
|
||||
echo "Restoring DE hotkeys..."
|
||||
kwinkeys=$(ls | grep -m1 "kwinrc")
|
||||
kdekeys=$(ls | grep -m1 "kglobalshortcutsrc")
|
||||
cp ./"$kdekeys" ~/.config/kglobalshortcutsrc
|
||||
cp ./"$kwinkeys" ~/.config/kwinrc
|
||||
elif [ "$dename" == "xfce" ]; then
|
||||
echo "Restoring DE hotkeys..."
|
||||
xfcekeys=$(ls | grep -m1 "xfce4-keyboard")
|
||||
cp ./"$xfcekeys" ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function removeAppleKB {
|
||||
# Undo Apple keyboard cmd & alt swap
|
||||
if test -f "/sys/module/hid_apple/parameters/swap_opt_cmd" && [ `cat /sys/module/hid_apple/parameters/swap_opt_cmd` == "1" ]; then
|
||||
echo '0' | sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd
|
||||
echo 'options hid_apple swap_opt_cmd=0' | sudo tee /etc/modprobe.d/hid_apple.conf
|
||||
sudo update-initramfs -u -k all
|
||||
fi
|
||||
if test -f "/sys/module/applespi/parameters/swap_opt_cmd" && [ `cat /sys/module/applespi/parameters/swap_opt_cmd` == "1" ]; then
|
||||
echo '0' | sudo tee /sys/module/applespi/parameters/swap_opt_cmd
|
||||
echo 'options applespi swap_opt_cmd=0' | sudo tee /etc/modprobe.d/applespi.conf
|
||||
sudo update-initramfs -u -k all
|
||||
fi
|
||||
}
|
||||
|
||||
function trayApp {
|
||||
if [ -f /usr/bin/budgie-desktop ];then
|
||||
while true; do
|
||||
read -rep $'Would you like to install the Kinto Budgie Applet? (y/n)\n(You will need log off & back on and go to Budgie Desktop Settings & add Kinto to your top panel.)\n' yn
|
||||
case $yn in
|
||||
[Yy]* ) yn="y"; break;;
|
||||
[Nn]* ) yn="n";break;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
if [ "$yn" == "y" ]; then
|
||||
cd ./xkeysnail-config/trayapps/BudgieApplet/
|
||||
sudo ./install-applet.sh
|
||||
cd ../../../
|
||||
echo "Please logoff and back on for the Applet to be available for the top panel."
|
||||
sudo /usr/local/bin/logoff.sh $USER $DISPLAY&
|
||||
fi
|
||||
else
|
||||
while true; do
|
||||
read -rep $'Would you like to install the Kinto Gnome/XFCE System Tray? (y/n)\n' yn
|
||||
case $yn in
|
||||
[Yy]* ) yn="y"; break;;
|
||||
[Nn]* ) yn="n";break;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
if [ "$yn" == "y" ]; then
|
||||
echo "Kinto Gnome/XFCE System Tray Installed."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function budgieUninstall {
|
||||
if [ -f /usr/bin/budgie-desktop ];then
|
||||
read -n 1 -s -r -p "Your system may log you off immediately during the restoration of budgie-daemon. Press any key to continue..."
|
||||
bdmd5="$(md5sum /usr/bin/budgie-daemon | awk '{ print $1 }')"
|
||||
oldbdmd5=$(md5sum ./budgie-daemon_10.5.1.bak | awk '{ print $1 }')
|
||||
if [ "$bdmd5" != "$oldbdmd5" ]; then
|
||||
echo -e "\nReplacing budgie-daemon with backup..."
|
||||
sudo pkill budgie-daemon && sudo cp ./budgie-daemon_10.5.1.bak /usr/bin/budgie-daemon
|
||||
else
|
||||
echo -e "\nBudgie-daemon is already an original."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function budgieUpdate {
|
||||
# Check for budgie and install App Switching hack
|
||||
if [ -f /usr/bin/budgie-desktop ];then
|
||||
while true; do
|
||||
read -rep $'Would you like to update Budgie to support proper App Switching? (y/n)\n(Your system may immediately log you out after this runs.)\n' yn
|
||||
case $yn in
|
||||
[Yy]* ) yn="y"; break;;
|
||||
[Nn]* ) yn="n";break;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
if [ "$yn" == "y" ]; then
|
||||
budgieVersion="$(/usr/bin/budgie-desktop --version | awk '{ print $2; }' | head -n1)"
|
||||
if [ "$budgieVersion" == "10.5.1" ]; then
|
||||
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
|
||||
wget https://github.com/rbreaves/budgie-desktop/blob/binaries/binaries/budgie-daemon_10.5.1?raw=true -O ./system-config/budgie-daemon_10.5.1
|
||||
fi
|
||||
bdmd5=$(md5sum /usr/bin/budgie-daemon | awk '{ print $1 }')
|
||||
newbdmd5=$(md5sum ./system-config/budgie-daemon_10.5.1 | awk '{ print $1 }')
|
||||
if [ "$bdmd5" != "$newbdmd5" ]; then
|
||||
cp /usr/bin/budgie-daemon ./budgie-daemon_"$budgieVersion".bak
|
||||
sudo pkill budgie-daemon && sudo cp ./system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
|
||||
echo "Updated Budgie to use App Switching Patch"
|
||||
else
|
||||
echo "Budgie-daemon already patched, skipping replacement."
|
||||
fi
|
||||
else
|
||||
echo "Your Budgie version was $budgieVersion and the patch is for 10.5.1."
|
||||
while true; do
|
||||
read -rep $'Would you like to replace it any ways? (y/n)\n(A backup will be made)\n' yn
|
||||
case $yn in
|
||||
[Yy]* ) yn="y"; break;;
|
||||
[Nn]* ) yn="n";break;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
if [ "$yn" == "y" ]; then
|
||||
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
|
||||
wget https://github.com/rbreaves/budgie-desktop/raw/43d3b44243b0bcaee3262a79818024a651475b58/binaries/budgie-daemon_10.5.1 -O ./system-config/budgie-daemon_10.5.1
|
||||
fi
|
||||
cp /usr/bin/budgie-daemon ./budgie-daemon_"$budgieVersion".bak
|
||||
sudo pkill budgie-daemon && sudo cp ./system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
|
||||
echo "Updated Budgie to use App Switching Patch"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Install Kinto - xkeysnail (udev)"
|
||||
echo " 1) Windows & Mac (HID driver) - Most Standard keyboards (& 1st party usb/bt Apple keyboards)"
|
||||
echo " 2) Mac Only & VMs on Macbooks - 3rd & 1st party Apple keyboards"
|
||||
echo " 3) Chromebook - Chromebook running Linux"
|
||||
echo " 4) IBM M - Keyboards w/o Super/Win keys"
|
||||
# echo " 5) Uninstall"
|
||||
|
||||
read n
|
||||
|
||||
set "$n"
|
||||
fi
|
||||
|
||||
# Kinto tray
|
||||
installtray=false
|
||||
# multi-language
|
||||
rightalt=false
|
||||
# VS code remap
|
||||
vssublime=false
|
||||
|
||||
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "4" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" || $1 == "ibm" ]]; then
|
||||
if [[ $dename == "gnome" || $dename == "budgie" || $dename == "mate" || $dename == "xfce" ]];then
|
||||
installtray=true
|
||||
while true; do
|
||||
read -rep $'\nWould you like to install the Kinto System Tray (AppInidcator)? (Y/n)\n' yn
|
||||
case $yn in
|
||||
[Nn]* ) installtray=false; break;;
|
||||
* ) break;;
|
||||
esac
|
||||
done
|
||||
if [[ $dename == "gnome" ]]; then
|
||||
echo "Please install KStatusNotifierItem for AppIndicators to show up."
|
||||
echo "https://extensions.gnome.org/extension/615/appindicator-support/"
|
||||
echo "Note: This may still fail. If so use the Kinto gui app instead."
|
||||
read -p "Press enter to continue"
|
||||
fi
|
||||
fi
|
||||
|
||||
while true; do
|
||||
read -rep $'\nDo you want multi-language on Right Alt key? (y/N)\naka Left side remaps, right side doesn\'t\n' yn
|
||||
case $yn in
|
||||
[Yy]* ) rightalt=true; break;;
|
||||
* ) break;;
|
||||
esac
|
||||
done
|
||||
while true; do
|
||||
read -rep $'\nWould you like to give VS Code Sublime Text keymaps? (y/N)\n' yn
|
||||
case $yn in
|
||||
[Yy]* ) vssublime=true; break;;
|
||||
* ) break;;
|
||||
esac
|
||||
done
|
||||
# branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
# if [ "$branch" == "dev" ] || [ "$branch" == "alpha" ];then
|
||||
# while true; do
|
||||
# read -rep $'\nExperimental Support for Firefox/Chrome Back/Forward hotkeys (Cmd+Left/Right)?\n(Keys could get stuck, switch windows or press ctrl &/or super to release) (y/n)\n' yn
|
||||
# case $yn in
|
||||
# [Yy]* ) exp='/sbin/runuser -l {username} -c "export DISPLAY={displayid};{homedir}/.config/kinto/caret_status_xkey.sh\&";'; expsh='"{homedir}/.config/kinto/caret_status_xkey.sh"'; break;;
|
||||
# [Nn]* ) exp=" "; expsh=" " break;;
|
||||
# # * ) echo "Please answer yes or no.";;
|
||||
# esac
|
||||
# done
|
||||
# else
|
||||
# echo -e "\nSupport for Firefox/Chrome Back/Forward hotkeys (Cmd+Left/Right) disabled on $branch w/ xkeysnail \n"
|
||||
exp=" "
|
||||
expsh=" "
|
||||
# fi
|
||||
sudo systemctl enable xkeysnail >/dev/null 2>&1
|
||||
# if ! [ -x "$(command -v inotifywait)" ]; then
|
||||
# echo "Will need to install inotify-tools to restart key remapper live for config file changes..."
|
||||
# sudo ./system-config/unipkg.sh inotify-tools
|
||||
# fi
|
||||
if ! [ -x "$(command -v pip3)" ]; then
|
||||
echo "Will need to install python3-pip..."
|
||||
sudo ./system-config/unipkg.sh python3-pip
|
||||
fi
|
||||
if ! [ -x "$(command -v python3-config)" ]; then
|
||||
if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] || [ "$distro" == '"linux mint"' ]; then
|
||||
pydev="python3-dev"
|
||||
elif [ "$distro" == "fedora" ]; then
|
||||
pydev="python3-devel"
|
||||
fi
|
||||
if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "$distro" == "debian" ] || [ "$distro" == '"linux mint"' ]; then
|
||||
echo "Will need to install $pydev..."
|
||||
sudo ./system-config/unipkg.sh "$pydev"
|
||||
fi
|
||||
fi
|
||||
if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then
|
||||
if [ "$distro" == "\"manjaro linux\"" ]; then
|
||||
sudo ./system-config/unipkg.sh "xorg-xhost gcc"
|
||||
fi
|
||||
fi
|
||||
if [ "$distro" == '"linux mint"' ]; then
|
||||
pip3 install setuptools
|
||||
fi
|
||||
|
||||
# echo "Transferring files..."
|
||||
mkdir -p ~/.config/kinto
|
||||
|
||||
# KDE xhost fix
|
||||
# mkdir -p ~/.kde/Autostart
|
||||
# echo -e '#!/bin/sh\rxhost +SI:localuser:root' > ~/.kde/Autostart/kintohost.sh
|
||||
# chmod +x ~/.kde/Autostart/kintohost.sh
|
||||
|
||||
# KDE startup - xhost fix
|
||||
mkdir -p ~/.config/autostart
|
||||
yes | cp -rf ./xkeysnail-config/xkeysnail.desktop ~/.config/autostart/xkeysnail.desktop
|
||||
|
||||
# yes | cp -rf ./xkeysnail-config/xkeystart.sh ~/.config/kinto/xkeystart.sh
|
||||
|
||||
# *** More testing needing, universal way of killing kinto on user log out? ***
|
||||
# yes | sudo cp -rf xkeysnail-config/root_logoff.sh /usr/local/bin/logoff.sh
|
||||
# sudo chown root:root /usr/local/bin/logoff.sh
|
||||
# sudo chmod u+rwx /usr/local/bin/logoff.sh
|
||||
# sudo chmod go-w+rx /usr/local/bin/logoff.sh
|
||||
# *** End universal killing of kinto
|
||||
if $installtray ; then
|
||||
yes | sudo cp -rf xkeysnail-config/gnome_logoff.sh ~/.config/kinto/logoff.sh
|
||||
fi
|
||||
|
||||
yes | cp -rf ./xkeysnail-config/kinto.py ./xkeysnail-config/kinto.py.new
|
||||
yes | cp -rf ./xkeysnail-config/limitedadmins ./xkeysnail-config/limitedadmins.new
|
||||
yes | cp -rf ./xkeysnail-config/killdups.sh ~/.config/kinto/killdups.sh
|
||||
yes | cp -rf ./xkeysnail-config/appleKB.sh ~/.config/kinto/appleKB.sh
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/kintotray.py ~/.config/kinto/kintotray.py
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/kintotray.desktop ~/.config/kinto/kintotray.desktop
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/BudgieApplet/icons/kinto-color-16.svg ~/.config/kinto/kinto-color.svg
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/BudgieApplet/icons/kinto-invert-16.svg ~/.config/kinto/kinto-invert.svg
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/BudgieApplet/icons/kinto-solid-16.svg ~/.config/kinto/kinto-solid.svg
|
||||
# yes | cp -rf ./system-config/caret_status_xkey.sh ~/.config/kinto/caret_status_xkey.sh
|
||||
yes | cp -rf ./xkeysnail-config/xkeysnail.service ./xkeysnail-config/xkeysnail.service.new
|
||||
# yes | cp -rf ./xkeysnail-config/xkeysnail.timer ~/.config/systemd/user/xkeysnail.timer
|
||||
sed -i "s#{experimental-caret}#$exp#g" ./xkeysnail-config/xkeysnail.service.new
|
||||
if [ "$expsh" != " " ];then
|
||||
sed -i "s#{kill-caret}#/usr/bin/pkill -f $expsh#g" ./xkeysnail-config/xkeysnail.service.new
|
||||
else
|
||||
sed -i "s#{kill-caret}#$expsh#g" ./xkeysnail-config/xkeysnail.service.new
|
||||
fi
|
||||
sed -i "s/{username}/`whoami`/g" ./xkeysnail-config/xkeysnail.service.new
|
||||
sed -i "s#{homedir}#`echo "$HOME"`#g" ./xkeysnail-config/xkeysnail.service.new
|
||||
sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/kintotray.desktop
|
||||
sed -i "s#{xhost}#`\\which xhost`#g" ./xkeysnail-config/xkeysnail.service.new
|
||||
sed -i "s/{username}/`whoami`/g" ./xkeysnail-config/limitedadmins.new
|
||||
sed -i "s#{systemctl}#`\\which systemctl`#g" ./xkeysnail-config/limitedadmins.new
|
||||
sed -i "s#{pkill}#`\\which pkill`#g" ./xkeysnail-config/limitedadmins.new
|
||||
sed -i "s#{xkeysnail}#/usr/local/bin/xkeysnail#g" ./xkeysnail-config/limitedadmins.new
|
||||
sudo chown root:root ./xkeysnail-config/limitedadmins.new
|
||||
sudo mv ./xkeysnail-config/limitedadmins.new /etc/sudoers.d/limitedadmins
|
||||
sed -i "s#{systemctl}#`\\which systemctl`#g" ~/.config/autostart/xkeysnail.desktop
|
||||
yes | cp -rf ~/.config/kinto/kintotray.desktop ~/.config/autostart/kintotray.desktop
|
||||
if $installtray ; then
|
||||
sed -i "s#-c \"grep#-c \"python3 {homedir}/.config/kinto/kintotray.py;grep#g" ~/.config/autostart/xkeysnail.desktop
|
||||
sed -i "s#xkeysnail\"#xkeysnail;{homedir}/.config/kinto/logoff.sh\"#g" ~/.config/autostart/xkeysnail.desktop
|
||||
fi
|
||||
sed -i "s#{xhost}#`\\which xhost`#g" ~/.config/autostart/xkeysnail.desktop
|
||||
sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/autostart/xkeysnail.desktop
|
||||
# sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/prexk.sh
|
||||
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ./xkeysnail-config/xkeysnail.service.new
|
||||
# sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/kinto/prexk.sh
|
||||
|
||||
if $vssublime ; then
|
||||
perl -pi -e "s/(# )(.*)(- Sublime)/\$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $dename == "gnome" || dename == "budgie" ]]; then
|
||||
perl -pi -e "s/(# )(.*)(# gnome)/\$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
if [[ $dename == "kde" ]]; then
|
||||
echo "Applying Cmd-Space to open App Launcher for KDE..."
|
||||
perl -pi -e "s/(# )(.*)(#.*kde)/\$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ $1 == "1" || $1 == "winmac" ]]; then
|
||||
if ls /sys/module | grep hid_apple >/dev/null 2>&1 ; then
|
||||
echo '1' | sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd;echo 'options hid_apple swap_opt_cmd=1' | sudo tee /etc/modprobe.d/hid_apple.conf;sudo update-initramfs -u -k all
|
||||
fi
|
||||
if ls /sys/module | grep applespi >/dev/null 2>&1 ; then
|
||||
echo '1' | sudo tee /sys/module/applespi/parameters/swap_opt_cmd;echo 'options applespi swap_opt_cmd=1' | sudo tee /etc/modprobe.d/applespi.conf;sudo update-initramfs -u -k all
|
||||
fi
|
||||
if ! ls /sys/module | grep apple ; then
|
||||
removeAppleKB
|
||||
fi
|
||||
perl -pi -e "s/(# )(.*)(# WinMac)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
if [[ $dename == "xfce" ]]; then
|
||||
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
|
||||
fi
|
||||
elif [[ $1 == "2" || $1 == "mac" ]]; then
|
||||
removeAppleKB
|
||||
perl -pi -e "s/(# )(.*)(# Mac)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
if [[ $dename == "xfce" ]]; then
|
||||
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
|
||||
fi
|
||||
elif [[ $1 == "3" || $1 == "chromebook" ]]; then
|
||||
perl -pi -e "s/(# )(.*)(# Chromebook)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "s/(\w.*)(# Default)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
|
||||
elif [[ $1 == "4" || $1 == "ibm" ]]; then
|
||||
perl -pi -e "s/(# )(.*)(# IBM)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "s=(# )(.*)(# Chromebook/IBM)=\$2\$3=g" ./xkeysnail-config/kinto.py.new
|
||||
# perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "s/(\w.*)(# Default)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
|
||||
fi
|
||||
if [[ $dename == "xfce" ]] && ls /etc/apt/sources.list.d/enso* 1> /dev/null 2>&1; then
|
||||
echo "enso OS detected, applying Cmd-Space for Launchy..."
|
||||
perl -pi -e "s/(K\(\"RC-Space)(.*)(# )(xfce4)/\$3\$1\$2\$3\$4/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary>space" --create --type string --set "launchy"
|
||||
fi
|
||||
|
||||
if $rightalt ; then
|
||||
perl -pi -e "s/(\w.*)(Multi-language)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
|
||||
mv ./xkeysnail-config/kinto.py.new ~/.config/kinto/kinto.py
|
||||
git describe --tags | perl -ne "print \"\$1 build `git rev-parse --short HEAD`\n\" for m/\b(.*)-\w+-\w{8}/" > ~/.config/kinto/version
|
||||
# if [ "$distro" == "fedora" ];then
|
||||
sudo rm /etc/systemd/system/xkeysnail.service
|
||||
if [ -d /usr/lib/systemd/system ];then
|
||||
xkeypath="/usr/lib/systemd/system/"
|
||||
elif [ -d /lib/systemd/system ];then
|
||||
xkeypath="/lib/systemd/system/"
|
||||
fi
|
||||
sudo mv ./xkeysnail-config/xkeysnail.service.new "$xkeypath"xkeysnail.service && echo "Service file added to "$xkeypath"xkeysnail.service"
|
||||
sudo chown -R root:root "$xkeypath"xkeysnail.service && echo "Ownership set for root..." || echo "Failed to set ownership..."
|
||||
sudo chmod 644 "$xkeypath"xkeysnail.service && echo "Permissions set to 644..." || echo "Failed to set permissions..."
|
||||
sudo ln -s "$xkeypath"xkeysnail.service /etc/systemd/system/xkeysnail.service && echo "Created soft symlink..." || echo "Failed to create soft symlink..."
|
||||
sudo ln -s "$xkeypath"xkeysnail.service /etc/systemd/system/graphical.target.wants/xkeysnail.service && echo "Created soft symlink for graphical target..." || echo "Failed to create soft symlink for graphical target..."
|
||||
xhost +SI:localuser:root
|
||||
git clone --depth 10 https://github.com/rbreaves/xkeysnail.git || git pull --depth 10
|
||||
cd xkeysnail
|
||||
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
|
||||
giturl=$(git ls-remote --get-url)
|
||||
if [ "$giturl" != "https://github.com/rbreaves/xkeysnail.git" ];then
|
||||
echo -e "\nreplacing xkeysnail with fork...\n"
|
||||
cd ..
|
||||
rm -rf ./xkeysnail
|
||||
git clone --depth 10 https://github.com/rbreaves/xkeysnail.git
|
||||
cd xkeysnail
|
||||
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
|
||||
fi
|
||||
sudo pip3 install --upgrade .
|
||||
cd ..
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl disable xkeysnail
|
||||
# sudo systemctl --state=not-found --all | grep xkeysnail
|
||||
# if [ "$distro" == "fedora" ];then
|
||||
# systemctl enable xkeysnail.service
|
||||
# else
|
||||
# sudo systemctl enable xkeysnail.service
|
||||
# fi
|
||||
sudo systemctl restart xkeysnail
|
||||
sudo pkill -f kintotray >/dev/null 2>&1
|
||||
nohup python3 ~/.config/kinto/kintotray.py& >/dev/null 2>&1
|
||||
|
||||
echo -e "Adding xhost fix...\n"
|
||||
|
||||
LINE='xhost +SI:localuser:root'
|
||||
|
||||
if [ ! -e "~/.xprofile" ]; then
|
||||
# Ubuntu xhost fix
|
||||
echo "$LINE" > ~/.xprofile
|
||||
# echo "$LINE" > ~/.xinitrc
|
||||
fi
|
||||
# Ubuntu xhost fix
|
||||
grep -qF -- "$LINE" ~/.xprofile || echo "$LINE" >> ~/.xprofile
|
||||
# KDE xhost fix
|
||||
# grep -qF -- "$LINE" ~/.bashrc || echo "$LINE" >> ~/.bashrc
|
||||
# grep -qF -- "$LINE" ~/.xinitrc || echo "$LINE" >> ~/.xinitrc
|
||||
|
||||
# remove kintox11 login startup
|
||||
if test -f "~/.config/autostart/kinto.desktop"; then
|
||||
rm ~/.config/autostart/kinto.desktop
|
||||
fi
|
||||
|
||||
echo -e "Kinto install is \e[1m\e[32mcomplete\e[0m.\n"
|
||||
if `sudo systemctl is-active --quiet xkeysnail`;then
|
||||
echo -e "Kinto \e[1m\e[32mxkeysnail service is running\e[0m.\n"
|
||||
echo "Commands for controlling Kinto's xkeysnail service"
|
||||
echo "sudo systemctl restart xkeysnail"
|
||||
echo "sudo systemctl stop xkeysnail"
|
||||
echo "sudo systemctl start xkeysnail"
|
||||
echo "sudo systemctl status xkeysnail"
|
||||
else
|
||||
echo -e "Kinto \e[1m\e[91mxkeysnail service has failed.\e[0m"
|
||||
echo "You can run 'sudo systemctl status xkeysnail' for more info"
|
||||
echo "You can also run 'sudo journalctl -u xkeysnail'"
|
||||
fi
|
||||
echo ""
|
||||
if $vssublime ; then
|
||||
echo -e "\e[1m\e[32mEnabled\e[0m VS Code Sublime Text remap."
|
||||
fi
|
||||
if $rightalt ; then
|
||||
echo -e "\e[1m\e[32mEnabled\e[0m mutli-language support."
|
||||
fi
|
||||
|
||||
# trayApp
|
||||
|
||||
elif [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
|
||||
echo "Uninstalling Kinto - xkeysnail (udev)"
|
||||
uninstall
|
||||
removeAppleKB
|
||||
pkill -f kintotray >/dev/null 2>&1
|
||||
sudo systemctl stop xkeysnail >/dev/null 2>&1
|
||||
sudo systemctl disable xkeysnail >/dev/null 2>&1
|
||||
sudo rm /etc/sudoers.d/limitedadmins
|
||||
rm ~/.config/autostart/xkeysnail.desktop
|
||||
rm -rf ~/.config/kinto
|
||||
sudo rm /etc/systemd/system/xkeysnail.service >/dev/null 2>&1
|
||||
sudo rm /etc/systemd/system/graphical.target.wants/xkeysnail.service >/dev/null 2>&1
|
||||
sudo rm /usr/lib/systemd/system/xkeysnail.service >/dev/null 2>&1
|
||||
if [ -f /usr/local/bin/logoff.sh ];then
|
||||
sudo rm /usr/local/bin/logoff.sh
|
||||
fi
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl --state=not-found --all | grep xkeysnail
|
||||
budgieUninstall
|
||||
exit 0
|
||||
elif [[ $1 == "budgieUpdate" ]]; then
|
||||
budgieUpdate
|
||||
else
|
||||
echo "Expected argument was not provided"
|
||||
fi
|
0
xkeysnail-config/gui/capslock_1200x720.png → linux/gui/capslock_1200x720.png
Executable file → Normal file
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
0
xkeysnail-config/gui/keys_1200x720.png → linux/gui/keys_1200x720.png
Executable file → Normal file
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
0
xkeysnail-config/gui/kinto.desktop → linux/gui/kinto.desktop
Normal file → Executable file
0
xkeysnail-config/gui/tuxbg.png → linux/gui/tuxbg.png
Executable file → Normal file
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 111 KiB |
0
xkeysnail-config/gui/tuxcry4.png → linux/gui/tuxcry4.png
Executable file → Normal file
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
0
xkeysnail-config/gui/tuxerror.png → linux/gui/tuxerror.png
Executable file → Normal file
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB |
0
xkeysnail-config/gui/tuxuninstall.png → linux/gui/tuxuninstall.png
Executable file → Normal file
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
80
xkeysnail-config/kinto.py → linux/kinto.py
Normal file → Executable file
@@ -7,17 +7,35 @@ from xkeysnail.transform import *
|
||||
# Use the following for testing terminal keymaps
|
||||
# terminals = [ "", ... ]
|
||||
# xbindkeys -mk
|
||||
terminals = ["kinto-gui.py","gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal","tilix","xfce4-terminal"]
|
||||
terminals = ["kinto-gui.py","gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal","tilix","xfce4-terminal","hyper"]
|
||||
terminals = [term.casefold() for term in terminals]
|
||||
termStr = "|".join(str(x) for x in terminals)
|
||||
|
||||
mscodes = ["code","vscodium"]
|
||||
codeStr = "|".join(str(x) for x in mscodes)
|
||||
|
||||
# Add remote desktop clients & VM software here
|
||||
# Ideally we'd only exclude the client window,
|
||||
# but that may not be easily done.
|
||||
remotes = ["org.remmina.Remmina"]
|
||||
remotes = [client.casefold() for client in remotes]
|
||||
|
||||
# Add remote desktop clients & VMs for no remapping
|
||||
terminals.extend(remotes)
|
||||
mscodes.extend(remotes)
|
||||
|
||||
# Use for browser specific hotkeys
|
||||
browsers = ["Chromium","Chromium-browser","Google-chrome","Epiphany","Firefox","Discord"]
|
||||
browsers = ["Chromium","Chromium-browser","Google-chrome","microsoft-edge-dev","microsoft-edge","Epiphany","Firefox","Discord"]
|
||||
browsers = [browser.casefold() for browser in browsers]
|
||||
browserStr = "|".join(str(x) for x in browsers)
|
||||
|
||||
mscodes = ["code","vscodium"]
|
||||
codeStr = "|".join(str(x) for x in mscodes)
|
||||
chromes = ["Chromium","Chromium-browser","Google-chrome","microsoft-edge-dev","microsoft-edge"]
|
||||
chromes = [chrome.casefold() for chrome in chromes]
|
||||
chromeStr = "|".join(str(x) for x in chromes)
|
||||
|
||||
# edges = ["microsoft-edge-dev","microsoft-edge"]
|
||||
# edges = [edge.casefold() for edge in edges]
|
||||
# edgeStr = "|".join(str(x) for x in edges)
|
||||
|
||||
define_multipurpose_modmap(
|
||||
# {Key.ENTER: [Key.ENTER, Key.RIGHT_CTRL] # Enter2Cmd
|
||||
@@ -99,7 +117,7 @@ define_conditional_modmap(re.compile(termStr, re.IGNORECASE), {
|
||||
})
|
||||
|
||||
# Keybindings for IntelliJ
|
||||
define_keymap(re.compile("jetbrains-idea", re.IGNORECASE),{
|
||||
define_keymap(re.compile("^jetbrains-(?!.*toolbox).*$", re.IGNORECASE),{
|
||||
# General
|
||||
K("C-Key_0"): K("M-Key_0"), # Open corresponding tool window
|
||||
K("C-Key_1"): K("M-Key_1"), # Open corresponding tool window
|
||||
@@ -198,10 +216,33 @@ define_keymap(re.compile("org.gnome.nautilus", re.IGNORECASE),{
|
||||
|
||||
# Keybindings for Browsers
|
||||
define_keymap(re.compile(browserStr, re.IGNORECASE),{
|
||||
K("RC-Q"): K("RC-Q"), # Close all browsers Instances
|
||||
K("RC-Q"): K("RC-Q"), # Close all browsers Instances
|
||||
K("M-RC-I"): K("RC-Shift-I"), # Dev tools
|
||||
K("M-RC-J"): K("RC-Shift-J"), # Dev tools
|
||||
K("RC-Key_1"): K("M-Key_1"), # Jump to Tab #1-#8
|
||||
K("RC-Key_2"): K("M-Key_2"),
|
||||
K("RC-Key_3"): K("M-Key_3"),
|
||||
K("RC-Key_4"): K("M-Key_4"),
|
||||
K("RC-Key_5"): K("M-Key_5"),
|
||||
K("RC-Key_6"): K("M-Key_6"),
|
||||
K("RC-Key_7"): K("M-Key_7"),
|
||||
K("RC-Key_8"): K("M-Key_8"),
|
||||
K("RC-Key_9"): K("M-Key_9"), # Jump to last tab
|
||||
})
|
||||
|
||||
define_keymap(None,{
|
||||
# Open preferences in browsers
|
||||
define_keymap(re.compile("Firefox", re.IGNORECASE),{
|
||||
K("C-comma"): [K("C-T"),K("a"),K("b"),K("o"),K("u"),K("t"),K("Shift-SEMICOLON"),K("p"),K("r"),K("e"),K("f"),K("e"),K("r"),K("e"),K("n"),K("c"),K("e"),K("s"),K("Enter")],
|
||||
})
|
||||
define_keymap(re.compile(chromeStr, re.IGNORECASE),{
|
||||
K("C-comma"): [K("M-e"), K("s"),K("Enter")],
|
||||
})
|
||||
# Opera C-F12
|
||||
|
||||
# None referenced here originally
|
||||
# - but remote clients and VM software ought to be set here
|
||||
# These are the typical remaps for ALL GUI based apps
|
||||
define_keymap(lambda wm_class: wm_class.casefold() not in remotes,{
|
||||
K("RC-Space"): K("Alt-F1"), # Default SL - Launch Application Menu (gnome/kde)
|
||||
K("RC-F3"):K("Super-d"), # Default SL - Show Desktop (gnome/kde,eos)
|
||||
K("RC-LC-f"):K("M-F10"), # Default SL - Maximize app (gnome/kde)
|
||||
@@ -213,7 +254,7 @@ define_keymap(None,{
|
||||
K("RC-Tab"): K("M-Tab"), # Default not-xfce4 - Cmd Tab - App Switching Default
|
||||
K("RC-Shift-Tab"): K("M-Shift-Tab"), # Default not-xfce4 - Cmd Tab - App Switching Default
|
||||
K("RC-Grave"): K("M-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching
|
||||
K("RC-Shift-Grave"): K("M-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching
|
||||
K("RC-Shift-Grave"): K("M-Shift-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching
|
||||
# K("Super-Right"):K("Super-Page_Up"), # SL - Change workspace (ubuntu/fedora)
|
||||
# K("Super-Left"):K("Super-Page_Down"), # SL - Change workspace (ubuntu/fedora)
|
||||
# K("Super-Right"):K("Super-C-Up"), # SL - Change workspace (popos)
|
||||
@@ -239,6 +280,9 @@ define_keymap(None,{
|
||||
# K("M-Grave") : K("C-Shift-Tab"), # Chromebook/IBM - In-App Tab switching
|
||||
K("Super-Tab"): K("LC-Tab"), # Default not-chromebook
|
||||
K("Super-Shift-Tab"): K("LC-Shift-Tab"), # Default not-chromebook
|
||||
|
||||
# Fn to Alt style remaps
|
||||
K("RM-Enter"): K("insert"), # Insert
|
||||
|
||||
# emacs style
|
||||
K("Super-a"): K("Home"), # Beginning of Line
|
||||
@@ -250,6 +294,8 @@ define_keymap(None,{
|
||||
K("Super-k"): [K("Shift-End"), K("Backspace")],
|
||||
K("Super-d"): K("Delete"),
|
||||
|
||||
# K("M-RC-Space"): K(""), # Open Finder - Placeholder
|
||||
|
||||
# Wordwise
|
||||
K("RC-Left"): K("Home"), # Beginning of Line
|
||||
K("RC-Shift-Left"): K("Shift-Home"), # Select all to Beginning of Line
|
||||
@@ -322,7 +368,10 @@ define_keymap(re.compile(codeStr, re.IGNORECASE),{
|
||||
K("C-g"): K("f3"), # find_next
|
||||
K("Shift-f3"): pass_through_key, # cancel find_prev
|
||||
K("C-Shift-g"): K("Shift-f3"), # find_prev
|
||||
K("Super-c"): K("LC-c"), # Sigints - interrupt
|
||||
# K("Super-c"): K("LC-c"), # Default - Terminal - Sigint
|
||||
# K("Super-x"): K("LC-x"), # Default - Terminal - Exit nano
|
||||
# K("M-c"): K("LC-c"), # Chromebook/IBM - Terminal - Sigint
|
||||
# K("M-x"): K("LC-x"), # Chromebook/IBM - Terminal - Exit nano
|
||||
# K("Super-C-g"): K("C-f2"), # Default - Sublime - find_all_under
|
||||
# K("C-M-g"): K("C-f2"), # Chromebook/IBM - Sublime - find_all_under
|
||||
# K("Super-Shift-up"): K("M-Shift-up"), # multi-cursor up - Sublime
|
||||
@@ -333,6 +382,10 @@ define_keymap(re.compile(codeStr, re.IGNORECASE),{
|
||||
|
||||
# Keybindings for Sublime Text
|
||||
define_keymap(re.compile("Sublime_text", re.IGNORECASE),{
|
||||
# K("Super-c"): K("LC-c"), # Default - Terminal - Sigint
|
||||
# K("Super-x"): K("LC-x"), # Default - Terminal - Exit nano
|
||||
# K("M-c"): K("LC-c"), # Chromebook/IBM - Terminal - Sigint
|
||||
# K("M-x"): K("LC-x"), # Chromebook/IBM - Terminal - Exit nano
|
||||
K("Super-Space"): K("C-Space"), # Basic code completion
|
||||
K("C-Super-up"): K("M-o"), # Switch file
|
||||
K("Super-RC-f"): K("f11"), # toggle_full_screen
|
||||
@@ -428,9 +481,14 @@ define_keymap(re.compile(termStr, re.IGNORECASE),{
|
||||
K("LC-Tab") : K("LC-PAGE_DOWN"),
|
||||
K("LC-Shift-Tab") : K("LC-PAGE_UP"),
|
||||
K("LC-Grave") : K("LC-PAGE_UP"),
|
||||
# K("M-Tab"): pass_through_key, # Default not-xfce4 - Cmd Tab - App Switching Default
|
||||
# K("RC-Tab"): K("M-Tab"), # Default not-xfce4 - Cmd Tab - App Switching Default
|
||||
# K("RC-Shift-Tab"): K("M-Shift-Tab"), # Default not-xfce4 - Cmd Tab - App Switching Default
|
||||
# Cmd Tab - App Switching Default
|
||||
# K("RC-Tab"): K("RC-backslash"), # xfce4
|
||||
# K("RC-Shift-Tab"): K("RC-Shift-backslash"), # xfce4
|
||||
# K("RC-Grave"): K("RC-Shift-backslash"), # xfce4
|
||||
# Converts Cmd to use Ctrl-Shift
|
||||
K("RC-Tab"): K("RC-F13"),
|
||||
K("RC-Shift-Tab"): K("RC-Shift-F13"),
|
||||
K("RC-V"): K("C-Shift-V"),
|
||||
K("RC-MINUS"): K("C-Shift-MINUS"),
|
||||
K("RC-EQUAL"): K("C-Shift-EQUAL"),
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
0
xkeysnail-config/xkeysnail.desktop → linux/xkeysnail.desktop
Normal file → Executable file
0
xkeysnail-config/xkeysnail.service → linux/xkeysnail.service
Normal file → Executable file
@@ -1,705 +0,0 @@
|
||||
[
|
||||
/*
|
||||
Custom macOS keymap for Kinto keymap
|
||||
*/
|
||||
{ "keys": ["ctrl+shift+n"], "command": "new_window" },
|
||||
{ "keys": ["ctrl+shift+w"], "command": "close_window" },
|
||||
{ "keys": ["ctrl+o"], "command": "prompt_open" },
|
||||
{ "keys": ["ctrl+shift+t"], "command": "reopen_last_file" },
|
||||
{ "keys": ["ctrl+super+up"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "hh", "h", "ipp", "inl", "m", "mm"]} },
|
||||
{ "keys": ["ctrl+n"], "command": "new_file" },
|
||||
{ "keys": ["ctrl+s"], "command": "save" },
|
||||
{ "keys": ["ctrl+shift+s"], "command": "prompt_save_as" },
|
||||
{ "keys": ["ctrl+super+s"], "command": "save_all" },
|
||||
{ "keys": ["ctrl+w"], "command": "close" },
|
||||
|
||||
{ "keys": ["ctrl+k", "ctrl+b"], "command": "toggle_side_bar" },
|
||||
{ "keys": ["ctrl+alt+f"], "command": "toggle_full_screen" },
|
||||
{ "keys": ["ctrl+alt+shift+f"], "command": "toggle_distraction_free" },
|
||||
|
||||
{ "keys": ["ctrl+z"], "command": "undo" },
|
||||
{ "keys": ["ctrl+shift+z"], "command": "redo" },
|
||||
{ "keys": ["ctrl+y"], "command": "redo_or_repeat" },
|
||||
{ "keys": ["ctrl+u"], "command": "soft_undo" },
|
||||
{ "keys": ["ctrl+shift+u"], "command": "soft_redo" },
|
||||
|
||||
{ "keys": ["ctrl+x"], "command": "cut" },
|
||||
{ "keys": ["ctrl+c"], "command": "copy" },
|
||||
{ "keys": ["ctrl+v"], "command": "paste" },
|
||||
{ "keys": ["ctrl+shift+v"], "command": "paste_and_indent" },
|
||||
{ "keys": ["ctrl+k", "ctrl+v"], "command": "paste_from_history" },
|
||||
{ "keys": ["ctrl+option+v"], "command": "paste_from_history" },
|
||||
|
||||
{ "keys": ["alt+super+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
|
||||
{ "keys": ["alt+super+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
|
||||
{ "keys": ["alt+super+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
|
||||
{ "keys": ["alt+super+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
|
||||
|
||||
{ "keys": ["alt+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
|
||||
{ "keys": ["alt+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
|
||||
{ "keys": ["alt+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
|
||||
{ "keys": ["alt+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
|
||||
|
||||
{ "keys": ["alt+super+up"], "command": "scroll_lines", "args": {"amount": 1.0} },
|
||||
{ "keys": ["alt+super+down"], "command": "scroll_lines", "args": {"amount": -1.0} },
|
||||
|
||||
{ "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} },
|
||||
{ "keys": ["alt+shift+down"], "command": "select_lines", "args": {"forward": true} },
|
||||
|
||||
{ "keys": ["ctrl+shift+["], "command": "prev_view" },
|
||||
{ "keys": ["ctrl+shift+]"], "command": "next_view" },
|
||||
{ "keys": ["ctrl+super+left"], "command": "prev_view" },
|
||||
{ "keys": ["ctrl+super+right"], "command": "next_view" },
|
||||
|
||||
{ "keys": ["alt+tab"], "command": "next_view_in_stack" },
|
||||
{ "keys": ["alt+shift+tab"], "command": "prev_view_in_stack" },
|
||||
|
||||
{ "keys": ["ctrl+a"], "command": "select_all" },
|
||||
{ "keys": ["ctrl+shift+l"], "command": "split_selection_into_lines" },
|
||||
{ "keys": ["escape"], "command": "single_selection", "context":
|
||||
[
|
||||
{ "key": "num_selections", "operator": "not_equal", "operand": 1 }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "clear_fields", "context":
|
||||
[
|
||||
{ "key": "has_next_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "clear_fields", "context":
|
||||
[
|
||||
{ "key": "has_prev_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_panel", "args": {"cancel": true},
|
||||
"context":
|
||||
[
|
||||
{ "key": "panel_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_overlay", "context":
|
||||
[
|
||||
{ "key": "overlay_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_popup", "context":
|
||||
[
|
||||
{ "key": "popup_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_auto_complete", "context":
|
||||
[
|
||||
{ "key": "auto_complete_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+]"], "command": "indent" },
|
||||
{ "keys": ["ctrl+["], "command": "unindent" },
|
||||
|
||||
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
|
||||
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},
|
||||
"context":
|
||||
[
|
||||
{ "key": "setting.tab_completion", "operator": "equal", "operand": true },
|
||||
{ "key": "preceding_text", "operator": "not_regex_match", "operand": ".*\\b[0-9]+$", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "replace_completion_with_next_completion", "context":
|
||||
[
|
||||
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
|
||||
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "reindent", "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "indent", "context":
|
||||
[
|
||||
{ "key": "text", "operator": "regex_contains", "operand": "\n" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "next_field", "context":
|
||||
[
|
||||
{ "key": "has_next_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "commit_completion", "context":
|
||||
[
|
||||
{ "key": "auto_complete_visible" },
|
||||
{ "key": "setting.auto_complete_commit_on_tab" }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["shift+tab"], "command": "insert", "args": {"characters": "\t"} },
|
||||
{ "keys": ["shift+tab"], "command": "unindent", "context":
|
||||
[
|
||||
{ "key": "setting.shift_tab_unindent", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+tab"], "command": "unindent", "context":
|
||||
[
|
||||
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\t ]*" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+tab"], "command": "unindent", "context":
|
||||
[
|
||||
{ "key": "text", "operator": "regex_contains", "operand": "\n" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+tab"], "command": "prev_field", "context":
|
||||
[
|
||||
{ "key": "has_prev_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+l"], "command": "expand_selection", "args": {"to": "line"} },
|
||||
{ "keys": ["ctrl+d"], "command": "find_under_expand" },
|
||||
{ "keys": ["ctrl+k", "ctrl+d"], "command": "find_under_expand_skip" },
|
||||
{ "keys": ["ctrl+shift+space"], "command": "expand_selection", "args": {"to": "scope"} },
|
||||
{ "keys": ["alt+shift+m"], "command": "expand_selection", "args": {"to": "brackets"} },
|
||||
{ "keys": ["alt+m"], "command": "move_to", "args": {"to": "brackets"} },
|
||||
{ "keys": ["ctrl+shift+j"], "command": "expand_selection", "args": {"to": "indentation"} },
|
||||
{ "keys": ["ctrl+shift+a"], "command": "expand_selection", "args": {"to": "tag"} },
|
||||
|
||||
{ "keys": ["ctrl+super+."], "command": "close_tag" },
|
||||
|
||||
{ "keys": ["alt+q"], "command": "toggle_record_macro" },
|
||||
{ "keys": ["alt+shift+q"], "command": "run_macro" },
|
||||
|
||||
{ "keys": ["ctrl+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line.sublime-macro"} },
|
||||
{ "keys": ["ctrl+shift+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line Before.sublime-macro"} },
|
||||
{ "keys": ["enter"], "command": "commit_completion", "context":
|
||||
[
|
||||
{ "key": "auto_complete_visible" },
|
||||
{ "key": "setting.auto_complete_commit_on_tab", "operand": false }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+t"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
|
||||
{ "keys": ["ctrl+p"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
|
||||
{ "keys": ["ctrl+shift+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
|
||||
{ "keys": ["ctrl+alt+p"], "command": "prompt_select_workspace" },
|
||||
{ "keys": ["ctrl+r"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
|
||||
{ "keys": ["alt+g"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
|
||||
{ "keys": ["f12"], "command": "goto_definition" },
|
||||
{ "keys": ["ctrl+super+down"], "command": "goto_definition" },
|
||||
{ "keys": ["ctrl+shift+r"], "command": "goto_symbol_in_project" },
|
||||
{ "keys": ["alt+minus"], "command": "jump_back" },
|
||||
{ "keys": ["alt+shift+minus"], "command": "jump_forward" },
|
||||
|
||||
{ "keys": ["ctrl+i"], "command": "show_panel", "args": {"panel": "incremental_find", "reverse": false} },
|
||||
{ "keys": ["ctrl+shift+i"], "command": "show_panel", "args": {"panel": "incremental_find", "reverse": true} },
|
||||
{ "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": "find", "reverse": false} },
|
||||
{ "keys": ["ctrl+super+f"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },
|
||||
{ "keys": ["ctrl+super+e"], "command": "replace_next" },
|
||||
{ "keys": ["ctrl+g"], "command": "find_next" },
|
||||
{ "keys": ["ctrl+shift+g"], "command": "find_prev" },
|
||||
{ "keys": ["ctrl+e"], "command": "slurp_find_string" },
|
||||
{ "keys": ["ctrl+shift+e"], "command": "slurp_replace_string" },
|
||||
|
||||
{ "keys": ["super+ctrl+g"], "command": "find_under" },
|
||||
{ "keys": ["shift+super+ctrl+g"], "command": "find_under_prev" },
|
||||
{ "keys": ["alt+ctrl+g"], "command": "find_all_under" },
|
||||
|
||||
{ "keys": ["ctrl+shift+f"], "command": "show_panel", "args": {"panel": "find_in_files"} },
|
||||
{ "keys": ["f4"], "command": "next_result" },
|
||||
{ "keys": ["shift+f4"], "command": "prev_result" },
|
||||
|
||||
{ "keys": ["f6"], "command": "toggle_setting", "args": {"setting": "spell_check"} },
|
||||
{ "keys": ["alt+f6"], "command": "next_misspelling" },
|
||||
{ "keys": ["alt+shift+f6"], "command": "prev_misspelling" },
|
||||
|
||||
{ "keys": ["alt+ctrl+up"], "command": "swap_line_up" },
|
||||
{ "keys": ["alt+ctrl+down"], "command": "swap_line_down" },
|
||||
|
||||
{ "keys": ["alt+backspace"], "command": "delete_word", "args": { "forward": false, "sub_words": true } },
|
||||
{ "keys": ["alt+delete"], "command": "delete_word", "args": { "forward": true, "sub_words": true } },
|
||||
|
||||
{ "keys": ["ctrl+forward_slash"], "command": "toggle_comment", "args": { "block": false } },
|
||||
{ "keys": ["ctrl+super+forward_slash"], "command": "toggle_comment", "args": { "block": true } },
|
||||
|
||||
{ "keys": ["ctrl+j"], "command": "join_lines" },
|
||||
{ "keys": ["ctrl+shift+d"], "command": "duplicate_line" },
|
||||
|
||||
{ "keys": ["alt+backquote"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },
|
||||
|
||||
{ "keys": ["alt+space"], "command": "auto_complete" },
|
||||
{ "keys": ["alt+space"], "command": "replace_completion_with_auto_complete", "context":
|
||||
[
|
||||
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
|
||||
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
|
||||
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+super+p"], "command": "show_scope_name" },
|
||||
{ "keys": ["alt+shift+p"], "command": "show_scope_name" },
|
||||
|
||||
{ "keys": ["f7"], "command": "build" },
|
||||
{ "keys": ["ctrl+b"], "command": "build" },
|
||||
{ "keys": ["ctrl+shift+b"], "command": "build", "args": {"select": true} },
|
||||
|
||||
{ "keys": ["alt+c"], "command": "cancel_build" },
|
||||
|
||||
{ "keys": ["alt+t"], "command": "transpose" },
|
||||
|
||||
{ "keys": ["f5"], "command": "sort_lines", "args": {"case_sensitive": false} },
|
||||
{ "keys": ["alt+f5"], "command": "sort_lines", "args": {"case_sensitive": true} },
|
||||
|
||||
// Auto-pair quotes
|
||||
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\""}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\"a-zA-Z0-9_]$", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"${0:$SELECTION}\""}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["\""], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\"$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair single quotes
|
||||
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'${0:$SELECTION}'"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["'"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "'$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair brackets
|
||||
{ "keys": ["("], "command": "insert_snippet", "args": {"contents": "($0)"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["("], "command": "insert_snippet", "args": {"contents": "(${0:$SELECTION})"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": [")"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\($", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair square brackets
|
||||
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[$0]"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[${0:$SELECTION}]"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["]"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\[$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair curly brackets
|
||||
{ "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{$0}"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["{"], "command": "wrap_block", "args": {"begin": "{", "end": "}"}, "context":
|
||||
[
|
||||
{ "key": "indented_block", "match_all": true },
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{${0:$SELECTION}}"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["}"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["enter"], "command": "auto_indent_tag", "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.tag.begin", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": ">$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^</", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "auto_indent_tag", "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.tag.begin", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": ">$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^</", "match_all": true },
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"keys": ["ctrl+super+1"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+super+2"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.5, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+super+3"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.33, 0.66, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+super+4"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.25, 0.5, 0.75, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1], [3, 0, 4, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+super+shift+2"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 1.0],
|
||||
"rows": [0.0, 0.5, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [0, 1, 1, 2]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+super+shift+3"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 1.0],
|
||||
"rows": [0.0, 0.33, 0.66, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [0, 1, 1, 2], [0, 2, 1, 3]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+super+5"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.5, 1.0],
|
||||
"rows": [0.0, 0.5, 1.0],
|
||||
"cells":
|
||||
[
|
||||
[0, 0, 1, 1], [1, 0, 2, 1],
|
||||
[0, 1, 1, 2], [1, 1, 2, 2]
|
||||
]
|
||||
}
|
||||
},
|
||||
{ "keys": ["alt+1"], "command": "focus_group", "args": { "group": 0 } },
|
||||
{ "keys": ["alt+2"], "command": "focus_group", "args": { "group": 1 } },
|
||||
{ "keys": ["alt+3"], "command": "focus_group", "args": { "group": 2 } },
|
||||
{ "keys": ["alt+4"], "command": "focus_group", "args": { "group": 3 } },
|
||||
{ "keys": ["alt+5"], "command": "focus_group", "args": { "group": 4 } },
|
||||
{ "keys": ["alt+6"], "command": "focus_group", "args": { "group": 5 } },
|
||||
{ "keys": ["alt+7"], "command": "focus_group", "args": { "group": 6 } },
|
||||
{ "keys": ["alt+8"], "command": "focus_group", "args": { "group": 7 } },
|
||||
{ "keys": ["alt+9"], "command": "focus_group", "args": { "group": 8 } },
|
||||
{ "keys": ["alt+shift+1"], "command": "move_to_group", "args": { "group": 0 } },
|
||||
{ "keys": ["alt+shift+2"], "command": "move_to_group", "args": { "group": 1 } },
|
||||
{ "keys": ["alt+shift+3"], "command": "move_to_group", "args": { "group": 2 } },
|
||||
{ "keys": ["alt+shift+4"], "command": "move_to_group", "args": { "group": 3 } },
|
||||
{ "keys": ["alt+shift+5"], "command": "move_to_group", "args": { "group": 4 } },
|
||||
{ "keys": ["alt+shift+6"], "command": "move_to_group", "args": { "group": 5 } },
|
||||
{ "keys": ["alt+shift+7"], "command": "move_to_group", "args": { "group": 6 } },
|
||||
{ "keys": ["alt+shift+8"], "command": "move_to_group", "args": { "group": 7 } },
|
||||
{ "keys": ["alt+shift+9"], "command": "move_to_group", "args": { "group": 8 } },
|
||||
{ "keys": ["alt+0"], "command": "focus_side_bar" },
|
||||
|
||||
{ "keys": ["ctrl+k", "ctrl+up"], "command": "new_pane" },
|
||||
{ "keys": ["ctrl+k", "ctrl+shift+up"], "command": "new_pane", "args": {"move": false} },
|
||||
{ "keys": ["ctrl+k", "ctrl+down"], "command": "close_pane" },
|
||||
{ "keys": ["ctrl+k", "ctrl+left"], "command": "focus_neighboring_group", "args": {"forward": false} },
|
||||
{ "keys": ["ctrl+k", "ctrl+right"], "command": "focus_neighboring_group" },
|
||||
{ "keys": ["ctrl+k", "ctrl+shift+left"], "command": "move_to_neighboring_group", "args": {"forward": false} },
|
||||
{ "keys": ["ctrl+k", "ctrl+shift+right"], "command": "move_to_neighboring_group" },
|
||||
|
||||
{ "keys": ["ctrl+1"], "command": "select_by_index", "args": { "index": 0 } },
|
||||
{ "keys": ["ctrl+2"], "command": "select_by_index", "args": { "index": 1 } },
|
||||
{ "keys": ["ctrl+3"], "command": "select_by_index", "args": { "index": 2 } },
|
||||
{ "keys": ["ctrl+4"], "command": "select_by_index", "args": { "index": 3 } },
|
||||
{ "keys": ["ctrl+5"], "command": "select_by_index", "args": { "index": 4 } },
|
||||
{ "keys": ["ctrl+6"], "command": "select_by_index", "args": { "index": 5 } },
|
||||
{ "keys": ["ctrl+7"], "command": "select_by_index", "args": { "index": 6 } },
|
||||
{ "keys": ["ctrl+8"], "command": "select_by_index", "args": { "index": 7 } },
|
||||
{ "keys": ["ctrl+9"], "command": "select_by_index", "args": { "index": 8 } },
|
||||
{ "keys": ["ctrl+0"], "command": "select_by_index", "args": { "index": 9 } },
|
||||
|
||||
{ "keys": ["f2"], "command": "next_bookmark" },
|
||||
{ "keys": ["shift+f2"], "command": "prev_bookmark" },
|
||||
{ "keys": ["ctrl+f2"], "command": "toggle_bookmark" },
|
||||
{ "keys": ["ctrl+shift+f2"], "command": "clear_bookmarks" },
|
||||
{ "keys": ["super+f2"], "command": "select_all_bookmarks" },
|
||||
|
||||
{ "keys": ["ctrl+k", "ctrl+u"], "command": "upper_case" },
|
||||
{ "keys": ["ctrl+k", "ctrl+l"], "command": "lower_case" },
|
||||
{ "keys": ["ctrl+k", "ctrl+space"], "command": "set_mark" },
|
||||
{ "keys": ["ctrl+k", "ctrl+a"], "command": "select_to_mark" },
|
||||
{ "keys": ["ctrl+k", "ctrl+w"], "command": "delete_to_mark" },
|
||||
{ "keys": ["ctrl+k", "ctrl+x"], "command": "swap_with_mark" },
|
||||
{ "keys": ["ctrl+k", "ctrl+g"], "command": "clear_bookmarks", "args": {"name": "mark"} },
|
||||
|
||||
{ "keys": ["ctrl+equals"], "command": "increase_font_size" },
|
||||
{ "keys": ["ctrl+plus"], "command": "increase_font_size" },
|
||||
{ "keys": ["ctrl+minus"], "command": "decrease_font_size" },
|
||||
|
||||
{ "keys": ["alt+shift+w"], "command": "insert_snippet", "args": { "name": "Packages/XML/Snippets/long-tag.sublime-snippet" } },
|
||||
|
||||
{ "keys": ["alt+shift+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
|
||||
|
||||
{ "keys": ["ctrl+super+q"], "command": "wrap_lines" },
|
||||
|
||||
{ "keys": ["ctrl+super+["], "command": "fold" },
|
||||
{ "keys": ["ctrl+super+]"], "command": "unfold" },
|
||||
{ "keys": ["ctrl+k", "ctrl+1"], "command": "fold_by_level", "args": {"level": 1} },
|
||||
{ "keys": ["ctrl+k", "ctrl+2"], "command": "fold_by_level", "args": {"level": 2} },
|
||||
{ "keys": ["ctrl+k", "ctrl+3"], "command": "fold_by_level", "args": {"level": 3} },
|
||||
{ "keys": ["ctrl+k", "ctrl+4"], "command": "fold_by_level", "args": {"level": 4} },
|
||||
{ "keys": ["ctrl+k", "ctrl+5"], "command": "fold_by_level", "args": {"level": 5} },
|
||||
{ "keys": ["ctrl+k", "ctrl+6"], "command": "fold_by_level", "args": {"level": 6} },
|
||||
{ "keys": ["ctrl+k", "ctrl+7"], "command": "fold_by_level", "args": {"level": 7} },
|
||||
{ "keys": ["ctrl+k", "ctrl+8"], "command": "fold_by_level", "args": {"level": 8} },
|
||||
{ "keys": ["ctrl+k", "ctrl+9"], "command": "fold_by_level", "args": {"level": 9} },
|
||||
{ "keys": ["ctrl+k", "ctrl+0"], "command": "unfold_all" },
|
||||
{ "keys": ["ctrl+k", "ctrl+j"], "command": "unfold_all" },
|
||||
{ "keys": ["ctrl+k", "ctrl+t"], "command": "fold_tag_attributes" },
|
||||
|
||||
{ "keys": ["ctrl+super+o"], "command": "toggle_overwrite" },
|
||||
|
||||
{ "keys": ["super+f2"], "command": "context_menu" },
|
||||
|
||||
{ "keys": ["ctrl+super+c"], "command": "toggle_case_sensitive", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["ctrl+super+r"], "command": "toggle_regex", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["ctrl+super+w"], "command": "toggle_whole_word", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["ctrl+super+a"], "command": "toggle_preserve_case", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
// Find panel key bindings
|
||||
{ "keys": ["enter"], "command": "find_next", "context":
|
||||
[{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "find_prev", "context":
|
||||
[{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["super+enter"], "command": "find_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
// Replace panel key bindings
|
||||
{ "keys": ["enter"], "command": "find_next", "context":
|
||||
[{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "find_prev", "context":
|
||||
[{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["super+enter"], "command": "find_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["alt+super+enter"], "command": "replace_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
// Incremental find panel key bindings
|
||||
{ "keys": ["enter"], "command": "hide_panel", "context":
|
||||
[{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "find_prev", "context":
|
||||
[{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["super+enter"], "command": "find_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+,"], "command": "edit_settings", "args":
|
||||
{
|
||||
"base_file": "${packages}/Default/Preferences.sublime-settings",
|
||||
"default": "// Settings in here override those in \"Default/Preferences.sublime-settings\",\n// and are overridden in turn by syntax-specific settings.\n{\n\t$0\n}\n"
|
||||
}
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+k", "ctrl+y"], "command": "yank" },
|
||||
{ "keys": ["ctrl+k", "ctrl+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard EOL.sublime-macro"} },
|
||||
{ "keys": ["ctrl+k", "ctrl+backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard BOL.sublime-macro"} },
|
||||
{ "keys": ["ctrl+k", "ctrl+c"], "command": "show_at_center" },
|
||||
|
||||
// These are OS X built in commands, and don't need to be listed here, but
|
||||
// doing so lets them show up in the menu
|
||||
{ "keys": ["alt+y"], "command": "yank" },
|
||||
{ "keys": ["ctrl+backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard BOL.sublime-macro"} },
|
||||
// ctrl+delete isn't a built in command, but makes sense anyway
|
||||
{ "keys": ["ctrl+delete"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard EOL.sublime-macro"} },
|
||||
{ "keys": ["alt+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard EOL.sublime-macro"} },
|
||||
{ "keys": ["alt+l"], "command": "show_at_center" },
|
||||
{ "keys": ["alt+o"], "command": "insert_snippet", "args": { "contents": "$0\n" } },
|
||||
{ "keys": ["alt+ctrl+d"], "command": "noop" },
|
||||
{ "keys": ["alt+ctrl+shift+d"], "command": "noop" },
|
||||
|
||||
// HTML, XML close tag
|
||||
{ "keys": ["/"], "command": "close_tag", "args": { "insert_slash": true }, "context":
|
||||
[
|
||||
{ "key": "selector", "operator": "equal", "operand": "(text.html, text.xml) - string - comment", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_match", "operand": ".*<$", "match_all": true },
|
||||
{ "key": "setting.auto_close_tags" }
|
||||
]
|
||||
}
|
||||
]
|
@@ -1,706 +0,0 @@
|
||||
/*
|
||||
On OS X, basic text manipulations (left, right, command+left, etc) make use of the system key bindings,
|
||||
and don't need to be repeated here. Anything listed here will take precedence, however.
|
||||
*/
|
||||
[
|
||||
{ "keys": ["ctrl+shift+n"], "command": "new_window" },
|
||||
{ "keys": ["ctrl+shift+w"], "command": "close_window" },
|
||||
{ "keys": ["ctrl+o"], "command": "prompt_open" },
|
||||
{ "keys": ["ctrl+shift+t"], "command": "reopen_last_file" },
|
||||
{ "keys": ["ctrl+super+up"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "hh", "h", "ipp", "inl", "m", "mm"]} },
|
||||
{ "keys": ["ctrl+n"], "command": "new_file" },
|
||||
{ "keys": ["ctrl+s"], "command": "save" },
|
||||
{ "keys": ["ctrl+shift+s"], "command": "prompt_save_as" },
|
||||
{ "keys": ["ctrl+super+s"], "command": "save_all" },
|
||||
{ "keys": ["ctrl+w"], "command": "close" },
|
||||
|
||||
{ "keys": ["ctrl+k", "ctrl+b"], "command": "toggle_side_bar" },
|
||||
{ "keys": ["ctrl+alt+f"], "command": "toggle_full_screen" },
|
||||
{ "keys": ["ctrl+alt+shift+f"], "command": "toggle_distraction_free" },
|
||||
|
||||
{ "keys": ["ctrl+z"], "command": "undo" },
|
||||
{ "keys": ["ctrl+shift+z"], "command": "redo" },
|
||||
{ "keys": ["ctrl+y"], "command": "redo_or_repeat" },
|
||||
{ "keys": ["ctrl+u"], "command": "soft_undo" },
|
||||
{ "keys": ["ctrl+shift+u"], "command": "soft_redo" },
|
||||
|
||||
{ "keys": ["ctrl+x"], "command": "cut" },
|
||||
{ "keys": ["ctrl+c"], "command": "copy" },
|
||||
{ "keys": ["ctrl+v"], "command": "paste" },
|
||||
{ "keys": ["ctrl+shift+v"], "command": "paste_and_indent" },
|
||||
{ "keys": ["ctrl+k", "ctrl+v"], "command": "paste_from_history" },
|
||||
{ "keys": ["ctrl+option+v"], "command": "paste_from_history" },
|
||||
|
||||
{ "keys": ["alt+super+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
|
||||
{ "keys": ["alt+super+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
|
||||
{ "keys": ["alt+super+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
|
||||
{ "keys": ["alt+super+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
|
||||
|
||||
{ "keys": ["alt+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
|
||||
{ "keys": ["alt+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
|
||||
{ "keys": ["alt+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
|
||||
{ "keys": ["alt+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
|
||||
|
||||
{ "keys": ["alt+super+up"], "command": "scroll_lines", "args": {"amount": 1.0} },
|
||||
{ "keys": ["alt+super+down"], "command": "scroll_lines", "args": {"amount": -1.0} },
|
||||
|
||||
{ "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} },
|
||||
{ "keys": ["alt+shift+down"], "command": "select_lines", "args": {"forward": true} },
|
||||
|
||||
{ "keys": ["ctrl+shift+["], "command": "prev_view" },
|
||||
{ "keys": ["ctrl+shift+]"], "command": "next_view" },
|
||||
{ "keys": ["ctrl+super+left"], "command": "prev_view" },
|
||||
{ "keys": ["ctrl+super+right"], "command": "next_view" },
|
||||
|
||||
{ "keys": ["alt+tab"], "command": "next_view_in_stack" },
|
||||
{ "keys": ["alt+shift+tab"], "command": "prev_view_in_stack" },
|
||||
|
||||
{ "keys": ["ctrl+a"], "command": "select_all" },
|
||||
{ "keys": ["ctrl+shift+l"], "command": "split_selection_into_lines" },
|
||||
{ "keys": ["escape"], "command": "single_selection", "context":
|
||||
[
|
||||
{ "key": "num_selections", "operator": "not_equal", "operand": 1 }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "clear_fields", "context":
|
||||
[
|
||||
{ "key": "has_next_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "clear_fields", "context":
|
||||
[
|
||||
{ "key": "has_prev_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_panel", "args": {"cancel": true},
|
||||
"context":
|
||||
[
|
||||
{ "key": "panel_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_overlay", "context":
|
||||
[
|
||||
{ "key": "overlay_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_popup", "context":
|
||||
[
|
||||
{ "key": "popup_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_auto_complete", "context":
|
||||
[
|
||||
{ "key": "auto_complete_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+]"], "command": "indent" },
|
||||
{ "keys": ["ctrl+["], "command": "unindent" },
|
||||
|
||||
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
|
||||
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},
|
||||
"context":
|
||||
[
|
||||
{ "key": "setting.tab_completion", "operator": "equal", "operand": true },
|
||||
{ "key": "preceding_text", "operator": "not_regex_match", "operand": ".*\\b[0-9]+$", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "replace_completion_with_next_completion", "context":
|
||||
[
|
||||
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
|
||||
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "reindent", "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "indent", "context":
|
||||
[
|
||||
{ "key": "text", "operator": "regex_contains", "operand": "\n" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "next_field", "context":
|
||||
[
|
||||
{ "key": "has_next_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "commit_completion", "context":
|
||||
[
|
||||
{ "key": "auto_complete_visible" },
|
||||
{ "key": "setting.auto_complete_commit_on_tab" }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["shift+tab"], "command": "insert", "args": {"characters": "\t"} },
|
||||
{ "keys": ["shift+tab"], "command": "unindent", "context":
|
||||
[
|
||||
{ "key": "setting.shift_tab_unindent", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+tab"], "command": "unindent", "context":
|
||||
[
|
||||
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\t ]*" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+tab"], "command": "unindent", "context":
|
||||
[
|
||||
{ "key": "text", "operator": "regex_contains", "operand": "\n" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+tab"], "command": "prev_field", "context":
|
||||
[
|
||||
{ "key": "has_prev_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+l"], "command": "expand_selection", "args": {"to": "line"} },
|
||||
{ "keys": ["ctrl+d"], "command": "find_under_expand" },
|
||||
{ "keys": ["ctrl+k", "ctrl+d"], "command": "find_under_expand_skip" },
|
||||
{ "keys": ["ctrl+shift+space"], "command": "expand_selection", "args": {"to": "scope"} },
|
||||
{ "keys": ["alt+shift+m"], "command": "expand_selection", "args": {"to": "brackets"} },
|
||||
{ "keys": ["alt+m"], "command": "move_to", "args": {"to": "brackets"} },
|
||||
{ "keys": ["ctrl+shift+j"], "command": "expand_selection", "args": {"to": "indentation"} },
|
||||
{ "keys": ["ctrl+shift+a"], "command": "expand_selection", "args": {"to": "tag"} },
|
||||
|
||||
{ "keys": ["ctrl+super+."], "command": "close_tag" },
|
||||
|
||||
{ "keys": ["alt+q"], "command": "toggle_record_macro" },
|
||||
{ "keys": ["alt+shift+q"], "command": "run_macro" },
|
||||
|
||||
{ "keys": ["ctrl+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line.sublime-macro"} },
|
||||
{ "keys": ["ctrl+shift+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line Before.sublime-macro"} },
|
||||
{ "keys": ["enter"], "command": "commit_completion", "context":
|
||||
[
|
||||
{ "key": "auto_complete_visible" },
|
||||
{ "key": "setting.auto_complete_commit_on_tab", "operand": false }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+t"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
|
||||
{ "keys": ["ctrl+p"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
|
||||
{ "keys": ["ctrl+shift+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
|
||||
{ "keys": ["ctrl+alt+p"], "command": "prompt_select_workspace" },
|
||||
{ "keys": ["ctrl+r"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
|
||||
{ "keys": ["alt+g"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
|
||||
{ "keys": ["f12"], "command": "goto_definition" },
|
||||
{ "keys": ["ctrl+super+down"], "command": "goto_definition" },
|
||||
{ "keys": ["ctrl+shift+r"], "command": "goto_symbol_in_project" },
|
||||
{ "keys": ["alt+minus"], "command": "jump_back" },
|
||||
{ "keys": ["alt+shift+minus"], "command": "jump_forward" },
|
||||
|
||||
{ "keys": ["ctrl+i"], "command": "show_panel", "args": {"panel": "incremental_find", "reverse": false} },
|
||||
{ "keys": ["ctrl+shift+i"], "command": "show_panel", "args": {"panel": "incremental_find", "reverse": true} },
|
||||
{ "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": "find", "reverse": false} },
|
||||
{ "keys": ["ctrl+super+f"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },
|
||||
{ "keys": ["ctrl+super+e"], "command": "replace_next" },
|
||||
{ "keys": ["ctrl+g"], "command": "find_next" },
|
||||
{ "keys": ["ctrl+shift+g"], "command": "find_prev" },
|
||||
{ "keys": ["ctrl+e"], "command": "slurp_find_string" },
|
||||
{ "keys": ["ctrl+shift+e"], "command": "slurp_replace_string" },
|
||||
|
||||
{ "keys": ["super+ctrl+g"], "command": "find_under" },
|
||||
{ "keys": ["shift+super+ctrl+g"], "command": "find_under_prev" },
|
||||
{ "keys": ["alt+ctrl+g"], "command": "find_all_under" },
|
||||
|
||||
{ "keys": ["ctrl+shift+f"], "command": "show_panel", "args": {"panel": "find_in_files"} },
|
||||
{ "keys": ["f4"], "command": "next_result" },
|
||||
{ "keys": ["shift+f4"], "command": "prev_result" },
|
||||
|
||||
{ "keys": ["f6"], "command": "toggle_setting", "args": {"setting": "spell_check"} },
|
||||
{ "keys": ["alt+f6"], "command": "next_misspelling" },
|
||||
{ "keys": ["alt+shift+f6"], "command": "prev_misspelling" },
|
||||
|
||||
{ "keys": ["alt+ctrl+up"], "command": "swap_line_up" },
|
||||
{ "keys": ["alt+ctrl+down"], "command": "swap_line_down" },
|
||||
|
||||
{ "keys": ["alt+backspace"], "command": "delete_word", "args": { "forward": false, "sub_words": true } },
|
||||
{ "keys": ["alt+delete"], "command": "delete_word", "args": { "forward": true, "sub_words": true } },
|
||||
|
||||
{ "keys": ["ctrl+forward_slash"], "command": "toggle_comment", "args": { "block": false } },
|
||||
{ "keys": ["ctrl+super+forward_slash"], "command": "toggle_comment", "args": { "block": true } },
|
||||
|
||||
{ "keys": ["ctrl+j"], "command": "join_lines" },
|
||||
{ "keys": ["ctrl+shift+d"], "command": "duplicate_line" },
|
||||
|
||||
{ "keys": ["alt+backquote"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },
|
||||
|
||||
{ "keys": ["alt+space"], "command": "auto_complete" },
|
||||
{ "keys": ["alt+space"], "command": "replace_completion_with_auto_complete", "context":
|
||||
[
|
||||
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
|
||||
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
|
||||
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+super+p"], "command": "show_scope_name" },
|
||||
{ "keys": ["alt+shift+p"], "command": "show_scope_name" },
|
||||
|
||||
{ "keys": ["f7"], "command": "build" },
|
||||
{ "keys": ["ctrl+b"], "command": "build" },
|
||||
{ "keys": ["ctrl+shift+b"], "command": "build", "args": {"select": true} },
|
||||
|
||||
{ "keys": ["alt+c"], "command": "cancel_build" },
|
||||
|
||||
{ "keys": ["alt+t"], "command": "transpose" },
|
||||
|
||||
{ "keys": ["f5"], "command": "sort_lines", "args": {"case_sensitive": false} },
|
||||
{ "keys": ["alt+f5"], "command": "sort_lines", "args": {"case_sensitive": true} },
|
||||
|
||||
// Auto-pair quotes
|
||||
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\""}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\"a-zA-Z0-9_]$", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"${0:$SELECTION}\""}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["\""], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\"$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair single quotes
|
||||
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'${0:$SELECTION}'"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["'"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "'$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair brackets
|
||||
{ "keys": ["("], "command": "insert_snippet", "args": {"contents": "($0)"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["("], "command": "insert_snippet", "args": {"contents": "(${0:$SELECTION})"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": [")"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\($", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair square brackets
|
||||
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[$0]"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[${0:$SELECTION}]"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["]"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\[$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair curly brackets
|
||||
{ "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{$0}"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["{"], "command": "wrap_block", "args": {"begin": "{", "end": "}"}, "context":
|
||||
[
|
||||
{ "key": "indented_block", "match_all": true },
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{${0:$SELECTION}}"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["}"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["enter"], "command": "auto_indent_tag", "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.tag.begin", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": ">$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^</", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "auto_indent_tag", "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.tag.begin", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": ">$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^</", "match_all": true },
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"keys": ["ctrl+super+1"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+super+2"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.5, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+super+3"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.33, 0.66, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+super+4"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.25, 0.5, 0.75, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1], [3, 0, 4, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+super+shift+2"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 1.0],
|
||||
"rows": [0.0, 0.5, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [0, 1, 1, 2]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+super+shift+3"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 1.0],
|
||||
"rows": [0.0, 0.33, 0.66, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [0, 1, 1, 2], [0, 2, 1, 3]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["ctrl+super+5"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.5, 1.0],
|
||||
"rows": [0.0, 0.5, 1.0],
|
||||
"cells":
|
||||
[
|
||||
[0, 0, 1, 1], [1, 0, 2, 1],
|
||||
[0, 1, 1, 2], [1, 1, 2, 2]
|
||||
]
|
||||
}
|
||||
},
|
||||
{ "keys": ["alt+1"], "command": "focus_group", "args": { "group": 0 } },
|
||||
{ "keys": ["alt+2"], "command": "focus_group", "args": { "group": 1 } },
|
||||
{ "keys": ["alt+3"], "command": "focus_group", "args": { "group": 2 } },
|
||||
{ "keys": ["alt+4"], "command": "focus_group", "args": { "group": 3 } },
|
||||
{ "keys": ["alt+5"], "command": "focus_group", "args": { "group": 4 } },
|
||||
{ "keys": ["alt+6"], "command": "focus_group", "args": { "group": 5 } },
|
||||
{ "keys": ["alt+7"], "command": "focus_group", "args": { "group": 6 } },
|
||||
{ "keys": ["alt+8"], "command": "focus_group", "args": { "group": 7 } },
|
||||
{ "keys": ["alt+9"], "command": "focus_group", "args": { "group": 8 } },
|
||||
{ "keys": ["alt+shift+1"], "command": "move_to_group", "args": { "group": 0 } },
|
||||
{ "keys": ["alt+shift+2"], "command": "move_to_group", "args": { "group": 1 } },
|
||||
{ "keys": ["alt+shift+3"], "command": "move_to_group", "args": { "group": 2 } },
|
||||
{ "keys": ["alt+shift+4"], "command": "move_to_group", "args": { "group": 3 } },
|
||||
{ "keys": ["alt+shift+5"], "command": "move_to_group", "args": { "group": 4 } },
|
||||
{ "keys": ["alt+shift+6"], "command": "move_to_group", "args": { "group": 5 } },
|
||||
{ "keys": ["alt+shift+7"], "command": "move_to_group", "args": { "group": 6 } },
|
||||
{ "keys": ["alt+shift+8"], "command": "move_to_group", "args": { "group": 7 } },
|
||||
{ "keys": ["alt+shift+9"], "command": "move_to_group", "args": { "group": 8 } },
|
||||
{ "keys": ["alt+0"], "command": "focus_side_bar" },
|
||||
|
||||
{ "keys": ["ctrl+k", "ctrl+up"], "command": "new_pane" },
|
||||
{ "keys": ["ctrl+k", "ctrl+shift+up"], "command": "new_pane", "args": {"move": false} },
|
||||
{ "keys": ["ctrl+k", "ctrl+down"], "command": "close_pane" },
|
||||
{ "keys": ["ctrl+k", "ctrl+left"], "command": "focus_neighboring_group", "args": {"forward": false} },
|
||||
{ "keys": ["ctrl+k", "ctrl+right"], "command": "focus_neighboring_group" },
|
||||
{ "keys": ["ctrl+k", "ctrl+shift+left"], "command": "move_to_neighboring_group", "args": {"forward": false} },
|
||||
{ "keys": ["ctrl+k", "ctrl+shift+right"], "command": "move_to_neighboring_group" },
|
||||
|
||||
{ "keys": ["ctrl+1"], "command": "select_by_index", "args": { "index": 0 } },
|
||||
{ "keys": ["ctrl+2"], "command": "select_by_index", "args": { "index": 1 } },
|
||||
{ "keys": ["ctrl+3"], "command": "select_by_index", "args": { "index": 2 } },
|
||||
{ "keys": ["ctrl+4"], "command": "select_by_index", "args": { "index": 3 } },
|
||||
{ "keys": ["ctrl+5"], "command": "select_by_index", "args": { "index": 4 } },
|
||||
{ "keys": ["ctrl+6"], "command": "select_by_index", "args": { "index": 5 } },
|
||||
{ "keys": ["ctrl+7"], "command": "select_by_index", "args": { "index": 6 } },
|
||||
{ "keys": ["ctrl+8"], "command": "select_by_index", "args": { "index": 7 } },
|
||||
{ "keys": ["ctrl+9"], "command": "select_by_index", "args": { "index": 8 } },
|
||||
{ "keys": ["ctrl+0"], "command": "select_by_index", "args": { "index": 9 } },
|
||||
|
||||
{ "keys": ["f2"], "command": "next_bookmark" },
|
||||
{ "keys": ["shift+f2"], "command": "prev_bookmark" },
|
||||
{ "keys": ["ctrl+f2"], "command": "toggle_bookmark" },
|
||||
{ "keys": ["ctrl+shift+f2"], "command": "clear_bookmarks" },
|
||||
{ "keys": ["super+f2"], "command": "select_all_bookmarks" },
|
||||
|
||||
{ "keys": ["ctrl+k", "ctrl+u"], "command": "upper_case" },
|
||||
{ "keys": ["ctrl+k", "ctrl+l"], "command": "lower_case" },
|
||||
{ "keys": ["ctrl+k", "ctrl+space"], "command": "set_mark" },
|
||||
{ "keys": ["ctrl+k", "ctrl+a"], "command": "select_to_mark" },
|
||||
{ "keys": ["ctrl+k", "ctrl+w"], "command": "delete_to_mark" },
|
||||
{ "keys": ["ctrl+k", "ctrl+x"], "command": "swap_with_mark" },
|
||||
{ "keys": ["ctrl+k", "ctrl+g"], "command": "clear_bookmarks", "args": {"name": "mark"} },
|
||||
|
||||
{ "keys": ["ctrl+equals"], "command": "increase_font_size" },
|
||||
{ "keys": ["ctrl+plus"], "command": "increase_font_size" },
|
||||
{ "keys": ["ctrl+minus"], "command": "decrease_font_size" },
|
||||
|
||||
{ "keys": ["alt+shift+w"], "command": "insert_snippet", "args": { "name": "Packages/XML/Snippets/long-tag.sublime-snippet" } },
|
||||
|
||||
{ "keys": ["alt+shift+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
|
||||
|
||||
{ "keys": ["ctrl+super+q"], "command": "wrap_lines" },
|
||||
|
||||
{ "keys": ["ctrl+super+["], "command": "fold" },
|
||||
{ "keys": ["ctrl+super+]"], "command": "unfold" },
|
||||
{ "keys": ["ctrl+k", "ctrl+1"], "command": "fold_by_level", "args": {"level": 1} },
|
||||
{ "keys": ["ctrl+k", "ctrl+2"], "command": "fold_by_level", "args": {"level": 2} },
|
||||
{ "keys": ["ctrl+k", "ctrl+3"], "command": "fold_by_level", "args": {"level": 3} },
|
||||
{ "keys": ["ctrl+k", "ctrl+4"], "command": "fold_by_level", "args": {"level": 4} },
|
||||
{ "keys": ["ctrl+k", "ctrl+5"], "command": "fold_by_level", "args": {"level": 5} },
|
||||
{ "keys": ["ctrl+k", "ctrl+6"], "command": "fold_by_level", "args": {"level": 6} },
|
||||
{ "keys": ["ctrl+k", "ctrl+7"], "command": "fold_by_level", "args": {"level": 7} },
|
||||
{ "keys": ["ctrl+k", "ctrl+8"], "command": "fold_by_level", "args": {"level": 8} },
|
||||
{ "keys": ["ctrl+k", "ctrl+9"], "command": "fold_by_level", "args": {"level": 9} },
|
||||
{ "keys": ["ctrl+k", "ctrl+0"], "command": "unfold_all" },
|
||||
{ "keys": ["ctrl+k", "ctrl+j"], "command": "unfold_all" },
|
||||
{ "keys": ["ctrl+k", "ctrl+t"], "command": "fold_tag_attributes" },
|
||||
|
||||
{ "keys": ["ctrl+super+o"], "command": "toggle_overwrite" },
|
||||
|
||||
{ "keys": ["super+f2"], "command": "context_menu" },
|
||||
|
||||
{ "keys": ["ctrl+super+c"], "command": "toggle_case_sensitive", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["ctrl+super+r"], "command": "toggle_regex", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["ctrl+super+w"], "command": "toggle_whole_word", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["ctrl+super+a"], "command": "toggle_preserve_case", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
// Find panel key bindings
|
||||
{ "keys": ["enter"], "command": "find_next", "context":
|
||||
[{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "find_prev", "context":
|
||||
[{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["super+enter"], "command": "find_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
// Replace panel key bindings
|
||||
{ "keys": ["enter"], "command": "find_next", "context":
|
||||
[{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "find_prev", "context":
|
||||
[{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["super+enter"], "command": "find_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["alt+super+enter"], "command": "replace_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
// Incremental find panel key bindings
|
||||
{ "keys": ["enter"], "command": "hide_panel", "context":
|
||||
[{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "find_prev", "context":
|
||||
[{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["super+enter"], "command": "find_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+,"], "command": "edit_settings", "args":
|
||||
{
|
||||
"base_file": "${packages}/Default/Preferences.sublime-settings",
|
||||
"default": "// Settings in here override those in \"Default/Preferences.sublime-settings\",\n// and are overridden in turn by syntax-specific settings.\n{\n\t$0\n}\n"
|
||||
}
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+k", "ctrl+y"], "command": "yank" },
|
||||
{ "keys": ["ctrl+k", "ctrl+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard EOL.sublime-macro"} },
|
||||
{ "keys": ["ctrl+k", "ctrl+backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard BOL.sublime-macro"} },
|
||||
{ "keys": ["ctrl+k", "ctrl+c"], "command": "show_at_center" },
|
||||
|
||||
// These are OS X built in commands, and don't need to be listed here, but
|
||||
// doing so lets them show up in the menu
|
||||
{ "keys": ["alt+y"], "command": "yank" },
|
||||
{ "keys": ["ctrl+backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard BOL.sublime-macro"} },
|
||||
// ctrl+delete isn't a built in command, but makes sense anyway
|
||||
{ "keys": ["ctrl+delete"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard EOL.sublime-macro"} },
|
||||
{ "keys": ["alt+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard EOL.sublime-macro"} },
|
||||
{ "keys": ["alt+l"], "command": "show_at_center" },
|
||||
{ "keys": ["alt+o"], "command": "insert_snippet", "args": { "contents": "$0\n" } },
|
||||
{ "keys": ["alt+ctrl+d"], "command": "noop" },
|
||||
{ "keys": ["alt+ctrl+shift+d"], "command": "noop" },
|
||||
|
||||
// HTML, XML close tag
|
||||
{ "keys": ["/"], "command": "close_tag", "args": { "insert_slash": true }, "context":
|
||||
[
|
||||
{ "key": "selector", "operator": "equal", "operand": "(text.html, text.xml) - string - comment", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_match", "operand": ".*<$", "match_all": true },
|
||||
{ "key": "setting.auto_close_tags" }
|
||||
]
|
||||
}
|
||||
]
|
@@ -1,734 +0,0 @@
|
||||
[
|
||||
{ "keys": ["ctrl+q"], "command": "exit" },
|
||||
|
||||
{ "keys": ["ctrl+shift+n"], "command": "new_window" },
|
||||
{ "keys": ["ctrl+shift+w"], "command": "close_window" },
|
||||
{ "keys": ["ctrl+o"], "command": "prompt_open_file" },
|
||||
{ "keys": ["ctrl+shift+t"], "command": "reopen_last_file" },
|
||||
{ "keys": ["alt+o"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "hh", "h", "ipp", "inl", "m", "mm"]} },
|
||||
{ "keys": ["ctrl+n"], "command": "new_file" },
|
||||
{ "keys": ["ctrl+s"], "command": "save" },
|
||||
{ "keys": ["ctrl+shift+s"], "command": "prompt_save_as" },
|
||||
{ "keys": ["ctrl+f4"], "command": "close_file" },
|
||||
{ "keys": ["ctrl+w"], "command": "close" },
|
||||
|
||||
{ "keys": ["ctrl+k", "ctrl+b"], "command": "toggle_side_bar" },
|
||||
{ "keys": ["f11"], "command": "toggle_full_screen" },
|
||||
{ "keys": ["shift+f11"], "command": "toggle_distraction_free" },
|
||||
|
||||
{ "keys": ["backspace"], "command": "left_delete" },
|
||||
{ "keys": ["shift+backspace"], "command": "left_delete" },
|
||||
{ "keys": ["ctrl+shift+backspace"], "command": "left_delete" },
|
||||
{ "keys": ["delete"], "command": "right_delete" },
|
||||
{ "keys": ["enter"], "command": "insert", "args": {"characters": "\n"} },
|
||||
{ "keys": ["shift+enter"], "command": "insert", "args": {"characters": "\n"} },
|
||||
{ "keys": ["keypad_enter"], "command": "insert", "args": {"characters": "\n"} },
|
||||
{ "keys": ["shift+keypad_enter"], "command": "insert", "args": {"characters": "\n"} },
|
||||
|
||||
{ "keys": ["ctrl+z"], "command": "undo" },
|
||||
{ "keys": ["ctrl+shift+z"], "command": "redo" },
|
||||
{ "keys": ["ctrl+y"], "command": "redo_or_repeat" },
|
||||
{ "keys": ["ctrl+u"], "command": "soft_undo" },
|
||||
{ "keys": ["ctrl+shift+u"], "command": "soft_redo" },
|
||||
|
||||
{ "keys": ["shift+delete"], "command": "cut" },
|
||||
{ "keys": ["ctrl+insert"], "command": "copy" },
|
||||
{ "keys": ["shift+insert"], "command": "paste" },
|
||||
|
||||
// These two key bindings should replace the above three if you'd prefer
|
||||
// the traditional X11 behavior of shift+insert pasting from the primary
|
||||
// selection. The above CUA keys are the default, to match most GTK
|
||||
// applications.
|
||||
//{ "keys": ["shift+insert"], "command": "paste", "args": {"clipboard": "selection"} },
|
||||
//{ "keys": ["shift+delete"], "command": "right_delete" },
|
||||
|
||||
{ "keys": ["ctrl+x"], "command": "cut" },
|
||||
{ "keys": ["ctrl+c"], "command": "copy" },
|
||||
{ "keys": ["ctrl+v"], "command": "paste" },
|
||||
{ "keys": ["ctrl+shift+v"], "command": "paste_and_indent" },
|
||||
{ "keys": ["ctrl+k", "ctrl+v"], "command": "paste_from_history" },
|
||||
|
||||
{ "keys": ["left"], "command": "move", "args": {"by": "characters", "forward": false} },
|
||||
{ "keys": ["right"], "command": "move", "args": {"by": "characters", "forward": true} },
|
||||
{ "keys": ["up"], "command": "move", "args": {"by": "lines", "forward": false} },
|
||||
{ "keys": ["down"], "command": "move", "args": {"by": "lines", "forward": true} },
|
||||
{ "keys": ["shift+left"], "command": "move", "args": {"by": "characters", "forward": false, "extend": true} },
|
||||
{ "keys": ["shift+right"], "command": "move", "args": {"by": "characters", "forward": true, "extend": true} },
|
||||
{ "keys": ["shift+up"], "command": "move", "args": {"by": "lines", "forward": false, "extend": true} },
|
||||
{ "keys": ["shift+down"], "command": "move", "args": {"by": "lines", "forward": true, "extend": true} },
|
||||
|
||||
{ "keys": ["ctrl+left"], "command": "move", "args": {"by": "words", "forward": false} },
|
||||
{ "keys": ["ctrl+right"], "command": "move", "args": {"by": "word_ends", "forward": true} },
|
||||
{ "keys": ["ctrl+shift+left"], "command": "move", "args": {"by": "words", "forward": false, "extend": true} },
|
||||
{ "keys": ["ctrl+shift+right"], "command": "move", "args": {"by": "word_ends", "forward": true, "extend": true} },
|
||||
|
||||
{ "keys": ["alt+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
|
||||
{ "keys": ["alt+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
|
||||
{ "keys": ["alt+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
|
||||
{ "keys": ["alt+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
|
||||
|
||||
{ "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} },
|
||||
{ "keys": ["alt+shift+down"], "command": "select_lines", "args": {"forward": true} },
|
||||
|
||||
{ "keys": ["pageup"], "command": "move", "args": {"by": "pages", "forward": false} },
|
||||
{ "keys": ["pagedown"], "command": "move", "args": {"by": "pages", "forward": true} },
|
||||
{ "keys": ["shift+pageup"], "command": "move", "args": {"by": "pages", "forward": false, "extend": true} },
|
||||
{ "keys": ["shift+pagedown"], "command": "move", "args": {"by": "pages", "forward": true, "extend": true} },
|
||||
|
||||
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol", "extend": false} },
|
||||
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol", "extend": false} },
|
||||
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true} },
|
||||
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} },
|
||||
{ "keys": ["ctrl+home"], "command": "move_to", "args": {"to": "bof", "extend": false} },
|
||||
{ "keys": ["ctrl+end"], "command": "move_to", "args": {"to": "eof", "extend": false} },
|
||||
{ "keys": ["ctrl+shift+home"], "command": "move_to", "args": {"to": "bof", "extend": true} },
|
||||
{ "keys": ["ctrl+shift+end"], "command": "move_to", "args": {"to": "eof", "extend": true} },
|
||||
|
||||
{ "keys": ["ctrl+up"], "command": "scroll_lines", "args": {"amount": 1.0 } },
|
||||
{ "keys": ["ctrl+down"], "command": "scroll_lines", "args": {"amount": -1.0 } },
|
||||
|
||||
{ "keys": ["ctrl+pagedown"], "command": "next_view" },
|
||||
{ "keys": ["ctrl+pageup"], "command": "prev_view" },
|
||||
|
||||
{ "keys": ["ctrl+tab"], "command": "next_view_in_stack" },
|
||||
{ "keys": ["ctrl+shift+tab"], "command": "prev_view_in_stack" },
|
||||
|
||||
{ "keys": ["ctrl+a"], "command": "select_all" },
|
||||
{ "keys": ["ctrl+shift+l"], "command": "split_selection_into_lines" },
|
||||
{ "keys": ["escape"], "command": "single_selection", "context":
|
||||
[
|
||||
{ "key": "num_selections", "operator": "not_equal", "operand": 1 }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "clear_fields", "context":
|
||||
[
|
||||
{ "key": "has_next_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "clear_fields", "context":
|
||||
[
|
||||
{ "key": "has_prev_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_panel", "args": {"cancel": true},
|
||||
"context":
|
||||
[
|
||||
{ "key": "panel_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_overlay", "context":
|
||||
[
|
||||
{ "key": "overlay_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_popup", "context":
|
||||
[
|
||||
{ "key": "popup_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_auto_complete", "context":
|
||||
[
|
||||
{ "key": "auto_complete_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
|
||||
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},
|
||||
"context":
|
||||
[
|
||||
{ "key": "setting.tab_completion", "operator": "equal", "operand": true },
|
||||
{ "key": "preceding_text", "operator": "not_regex_match", "operand": ".*\\b[0-9]+$", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "replace_completion_with_next_completion", "context":
|
||||
[
|
||||
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
|
||||
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "reindent", "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "indent", "context":
|
||||
[
|
||||
{ "key": "text", "operator": "regex_contains", "operand": "\n" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "next_field", "context":
|
||||
[
|
||||
{ "key": "has_next_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "commit_completion", "context":
|
||||
[
|
||||
{ "key": "auto_complete_visible" },
|
||||
{ "key": "setting.auto_complete_commit_on_tab" }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["shift+tab"], "command": "insert", "args": {"characters": "\t"} },
|
||||
{ "keys": ["shift+tab"], "command": "unindent", "context":
|
||||
[
|
||||
{ "key": "setting.shift_tab_unindent", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+tab"], "command": "unindent", "context":
|
||||
[
|
||||
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\t ]*" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+tab"], "command": "unindent", "context":
|
||||
[
|
||||
{ "key": "text", "operator": "regex_contains", "operand": "\n" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+tab"], "command": "prev_field", "context":
|
||||
[
|
||||
{ "key": "has_prev_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+]"], "command": "indent" },
|
||||
{ "keys": ["ctrl+["], "command": "unindent" },
|
||||
|
||||
{ "keys": ["insert"], "command": "toggle_overwrite" },
|
||||
|
||||
{ "keys": ["ctrl+l"], "command": "expand_selection", "args": {"to": "line"} },
|
||||
{ "keys": ["ctrl+d"], "command": "find_under_expand" },
|
||||
{ "keys": ["ctrl+k", "ctrl+d"], "command": "find_under_expand_skip" },
|
||||
{ "keys": ["ctrl+shift+space"], "command": "expand_selection", "args": {"to": "scope"} },
|
||||
{ "keys": ["ctrl+shift+m"], "command": "expand_selection", "args": {"to": "brackets"} },
|
||||
{ "keys": ["ctrl+m"], "command": "move_to", "args": {"to": "brackets"} },
|
||||
{ "keys": ["ctrl+shift+j"], "command": "expand_selection", "args": {"to": "indentation"} },
|
||||
{ "keys": ["ctrl+shift+a"], "command": "expand_selection", "args": {"to": "tag"} },
|
||||
|
||||
{ "keys": ["alt+."], "command": "close_tag" },
|
||||
|
||||
{ "keys": ["ctrl+alt+q"], "command": "toggle_record_macro" },
|
||||
{ "keys": ["ctrl+alt+shift+q"], "command": "run_macro" },
|
||||
|
||||
{ "keys": ["ctrl+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line.sublime-macro"} },
|
||||
{ "keys": ["ctrl+shift+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line Before.sublime-macro"} },
|
||||
{ "keys": ["enter"], "command": "commit_completion", "context":
|
||||
[
|
||||
{ "key": "auto_complete_visible" },
|
||||
{ "key": "setting.auto_complete_commit_on_tab", "operand": false }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+p"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
|
||||
{ "keys": ["ctrl+shift+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
|
||||
{ "keys": ["ctrl+alt+p"], "command": "prompt_select_workspace" },
|
||||
{ "keys": ["ctrl+r"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
|
||||
{ "keys": ["ctrl+g"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
|
||||
{ "keys": ["ctrl+;"], "command": "show_overlay", "args": {"overlay": "goto", "text": "#"} },
|
||||
{ "keys": ["f12"], "command": "goto_definition" },
|
||||
{ "keys": ["shift+f12"], "command": "goto_reference" },
|
||||
{ "keys": ["ctrl+shift+r"], "command": "goto_symbol_in_project" },
|
||||
{ "keys": ["alt+-"], "command": "jump_back" },
|
||||
{ "keys": ["alt+shift+-"], "command": "jump_forward" },
|
||||
{ "keys": ["alt+keypad_minus"], "command": "jump_back" },
|
||||
{ "keys": ["alt+shift+keypad_minus"], "command": "jump_forward" },
|
||||
|
||||
{ "keys": ["ctrl+i"], "command": "show_panel", "args": {"panel": "incremental_find", "reverse": false} },
|
||||
{ "keys": ["ctrl+shift+i"], "command": "show_panel", "args": {"panel": "incremental_find", "reverse": true} },
|
||||
{ "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": "find", "reverse": false} },
|
||||
{ "keys": ["ctrl+h"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },
|
||||
{ "keys": ["ctrl+shift+h"], "command": "replace_next" },
|
||||
{ "keys": ["f3"], "command": "find_next" },
|
||||
{ "keys": ["shift+f3"], "command": "find_prev" },
|
||||
{ "keys": ["ctrl+f3"], "command": "find_under" },
|
||||
{ "keys": ["ctrl+shift+f3"], "command": "find_under_prev" },
|
||||
{ "keys": ["alt+f3"], "command": "find_all_under" },
|
||||
{ "keys": ["ctrl+e"], "command": "slurp_find_string" },
|
||||
{ "keys": ["ctrl+shift+e"], "command": "slurp_replace_string" },
|
||||
{ "keys": ["ctrl+shift+f"], "command": "show_panel", "args": {"panel": "find_in_files"} },
|
||||
{ "keys": ["f4"], "command": "next_result" },
|
||||
{ "keys": ["shift+f4"], "command": "prev_result" },
|
||||
|
||||
{ "keys": ["f6"], "command": "toggle_setting", "args": {"setting": "spell_check"} },
|
||||
{ "keys": ["ctrl+f6"], "command": "next_misspelling" },
|
||||
{ "keys": ["ctrl+shift+f6"], "command": "prev_misspelling" },
|
||||
|
||||
{ "keys": ["ctrl+shift+up"], "command": "swap_line_up" },
|
||||
{ "keys": ["ctrl+shift+down"], "command": "swap_line_down" },
|
||||
|
||||
{ "keys": ["ctrl+backspace"], "command": "delete_word", "args": { "forward": false } },
|
||||
{ "keys": ["ctrl+shift+backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard BOL.sublime-macro"} },
|
||||
|
||||
{ "keys": ["ctrl+delete"], "command": "delete_word", "args": { "forward": true } },
|
||||
{ "keys": ["ctrl+shift+delete"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard EOL.sublime-macro"} },
|
||||
|
||||
{ "keys": ["ctrl+/"], "command": "toggle_comment", "args": { "block": false } },
|
||||
{ "keys": ["ctrl+shift+/"], "command": "toggle_comment", "args": { "block": true } },
|
||||
|
||||
{ "keys": ["ctrl+j"], "command": "join_lines" },
|
||||
{ "keys": ["ctrl+shift+d"], "command": "duplicate_line" },
|
||||
|
||||
{ "keys": ["ctrl+`"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },
|
||||
|
||||
{ "keys": ["alt+/"], "command": "auto_complete" },
|
||||
{ "keys": ["alt+/"], "command": "replace_completion_with_auto_complete", "context":
|
||||
[
|
||||
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
|
||||
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
|
||||
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["ctrl+alt+shift+p"], "command": "show_scope_name" },
|
||||
|
||||
{ "keys": ["f7"], "command": "build" },
|
||||
{ "keys": ["ctrl+b"], "command": "build" },
|
||||
{ "keys": ["ctrl+shift+b"], "command": "build", "args": {"select": true} },
|
||||
{ "keys": ["ctrl+break"], "command": "cancel_build" },
|
||||
|
||||
{ "keys": ["ctrl+t"], "command": "transpose" },
|
||||
|
||||
{ "keys": ["f9"], "command": "sort_lines", "args": {"case_sensitive": false} },
|
||||
{ "keys": ["ctrl+f9"], "command": "sort_lines", "args": {"case_sensitive": true} },
|
||||
|
||||
// Auto-pair quotes
|
||||
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\""}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\"a-zA-Z0-9_]$", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"${0:$SELECTION}\""}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["\""], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\"$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair single quotes
|
||||
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'${0:$SELECTION}'"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["'"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "'$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair brackets
|
||||
{ "keys": ["("], "command": "insert_snippet", "args": {"contents": "($0)"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["("], "command": "insert_snippet", "args": {"contents": "(${0:$SELECTION})"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": [")"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\($", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair square brackets
|
||||
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[$0]"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[${0:$SELECTION}]"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["]"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\[$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair curly brackets
|
||||
{ "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{$0}"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["{"], "command": "wrap_block", "args": {"begin": "{", "end": "}"}, "context":
|
||||
[
|
||||
{ "key": "indented_block", "match_all": true },
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{${0:$SELECTION}}"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["}"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["enter"], "command": "auto_indent_tag", "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.tag.begin", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": ">$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^</", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "auto_indent_tag", "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.tag.begin", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": ">$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^</", "match_all": true },
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"keys": ["alt+shift+1"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["alt+shift+2"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.5, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["alt+shift+3"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.33, 0.66, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["alt+shift+4"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.25, 0.5, 0.75, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1], [3, 0, 4, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["alt+shift+8"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 1.0],
|
||||
"rows": [0.0, 0.5, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [0, 1, 1, 2]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["alt+shift+9"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 1.0],
|
||||
"rows": [0.0, 0.33, 0.66, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [0, 1, 1, 2], [0, 2, 1, 3]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["alt+shift+5"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.5, 1.0],
|
||||
"rows": [0.0, 0.5, 1.0],
|
||||
"cells":
|
||||
[
|
||||
[0, 0, 1, 1], [1, 0, 2, 1],
|
||||
[0, 1, 1, 2], [1, 1, 2, 2]
|
||||
]
|
||||
}
|
||||
},
|
||||
{ "keys": ["ctrl+1"], "command": "focus_group", "args": { "group": 0 } },
|
||||
{ "keys": ["ctrl+2"], "command": "focus_group", "args": { "group": 1 } },
|
||||
{ "keys": ["ctrl+3"], "command": "focus_group", "args": { "group": 2 } },
|
||||
{ "keys": ["ctrl+4"], "command": "focus_group", "args": { "group": 3 } },
|
||||
{ "keys": ["ctrl+5"], "command": "focus_group", "args": { "group": 4 } },
|
||||
{ "keys": ["ctrl+6"], "command": "focus_group", "args": { "group": 5 } },
|
||||
{ "keys": ["ctrl+7"], "command": "focus_group", "args": { "group": 6 } },
|
||||
{ "keys": ["ctrl+8"], "command": "focus_group", "args": { "group": 7 } },
|
||||
{ "keys": ["ctrl+9"], "command": "focus_group", "args": { "group": 8 } },
|
||||
{ "keys": ["ctrl+shift+1"], "command": "move_to_group", "args": { "group": 0 } },
|
||||
{ "keys": ["ctrl+shift+2"], "command": "move_to_group", "args": { "group": 1 } },
|
||||
{ "keys": ["ctrl+shift+3"], "command": "move_to_group", "args": { "group": 2 } },
|
||||
{ "keys": ["ctrl+shift+4"], "command": "move_to_group", "args": { "group": 3 } },
|
||||
{ "keys": ["ctrl+shift+5"], "command": "move_to_group", "args": { "group": 4 } },
|
||||
{ "keys": ["ctrl+shift+6"], "command": "move_to_group", "args": { "group": 5 } },
|
||||
{ "keys": ["ctrl+shift+7"], "command": "move_to_group", "args": { "group": 6 } },
|
||||
{ "keys": ["ctrl+shift+8"], "command": "move_to_group", "args": { "group": 7 } },
|
||||
{ "keys": ["ctrl+shift+9"], "command": "move_to_group", "args": { "group": 8 } },
|
||||
{ "keys": ["ctrl+0"], "command": "focus_side_bar" },
|
||||
|
||||
{ "keys": ["ctrl+k", "ctrl+up"], "command": "new_pane" },
|
||||
{ "keys": ["ctrl+k", "ctrl+shift+up"], "command": "new_pane", "args": {"move": false} },
|
||||
{ "keys": ["ctrl+k", "ctrl+down"], "command": "close_pane" },
|
||||
{ "keys": ["ctrl+k", "ctrl+left"], "command": "focus_neighboring_group", "args": {"forward": false} },
|
||||
{ "keys": ["ctrl+k", "ctrl+right"], "command": "focus_neighboring_group" },
|
||||
{ "keys": ["ctrl+k", "ctrl+shift+left"], "command": "move_to_neighboring_group", "args": {"forward": false} },
|
||||
{ "keys": ["ctrl+k", "ctrl+shift+right"], "command": "move_to_neighboring_group" },
|
||||
|
||||
{ "keys": ["alt+1"], "command": "select_by_index", "args": { "index": 0 } },
|
||||
{ "keys": ["alt+2"], "command": "select_by_index", "args": { "index": 1 } },
|
||||
{ "keys": ["alt+3"], "command": "select_by_index", "args": { "index": 2 } },
|
||||
{ "keys": ["alt+4"], "command": "select_by_index", "args": { "index": 3 } },
|
||||
{ "keys": ["alt+5"], "command": "select_by_index", "args": { "index": 4 } },
|
||||
{ "keys": ["alt+6"], "command": "select_by_index", "args": { "index": 5 } },
|
||||
{ "keys": ["alt+7"], "command": "select_by_index", "args": { "index": 6 } },
|
||||
{ "keys": ["alt+8"], "command": "select_by_index", "args": { "index": 7 } },
|
||||
{ "keys": ["alt+9"], "command": "select_by_index", "args": { "index": 8 } },
|
||||
{ "keys": ["alt+0"], "command": "select_by_index", "args": { "index": 9 } },
|
||||
|
||||
{ "keys": ["f2"], "command": "next_bookmark" },
|
||||
{ "keys": ["shift+f2"], "command": "prev_bookmark" },
|
||||
{ "keys": ["ctrl+f2"], "command": "toggle_bookmark" },
|
||||
{ "keys": ["ctrl+shift+f2"], "command": "clear_bookmarks" },
|
||||
{ "keys": ["alt+f2"], "command": "select_all_bookmarks" },
|
||||
|
||||
{ "keys": ["ctrl+shift+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
|
||||
|
||||
{ "keys": ["alt+q"], "command": "wrap_lines" },
|
||||
|
||||
{ "keys": ["ctrl+k", "ctrl+u"], "command": "upper_case" },
|
||||
{ "keys": ["ctrl+k", "ctrl+l"], "command": "lower_case" },
|
||||
|
||||
{ "keys": ["ctrl+k", "ctrl+space"], "command": "set_mark" },
|
||||
{ "keys": ["ctrl+k", "ctrl+a"], "command": "select_to_mark" },
|
||||
{ "keys": ["ctrl+k", "ctrl+w"], "command": "delete_to_mark" },
|
||||
{ "keys": ["ctrl+k", "ctrl+x"], "command": "swap_with_mark" },
|
||||
{ "keys": ["ctrl+k", "ctrl+y"], "command": "yank" },
|
||||
{ "keys": ["ctrl+k", "ctrl+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard EOL.sublime-macro"} },
|
||||
{ "keys": ["ctrl+k", "ctrl+backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard BOL.sublime-macro"} },
|
||||
{ "keys": ["ctrl+k", "ctrl+g"], "command": "clear_bookmarks", "args": {"name": "mark"} },
|
||||
{ "keys": ["ctrl+k", "ctrl+c"], "command": "show_at_center" },
|
||||
|
||||
{ "keys": ["ctrl++"], "command": "increase_font_size" },
|
||||
{ "keys": ["ctrl+="], "command": "increase_font_size" },
|
||||
{ "keys": ["ctrl+-"], "command": "decrease_font_size" },
|
||||
|
||||
{ "keys": ["alt+shift+w"], "command": "insert_snippet", "args": { "name": "Packages/XML/Snippets/long-tag.sublime-snippet" } },
|
||||
|
||||
{ "keys": ["ctrl+shift+["], "command": "fold" },
|
||||
{ "keys": ["ctrl+shift+]"], "command": "unfold" },
|
||||
{ "keys": ["ctrl+k", "ctrl+1"], "command": "fold_by_level", "args": {"level": 1} },
|
||||
{ "keys": ["ctrl+k", "ctrl+2"], "command": "fold_by_level", "args": {"level": 2} },
|
||||
{ "keys": ["ctrl+k", "ctrl+3"], "command": "fold_by_level", "args": {"level": 3} },
|
||||
{ "keys": ["ctrl+k", "ctrl+4"], "command": "fold_by_level", "args": {"level": 4} },
|
||||
{ "keys": ["ctrl+k", "ctrl+5"], "command": "fold_by_level", "args": {"level": 5} },
|
||||
{ "keys": ["ctrl+k", "ctrl+6"], "command": "fold_by_level", "args": {"level": 6} },
|
||||
{ "keys": ["ctrl+k", "ctrl+7"], "command": "fold_by_level", "args": {"level": 7} },
|
||||
{ "keys": ["ctrl+k", "ctrl+8"], "command": "fold_by_level", "args": {"level": 8} },
|
||||
{ "keys": ["ctrl+k", "ctrl+9"], "command": "fold_by_level", "args": {"level": 9} },
|
||||
{ "keys": ["ctrl+k", "ctrl+0"], "command": "unfold_all" },
|
||||
{ "keys": ["ctrl+k", "ctrl+j"], "command": "unfold_all" },
|
||||
{ "keys": ["ctrl+k", "ctrl+t"], "command": "fold_tag_attributes" },
|
||||
|
||||
{ "keys": ["context_menu"], "command": "context_menu" },
|
||||
|
||||
{ "keys": ["alt+c"], "command": "toggle_case_sensitive", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["alt+r"], "command": "toggle_regex", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["alt+w"], "command": "toggle_whole_word", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["alt+a"], "command": "toggle_preserve_case", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
// Find panel key bindings
|
||||
{ "keys": ["enter"], "command": "find_next", "context":
|
||||
[{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "find_prev", "context":
|
||||
[{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
// Replace panel key bindings
|
||||
{ "keys": ["enter"], "command": "find_next", "context":
|
||||
[{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "find_prev", "context":
|
||||
[{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["ctrl+alt+enter"], "command": "replace_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
// Incremental find panel key bindings
|
||||
{ "keys": ["enter"], "command": "hide_panel", "context":
|
||||
[{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "find_prev", "context":
|
||||
[{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
// Find in Files panel key bindings
|
||||
{ "keys": ["alt+enter"], "command": "find_all",
|
||||
"context": [{"key": "panel", "operand": "find_in_files"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["ctrl+alt+enter"], "command": "replace_all",
|
||||
"context": [{"key": "panel", "operand": "find_in_files"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
// HTML, XML close tag
|
||||
{ "keys": ["/"], "command": "close_tag", "args": { "insert_slash": true }, "context":
|
||||
[
|
||||
{ "key": "selector", "operator": "equal", "operand": "(text.html, text.xml) - string - comment", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_match", "operand": ".*<$", "match_all": true },
|
||||
{ "key": "setting.auto_close_tags" }
|
||||
]
|
||||
}
|
||||
]
|
@@ -1,706 +0,0 @@
|
||||
/*
|
||||
On OS X, basic text manipulations (left, right, command+left, etc) make use of the system key bindings,
|
||||
and don't need to be repeated here. Anything listed here will take precedence, however.
|
||||
*/
|
||||
[
|
||||
{ "keys": ["super+shift+n"], "command": "new_window" },
|
||||
{ "keys": ["super+shift+w"], "command": "close_window" },
|
||||
{ "keys": ["super+o"], "command": "prompt_open" },
|
||||
{ "keys": ["super+shift+t"], "command": "reopen_last_file" },
|
||||
{ "keys": ["super+alt+up"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "hh", "h", "ipp", "inl", "m", "mm"]} },
|
||||
{ "keys": ["super+n"], "command": "new_file" },
|
||||
{ "keys": ["super+s"], "command": "save" },
|
||||
{ "keys": ["super+shift+s"], "command": "prompt_save_as" },
|
||||
{ "keys": ["super+alt+s"], "command": "save_all" },
|
||||
{ "keys": ["super+w"], "command": "close" },
|
||||
|
||||
{ "keys": ["super+k", "super+b"], "command": "toggle_side_bar" },
|
||||
{ "keys": ["super+ctrl+f"], "command": "toggle_full_screen" },
|
||||
{ "keys": ["super+ctrl+shift+f"], "command": "toggle_distraction_free" },
|
||||
|
||||
{ "keys": ["super+z"], "command": "undo" },
|
||||
{ "keys": ["super+shift+z"], "command": "redo" },
|
||||
{ "keys": ["super+y"], "command": "redo_or_repeat" },
|
||||
{ "keys": ["super+u"], "command": "soft_undo" },
|
||||
{ "keys": ["super+shift+u"], "command": "soft_redo" },
|
||||
|
||||
{ "keys": ["super+x"], "command": "cut" },
|
||||
{ "keys": ["super+c"], "command": "copy" },
|
||||
{ "keys": ["super+v"], "command": "paste" },
|
||||
{ "keys": ["super+shift+v"], "command": "paste_and_indent" },
|
||||
{ "keys": ["super+k", "super+v"], "command": "paste_from_history" },
|
||||
{ "keys": ["super+option+v"], "command": "paste_from_history" },
|
||||
|
||||
{ "keys": ["ctrl+alt+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
|
||||
{ "keys": ["ctrl+alt+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
|
||||
{ "keys": ["ctrl+alt+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
|
||||
{ "keys": ["ctrl+alt+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
|
||||
|
||||
{ "keys": ["ctrl+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
|
||||
{ "keys": ["ctrl+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
|
||||
{ "keys": ["ctrl+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
|
||||
{ "keys": ["ctrl+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
|
||||
|
||||
{ "keys": ["ctrl+alt+up"], "command": "scroll_lines", "args": {"amount": 1.0} },
|
||||
{ "keys": ["ctrl+alt+down"], "command": "scroll_lines", "args": {"amount": -1.0} },
|
||||
|
||||
{ "keys": ["ctrl+shift+up"], "command": "select_lines", "args": {"forward": false} },
|
||||
{ "keys": ["ctrl+shift+down"], "command": "select_lines", "args": {"forward": true} },
|
||||
|
||||
{ "keys": ["super+shift+["], "command": "prev_view" },
|
||||
{ "keys": ["super+shift+]"], "command": "next_view" },
|
||||
{ "keys": ["super+alt+left"], "command": "prev_view" },
|
||||
{ "keys": ["super+alt+right"], "command": "next_view" },
|
||||
|
||||
{ "keys": ["ctrl+tab"], "command": "next_view_in_stack" },
|
||||
{ "keys": ["ctrl+shift+tab"], "command": "prev_view_in_stack" },
|
||||
|
||||
{ "keys": ["super+a"], "command": "select_all" },
|
||||
{ "keys": ["super+shift+l"], "command": "split_selection_into_lines" },
|
||||
{ "keys": ["escape"], "command": "single_selection", "context":
|
||||
[
|
||||
{ "key": "num_selections", "operator": "not_equal", "operand": 1 }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "clear_fields", "context":
|
||||
[
|
||||
{ "key": "has_next_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "clear_fields", "context":
|
||||
[
|
||||
{ "key": "has_prev_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_panel", "args": {"cancel": true},
|
||||
"context":
|
||||
[
|
||||
{ "key": "panel_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_overlay", "context":
|
||||
[
|
||||
{ "key": "overlay_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_popup", "context":
|
||||
[
|
||||
{ "key": "popup_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["escape"], "command": "hide_auto_complete", "context":
|
||||
[
|
||||
{ "key": "auto_complete_visible", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["super+]"], "command": "indent" },
|
||||
{ "keys": ["super+["], "command": "unindent" },
|
||||
|
||||
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
|
||||
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},
|
||||
"context":
|
||||
[
|
||||
{ "key": "setting.tab_completion", "operator": "equal", "operand": true },
|
||||
{ "key": "preceding_text", "operator": "not_regex_match", "operand": ".*\\b[0-9]+$", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "replace_completion_with_next_completion", "context":
|
||||
[
|
||||
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
|
||||
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "reindent", "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "indent", "context":
|
||||
[
|
||||
{ "key": "text", "operator": "regex_contains", "operand": "\n" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "next_field", "context":
|
||||
[
|
||||
{ "key": "has_next_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["tab"], "command": "commit_completion", "context":
|
||||
[
|
||||
{ "key": "auto_complete_visible" },
|
||||
{ "key": "setting.auto_complete_commit_on_tab" }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["shift+tab"], "command": "insert", "args": {"characters": "\t"} },
|
||||
{ "keys": ["shift+tab"], "command": "unindent", "context":
|
||||
[
|
||||
{ "key": "setting.shift_tab_unindent", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+tab"], "command": "unindent", "context":
|
||||
[
|
||||
{ "key": "preceding_text", "operator": "regex_match", "operand": "^[\t ]*" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+tab"], "command": "unindent", "context":
|
||||
[
|
||||
{ "key": "text", "operator": "regex_contains", "operand": "\n" }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+tab"], "command": "prev_field", "context":
|
||||
[
|
||||
{ "key": "has_prev_field", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["super+l"], "command": "expand_selection", "args": {"to": "line"} },
|
||||
{ "keys": ["super+d"], "command": "find_under_expand" },
|
||||
{ "keys": ["super+k", "super+d"], "command": "find_under_expand_skip" },
|
||||
{ "keys": ["super+shift+space"], "command": "expand_selection", "args": {"to": "scope"} },
|
||||
{ "keys": ["ctrl+shift+m"], "command": "expand_selection", "args": {"to": "brackets"} },
|
||||
{ "keys": ["ctrl+m"], "command": "move_to", "args": {"to": "brackets"} },
|
||||
{ "keys": ["super+shift+j"], "command": "expand_selection", "args": {"to": "indentation"} },
|
||||
{ "keys": ["super+shift+a"], "command": "expand_selection", "args": {"to": "tag"} },
|
||||
|
||||
{ "keys": ["super+alt+."], "command": "close_tag" },
|
||||
|
||||
{ "keys": ["ctrl+q"], "command": "toggle_record_macro" },
|
||||
{ "keys": ["ctrl+shift+q"], "command": "run_macro" },
|
||||
|
||||
{ "keys": ["super+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line.sublime-macro"} },
|
||||
{ "keys": ["super+shift+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line Before.sublime-macro"} },
|
||||
{ "keys": ["enter"], "command": "commit_completion", "context":
|
||||
[
|
||||
{ "key": "auto_complete_visible" },
|
||||
{ "key": "setting.auto_complete_commit_on_tab", "operand": false }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["super+t"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
|
||||
{ "keys": ["super+p"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
|
||||
{ "keys": ["super+shift+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
|
||||
{ "keys": ["super+ctrl+p"], "command": "prompt_select_workspace" },
|
||||
{ "keys": ["super+r"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
|
||||
{ "keys": ["ctrl+g"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
|
||||
{ "keys": ["f12"], "command": "goto_definition" },
|
||||
{ "keys": ["super+alt+down"], "command": "goto_definition" },
|
||||
{ "keys": ["super+shift+r"], "command": "goto_symbol_in_project" },
|
||||
{ "keys": ["ctrl+minus"], "command": "jump_back" },
|
||||
{ "keys": ["ctrl+shift+minus"], "command": "jump_forward" },
|
||||
|
||||
{ "keys": ["super+i"], "command": "show_panel", "args": {"panel": "incremental_find", "reverse": false} },
|
||||
{ "keys": ["super+shift+i"], "command": "show_panel", "args": {"panel": "incremental_find", "reverse": true} },
|
||||
{ "keys": ["super+f"], "command": "show_panel", "args": {"panel": "find", "reverse": false} },
|
||||
{ "keys": ["super+alt+f"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },
|
||||
{ "keys": ["super+alt+e"], "command": "replace_next" },
|
||||
{ "keys": ["super+g"], "command": "find_next" },
|
||||
{ "keys": ["super+shift+g"], "command": "find_prev" },
|
||||
{ "keys": ["super+e"], "command": "slurp_find_string" },
|
||||
{ "keys": ["super+shift+e"], "command": "slurp_replace_string" },
|
||||
|
||||
{ "keys": ["alt+super+g"], "command": "find_under" },
|
||||
{ "keys": ["shift+alt+super+g"], "command": "find_under_prev" },
|
||||
{ "keys": ["ctrl+super+g"], "command": "find_all_under" },
|
||||
|
||||
{ "keys": ["super+shift+f"], "command": "show_panel", "args": {"panel": "find_in_files"} },
|
||||
{ "keys": ["f4"], "command": "next_result" },
|
||||
{ "keys": ["shift+f4"], "command": "prev_result" },
|
||||
|
||||
{ "keys": ["f6"], "command": "toggle_setting", "args": {"setting": "spell_check"} },
|
||||
{ "keys": ["ctrl+f6"], "command": "next_misspelling" },
|
||||
{ "keys": ["ctrl+shift+f6"], "command": "prev_misspelling" },
|
||||
|
||||
{ "keys": ["ctrl+super+up"], "command": "swap_line_up" },
|
||||
{ "keys": ["ctrl+super+down"], "command": "swap_line_down" },
|
||||
|
||||
{ "keys": ["ctrl+backspace"], "command": "delete_word", "args": { "forward": false, "sub_words": true } },
|
||||
{ "keys": ["ctrl+delete"], "command": "delete_word", "args": { "forward": true, "sub_words": true } },
|
||||
|
||||
{ "keys": ["super+forward_slash"], "command": "toggle_comment", "args": { "block": false } },
|
||||
{ "keys": ["super+alt+forward_slash"], "command": "toggle_comment", "args": { "block": true } },
|
||||
|
||||
{ "keys": ["super+j"], "command": "join_lines" },
|
||||
{ "keys": ["super+shift+d"], "command": "duplicate_line" },
|
||||
|
||||
{ "keys": ["ctrl+backquote"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },
|
||||
|
||||
{ "keys": ["ctrl+space"], "command": "auto_complete" },
|
||||
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
|
||||
[
|
||||
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
|
||||
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
|
||||
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["super+alt+p"], "command": "show_scope_name" },
|
||||
{ "keys": ["ctrl+shift+p"], "command": "show_scope_name" },
|
||||
|
||||
{ "keys": ["f7"], "command": "build" },
|
||||
{ "keys": ["super+b"], "command": "build" },
|
||||
{ "keys": ["super+shift+b"], "command": "build", "args": {"select": true} },
|
||||
|
||||
{ "keys": ["ctrl+c"], "command": "cancel_build" },
|
||||
|
||||
{ "keys": ["ctrl+t"], "command": "transpose" },
|
||||
|
||||
{ "keys": ["f5"], "command": "sort_lines", "args": {"case_sensitive": false} },
|
||||
{ "keys": ["ctrl+f5"], "command": "sort_lines", "args": {"case_sensitive": true} },
|
||||
|
||||
// Auto-pair quotes
|
||||
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\""}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\"a-zA-Z0-9_]$", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"${0:$SELECTION}\""}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["\""], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\"$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair single quotes
|
||||
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'${0:$SELECTION}'"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["'"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "'$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true },
|
||||
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
|
||||
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true },
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair brackets
|
||||
{ "keys": ["("], "command": "insert_snippet", "args": {"contents": "($0)"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["("], "command": "insert_snippet", "args": {"contents": "(${0:$SELECTION})"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": [")"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\($", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair square brackets
|
||||
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[$0]"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[${0:$SELECTION}]"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["]"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\[$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
// Auto-pair curly brackets
|
||||
{ "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{$0}"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["{"], "command": "wrap_block", "args": {"begin": "{", "end": "}"}, "context":
|
||||
[
|
||||
{ "key": "indented_block", "match_all": true },
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{${0:$SELECTION}}"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["}"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
|
||||
]
|
||||
},
|
||||
|
||||
{ "keys": ["enter"], "command": "auto_indent_tag", "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.tag.begin", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": ">$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^</", "match_all": true },
|
||||
]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "auto_indent_tag", "context":
|
||||
[
|
||||
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
|
||||
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
|
||||
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.tag.begin", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_contains", "operand": ">$", "match_all": true },
|
||||
{ "key": "following_text", "operator": "regex_contains", "operand": "^</", "match_all": true },
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"keys": ["super+alt+1"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["super+alt+2"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.5, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["super+alt+3"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.33, 0.66, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["super+alt+4"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.25, 0.5, 0.75, 1.0],
|
||||
"rows": [0.0, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1], [3, 0, 4, 1]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["super+alt+shift+2"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 1.0],
|
||||
"rows": [0.0, 0.5, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [0, 1, 1, 2]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["super+alt+shift+3"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 1.0],
|
||||
"rows": [0.0, 0.33, 0.66, 1.0],
|
||||
"cells": [[0, 0, 1, 1], [0, 1, 1, 2], [0, 2, 1, 3]]
|
||||
}
|
||||
},
|
||||
{
|
||||
"keys": ["super+alt+5"],
|
||||
"command": "set_layout",
|
||||
"args":
|
||||
{
|
||||
"cols": [0.0, 0.5, 1.0],
|
||||
"rows": [0.0, 0.5, 1.0],
|
||||
"cells":
|
||||
[
|
||||
[0, 0, 1, 1], [1, 0, 2, 1],
|
||||
[0, 1, 1, 2], [1, 1, 2, 2]
|
||||
]
|
||||
}
|
||||
},
|
||||
{ "keys": ["ctrl+1"], "command": "focus_group", "args": { "group": 0 } },
|
||||
{ "keys": ["ctrl+2"], "command": "focus_group", "args": { "group": 1 } },
|
||||
{ "keys": ["ctrl+3"], "command": "focus_group", "args": { "group": 2 } },
|
||||
{ "keys": ["ctrl+4"], "command": "focus_group", "args": { "group": 3 } },
|
||||
{ "keys": ["ctrl+5"], "command": "focus_group", "args": { "group": 4 } },
|
||||
{ "keys": ["ctrl+6"], "command": "focus_group", "args": { "group": 5 } },
|
||||
{ "keys": ["ctrl+7"], "command": "focus_group", "args": { "group": 6 } },
|
||||
{ "keys": ["ctrl+8"], "command": "focus_group", "args": { "group": 7 } },
|
||||
{ "keys": ["ctrl+9"], "command": "focus_group", "args": { "group": 8 } },
|
||||
{ "keys": ["ctrl+shift+1"], "command": "move_to_group", "args": { "group": 0 } },
|
||||
{ "keys": ["ctrl+shift+2"], "command": "move_to_group", "args": { "group": 1 } },
|
||||
{ "keys": ["ctrl+shift+3"], "command": "move_to_group", "args": { "group": 2 } },
|
||||
{ "keys": ["ctrl+shift+4"], "command": "move_to_group", "args": { "group": 3 } },
|
||||
{ "keys": ["ctrl+shift+5"], "command": "move_to_group", "args": { "group": 4 } },
|
||||
{ "keys": ["ctrl+shift+6"], "command": "move_to_group", "args": { "group": 5 } },
|
||||
{ "keys": ["ctrl+shift+7"], "command": "move_to_group", "args": { "group": 6 } },
|
||||
{ "keys": ["ctrl+shift+8"], "command": "move_to_group", "args": { "group": 7 } },
|
||||
{ "keys": ["ctrl+shift+9"], "command": "move_to_group", "args": { "group": 8 } },
|
||||
{ "keys": ["ctrl+0"], "command": "focus_side_bar" },
|
||||
|
||||
{ "keys": ["super+k", "super+up"], "command": "new_pane" },
|
||||
{ "keys": ["super+k", "super+shift+up"], "command": "new_pane", "args": {"move": false} },
|
||||
{ "keys": ["super+k", "super+down"], "command": "close_pane" },
|
||||
{ "keys": ["super+k", "super+left"], "command": "focus_neighboring_group", "args": {"forward": false} },
|
||||
{ "keys": ["super+k", "super+right"], "command": "focus_neighboring_group" },
|
||||
{ "keys": ["super+k", "super+shift+left"], "command": "move_to_neighboring_group", "args": {"forward": false} },
|
||||
{ "keys": ["super+k", "super+shift+right"], "command": "move_to_neighboring_group" },
|
||||
|
||||
{ "keys": ["super+1"], "command": "select_by_index", "args": { "index": 0 } },
|
||||
{ "keys": ["super+2"], "command": "select_by_index", "args": { "index": 1 } },
|
||||
{ "keys": ["super+3"], "command": "select_by_index", "args": { "index": 2 } },
|
||||
{ "keys": ["super+4"], "command": "select_by_index", "args": { "index": 3 } },
|
||||
{ "keys": ["super+5"], "command": "select_by_index", "args": { "index": 4 } },
|
||||
{ "keys": ["super+6"], "command": "select_by_index", "args": { "index": 5 } },
|
||||
{ "keys": ["super+7"], "command": "select_by_index", "args": { "index": 6 } },
|
||||
{ "keys": ["super+8"], "command": "select_by_index", "args": { "index": 7 } },
|
||||
{ "keys": ["super+9"], "command": "select_by_index", "args": { "index": 8 } },
|
||||
{ "keys": ["super+0"], "command": "select_by_index", "args": { "index": 9 } },
|
||||
|
||||
{ "keys": ["f2"], "command": "next_bookmark" },
|
||||
{ "keys": ["shift+f2"], "command": "prev_bookmark" },
|
||||
{ "keys": ["super+f2"], "command": "toggle_bookmark" },
|
||||
{ "keys": ["super+shift+f2"], "command": "clear_bookmarks" },
|
||||
{ "keys": ["alt+f2"], "command": "select_all_bookmarks" },
|
||||
|
||||
{ "keys": ["super+k", "super+u"], "command": "upper_case" },
|
||||
{ "keys": ["super+k", "super+l"], "command": "lower_case" },
|
||||
{ "keys": ["super+k", "super+space"], "command": "set_mark" },
|
||||
{ "keys": ["super+k", "super+a"], "command": "select_to_mark" },
|
||||
{ "keys": ["super+k", "super+w"], "command": "delete_to_mark" },
|
||||
{ "keys": ["super+k", "super+x"], "command": "swap_with_mark" },
|
||||
{ "keys": ["super+k", "super+g"], "command": "clear_bookmarks", "args": {"name": "mark"} },
|
||||
|
||||
{ "keys": ["super+equals"], "command": "increase_font_size" },
|
||||
{ "keys": ["super+plus"], "command": "increase_font_size" },
|
||||
{ "keys": ["super+minus"], "command": "decrease_font_size" },
|
||||
|
||||
{ "keys": ["ctrl+shift+w"], "command": "insert_snippet", "args": { "name": "Packages/XML/Snippets/long-tag.sublime-snippet" } },
|
||||
|
||||
{ "keys": ["ctrl+shift+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
|
||||
|
||||
{ "keys": ["super+alt+q"], "command": "wrap_lines" },
|
||||
|
||||
{ "keys": ["super+alt+["], "command": "fold" },
|
||||
{ "keys": ["super+alt+]"], "command": "unfold" },
|
||||
{ "keys": ["super+k", "super+1"], "command": "fold_by_level", "args": {"level": 1} },
|
||||
{ "keys": ["super+k", "super+2"], "command": "fold_by_level", "args": {"level": 2} },
|
||||
{ "keys": ["super+k", "super+3"], "command": "fold_by_level", "args": {"level": 3} },
|
||||
{ "keys": ["super+k", "super+4"], "command": "fold_by_level", "args": {"level": 4} },
|
||||
{ "keys": ["super+k", "super+5"], "command": "fold_by_level", "args": {"level": 5} },
|
||||
{ "keys": ["super+k", "super+6"], "command": "fold_by_level", "args": {"level": 6} },
|
||||
{ "keys": ["super+k", "super+7"], "command": "fold_by_level", "args": {"level": 7} },
|
||||
{ "keys": ["super+k", "super+8"], "command": "fold_by_level", "args": {"level": 8} },
|
||||
{ "keys": ["super+k", "super+9"], "command": "fold_by_level", "args": {"level": 9} },
|
||||
{ "keys": ["super+k", "super+0"], "command": "unfold_all" },
|
||||
{ "keys": ["super+k", "super+j"], "command": "unfold_all" },
|
||||
{ "keys": ["super+k", "super+t"], "command": "fold_tag_attributes" },
|
||||
|
||||
{ "keys": ["super+alt+o"], "command": "toggle_overwrite" },
|
||||
|
||||
{ "keys": ["alt+f2"], "command": "context_menu" },
|
||||
|
||||
{ "keys": ["super+alt+c"], "command": "toggle_case_sensitive", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["super+alt+r"], "command": "toggle_regex", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["super+alt+w"], "command": "toggle_whole_word", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
{ "keys": ["super+alt+a"], "command": "toggle_preserve_case", "context":
|
||||
[
|
||||
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
|
||||
]
|
||||
},
|
||||
|
||||
// Find panel key bindings
|
||||
{ "keys": ["enter"], "command": "find_next", "context":
|
||||
[{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "find_prev", "context":
|
||||
[{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
// Replace panel key bindings
|
||||
{ "keys": ["enter"], "command": "find_next", "context":
|
||||
[{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "find_prev", "context":
|
||||
[{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["ctrl+alt+enter"], "command": "replace_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "replace"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
// Incremental find panel key bindings
|
||||
{ "keys": ["enter"], "command": "hide_panel", "context":
|
||||
[{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["shift+enter"], "command": "find_prev", "context":
|
||||
[{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
{ "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
|
||||
"context": [{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
|
||||
},
|
||||
|
||||
{ "keys": ["super+,"], "command": "edit_settings", "args":
|
||||
{
|
||||
"base_file": "${packages}/Default/Preferences.sublime-settings",
|
||||
"default": "// Settings in here override those in \"Default/Preferences.sublime-settings\",\n// and are overridden in turn by syntax-specific settings.\n{\n\t$0\n}\n"
|
||||
}
|
||||
},
|
||||
|
||||
{ "keys": ["super+k", "super+y"], "command": "yank" },
|
||||
{ "keys": ["super+k", "super+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard EOL.sublime-macro"} },
|
||||
{ "keys": ["super+k", "super+backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard BOL.sublime-macro"} },
|
||||
{ "keys": ["super+k", "super+c"], "command": "show_at_center" },
|
||||
|
||||
// These are OS X built in commands, and don't need to be listed here, but
|
||||
// doing so lets them show up in the menu
|
||||
{ "keys": ["ctrl+y"], "command": "yank" },
|
||||
{ "keys": ["super+backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard BOL.sublime-macro"} },
|
||||
// super+delete isn't a built in command, but makes sense anyway
|
||||
{ "keys": ["super+delete"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard EOL.sublime-macro"} },
|
||||
{ "keys": ["ctrl+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete to Hard EOL.sublime-macro"} },
|
||||
{ "keys": ["ctrl+l"], "command": "show_at_center" },
|
||||
{ "keys": ["ctrl+o"], "command": "insert_snippet", "args": { "contents": "$0\n" } },
|
||||
{ "keys": ["ctrl+super+d"], "command": "noop" },
|
||||
{ "keys": ["ctrl+super+shift+d"], "command": "noop" },
|
||||
|
||||
// HTML, XML close tag
|
||||
{ "keys": ["/"], "command": "close_tag", "args": { "insert_slash": true }, "context":
|
||||
[
|
||||
{ "key": "selector", "operator": "equal", "operand": "(text.html, text.xml) - string - comment", "match_all": true },
|
||||
{ "key": "preceding_text", "operator": "regex_match", "operand": ".*<$", "match_all": true },
|
||||
{ "key": "setting.auto_close_tags" }
|
||||
]
|
||||
}
|
||||
]
|
@@ -1,432 +0,0 @@
|
||||
{"scancode":"01",
|
||||
"eventcode":1,
|
||||
"eventname":"ESC"},
|
||||
{"scancode":"02",
|
||||
"eventcode":2,
|
||||
"eventname":"1"},
|
||||
{"scancode":"03",
|
||||
"eventcode":3,
|
||||
"eventname":"2"},
|
||||
{"scancode":"04",
|
||||
"eventcode":4,
|
||||
"eventname":"3"},
|
||||
{"scancode":"05",
|
||||
"eventcode":5,
|
||||
"eventname":"4"},
|
||||
{"scancode":"06",
|
||||
"eventcode":6,
|
||||
"eventname":"5"},
|
||||
{"scancode":"07",
|
||||
"eventcode":7,
|
||||
"eventname":"6"},
|
||||
{"scancode":"08",
|
||||
"eventcode":8,
|
||||
"eventname":"7"},
|
||||
{"scancode":"09",
|
||||
"eventcode":9,
|
||||
"eventname":"8"},
|
||||
{"scancode":"0a",
|
||||
"eventcode":10,
|
||||
"eventname":"9"},
|
||||
{"scancode":"0b",
|
||||
"eventcode":11,
|
||||
"eventname":"0"},
|
||||
{"scancode":"0c",
|
||||
"eventcode":12,
|
||||
"eventname":"MINUS"},
|
||||
{"scancode":"0d",
|
||||
"eventcode":13,
|
||||
"eventname":"EQUAL"},
|
||||
{"scancode":"0e",
|
||||
"eventcode":14,
|
||||
"eventname":"BACKSPACE"},
|
||||
{"scancode":"0f",
|
||||
"eventcode":15,
|
||||
"eventname":"TAB"},
|
||||
{"scancode":"10",
|
||||
"eventcode":16,
|
||||
"eventname":"Q"},
|
||||
{"scancode":"11",
|
||||
"eventcode":17,
|
||||
"eventname":"W"},
|
||||
{"scancode":"12",
|
||||
"eventcode":18,
|
||||
"eventname":"E"},
|
||||
{"scancode":"13",
|
||||
"eventcode":19,
|
||||
"eventname":"R"},
|
||||
{"scancode":"14",
|
||||
"eventcode":20,
|
||||
"eventname":"T"},
|
||||
{"scancode":"15",
|
||||
"eventcode":21,
|
||||
"eventname":"Y"},
|
||||
{"scancode":"16",
|
||||
"eventcode":22,
|
||||
"eventname":"U"},
|
||||
{"scancode":"17",
|
||||
"eventcode":23,
|
||||
"eventname":"I"},
|
||||
{"scancode":"18",
|
||||
"eventcode":24,
|
||||
"eventname":"O"},
|
||||
{"scancode":"19",
|
||||
"eventcode":25,
|
||||
"eventname":"P"},
|
||||
{"scancode":"1a",
|
||||
"eventcode":26,
|
||||
"eventname":"LEFTBRACE"},
|
||||
{"scancode":"1b",
|
||||
"eventcode":27,
|
||||
"eventname":"RIGHTBRACE"},
|
||||
{"scancode":"1c",
|
||||
"eventcode":28,
|
||||
"eventname":"ENTER"},
|
||||
{"scancode":"1d",
|
||||
"eventcode":29,
|
||||
"eventname":"LEFTCTRL"},
|
||||
{"scancode":"1e",
|
||||
"eventcode":30,
|
||||
"eventname":"A"},
|
||||
{"scancode":"1f",
|
||||
"eventcode":31,
|
||||
"eventname":"S"},
|
||||
{"scancode":"20",
|
||||
"eventcode":32,
|
||||
"eventname":"D"},
|
||||
{"scancode":"21",
|
||||
"eventcode":33,
|
||||
"eventname":"F"},
|
||||
{"scancode":"22",
|
||||
"eventcode":34,
|
||||
"eventname":"G"},
|
||||
{"scancode":"23",
|
||||
"eventcode":35,
|
||||
"eventname":"H"},
|
||||
{"scancode":"24",
|
||||
"eventcode":36,
|
||||
"eventname":"J"},
|
||||
{"scancode":"25",
|
||||
"eventcode":37,
|
||||
"eventname":"K"},
|
||||
{"scancode":"26",
|
||||
"eventcode":38,
|
||||
"eventname":"L"},
|
||||
{"scancode":"27",
|
||||
"eventcode":39,
|
||||
"eventname":"SEMICOLON"},
|
||||
{"scancode":"28",
|
||||
"eventcode":40,
|
||||
"eventname":"APOSTROPHE"},
|
||||
{"scancode":"29",
|
||||
"eventcode":41,
|
||||
"eventname":"GRAVE"},
|
||||
{"scancode":"2a",
|
||||
"eventcode":42,
|
||||
"eventname":"LEFTSHIFT"},
|
||||
{"scancode":"2b",
|
||||
"eventcode":43,
|
||||
"eventname":"BACKSLASH"},
|
||||
{"scancode":"2c",
|
||||
"eventcode":44,
|
||||
"eventname":"Z"},
|
||||
{"scancode":"2d",
|
||||
"eventcode":45,
|
||||
"eventname":"X"},
|
||||
{"scancode":"2e",
|
||||
"eventcode":46,
|
||||
"eventname":"C"},
|
||||
{"scancode":"2f",
|
||||
"eventcode":47,
|
||||
"eventname":"V"},
|
||||
{"scancode":"30",
|
||||
"eventcode":48,
|
||||
"eventname":"B"},
|
||||
{"scancode":"31",
|
||||
"eventcode":49,
|
||||
"eventname":"N"},
|
||||
{"scancode":"32",
|
||||
"eventcode":50,
|
||||
"eventname":"M"},
|
||||
{"scancode":"33",
|
||||
"eventcode":51,
|
||||
"eventname":"COMMA"},
|
||||
{"scancode":"34",
|
||||
"eventcode":52,
|
||||
"eventname":"DOT"},
|
||||
{"scancode":"35",
|
||||
"eventcode":53,
|
||||
"eventname":"SLASH"},
|
||||
{"scancode":"36",
|
||||
"eventcode":54,
|
||||
"eventname":"RIGHTSHIFT"},
|
||||
{"scancode":"37",
|
||||
"eventcode":55,
|
||||
"eventname":"KPASTERISK"},
|
||||
{"scancode":"38",
|
||||
"eventcode":56,
|
||||
"eventname":"LEFTALT"},
|
||||
{"scancode":"39",
|
||||
"eventcode":57,
|
||||
"eventname":"SPACE"},
|
||||
{"scancode":"40",
|
||||
"eventcode":58,
|
||||
"eventname":"CAPSLOCK"},
|
||||
{"scancode":"41",
|
||||
"eventcode":59,
|
||||
"eventname":"F1"},
|
||||
{"scancode":"42",
|
||||
"eventcode":60,
|
||||
"eventname":"F2"},
|
||||
{"scancode":"43",
|
||||
"eventcode":61,
|
||||
"eventname":"F3"},
|
||||
{"scancode":"44",
|
||||
"eventcode":62,
|
||||
"eventname":"F4"},
|
||||
{"scancode":"45",
|
||||
"eventcode":63,
|
||||
"eventname":"F5"},
|
||||
{"scancode":"46",
|
||||
"eventcode":64,
|
||||
"eventname":"F6"},
|
||||
{"scancode":"47",
|
||||
"eventcode":65,
|
||||
"eventname":"F7"},
|
||||
{"scancode":"48",
|
||||
"eventcode":66,
|
||||
"eventname":"F8"},
|
||||
{"scancode":"49",
|
||||
"eventcode":67,
|
||||
"eventname":"F9"},
|
||||
{"scancode":"50",
|
||||
"eventcode":68,
|
||||
"eventname":"F10"},
|
||||
{"scancode":"51",
|
||||
"eventcode":69,
|
||||
"eventname":"NUMLOCK"},
|
||||
{"scancode":"52",
|
||||
"eventcode":70,
|
||||
"eventname":"SCROLLLOCK"},
|
||||
{"scancode":"53",
|
||||
"eventcode":71,
|
||||
"eventname":"KP7"},
|
||||
{"scancode":"54",
|
||||
"eventcode":72,
|
||||
"eventname":"KP8"},
|
||||
{"scancode":"55",
|
||||
"eventcode":73,
|
||||
"eventname":"KP9"},
|
||||
{"scancode":"56",
|
||||
"eventcode":74,
|
||||
"eventname":"KPMINUS"},
|
||||
{"scancode":"57",
|
||||
"eventcode":75,
|
||||
"eventname":"KP4"},
|
||||
{"scancode":"58",
|
||||
"eventcode":76,
|
||||
"eventname":"KP5"},
|
||||
{"scancode":"59",
|
||||
"eventcode":77,
|
||||
"eventname":"KP6"},
|
||||
{"scancode":"5A",
|
||||
"eventcode":78,
|
||||
"eventname":"KPPLUS"},
|
||||
{"scancode":"5B",
|
||||
"eventcode":79,
|
||||
"eventname":"KP1"},
|
||||
{"scancode":"5C",
|
||||
"eventcode":80,
|
||||
"eventname":"KP2"},
|
||||
{"scancode":"5D",
|
||||
"eventcode":81,
|
||||
"eventname":"KP3"},
|
||||
{"scancode":"5E",
|
||||
"eventcode":82,
|
||||
"eventname":"KP0"},
|
||||
{"scancode":"5F",
|
||||
"eventcode":83,
|
||||
"eventname":"KPDOT"},
|
||||
{"scancode":"60",
|
||||
"eventcode":85,
|
||||
"eventname":"ZENKAKUHANKAKU"},
|
||||
{"scancode":"61",
|
||||
"eventcode":86,
|
||||
"eventname":"102ND"},
|
||||
{"scancode":"62",
|
||||
"eventcode":87,
|
||||
"eventname":"F11"},
|
||||
{"scancode":"63",
|
||||
"eventcode":88,
|
||||
"eventname":"F12"},
|
||||
{"scancode":"64",
|
||||
"eventcode":89,
|
||||
"eventname":"RO"},
|
||||
{"scancode":"65",
|
||||
"eventcode":90,
|
||||
"eventname":"KATAKANA"},
|
||||
{"scancode":"66",
|
||||
"eventcode":91,
|
||||
"eventname":"HIRAGANA"},
|
||||
{"scancode":"67",
|
||||
"eventcode":92,
|
||||
"eventname":"HENKAN"},
|
||||
{"scancode":"68",
|
||||
"eventcode":93,
|
||||
"eventname":"KATAKANAHIRAGANA"},
|
||||
{"scancode":"69",
|
||||
"eventcode":94,
|
||||
"eventname":"MUHENKAN"},
|
||||
{"scancode":"6A",
|
||||
"eventcode":95,
|
||||
"eventname":"KPJPCOMMA"},
|
||||
{"scancode":"6B",
|
||||
"eventcode":96,
|
||||
"eventname":"KPENTER"},
|
||||
{"scancode":"6C",
|
||||
"eventcode":97,
|
||||
"eventname":"RIGHTCTRL"},
|
||||
{"scancode":"6D",
|
||||
"eventcode":98,
|
||||
"eventname":"KPSLASH"},
|
||||
{"scancode":"6E",
|
||||
"eventcode":99,
|
||||
"eventname":"SYSRQ"},
|
||||
{"scancode":"6F",
|
||||
"eventcode":100,
|
||||
"eventname":"RIGHTALT"},
|
||||
{"scancode":"70",
|
||||
"eventcode":102,
|
||||
"eventname":"HOME"},
|
||||
{"scancode":"71",
|
||||
"eventcode":103,
|
||||
"eventname":"UP"},
|
||||
{"scancode":"72",
|
||||
"eventcode":104,
|
||||
"eventname":"PAGEUP"},
|
||||
{"scancode":"73",
|
||||
"eventcode":105,
|
||||
"eventname":"LEFT"},
|
||||
{"scancode":"74",
|
||||
"eventcode":106,
|
||||
"eventname":"RIGHT"},
|
||||
{"scancode":"75",
|
||||
"eventcode":107,
|
||||
"eventname":"END"},
|
||||
{"scancode":"76",
|
||||
"eventcode":108,
|
||||
"eventname":"DOWN"},
|
||||
{"scancode":"77",
|
||||
"eventcode":109,
|
||||
"eventname":"PAGEDOWN"},
|
||||
{"scancode":"78",
|
||||
"eventcode":110,
|
||||
"eventname":"INSERT"},
|
||||
{"scancode":"79",
|
||||
"eventcode":111,
|
||||
"eventname":"DELETE"},
|
||||
{"scancode":"7A",
|
||||
"eventcode":112,
|
||||
"eventname":"MACRO"},
|
||||
{"scancode":"7B",
|
||||
"eventcode":113,
|
||||
"eventname":"MUTE"},
|
||||
{"scancode":"7C",
|
||||
"eventcode":114,
|
||||
"eventname":"VOLUMEDOWN"},
|
||||
{"scancode":"7D",
|
||||
"eventcode":115,
|
||||
"eventname":"VOLUMEUP"},
|
||||
{"scancode":"7E",
|
||||
"eventcode":116,
|
||||
"eventname":"POWER"},
|
||||
{"scancode":"7F",
|
||||
"eventcode":117,
|
||||
"eventname":"KPEQUAL"},
|
||||
{"scancode":"80",
|
||||
"eventcode":118,
|
||||
"eventname":"KPPLUSMINUS"},
|
||||
{"scancode":"81",
|
||||
"eventcode":119,
|
||||
"eventname":"PAUSE"},
|
||||
{"scancode":"82",
|
||||
"eventcode":121,
|
||||
"eventname":"KPCOMMA"},
|
||||
{"scancode":"83",
|
||||
"eventcode":122,
|
||||
"eventname":"HANGUEL"},
|
||||
{"scancode":"84",
|
||||
"eventcode":123,
|
||||
"eventname":"HANJA"},
|
||||
{"scancode":"85",
|
||||
"eventcode":124,
|
||||
"eventname":"YEN"},
|
||||
{"scancode":"86",
|
||||
"eventcode":125,
|
||||
"eventname":"LEFTMETA"},
|
||||
{"scancode":"87",
|
||||
"eventcode":126,
|
||||
"eventname":"RIGHTMETA"},
|
||||
{"scancode":"88",
|
||||
"eventcode":127,
|
||||
"eventname":"COMPOSE"},
|
||||
{"scancode":"89",
|
||||
"eventcode":128,
|
||||
"eventname":"STOP"},
|
||||
{"scancode":"8A",
|
||||
"eventcode":140,
|
||||
"eventname":"CALC"},
|
||||
{"scancode":"8B",
|
||||
"eventcode":142,
|
||||
"eventname":"SLEEP"},
|
||||
{"scancode":"8C",
|
||||
"eventcode":143,
|
||||
"eventname":"WAKEUP"},
|
||||
{"scancode":"8D",
|
||||
"eventcode":155,
|
||||
"eventname":"MAIL"},
|
||||
{"scancode":"8E",
|
||||
"eventcode":156,
|
||||
"eventname":"BOOKMARKS"},
|
||||
{"scancode":"8F",
|
||||
"eventcode":157,
|
||||
"eventname":"COMPUTER"},
|
||||
{"scancode":"90",
|
||||
"eventcode":158,
|
||||
"eventname":"BACK"},
|
||||
{"scancode":"91",
|
||||
"eventcode":159,
|
||||
"eventname":"FORWARD"},
|
||||
{"scancode":"92",
|
||||
"eventcode":163,
|
||||
"eventname":"NEXTSONG"},
|
||||
{"scancode":"93",
|
||||
"eventcode":164,
|
||||
"eventname":"PLAYPAUSE"},
|
||||
{"scancode":"94",
|
||||
"eventcode":165,
|
||||
"eventname":"PREVIOUSSONG"},
|
||||
{"scancode":"95",
|
||||
"eventcode":166,
|
||||
"eventname":"STOPCD"},
|
||||
{"scancode":"96",
|
||||
"eventcode":172,
|
||||
"eventname":"HOMEPAGE"},
|
||||
{"scancode":"97",
|
||||
"eventcode":173,
|
||||
"eventname":"REFRESH"},
|
||||
{"scancode":"98",
|
||||
"eventcode":183,
|
||||
"eventname":"F13"},
|
||||
{"scancode":"99",
|
||||
"eventcode":184,
|
||||
"eventname":"F14"},
|
||||
{"scancode":"9A",
|
||||
"eventcode":185,
|
||||
"eventname":"F15"},
|
||||
{"scancode":"9B",
|
||||
"eventcode":217,
|
||||
"eventname":"SEARCH"},
|
||||
{"scancode":"9C",
|
||||
"eventcode":226,
|
||||
"eventname":"MEDIA"}
|
@@ -1,115 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Kinto - Python implementation of Xlib
|
||||
#
|
||||
# Based on code by Stephan Sokolow
|
||||
# Source: https://gist.github.com/ssokolow/e7c9aae63fb7973e4d64cff969a78ae8
|
||||
from contextlib import contextmanager
|
||||
import Xlib
|
||||
import Xlib.display
|
||||
|
||||
# Connect to the X server and get the root window
|
||||
disp = Xlib.display.Display()
|
||||
root = disp.screen().root
|
||||
|
||||
# Prepare the property names we use so they can be fed into X11 APIs
|
||||
NET_ACTIVE_WINDOW = disp.intern_atom('_NET_ACTIVE_WINDOW')
|
||||
NET_WM_NAME = disp.intern_atom('_NET_WM_NAME') # UTF-8
|
||||
WM_NAME = disp.intern_atom('WM_NAME') # Legacy encoding
|
||||
NET_WM_CLASS = disp.intern_atom('_NET_WM_CLASS') # UTF-8
|
||||
WM_CLASS = disp.intern_atom('WM_CLASS')
|
||||
|
||||
last_seen = { 'xid': None, 'title': None }
|
||||
|
||||
@contextmanager
|
||||
def window_obj(win_id):
|
||||
"""Simplify dealing with BadWindow (make it either valid or None)"""
|
||||
window_obj = None
|
||||
if win_id:
|
||||
try:
|
||||
window_obj = disp.create_resource_object('window', win_id)
|
||||
except Xlib.error.XError:
|
||||
pass
|
||||
yield window_obj
|
||||
|
||||
def get_active_window():
|
||||
"""Return a (window_obj, focus_has_changed) tuple for the active window."""
|
||||
win_id = root.get_full_property(NET_ACTIVE_WINDOW,Xlib.X.AnyPropertyType).value[0]
|
||||
|
||||
focus_changed = (win_id != last_seen['xid'])
|
||||
if focus_changed:
|
||||
with window_obj(last_seen['xid']) as old_win:
|
||||
if old_win:
|
||||
old_win.change_attributes(event_mask=Xlib.X.NoEventMask)
|
||||
|
||||
last_seen['xid'] = win_id
|
||||
with window_obj(win_id) as new_win:
|
||||
if new_win:
|
||||
new_win.change_attributes(event_mask=Xlib.X.PropertyChangeMask)
|
||||
|
||||
return win_id, focus_changed
|
||||
|
||||
def _get_window_class_inner(win_obj):
|
||||
for atom in (NET_WM_CLASS, WM_CLASS):
|
||||
try:
|
||||
window_class = win_obj.get_full_property(atom, 0)
|
||||
|
||||
except UnicodeDecodeError: # Apparently a Debian distro package bug
|
||||
title = "<could not decode characters>"
|
||||
else:
|
||||
if window_class:
|
||||
win_class = window_class.value.split('\x00')[1]
|
||||
if isinstance(win_class, bytes):
|
||||
# Apparently COMPOUND_TEXT is so arcane that this is how
|
||||
# tools like xprop deal with receiving it these days
|
||||
win_class = win_class.split('\x00')[1].decode('latin1', 'replace')
|
||||
return win_class
|
||||
else:
|
||||
title = "<unnamed window>"
|
||||
|
||||
return "{} (XID: {})".format(title, win_obj.id)
|
||||
|
||||
def get_window_class(win_id):
|
||||
"""Look up the window name for a given X11 window ID"""
|
||||
if not win_id:
|
||||
last_seen['title'] = "<no window id>"
|
||||
return last_seen['title']
|
||||
|
||||
title_changed = False
|
||||
with window_obj(win_id) as wobj:
|
||||
if wobj:
|
||||
win_title = _get_window_class_inner(wobj)
|
||||
title_changed = (win_title != last_seen['title'])
|
||||
last_seen['title'] = win_title
|
||||
|
||||
return last_seen['title'], title_changed
|
||||
|
||||
def handle_xevent(event):
|
||||
# Loop through, ignoring events until we're notified of focus/title change
|
||||
if event.type != Xlib.X.PropertyNotify:
|
||||
return
|
||||
|
||||
changed = False
|
||||
if event.atom == NET_ACTIVE_WINDOW:
|
||||
if get_active_window()[1]:
|
||||
changed = changed or get_window_class(last_seen['xid'])[1]
|
||||
elif event.atom in (NET_WM_CLASS, WM_CLASS):
|
||||
changed = changed or get_window_class(last_seen['xid'])[1]
|
||||
|
||||
if changed:
|
||||
handle_change(last_seen)
|
||||
|
||||
def handle_change(new_state):
|
||||
"""Replace this with whatever you want to actually do"""
|
||||
print(new_state['title'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Listen for _NET_ACTIVE_WINDOW changes
|
||||
root.change_attributes(event_mask=Xlib.X.PropertyChangeMask)
|
||||
|
||||
# Prime last_seen with whatever window was active when we started this
|
||||
get_window_class(get_active_window()[0])
|
||||
handle_change(last_seen)
|
||||
|
||||
while True: # next_event() sleeps until we get an event
|
||||
handle_xevent(disp.next_event())
|
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
mkdir -p ~/.xkb/{keymap,symbols,types}
|
||||
cp ./.xkb/symbols/chromebook ~/.xkb/symbols/chromebook
|
||||
cp ./.xkb/symbols/mac_gui ~/.xkb/symbols/mac_gui
|
||||
cp ./.xkb/types/mac_gui ~/.xkb/types/mac_gui
|
||||
setxkbmap -option
|
||||
setxkbmap -print > ~/.xkb/keymap/kbd.chromebook.gui
|
||||
setxkbmap -print > ~/.xkb/keymap/kbd.chromebook.term
|
||||
line=$(cat ~/.xkb/keymap/kbd.chromebook.gui | grep -n 'xkb_symbols' | cut -f1 -d:)
|
||||
sed -ie "${line}s/\"/+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)\"/2" ~/.xkb/keymap/kbd.chromebook.gui
|
||||
sleep 1
|
||||
line=$(cat ~/.xkb/keymap/kbd.chromebook.gui | grep -n 'xkb_types' | cut -f1 -d:)
|
||||
sed -ie "${line}s/\"/+mac_gui(addmac_levels)\"/2" ~/.xkb/keymap/kbd.chromebook.gui
|
||||
sleep 1
|
||||
line=$(cat ~/.xkb/keymap/kbd.chromebook.term | grep -n 'xkb_symbols' | cut -f1 -d:)
|
||||
sed -ie "${line}s/\"/+altwin(swap_alt_win)+mac_term(mac_levelssym)\"/2" ~/.xkb/keymap/kbd.chromebook.term
|
@@ -1,176 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import os, platform, sysconfig, sys, subprocess, time
|
||||
|
||||
yellow = "\033[1;33m"
|
||||
green = "\033[0;32m"
|
||||
red = "\033[1;31m"
|
||||
italic = "\033[3m"
|
||||
reset = "\033[0;0m"
|
||||
|
||||
platform_name = platform.system()
|
||||
# print sysconfig.get_platform()
|
||||
|
||||
sys.stdout.write(yellow)
|
||||
cloud = '\u2601'
|
||||
circleo = '\u25CE'
|
||||
clocko = '\u2B6E'
|
||||
syme = '\u0250'
|
||||
syma = '\u0251'
|
||||
# bang = '\u1F589'.decode('unicode-escape')
|
||||
|
||||
internalid = 0
|
||||
usbid = 0
|
||||
|
||||
def keyboard_detect():
|
||||
global internalid, usbid, chromeswap, system_type
|
||||
internal_kbname = ""
|
||||
usb_kbname = ""
|
||||
|
||||
# If chromebook
|
||||
if system_type == "2":
|
||||
print()
|
||||
print("Looking for keyboards...")
|
||||
print()
|
||||
result = subprocess.check_output('xinput list | grep -iv "Virtual\|USB" | grep -i "keyboard.*keyboard" | grep -o -P "(?<=↳).*(?=id\=)";exit 0', shell=True).decode('utf-8')
|
||||
if result != "":
|
||||
internal_kbname = result.strip()
|
||||
internalid = subprocess.check_output('xinput list | grep -iv "Virtual\|USB" | grep -i "keyboard.*keyboard" | cut -d "=" -f 2- | awk \'{print $1}\' | tail -1;exit 0', shell=True).decode('utf-8')
|
||||
print("Internal Keyboard\nName: " + internal_kbname + "\nID: " + internalid)
|
||||
|
||||
result = subprocess.check_output('udevadm info -e | grep -o -P "(?<=by-id/usb-).*(?=-event-kbd)" | head -1;exit 0', shell=True).decode('utf-8')
|
||||
if result != "":
|
||||
usb_kbname = result.strip()
|
||||
|
||||
# Loop the following to ensure the id is picked up after 5-10 tries
|
||||
usbid = ""
|
||||
usbcount=0
|
||||
while usbid == "":
|
||||
usbid = subprocess.check_output('udevadm info -e | stdbuf -oL grep -o -P "(?<=event-kbd /dev/input/by-path/pci-0000:00:).*(?=.0-usb) | head -n 1";exit 0', shell=True).decode('utf-8')
|
||||
if usbid == "":
|
||||
usbcount += 1
|
||||
# print('usbid not found '+ str(usbcount))
|
||||
if usbcount == 5:
|
||||
usbid = "0"
|
||||
time.sleep(1)
|
||||
print("\nUSB Keyboard\n" + "Name: " + usb_kbname + "\nID: " + usbid)
|
||||
|
||||
if system_type == "1":
|
||||
system_type = "windows"
|
||||
elif system_type == "2":
|
||||
system_type = "chromebook"
|
||||
elif system_type == "3":
|
||||
result = subprocess.check_output('lsmod | grep hid_apple 1>/dev/null; echo $?', shell=True).decode('utf-8')
|
||||
if result.strip() == "0":
|
||||
system_type = "mac"
|
||||
else:
|
||||
system_type = "mac_only"
|
||||
print("Apple hid_apple driver is not loaded, a keymap that is specific for only Apple keyboards will be used.")
|
||||
|
||||
if system_type == "windows" or system_type == "mac":
|
||||
subprocess.check_output('/bin/bash -c ./mac_wordwise.sh', shell=True).decode('utf-8')
|
||||
cmdgui = '"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY"'
|
||||
elif system_type == "mac_only":
|
||||
subprocess.check_output('/bin/bash -c ./mac_only.sh', shell=True).decode('utf-8')
|
||||
cmdgui = '"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY"'
|
||||
elif system_type == "chromebook":
|
||||
subprocess.check_output('/bin/bash -c ./chromebook.sh', shell=True).decode('utf-8')
|
||||
cmdgui = '"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY"'
|
||||
|
||||
# password = getpass("Please enter your password to complete the keyswap: ")
|
||||
# proc = Popen("echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd".split(), stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
||||
# proc.communicate(password.encode())
|
||||
|
||||
if swap_behavior == 1:
|
||||
print("Setting up " + system_type + " keyswap as a service.")
|
||||
print("You can disable and remove the service by using the following command in the Kinto directory.")
|
||||
print("./uninstall.sh")
|
||||
|
||||
keyswapcmd = '/bin/bash -c "./keyswap_service.sh 1 0 ' + system_type + ' ' + str(internalid).strip() + ' ' + str(usbid).strip() + ' ' + str(chromeswap) + '"'
|
||||
# print(keyswapcmd)
|
||||
subprocess.check_output(keyswapcmd, shell=True).decode('utf-8')
|
||||
else:
|
||||
print("Setting up " + system_type + " keyswap inside your profiles ~/.Xsession file.")
|
||||
print("You can modify or remove the file if you want you want to remove the modification.")
|
||||
keyswapcmd = '/bin/bash -c \'./keyswap_service.sh 0 ' + cmdgui + '\''
|
||||
subprocess.check_output(keyswapcmd, shell=True).decode('utf-8')
|
||||
|
||||
if system_type == "mac":
|
||||
print()
|
||||
print("An Apple keyboard with the hid_apple driver was detected.")
|
||||
print("Please run the following commands to swap alt/option and Command.")
|
||||
print("Your Kinto keymapping will not work right on Apple keyboards without it.")
|
||||
print()
|
||||
print("echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd")
|
||||
print('echo "options hid_apple swap_opt_cmd=1" | sudo tee -a /etc/modprobe.d/hid_apple.conf')
|
||||
print('sudo update-initramfs -u -k all')
|
||||
|
||||
|
||||
|
||||
def os_detect():
|
||||
print()
|
||||
print("Checking for OS and system information...")
|
||||
print()
|
||||
print("OS Type")
|
||||
# print(" Platform: " + platform_name)
|
||||
if platform_name == 'Linux':
|
||||
result = subprocess.check_output("lsb_release -a | grep -v LSB ", shell=True).decode('ascii')
|
||||
print(result)
|
||||
|
||||
def hwinfo():
|
||||
print("Requires user password to display hardware information...")
|
||||
result = subprocess.check_output('sudo dmidecode | grep -A 9 "System Information" | grep -v "UUID\|Serial\|SKU\|Wake"', shell=True).decode('ascii')
|
||||
print(result)
|
||||
|
||||
def kblist():
|
||||
result = subprocess.check_output('xinput list', shell=True).decode('ascii')
|
||||
print(result)
|
||||
|
||||
print()
|
||||
print()
|
||||
print(" Kint" + circleo)
|
||||
sys.stdout.write(reset)
|
||||
print(italic + " - F!x the d" + syma + "mn k" + syme + "yb" + circleo + syma + "rd. - ")
|
||||
sys.stdout.write(reset)
|
||||
print()
|
||||
input("Press Enter to begin...")
|
||||
|
||||
system_type = input("\nWhat type of keyboard are you using? (If Mac and Windows then select Mac)\n\
|
||||
1) Windows\n\
|
||||
2) Chromebook\n\
|
||||
3) Mac\n")
|
||||
|
||||
swap_behavior = 1
|
||||
chromeswap = 0
|
||||
# Chromebook
|
||||
if system_type == "2":
|
||||
if not input("\nWould you like to swap Alt to Super/Win and Search key to Ctrl when using terminal applications? (y/n)\n\
|
||||
Note: For a more mac like experience & less issues with terminal based interactions y is recommended.\n").lower().strip()[:1] == "y":
|
||||
swap_behavior = 0
|
||||
# Windows
|
||||
if system_type == "1":
|
||||
if not input("\nWould you like to swap Alt to Super/Win and Ctrl key back to Ctrl when using terminal applications? (y/n)\n\
|
||||
Note: For a more mac like experience & less issues with terminal based interactions y is recommended.\n").lower().strip()[:1] == "y":
|
||||
swap_behavior = 0
|
||||
# Mac
|
||||
if system_type == "3":
|
||||
if not input("\nWould you like to swap Command back to Super/Win and Ctrl key back to Ctrl when using terminal applications? (y/n)\n\
|
||||
Note: For a more mac like experience & less issues with terminal based interactions y is recommended.\n").lower().strip()[:1] == "y":
|
||||
swap_behavior = 0
|
||||
|
||||
if int(system_type) == 2 and swap_behavior == 1:
|
||||
chromeswap = input("\nIf the keyswap is applied on a chromebook with both an internal and external Apple keyboard\n\
|
||||
you may need to press a key on the external Apple keyboard any time you switch between the terminal and gui based apps.\n\
|
||||
Are you ok with that, or would you like to only apply the keyswap on one keyboard type?\n\
|
||||
1) Built-in\n\
|
||||
2) Both - (Chromebook & Windows)\n\
|
||||
3) Both - (Chromebook & Mac)\n\
|
||||
4) USB External - (Mac)\n")
|
||||
|
||||
if chromeswap == "1":
|
||||
chromeswap = "none"
|
||||
elif chromeswap == "2":
|
||||
chromeswap = "both_win"
|
||||
elif chromeswap == "3" or chromeswap == "4":
|
||||
chromeswap = "both_mac"
|
||||
|
||||
keyboard_detect()
|
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
mkdir -p ~/.xkb/{keymap,symbols,types}
|
||||
cp ./.xkb/symbols/mac_gui ~/.xkb/symbols/mac_gui
|
||||
cp ./.xkb/types/mac_gui ~/.xkb/types/mac_gui
|
||||
setxkbmap -option
|
||||
setxkbmap -print > ~/.xkb/keymap/kbd.mac.gui
|
||||
setxkbmap -print > ~/.xkb/keymap/kbd.mac.term
|
||||
line=$(cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_symbols' | cut -f1 -d:)
|
||||
sed -ie "${line}s/\"/+ctrl(swap_lwin_lctl)+ctrl(swap_rwin_rctl)+mac_gui(mac_levelssym)\"/2" ~/.xkb/keymap/kbd.mac.gui
|
||||
sleep 1
|
||||
line=$(cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_types' | cut -f1 -d:)
|
||||
sed -ie "${line}s/\"/+mac_gui(addmac_levels)\"/2" ~/.xkb/keymap/kbd.mac.gui
|
||||
sleep 1
|
||||
line=$(cat ~/.xkb/keymap/kbd.mac.term | grep -n 'xkb_symbols' | cut -f1 -d:)
|
||||
sed -ie "${line}s/\"/+altwin(alt_super_win)+mac_term(mac_levelssym)\"/2" ~/.xkb/keymap/kbd.mac.term
|
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
mkdir -p ~/.xkb/{keymap,symbols,types}
|
||||
cp ./.xkb/symbols/mac_gui ~/.xkb/symbols/mac_gui
|
||||
cp ./.xkb/types/mac_gui ~/.xkb/types/mac_gui
|
||||
setxkbmap -option
|
||||
setxkbmap -print > ~/.xkb/keymap/kbd.mac.gui
|
||||
setxkbmap -print > ~/.xkb/keymap/kbd.mac.term
|
||||
line=$(cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_symbols' | cut -f1 -d:)
|
||||
sed -ie "${line}s/\"/+altwin(ctrl_alt_win)+mac_gui(mac_levelssym)\"/2" ~/.xkb/keymap/kbd.mac.gui
|
||||
sleep 1
|
||||
line=$(cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_types' | cut -f1 -d:)
|
||||
sed -ie "${line}s/\"/+mac_gui(addmac_levels)\"/2" ~/.xkb/keymap/kbd.mac.gui
|
||||
sleep 1
|
||||
line=$(cat ~/.xkb/keymap/kbd.mac.term | grep -n 'xkb_symbols' | cut -f1 -d:)
|
||||
sed -ie "${line}s/\"/+altwin(swap_alt_win)+mac_term(mac_levelssym)\"/2" ~/.xkb/keymap/kbd.mac.term
|
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
systemctl --user stop keyswap
|
||||
systemctl --user disable keyswap
|
||||
rm -rf ~/.config/autostart/keyswap.sh
|
||||
rm -rf ~/.config/xactive.sh
|
||||
rm -rf ~/.xkb
|
||||
|
||||
sed -i '/xkb/d' ~/.Xsession
|
@@ -1,316 +0,0 @@
|
||||
# pip3 install pynput
|
||||
# pip3 install --no-deps pynput
|
||||
|
||||
from pynput.keyboard import Key, Listener
|
||||
import sys, subprocess
|
||||
|
||||
uitype=sys.argv[1]
|
||||
apply_rules=sys.argv[2]
|
||||
windows=sys.argv[3]
|
||||
chromebook=sys.argv[4]
|
||||
mac=sys.argv[5]
|
||||
|
||||
class color:
|
||||
PURPLE = '\033[95m'
|
||||
CYAN = '\033[96m'
|
||||
DARKCYAN = '\033[36m'
|
||||
BLUE = '\033[94m'
|
||||
GREEN = '\033[92m'
|
||||
YELLOW = '\033[93m'
|
||||
RED = '\033[91m'
|
||||
BOLD = '\033[1m'
|
||||
UNDERLINE = '\033[4m'
|
||||
END = '\033[0m'
|
||||
|
||||
def on_press(key):
|
||||
print('{0} pressed'.format(key))
|
||||
|
||||
def on_release(key):
|
||||
# print('{0} release'.format(key))
|
||||
if key == Key.esc:
|
||||
# Stop listener
|
||||
return False
|
||||
|
||||
def is_ctrl_winchrome(key):
|
||||
if key == Key.ctrl:
|
||||
# print(str(key).replace("Key.", "").title() +' successfully mapped to physical Alt key.'.format(key))
|
||||
print(color.GREEN + 'Success' + color.END + ' Alt is now Ctrl')
|
||||
return False
|
||||
elif key == Key.esc:
|
||||
return False
|
||||
else:
|
||||
print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Alt key.'.format(key))
|
||||
return False
|
||||
|
||||
def is_ctrl_mac(key):
|
||||
if key == Key.ctrl:
|
||||
# print(str(key).replace("Key.", "").title() +' successfully mapped to physical Alt key.'.format(key))
|
||||
print(color.GREEN + 'Success' + color.END + ' Command is now Ctrl')
|
||||
return False
|
||||
elif key == Key.esc:
|
||||
return False
|
||||
else:
|
||||
print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Command key.'.format(key))
|
||||
return False
|
||||
|
||||
def is_ctrl_terminal(key):
|
||||
if key == Key.ctrl:
|
||||
# print(str(key).replace("Key.", "").title() +' successfully mapped to physical Ctrl key.'.format(key))
|
||||
print(color.GREEN + 'Success' + color.END + ' Ctrl remains Ctrl,\nwhile in terminal apps.')
|
||||
return False
|
||||
elif key == Key.esc:
|
||||
return False
|
||||
else:
|
||||
print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Ctrl key.'.format(key))
|
||||
return False
|
||||
|
||||
def is_alt_chromebook(key):
|
||||
if key == Key.alt:
|
||||
# print(str(key).replace("Key.", "").title() +' successfully mapped to the physical Ctrl key.'.format(key))
|
||||
print(color.GREEN + 'Success' + color.END + ' Ctrl is now Alt')
|
||||
return False
|
||||
elif key == Key.esc:
|
||||
return False
|
||||
else:
|
||||
print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Ctrl key.'.format(key))
|
||||
return False
|
||||
|
||||
def is_alt_windows(key):
|
||||
if key == Key.alt:
|
||||
# print(str(key).replace("Key.", "").title() +' successfully mapped to the physical Ctrl key.'.format(key))
|
||||
print(color.GREEN + 'Success' + color.END + ' Win/Super is now Alt')
|
||||
return False
|
||||
elif key == Key.esc:
|
||||
return False
|
||||
else:
|
||||
print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Win/Super key.'.format(key))
|
||||
return False
|
||||
|
||||
def is_alt_mac(key):
|
||||
if key == Key.alt:
|
||||
# print(str(key).replace("Key.", "").title() +' successfully mapped to the physical Ctrl key.'.format(key))
|
||||
print(color.GREEN + 'Success' + color.END + ' Alt remains Alt')
|
||||
return False
|
||||
elif key == Key.esc:
|
||||
return False
|
||||
else:
|
||||
print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Alt key.'.format(key))
|
||||
return False
|
||||
|
||||
def is_alt_chromebook_terminal(key):
|
||||
if key == Key.alt:
|
||||
# print(str(key).replace("Key.", "").title() +' successfully mapped to the physical Search key.'.format(key))
|
||||
print(color.GREEN + 'Success' + color.END + ' Search is now Alt,\nwhile in terminals apps.')
|
||||
return False
|
||||
elif key == Key.esc:
|
||||
return False
|
||||
else:
|
||||
print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Search key.'.format(key))
|
||||
return False
|
||||
|
||||
def is_super_winmac(key):
|
||||
if key == Key.cmd:
|
||||
# print('Super/Win successfully mapped to the physical Search key.'.format(key))
|
||||
print(color.GREEN + 'Success' + color.END + ' Ctrl key is Super/Win')
|
||||
return False
|
||||
elif key == Key.esc:
|
||||
return False
|
||||
else:
|
||||
print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Ctrl key.'.format(key))
|
||||
return False
|
||||
|
||||
def is_super_chromebook(key):
|
||||
if key == Key.cmd:
|
||||
# print('Super/Win successfully mapped to the physical Search key.'.format(key))
|
||||
print(color.GREEN + 'Success' + color.END + ' Search key is Super/Win')
|
||||
return False
|
||||
elif key == Key.esc:
|
||||
return False
|
||||
else:
|
||||
print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Search key.'.format(key))
|
||||
return False
|
||||
|
||||
def is_super_terminal(key):
|
||||
if key == Key.cmd:
|
||||
# print('Super/Win successfully mapped to the physical Alt key.'.format(key))
|
||||
print(color.GREEN + 'Success' + color.END + ' Alt is now Super/Win,\nwhile in terminal apps.')
|
||||
return False
|
||||
elif key == Key.esc:
|
||||
return False
|
||||
else:
|
||||
print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Alt key.'.format(key))
|
||||
return False
|
||||
|
||||
def is_super_mac_terminal(key):
|
||||
if key == Key.cmd:
|
||||
# print('Super/Win successfully mapped to the physical Alt key.'.format(key))
|
||||
print(color.GREEN + 'Success' + color.END + ' Command is now Super/Win,\nwhile in terminal apps.')
|
||||
return False
|
||||
elif key == Key.esc:
|
||||
return False
|
||||
else:
|
||||
print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Command key.'.format(key))
|
||||
return False
|
||||
|
||||
def chromebook_keys_gui():
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Alt" + color.END + " key to confirm the new keymapping to Ctrl..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_ctrl_winchrome) as listener:
|
||||
listener.join()
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Ctrl" + color.END + " key to confirm the new keymapping to Alt..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_alt_chromebook) as listener:
|
||||
listener.join()
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Search" + color.END + " key to confirm the new keymapping to Super/Win..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_super_chromebook) as listener:
|
||||
listener.join()
|
||||
|
||||
def chromebook_keys_terminal():
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Alt" + color.END + " key to confirm the new keymapping to Super/Win..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_super_terminal) as listener:
|
||||
listener.join()
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Ctrl" + color.END + " key to confirm the new keymapping to Ctrl..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_ctrl_terminal) as listener:
|
||||
listener.join()
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Search" + color.END + " key to confirm the new keymapping to Alt..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_alt_chromebook_terminal) as listener:
|
||||
listener.join()
|
||||
|
||||
def windows_keys_gui():
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Alt" + color.END + " key to confirm the new keymapping to Ctrl..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_ctrl_winchrome) as listener:
|
||||
listener.join()
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Win/Super" + color.END + " key to confirm the new keymapping to Alt..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_alt_windows) as listener:
|
||||
listener.join()
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Ctrl" + color.END + " key to confirm the new keymapping to Win/Super..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_super_winmac) as listener:
|
||||
listener.join()
|
||||
|
||||
def windows_keys_terminal():
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Alt" + color.END + " key to confirm the new keymapping to Super/Win..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_super_terminal) as listener:
|
||||
listener.join()
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Win/Super" + color.END + " key to confirm the new keymapping to Alt..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_alt_windows) as listener:
|
||||
listener.join()
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Ctrl" + color.END + " key to confirm the new keymapping to Ctrl..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_ctrl_terminal) as listener:
|
||||
listener.join()
|
||||
|
||||
def mac_keys_gui():
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Command" + color.END + " key to confirm the new keymapping to Ctrl..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_ctrl_mac) as listener:
|
||||
listener.join()
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Alt" + color.END + " key to confirm it remains Alt..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_alt_mac) as listener:
|
||||
listener.join()
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Ctrl" + color.END + " key to confirm the new keymapping to Win/Super..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_super_winmac) as listener:
|
||||
listener.join()
|
||||
|
||||
def mac_keys_terminal():
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Command" + color.END + " key to confirm the new keymapping to Super/Win..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_super_mac_terminal) as listener:
|
||||
listener.join()
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Alt" + color.END + " key to confirm it remains Alt..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_alt_mac) as listener:
|
||||
listener.join()
|
||||
print()
|
||||
print(color.UNDERLINE + color.YELLOW + "Press the physical Ctrl" + color.END + " key to confirm it remains Ctrl..")
|
||||
with Listener(
|
||||
# on_press=on_press,
|
||||
on_release=is_ctrl_terminal) as listener:
|
||||
listener.join()
|
||||
|
||||
if uitype == 'gui':
|
||||
if chromebook == '1':
|
||||
if apply_rules == '1':
|
||||
subprocess.check_output('setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY', shell=True).decode('utf-8')
|
||||
print()
|
||||
print("Testing chromebook - GUI apps - Kinto keymapping...")
|
||||
chromebook_keys_gui()
|
||||
|
||||
if windows == '1':
|
||||
if apply_rules == '1':
|
||||
subprocess.check_output('setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY', shell=True).decode('utf-8')
|
||||
print()
|
||||
print ("Testing windows keyboard - GUI apps - Kinto keymapping...")
|
||||
windows_keys_gui()
|
||||
|
||||
if mac == '1':
|
||||
if apply_rules == '1':
|
||||
subprocess.check_output('setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY', shell=True).decode('utf-8')
|
||||
print ("Testing mac keyboard - GUI apps - Kinto keymapping...")
|
||||
mac_keys_gui()
|
||||
|
||||
if uitype == 'term':
|
||||
if chromebook == '1':
|
||||
if apply_rules == '1':
|
||||
subprocess.check_output('setxkbmap -option;setxkbmap -option altwin:swap_lalt_lwin', shell=True).decode('utf-8')
|
||||
print("Testing chromebook - terminal - Kinto keymapping...")
|
||||
chromebook_keys_terminal()
|
||||
|
||||
if windows == '1':
|
||||
if apply_rules == '1':
|
||||
subprocess.check_output('setxkbmap -option;setxkbmap -option altwin:swap_alt_win', shell=True).decode('utf-8')
|
||||
print ("Testing windows keyboard - terminal - Kinto keymapping...")
|
||||
windows_keys_terminal()
|
||||
|
||||
if mac == '1':
|
||||
if apply_rules == '1':
|
||||
subprocess.check_output('setxkbmap -option;setxkbmap -option altwin:swap_alt_win', shell=True).decode('utf-8')
|
||||
print ("Testing mac keyboard - terminal - Kinto keymapping...")
|
||||
mac_keys_terminal()
|
||||
|
||||
if apply_rules == '1':
|
||||
subprocess.run('setxkbmap -option', shell=True)
|
@@ -1,75 +0,0 @@
|
||||
# GalliumOS Notes
|
||||
|
||||
xfconf-query -c xfce4-keyboard-shortcuts -lv | grep "show_desktop_key\|cycle_windows_key\|cycle_reverse_windows_key\|close_window_key\|maximize_window_key\|xfce4-popup-whiskermenu\|move_window_next_workspace_key\|move_window_prev_workspace_key\|hide" | grep -v "default\|<Alt>m"
|
||||
|
||||
# Show Desktop
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>d" --create --type string --set "show_desktop_key"
|
||||
|
||||
# Undo show desktop
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>d" --reset
|
||||
|
||||
# GUI Alt Tab - Window Switching
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Alt><Shift>Tab" --set "cycle_reverse_windows_key"
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Alt>Tab" --set "cycle_windows_key"
|
||||
|
||||
# Term Alt Tab - Window Switching
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Alt><Shift>Tab" --set "cycle_windows_key"
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Alt>Tab" --set "cycle_reverse_windows_key"
|
||||
|
||||
# Hide/minimize Window
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>h" --create --type string --set "hide_window_key"
|
||||
|
||||
# Spotlight
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary><Shift>space" --create --type string --set "xfce4-popup-whiskermenu"
|
||||
|
||||
# Change workspace to left
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>Left" --create --type string --set "move_window_prev_workspace_key"
|
||||
|
||||
# Change workspace to right
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>Right" --create --type string --set "move_window_next_workspace_key"
|
||||
|
||||
# PopOS
|
||||
|
||||
# Close App Alt+F4 (Super+w)
|
||||
gsettings set org.gnome.desktop.wm.keybindings close "['<Alt>F4','<Super>w']"
|
||||
# Undo
|
||||
gsettings set org.gnome.desktop.wm.keybindings close "['<Super>w']"
|
||||
|
||||
# Maximize Window
|
||||
gsettings set org.gnome.desktop.wm.keybindings toggle-maximized "['<Alt>F10','<Primary><Super>Up']"
|
||||
# Undo
|
||||
gsettings set org.gnome.desktop.wm.keybindings toggle-maximized "['<Primary><Super>Up']"
|
||||
|
||||
# Ubuntu 19.10
|
||||
# Change Workspace
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['<Primary><Alt>Left','<Super>Left']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['<Primary><Alt>Right','<Super>Right']"
|
||||
|
||||
# ElementaryOS
|
||||
# Show Desktop
|
||||
gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d','<Super>Down']"
|
||||
# Maximize Window
|
||||
gsettings set org.gnome.desktop.wm.keybindings toggle-maximized "['<Alt>F10','<Super>Up']"
|
||||
# Spotlight
|
||||
gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['<Control><Shift>Space','<Super>Space']"
|
||||
|
||||
# Fedora 31
|
||||
# Show Desktop
|
||||
gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d']"
|
||||
# Change Workspace
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['<Primary><Alt>Left','<Super>Left']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['<Primary><Alt>Right','<Super>Right']"
|
||||
|
||||
# Manjaro/Arch KDE
|
||||
# Maximize
|
||||
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" \
|
||||
--key "Maximize Window" "Alt+F10,Meta+PgUp,Maximize Window"
|
||||
# Minimize
|
||||
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" \
|
||||
--key "Minimize Window" "Meta+h,Meta+PgDown,Minimize Window"
|
||||
# Switch Desktops
|
||||
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" \
|
||||
--key "Switch to Next Desktop" "Meta+Right,Meta+Right,Switch to Next Desktop"
|
||||
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" \
|
||||
--key "Switch to Previous Desktop" "Meta+Left,Meta+Left,Switch to Previous Desktop"
|
||||
kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &
|
6
setup.py
@@ -55,11 +55,11 @@ def windows_setup():
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Chromebook)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers/CB)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
if default == 3 or default == 4:
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB/IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB\/IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers\/CB\/IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
if default == 4:
|
||||
kbtype = "ibm"
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers/CB/IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
if default > 0 and default < 5:
|
||||
stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC)
|
||||
print("\nWill now install Ubuntu Termimnal Theme as default...")
|
||||
@@ -113,7 +113,7 @@ if len(check_x11) == 0:
|
||||
sys.exit()
|
||||
|
||||
distro = cmdline("awk -F= '$1==\"NAME\" { print $2 ;}' /etc/os-release").replace('"','').strip().split(" ")[0]
|
||||
dename = cmdline("./system-config/dename.sh").replace('"','').strip().split(" ")[0].lower()
|
||||
dename = cmdline("./linux/system-config/dename.sh").replace('"','').strip().split(" ")[0].lower()
|
||||
|
||||
run_pkg = ""
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
; https://www.autohotkey.com/boards/viewtopic.php?t=9501
|
||||
OnMessage(0x404, "AHK_NOTIFYICON")
|
||||
|
||||
AHK_NOTIFYICON(wParam, lParam)
|
||||
AHK_NOTIFYICON(wParam, lParam)
|
||||
{
|
||||
if (lParam = 0x202) { ; user left-clicked tray icon
|
||||
;ADD ANY SUBROUTINE OR FUNCTION HERE
|
||||
@@ -109,6 +109,10 @@ tray_suspend(){
|
||||
menu, tray, unCheck, Suspend Kinto
|
||||
; I_Icon = %A_ScriptDir%\assets\kinto-white-invert.ico ; MacModifiers
|
||||
; I_Icon = %A_ScriptDir%\assets\kinto-white-invert.ico ; WinModifiers/CB/IBM
|
||||
; Menu, Tray, Tip, Mac - Kinto ; MacModifiers
|
||||
; Menu, Tray, Tip, Windows - Kinto ; WinModifiers
|
||||
; Menu, Tray, Tip, Chromebook - Kinto ; Chromebook
|
||||
; Menu, Tray, Tip, IBM - Kinto ; IBM
|
||||
Menu, Tray, Icon, %I_Icon%,,1
|
||||
Run, %A_ScriptDir%\detectUSB.ahk
|
||||
}
|
||||
@@ -162,6 +166,7 @@ GroupAdd, editors, ahk_exe Code.exe
|
||||
GroupAdd, browsers, ahk_exe chrome.exe
|
||||
GroupAdd, browsers, ahk_exe opera.exe
|
||||
GroupAdd, browsers, ahk_exe firefox.exe
|
||||
GroupAdd, browsers, ahk_exe msedge.exe
|
||||
|
||||
; Disable Key Remapping for Virtual Machines
|
||||
; Disable for Remote desktop solutions too
|
||||
@@ -239,7 +244,7 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
; Tertiary::LWin
|
||||
|
||||
; $LAlt::LCtrl ; CB/IBM
|
||||
; $RAlt::RCtrl ; CB/IBM
|
||||
; $RAlt::RCtrl ; IBM
|
||||
; $RCtrl::RAlt ; CB/IBM
|
||||
; $CapsLock::LWin ; IBM
|
||||
; $LCtrl::LAlt ; CB/IBM
|
||||
@@ -255,8 +260,15 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
; $LCtrl::LWin ; MacModifiers
|
||||
|
||||
; Hack to disable start menu on winkey
|
||||
; Static
|
||||
$LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up}
|
||||
; Static - Does not apply to IBM or Chromebooks
|
||||
; $LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up} ; Default
|
||||
; LWin::return ; Chromebook
|
||||
; RWin::return ; Chromebook
|
||||
; RAlt::return ; Chromebook
|
||||
|
||||
; Disable Win-Up/Down - interferes with Sublime text 3 multi-cursors
|
||||
#Down::return
|
||||
#Up::return
|
||||
|
||||
; temporary hack to ensure keys don't get stuck
|
||||
; impacts Alt-Tab fix
|
||||
@@ -265,6 +277,24 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
; $LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; MacModifiers
|
||||
; $LAlt up::Send {LWin up}{CapsLock up}{LAlt up}{LCtrl up} ; CB/IBM
|
||||
|
||||
!Enter::
|
||||
{
|
||||
if (GetKeyState("RAlt", "P")) {
|
||||
Send {Insert}
|
||||
}
|
||||
else{
|
||||
Send {Alt down}{Enter}{Alt up}
|
||||
}
|
||||
Return
|
||||
}
|
||||
|
||||
; Remap Alt+Esc to Break/Pause
|
||||
!Esc::SendInput, {Pause}
|
||||
|
||||
; Go up or down a page
|
||||
$!Down::Send {PgDn};
|
||||
$!Up::Send {PgUp};
|
||||
|
||||
; Close Apps
|
||||
^q::Send !{F4}
|
||||
|
||||
@@ -307,7 +337,8 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
^F3::Send #d
|
||||
|
||||
; Emoji Panel
|
||||
#^Space::Send {LWin down};{LWin up}
|
||||
; #^Space::Send {LWin down};{LWin up} ; Default
|
||||
; !^Space::Send {LWin down};{LWin up} ; CB/IBM
|
||||
|
||||
; Full Screenshot
|
||||
^+3::Send {PrintScreen}
|
||||
@@ -315,11 +346,11 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
; Region Screenshot
|
||||
^+4::Send #+{S}
|
||||
|
||||
; Open File Browser
|
||||
; !^space::Send #e ; Default
|
||||
; #^space::Send #e ; CB/IBM
|
||||
|
||||
; wordwise support
|
||||
$^Left::Send {Home}
|
||||
$^+Left::Send +{Home}
|
||||
$^Right::Send {End}
|
||||
$^+Right::Send +{End}
|
||||
^Up::Send ^{Home}
|
||||
^+Up::Send ^+{Home}
|
||||
^Down::Send ^{End}
|
||||
@@ -330,21 +361,73 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
!+Left::Send ^+{Left}
|
||||
!Right::Send ^{Right}
|
||||
!+Right::Send ^+{Right}
|
||||
$^Left::Send {Home}
|
||||
$^+Left::Send +{Home}
|
||||
$^Right::Send {End}
|
||||
$^+Right::Send +{End}
|
||||
|
||||
; emacs style
|
||||
#n::Send {Down}
|
||||
#p::Send {Up}
|
||||
#f::Send {Right}
|
||||
#b::Send {Left}
|
||||
#a::Send {Home}
|
||||
#e::Send {End}
|
||||
#d::Send {Delete}
|
||||
#k::Send +{End}{Backspace}
|
||||
; #if GetKeyState("LWin", "P") || GetKeyState("RAlt", "P") ; Chromebook
|
||||
; Space::Send ^{Esc} ; Chromebook
|
||||
; 0::Send #0 ; Chromebook
|
||||
; 1::Send #1 ; Chromebook
|
||||
; 2::Send #2 ; Chromebook
|
||||
; 3::Send #3 ; Chromebook
|
||||
; 4::Send #4 ; Chromebook
|
||||
; 5::Send #5 ; Chromebook
|
||||
; 6::Send #6 ; Chromebook
|
||||
; 7::Send #7 ; Chromebook
|
||||
; 8::Send #8 ; Chromebook
|
||||
; 9::Send #9 ; Chromebook
|
||||
; -::Send #- ; Chromebook
|
||||
; =::Send #= ; Chromebook
|
||||
; `::Send #` ; Chromebook
|
||||
; `;::Send #; ; Chromebook
|
||||
; a::Send #a ; Chromebook
|
||||
; b::Send #b ; Chromebook
|
||||
; c::Send #c ; Chromebook
|
||||
; d::Send #d ; Chromebook
|
||||
; e::Send #e ; Chromebook
|
||||
; f::Send #f ; Chromebook
|
||||
; g::Send #g ; Chromebook
|
||||
; h::Send #h ; Chromebook
|
||||
; i::Send #i ; Chromebook
|
||||
; j::Send #j ; Chromebook
|
||||
; k::Send #k ; Chromebook
|
||||
; l::Send #l ; Chromebook
|
||||
; m::Send #m ; Chromebook
|
||||
; n::Send #n ; Chromebook
|
||||
; o::Send #o ; Chromebook
|
||||
; p::Send #p ; Chromebook
|
||||
; q::Send #q ; Chromebook
|
||||
; r::Send #r ; Chromebook
|
||||
; s::Send #s ; Chromebook
|
||||
; t::Send #t ; Chromebook
|
||||
; u::Send #u ; Chromebook
|
||||
; v::Send #v ; Chromebook
|
||||
; w::Send #w ; Chromebook
|
||||
; x::Send #x ; Chromebook
|
||||
; y::Send #y ; Chromebook
|
||||
; z::Send #z ; Chromebook
|
||||
; #If ; Chromebook
|
||||
|
||||
#IfWinNotActive ahk_group terminals
|
||||
; emacs style
|
||||
#n::Send {Down}
|
||||
#p::Send {Up}
|
||||
#f::Send {Right}
|
||||
#b::Send {Left}
|
||||
#a::Send {Home}
|
||||
#e::Send {End}
|
||||
#d::Send {Delete}
|
||||
#k::Send +{End}{Backspace}
|
||||
#If
|
||||
|
||||
; Cmd+Space Alternative
|
||||
$^Space::Send ^{Esc}
|
||||
|
||||
#IfWinActive ahk_group intellij
|
||||
; $#c::Send ^{c} ; Default - Sigints interrupt
|
||||
; $!c::Send ^{c} ; CB/IBM
|
||||
; General
|
||||
^0::Send !{0} ;Open corresponding tool window
|
||||
^1::Send !{1} ;Open corresponding tool window
|
||||
@@ -436,7 +519,23 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
|
||||
; Close all browsers
|
||||
#IfWinActive ahk_group browsers
|
||||
^q::send {Alt Down}f{Alt Up}x ; exit all windows
|
||||
^q::send {Alt Down}f{Alt Up}x ; exit all windows
|
||||
; Dev Tools
|
||||
!^i::send {Ctrl Down}{Shift Down}i{Shift Up}{Ctrl Up}
|
||||
!^j::send {Ctrl Down}{Shift Down}j{Shift Up}{Ctrl Up}
|
||||
; Open preferences
|
||||
#IfWinActive ahk_exe firefox.exe
|
||||
^,::send, {Ctrl Down}t{Ctrl Up}about:preferences{Enter}
|
||||
#If
|
||||
#IfWinActive ahk_exe chrome.exe
|
||||
^,::send {Alt Down}e{Alt Up}s{Enter}
|
||||
#If
|
||||
#IfWinActive ahk_exe msedge.exe
|
||||
^,::send {Alt Down}e{Alt Up}s{Enter}
|
||||
#If
|
||||
#IfWinActive ahk_exe opera.exe
|
||||
^,::send {Ctrl Down}{F12}{Ctrl Up}
|
||||
#If
|
||||
#If
|
||||
|
||||
; Sublime Text Remaps for VS Code
|
||||
@@ -455,12 +554,19 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
!+g::send ^+{G} ; View source control
|
||||
; $#c::Send {Ctrl down}c{Ctrl up} ; Default - Sigints interrupt
|
||||
; $!c::Send {Ctrl down}c{Ctrl up} ; CB/IBM
|
||||
; $#x::Send {Ctrl down}x{Ctrl up} ; Default - Sigints interrupt
|
||||
; $!x::Send {Ctrl down}x{Ctrl up} ; CB/IBM
|
||||
|
||||
; #Space::Send ^{Space} ; Default - Basic code completion
|
||||
; !Space::Send ^{Space} ; CB/IBM - Basic code completion
|
||||
#If
|
||||
|
||||
#IfWinActive ahk_exe sublime_text.exe
|
||||
; #x::Send ^{x} ; Default - Terminal - Ctrl-x
|
||||
; #c::Send ^{c} ; Default - Terminal - Ctrl-c sigint
|
||||
; !x::Send ^{x} ; CB/IBM
|
||||
; !c::Send ^{c} ; CB/IBM
|
||||
; #c::send ^{Pause} ; cancel_build
|
||||
; #Space::Send ^{Space} ; Default - Basic code completion
|
||||
; !Space::Send ^{Space} ; CB/IBM - Basic code completion
|
||||
#^Up::send !{O} ; Switch file
|
||||
@@ -472,8 +578,8 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
^!Down::send ^{Down} ; scroll_lines down
|
||||
; #+Up::send {shift up}^!{Up} ; Default - multi-cursor up
|
||||
; #+Down::send {shift up}^!{Down} ; Default - multi-cursor down
|
||||
; #+Up::send {shift up}^!{Up} ; CB/IBM - multi-cursor up
|
||||
; #+Down::send {shift up}^!{Down} ; CB/IBM - multi-cursor down
|
||||
; !+Up::send {shift up}^!{Up} ; CB/IBM - multi-cursor up
|
||||
; !+Down::send {shift up}^!{Down} ; CB/IBM - multi-cursor down
|
||||
^PgDn::Return ; cancel next_view
|
||||
^PgUp::Return ; cancel prev_view
|
||||
^+{::send ^{PgDn} ; next_view
|
||||
@@ -482,7 +588,9 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
^!Left::send ^{PgUp} ; prev_view
|
||||
Insert::Return ; cancel toggle_overwrite
|
||||
^!O::send {Insert} ; toggle_overwrite
|
||||
!c::Return ; cancel toggle_case_sensitive
|
||||
; $#c::Send {Ctrl down}c{Ctrl up} ; Default - Sigints interrupt
|
||||
; !c::Return ; Default - cancel toggle_case_sensitive
|
||||
; $!c::send ^{c} ; CB/IBM - Sigint
|
||||
^!c::send !{c} ; toggle_case_sensitive
|
||||
; ^h::Return ; cancel replace
|
||||
^!f::send ^{h} ; replace
|
||||
@@ -501,7 +609,7 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
^+Down::Return ; cancel swap_line_down
|
||||
#!Down::send ^+{Down} ; swap_line_down
|
||||
^Pause::Return ; cancel cancel_build
|
||||
#c::send ^{Pause} ; cancel_build
|
||||
; #c::send ^{Pause} ; cancel_build
|
||||
F9::Return ; cancel sort_lines case_s false
|
||||
F5::send {F9} ; sort_lines case_s false
|
||||
#F9::Return ; cancel sort_lines case_s true
|
||||
@@ -617,35 +725,85 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
; #l::return
|
||||
; Clear Terminal and Scroll Buffer
|
||||
^k::Send clear && printf '\e[3J'{Enter}
|
||||
; Nano editor shortcuts
|
||||
#g::Send {LCtrl down}g{LCtrl Up} ; Default
|
||||
#k::Send {LCtrl down}k{LCtrl Up} ; Default
|
||||
#x::Send {LCtrl down}x{LCtrl Up} ; Default
|
||||
#o::Send {LCtrl down}o{LCtrl Up} ; Default
|
||||
#r::Send {LCtrl down}r{LCtrl Up} ; Default
|
||||
#w::Send {LCtrl down}w{LCtrl Up} ; Default
|
||||
#\::Send {LCtrl down}\{LCtrl Up} ; Default
|
||||
#u::Send {LCtrl down}u{LCtrl Up} ; Default
|
||||
#j::Send {LCtrl down}j{LCtrl Up} ; Default
|
||||
#t::Send {LCtrl down}t{LCtrl Up} ; Default
|
||||
#_::Send {LCtrl down}_{LCtrl Up} ; Default
|
||||
#z::Send {LCtrl down}z{LCtrl Up} ; Default
|
||||
#y::Send {LCtrl down}y{LCtrl Up} ; Default
|
||||
#v::Send {LCtrl down}v{LCtrl Up} ; Default
|
||||
!g::Send {LCtrl down}g{LCtrl Up} ; CB/IBM
|
||||
!k::Send {LCtrl down}k{LCtrl Up} ; CB/IBM
|
||||
!x::Send {LCtrl down}x{LCtrl Up} ; CB/IBM
|
||||
!o::Send {LCtrl down}o{LCtrl Up} ; CB/IBM
|
||||
!r::Send {LCtrl down}r{LCtrl Up} ; CB/IBM
|
||||
!w::Send {LCtrl down}w{LCtrl Up} ; CB/IBM
|
||||
!\::Send {LCtrl down}\{LCtrl Up} ; CB/IBM
|
||||
!u::Send {LCtrl down}u{LCtrl Up} ; CB/IBM
|
||||
!j::Send {LCtrl down}j{LCtrl Up} ; CB/IBM
|
||||
!t::Send {LCtrl down}t{LCtrl Up} ; CB/IBM
|
||||
!_::Send {LCtrl down}_{LCtrl Up} ; CB/IBM
|
||||
!z::Send {LCtrl down}z{LCtrl Up} ; CB/IBM
|
||||
!y::Send {LCtrl down}y{LCtrl Up} ; CB/IBM
|
||||
!v::Send {LCtrl down}v{LCtrl Up} ; CB/IBM
|
||||
; Remap Physical Ctrl back to Ctrl
|
||||
#0::Send {LCtrl down}0{Ctrl up} ; Default
|
||||
#1::Send {LCtrl down}1{Ctrl up} ; Default
|
||||
#2::Send {LCtrl down}2{Ctrl up} ; Default
|
||||
#3::Send {LCtrl down}3{Ctrl up} ; Default
|
||||
#4::Send {LCtrl down}4{Ctrl up} ; Default
|
||||
#5::Send {LCtrl down}5{Ctrl up} ; Default
|
||||
#6::Send {LCtrl down}6{Ctrl up} ; Default
|
||||
#7::Send {LCtrl down}7{Ctrl up} ; Default
|
||||
#8::Send {LCtrl down}8{Ctrl up} ; Default
|
||||
#9::Send {LCtrl down}9{Ctrl up} ; Default
|
||||
#-::Send {LCtrl down}-{Ctrl up} ; Default
|
||||
#=::Send {LCtrl down}={Ctrl up} ; Default
|
||||
#`::Send {LCtrl down}`{Ctrl up} ; Default
|
||||
#a::Send {LCtrl down}a{Ctrl up} ; Default
|
||||
#b::Send {LCtrl down}b{Ctrl up} ; Default
|
||||
#c::Send {LCtrl down}c{Ctrl up} ; Default
|
||||
#d::Send {LCtrl down}d{Ctrl up} ; Default
|
||||
#e::Send {LCtrl down}e{Ctrl up} ; Default
|
||||
#f::Send {LCtrl down}f{Ctrl up} ; Default
|
||||
#g::Send {LCtrl down}g{Ctrl up} ; Default
|
||||
#h::Send {LCtrl down}h{Ctrl up} ; Default
|
||||
#i::Send {LCtrl down}i{Ctrl up} ; Default
|
||||
#j::Send {LCtrl down}j{Ctrl up} ; Default
|
||||
#k::Send {LCtrl down}k{Ctrl up} ; Default
|
||||
#l::Send {LCtrl down}l{Ctrl up} ; Default
|
||||
#m::Send {LCtrl down}m{Ctrl up} ; Default
|
||||
#n::Send {LCtrl down}n{Ctrl up} ; Default
|
||||
#o::Send {LCtrl down}o{Ctrl up} ; Default
|
||||
#p::Send {LCtrl down}p{Ctrl up} ; Default
|
||||
#q::Send {LCtrl down}q{Ctrl up} ; Default
|
||||
#r::Send {LCtrl down}r{Ctrl up} ; Default
|
||||
#s::Send {LCtrl down}s{Ctrl up} ; Default
|
||||
#t::Send {LCtrl down}t{Ctrl up} ; Default
|
||||
#u::Send {LCtrl down}u{Ctrl up} ; Default
|
||||
#v::Send {LCtrl down}v{Ctrl up} ; Default
|
||||
#w::Send {LCtrl down}w{Ctrl up} ; Default
|
||||
#x::Send {LCtrl down}x{Ctrl up} ; Default
|
||||
#y::Send {LCtrl down}y{Ctrl up} ; Default
|
||||
#z::Send {LCtrl down}z{Ctrl up} ; Default
|
||||
; !0::Send {LCtrl down}0{Ctrl up} ; CB/IBM
|
||||
; !1::Send {LCtrl down}1{Ctrl up} ; CB/IBM
|
||||
; !2::Send {LCtrl down}2{Ctrl up} ; CB/IBM
|
||||
; !3::Send {LCtrl down}3{Ctrl up} ; CB/IBM
|
||||
; !4::Send {LCtrl down}4{Ctrl up} ; CB/IBM
|
||||
; !5::Send {LCtrl down}5{Ctrl up} ; CB/IBM
|
||||
; !6::Send {LCtrl down}6{Ctrl up} ; CB/IBM
|
||||
; !7::Send {LCtrl down}7{Ctrl up} ; CB/IBM
|
||||
; !8::Send {LCtrl down}8{Ctrl up} ; CB/IBM
|
||||
; !9::Send {LCtrl down}9{Ctrl up} ; CB/IBM
|
||||
; !-::Send {LCtrl down}-{Ctrl up} ; CB/IBM
|
||||
; !=::Send {LCtrl down}={Ctrl up} ; CB/IBM
|
||||
; !`::Send {LCtrl down}`{Ctrl up} ; CB/IBM
|
||||
; !a::Send {LCtrl down}a{Ctrl up} ; CB/IBM
|
||||
; !b::Send {LCtrl down}b{Ctrl up} ; CB/IBM
|
||||
; !c::Send {LCtrl down}c{Ctrl up} ; CB/IBM
|
||||
; !d::Send {LCtrl down}d{Ctrl up} ; CB/IBM
|
||||
; !e::Send {LCtrl down}e{Ctrl up} ; CB/IBM
|
||||
; !f::Send {LCtrl down}f{Ctrl up} ; CB/IBM
|
||||
; !g::Send {LCtrl down}g{Ctrl up} ; CB/IBM
|
||||
; !h::Send {LCtrl down}h{Ctrl up} ; CB/IBM
|
||||
; !i::Send {LCtrl down}i{Ctrl up} ; CB/IBM
|
||||
; !j::Send {LCtrl down}j{Ctrl up} ; CB/IBM
|
||||
; !k::Send {LCtrl down}k{Ctrl up} ; CB/IBM
|
||||
; !l::Send {LCtrl down}l{Ctrl up} ; CB/IBM
|
||||
; !m::Send {LCtrl down}m{Ctrl up} ; CB/IBM
|
||||
; !n::Send {LCtrl down}n{Ctrl up} ; CB/IBM
|
||||
; !o::Send {LCtrl down}o{Ctrl up} ; CB/IBM
|
||||
; !p::Send {LCtrl down}p{Ctrl up} ; CB/IBM
|
||||
; !q::Send {LCtrl down}q{Ctrl up} ; CB/IBM
|
||||
; !r::Send {LCtrl down}r{Ctrl up} ; CB/IBM
|
||||
; !s::Send {LCtrl down}s{Ctrl up} ; CB/IBM
|
||||
; !t::Send {LCtrl down}t{Ctrl up} ; CB/IBM
|
||||
; !u::Send {LCtrl down}u{Ctrl up} ; CB/IBM
|
||||
; !v::Send {LCtrl down}v{Ctrl up} ; CB/IBM
|
||||
; !w::Send {LCtrl down}w{Ctrl up} ; CB/IBM
|
||||
; !x::Send {LCtrl down}x{Ctrl up} ; CB/IBM
|
||||
; !y::Send {LCtrl down}y{Ctrl up} ; CB/IBM
|
||||
; !z::Send {LCtrl down}z{Ctrl up} ; CB/IBM
|
||||
#If
|
||||
#If
|
||||
|
||||
|
0
windows/macbook_winctrl_swap.skl → windows/unused/macbook_winctrl_swap.skl
Executable file → Normal file
@@ -6,7 +6,7 @@
|
||||
typeset -l distro
|
||||
distro=$(awk -F= '$1=="NAME" { gsub("[\",!,_, ]","",$2);print $2 ;}' /etc/os-release)
|
||||
typeset -l dename
|
||||
dename=$(./system-config/dename.sh | cut -d " " -f1)
|
||||
dename=$(./linux/system-config/dename.sh | cut -d " " -f1)
|
||||
|
||||
function uninstall {
|
||||
|
||||
@@ -123,14 +123,14 @@ function budgieUpdate {
|
||||
if [ "$yn" == "y" ]; then
|
||||
budgieVersion="$(/usr/bin/budgie-desktop --version | awk '{ print $2; }' | head -n1)"
|
||||
if [ "$budgieVersion" == "10.5.1" ]; then
|
||||
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
|
||||
wget https://github.com/rbreaves/budgie-desktop/blob/binaries/binaries/budgie-daemon_10.5.1?raw=true -O ./system-config/budgie-daemon_10.5.1
|
||||
if ! [ -f ./linux/system-config/budgie-daemon_10.5.1 ]; then
|
||||
wget https://github.com/rbreaves/budgie-desktop/blob/binaries/binaries/budgie-daemon_10.5.1?raw=true -O ./linux/system-config/budgie-daemon_10.5.1
|
||||
fi
|
||||
bdmd5=$(md5sum /usr/bin/budgie-daemon | awk '{ print $1 }')
|
||||
newbdmd5=$(md5sum ./system-config/budgie-daemon_10.5.1 | awk '{ print $1 }')
|
||||
newbdmd5=$(md5sum ./linux/system-config/budgie-daemon_10.5.1 | awk '{ print $1 }')
|
||||
if [ "$bdmd5" != "$newbdmd5" ]; then
|
||||
cp /usr/bin/budgie-daemon ./budgie-daemon_"$budgieVersion".bak
|
||||
sudo pkill budgie-daemon && sudo cp ./system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
|
||||
sudo pkill budgie-daemon && sudo cp ./linux/system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
|
||||
echo "Updated Budgie to use App Switching Patch"
|
||||
else
|
||||
echo "Budgie-daemon already patched, skipping replacement."
|
||||
@@ -146,11 +146,11 @@ function budgieUpdate {
|
||||
esac
|
||||
done
|
||||
if [ "$yn" == "y" ]; then
|
||||
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
|
||||
wget https://github.com/rbreaves/budgie-desktop/raw/43d3b44243b0bcaee3262a79818024a651475b58/binaries/budgie-daemon_10.5.1 -O ./system-config/budgie-daemon_10.5.1
|
||||
if ! [ -f ./linux/system-config/budgie-daemon_10.5.1 ]; then
|
||||
wget https://github.com/rbreaves/budgie-desktop/raw/43d3b44243b0bcaee3262a79818024a651475b58/binaries/budgie-daemon_10.5.1 -O ./linux/system-config/budgie-daemon_10.5.1
|
||||
fi
|
||||
cp /usr/bin/budgie-daemon ./budgie-daemon_"$budgieVersion".bak
|
||||
sudo pkill budgie-daemon && sudo cp ./system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
|
||||
sudo pkill budgie-daemon && sudo cp ./linux/system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
|
||||
echo "Updated Budgie to use App Switching Patch"
|
||||
fi
|
||||
fi
|
||||
@@ -196,6 +196,9 @@ if [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
|
||||
if [ -f /usr/local/bin/logoff.sh ];then
|
||||
sudo rm /usr/local/bin/logoff.sh
|
||||
fi
|
||||
if [[ $distro == "elementaryos" ]]; then
|
||||
gsettings set io.elementary.terminal.settings natural-copy-paste true
|
||||
fi
|
||||
sudo systemctl daemon-reload
|
||||
# sudo systemctl --state=not-found --all | grep xkeysnail
|
||||
exit 0
|
||||
@@ -234,17 +237,21 @@ if [[ $distro == 'popos' ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $distro == "elementaryos" ]]; then
|
||||
gsettings set io.elementary.terminal.settings natural-copy-paste false
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then
|
||||
if [ "$distro" == "manjarolinux" ]; then
|
||||
sudo ./system-config/unipkg.sh "xorg-xhost gcc"
|
||||
sudo ./linux/system-config/unipkg.sh "xorg-xhost gcc"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $dename == "kde" ]]; then
|
||||
if [[ $distro == "manjarolinux" ]]; then
|
||||
sudo ./system-config/unipkg.sh vte3
|
||||
sudo ./linux/system-config/unipkg.sh vte3
|
||||
else
|
||||
sudo ./system-config/unipkg.sh libvte-2.91-dev
|
||||
sudo ./linux/system-config/unipkg.sh libvte-2.91-dev
|
||||
fi
|
||||
fi
|
||||
if [[ $distro == 'kdeneon' ]]; then
|
||||
@@ -317,11 +324,11 @@ expsh=" "
|
||||
# sudo systemctl enable xkeysnail >/dev/null 2>&1
|
||||
# if ! [ -x "$(command -v inotifywait)" ]; then
|
||||
# echo "Will need to install inotify-tools to restart key remapper live for config file changes..."
|
||||
# sudo ./system-config/unipkg.sh inotify-tools
|
||||
# sudo ./linux/system-config/unipkg.sh inotify-tools
|
||||
# fi
|
||||
if ! [ -x "$(command -v pip3)" ]; then
|
||||
echo "Will need to install python3-pip..."
|
||||
sudo ./system-config/unipkg.sh python3-pip
|
||||
sudo ./linux/system-config/unipkg.sh python3-pip
|
||||
fi
|
||||
if ! [ -x "$(command -v python3-config)" ]; then
|
||||
if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] || [ "$distro" == 'linuxmint' ]; then
|
||||
@@ -331,15 +338,15 @@ if ! [ -x "$(command -v python3-config)" ]; then
|
||||
fi
|
||||
if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "$distro" == "debian" ] || [ "$distro" == 'linuxmint' ]; then
|
||||
echo "Will need to install $pydev..."
|
||||
sudo ./system-config/unipkg.sh "$pydev"
|
||||
sudo ./linux/system-config/unipkg.sh "$pydev"
|
||||
fi
|
||||
fi
|
||||
# if [ "$distro" == "ubuntu" ] && [ "$dename" == "gnome" ];then
|
||||
# sudo ./system-config/unipkg.sh gnome-tweaks gnome-shell-extension-appindicator gir1.2-appindicator3-0.1
|
||||
# sudo ./linux/system-config/unipkg.sh gnome-tweaks gnome-shell-extension-appindicator gir1.2-appindicator3-0.1
|
||||
# fi
|
||||
if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then
|
||||
if [ "$distro" == "\"manjaro linux\"" ]; then
|
||||
sudo ./system-config/unipkg.sh "xorg-xhost gcc"
|
||||
sudo ./linux/system-config/unipkg.sh "xorg-xhost gcc"
|
||||
fi
|
||||
fi
|
||||
if [ "$distro" == 'linuxmint' ]; then
|
||||
@@ -356,103 +363,103 @@ mkdir -p ~/.config/kinto
|
||||
|
||||
# KDE startup - xhost fix
|
||||
mkdir -p ~/.config/autostart
|
||||
yes | cp -rf ./xkeysnail-config/xkeysnail.desktop ~/.config/kinto/xkeysnail.desktop
|
||||
yes | cp -rf ./linux/xkeysnail.desktop ~/.config/kinto/xkeysnail.desktop
|
||||
|
||||
# yes | cp -rf ./xkeysnail-config/xkeystart.sh ~/.config/kinto/xkeystart.sh
|
||||
# yes | cp -rf ./linux/xkeystart.sh ~/.config/kinto/xkeystart.sh
|
||||
|
||||
# *** More testing needing, universal way of killing kinto on user log out? ***
|
||||
# yes | sudo cp -rf xkeysnail-config/root_logoff.sh /usr/local/bin/logoff.sh
|
||||
# yes | sudo cp -rf linux/root_logoff.sh /usr/local/bin/logoff.sh
|
||||
# sudo chown root:root /usr/local/bin/logoff.sh
|
||||
# sudo chmod u+rwx /usr/local/bin/logoff.sh
|
||||
# sudo chmod go-w+rx /usr/local/bin/logoff.sh
|
||||
# *** End universal killing of kinto
|
||||
|
||||
# logoff fix - not solid for every os. Prevents missed 1 character input on login
|
||||
# yes | sudo cp -rf xkeysnail-config/gnome_logoff.sh ~/.config/kinto/logoff.sh
|
||||
# yes | sudo cp -rf linux/gnome_logoff.sh ~/.config/kinto/logoff.sh
|
||||
|
||||
echo "$(git describe --tag --abbrev=0 | head -n 1)" "build" "$(git rev-parse --short HEAD)" > ~/.config/kinto/version
|
||||
yes | cp -rf ./xkeysnail-config/kinto.py ./xkeysnail-config/kinto.py.new
|
||||
yes | cp -rf ./xkeysnail-config/limitedadmins ./xkeysnail-config/limitedadmins.new
|
||||
yes | cp -rf ./xkeysnail-config/gui/ ~/.config/kinto/
|
||||
yes | cp -nrf ./xkeysnail-config/initkb ~/.config/kinto/initkb
|
||||
yes | cp -rf ./xkeysnail-config/killdups.sh ~/.config/kinto/killdups.sh
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/kintotray.py ~/.config/kinto/kintotray.py
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/kintotray.desktop ~/.config/kinto/kintotray.desktop
|
||||
yes | cp -rf ./xkeysnail-config/gui/kinto.desktop ./xkeysnail-config/gui/kinto.desktop.new
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/icons/kinto-color-16.svg ~/.config/kinto/kinto-color.svg
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/icons/kinto-color-16.svg ~/.config/kinto/kinto-color-48.svg
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/icons/kinto-invert-16.svg ~/.config/kinto/kinto-invert.svg
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/icons/kinto-solid-16.svg ~/.config/kinto/kinto-solid.svg
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/icons/kinto.svg ~/.config/kinto/kinto.svg
|
||||
# yes | cp -rf ./system-config/caret_status_xkey.sh ~/.config/kinto/caret_status_xkey.sh
|
||||
yes | cp -rf ./xkeysnail-config/xkeysnail.service ./xkeysnail-config/xkeysnail.service.new
|
||||
# yes | cp -rf ./xkeysnail-config/xkeysnail.timer ~/.config/systemd/user/xkeysnail.timer
|
||||
sed -i "s#{experimental-caret}#$exp#g" ./xkeysnail-config/xkeysnail.service.new
|
||||
yes | cp -rf ./linux/kinto.py ./linux/kinto.py.new
|
||||
yes | cp -rf ./linux/limitedadmins ./linux/limitedadmins.new
|
||||
yes | cp -rf ./linux/gui/ ~/.config/kinto/
|
||||
yes | cp -nrf ./linux/initkb ~/.config/kinto/initkb
|
||||
yes | cp -rf ./linux/killdups.sh ~/.config/kinto/killdups.sh
|
||||
yes | cp -rf ./linux/trayapps/appindicator/kintotray.py ~/.config/kinto/kintotray.py
|
||||
yes | cp -rf ./linux/trayapps/appindicator/kintotray.desktop ~/.config/kinto/kintotray.desktop
|
||||
yes | cp -rf ./linux/gui/kinto.desktop ./linux/gui/kinto.desktop.new
|
||||
yes | cp -rf ./linux/trayapps/appindicator/icons/kinto-color-16.svg ~/.config/kinto/kinto-color.svg
|
||||
yes | cp -rf ./linux/trayapps/appindicator/icons/kinto-color-16.svg ~/.config/kinto/kinto-color-48.svg
|
||||
yes | cp -rf ./linux/trayapps/appindicator/icons/kinto-invert-16.svg ~/.config/kinto/kinto-invert.svg
|
||||
yes | cp -rf ./linux/trayapps/appindicator/icons/kinto-solid-16.svg ~/.config/kinto/kinto-solid.svg
|
||||
yes | cp -rf ./linux/trayapps/appindicator/icons/kinto.svg ~/.config/kinto/kinto.svg
|
||||
# yes | cp -rf ./linux/system-config/caret_status_xkey.sh ~/.config/kinto/caret_status_xkey.sh
|
||||
yes | cp -rf ./linux/xkeysnail.service ./linux/xkeysnail.service.new
|
||||
# yes | cp -rf ./linux/xkeysnail.timer ~/.config/systemd/user/xkeysnail.timer
|
||||
sed -i "s#{experimental-caret}#$exp#g" ./linux/xkeysnail.service.new
|
||||
if [ "$expsh" != " " ];then
|
||||
sed -i "s#{kill-caret}#/usr/bin/pkill -f $expsh#g" ./xkeysnail-config/xkeysnail.service.new
|
||||
sed -i "s#{kill-caret}#/usr/bin/pkill -f $expsh#g" ./linux/xkeysnail.service.new
|
||||
else
|
||||
sed -i "s#{kill-caret}#$expsh#g" ./xkeysnail-config/xkeysnail.service.new
|
||||
sed -i "s#{kill-caret}#$expsh#g" ./linux/xkeysnail.service.new
|
||||
fi
|
||||
sed -i "s/{username}/`whoami`/g" ./xkeysnail-config/xkeysnail.service.new
|
||||
sed -i "s#{homedir}#`echo "$HOME"`#g" ./xkeysnail-config/xkeysnail.service.new
|
||||
sed -i "s/{username}/`whoami`/g" ./linux/xkeysnail.service.new
|
||||
sed -i "s#{homedir}#`echo "$HOME"`#g" ./linux/xkeysnail.service.new
|
||||
sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/kintotray.desktop
|
||||
sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/gui/kinto-gui.py
|
||||
sed -i "s#{homedir}#`echo "$HOME"`#g" ./xkeysnail-config/gui/kinto.desktop.new
|
||||
sudo mv ./xkeysnail-config/gui/kinto.desktop.new /usr/share/applications/kinto.desktop
|
||||
sed -i "s#{xhost}#`\\which xhost`#g" ./xkeysnail-config/xkeysnail.service.new
|
||||
sed -i "s/{username}/`whoami`/g" ./xkeysnail-config/limitedadmins.new
|
||||
sed -i "s#{systemctl}#`\\which systemctl`#g" ./xkeysnail-config/limitedadmins.new
|
||||
sed -i "s#{pkill}#`\\which pkill`#g" ./xkeysnail-config/limitedadmins.new
|
||||
sed -i "s#{homedir}#`echo "$HOME"`#g" ./linux/gui/kinto.desktop.new
|
||||
sudo mv ./linux/gui/kinto.desktop.new /usr/share/applications/kinto.desktop
|
||||
sed -i "s#{xhost}#`\\which xhost`#g" ./linux/xkeysnail.service.new
|
||||
sed -i "s/{username}/`whoami`/g" ./linux/limitedadmins.new
|
||||
sed -i "s#{systemctl}#`\\which systemctl`#g" ./linux/limitedadmins.new
|
||||
sed -i "s#{pkill}#`\\which pkill`#g" ./linux/limitedadmins.new
|
||||
sed -i "s#{systemctl}#`\\which systemctl`#g" ~/.config/kinto/xkeysnail.desktop
|
||||
sed -i "s#{xhost}#`\\which xhost`#g" ~/.config/kinto/xkeysnail.desktop
|
||||
sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/xkeysnail.desktop
|
||||
# sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/prexk.sh
|
||||
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ./xkeysnail-config/xkeysnail.service.new
|
||||
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ./linux/xkeysnail.service.new
|
||||
# sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/kinto/prexk.sh
|
||||
|
||||
if [[ $dename == "budgie" ]]; then
|
||||
perl -pi -e "s/\s{4}(# )(K.*)(# Default SL - Change workspace.*budgie.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
perl -pi -e "s/\s{4}(# )(K.*)(# Default SL - Change workspace.*budgie.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ $distro == "popos" ]]; then
|
||||
perl -pi -e "\s{4}(# )(K.*)(# SL - .*popos.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
perl -pi -e "\s{4}(# )(K.*)(# SL - .*popos.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ $distro == "fedora" ]]; then
|
||||
perl -pi -e "\s{4}(# )(K.*)(# SL - .*fedora.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
perl -pi -e "\s{4}(# )(K.*)(# SL - .*fedora.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ $distro == "elementaryos" ]]; then
|
||||
perl -pi -e "\s{4}(# )(K.*)(# SL - .*eos.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
perl -pi -e "\s{4}(# )(K.*)(# SL - .*eos.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ "$distro" == "manjaro"* ]]; then
|
||||
perl -pi -e "\s{4}(# )(K.*)(# SL - .*manjaro.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
perl -pi -e "\s{4}(# )(K.*)(# SL - .*manjaro.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ $dename == "gnome" ]]; then
|
||||
perl -pi -e "\s{4}(# )(K.*)(# SL - .*ubuntu.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
perl -pi -e "\s{4}(# )(K.*)(# SL - .*ubuntu.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ $dename == "kde" ]]; then
|
||||
echo "Applying Cmd-Space to open App Launcher for KDE..."
|
||||
perl -pi -e "s/(# )(.*)(#.*kde)/\$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
perl -pi -e "s/(# )(.*)(#.*kde)/\$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ $dename == "xfce" ]]; then
|
||||
perl -pi -e "\s{4}(# )(K.*)(# SL - .*xfce.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "\s{4}(# )(K.*)(# SL - .*xfce.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
|
||||
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./linux/kinto.py.new
|
||||
perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./linux/kinto.py.new
|
||||
fi
|
||||
|
||||
if [[ $dename == "xfce" ]] && ls /etc/apt/sources.list.d/enso* 1> /dev/null 2>&1; then
|
||||
echo "enso OS detected, applying Cmd-Space for Launchy..."
|
||||
perl -pi -e "s/(K\(\"RC-Space)(.*)(# )(xfce4)/\$3\$1\$2\$3\$4/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
|
||||
perl -pi -e "s/(K\(\"RC-Space)(.*)(# )(xfce4)/\$3\$1\$2\$3\$4/g" ./linux/kinto.py.new >/dev/null 2>&1
|
||||
xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary>space" --create --type string --set "launchy"
|
||||
fi
|
||||
|
||||
if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
|
||||
mv ./xkeysnail-config/kinto.py.new ~/.config/kinto/kinto.py
|
||||
mv ./linux/kinto.py.new ~/.config/kinto/kinto.py
|
||||
# if [ "$distro" == "fedora" ];then
|
||||
sudo rm /etc/systemd/system/xkeysnail.service >/dev/null 2>&1
|
||||
if [ -d /usr/lib/systemd/system ];then
|
||||
@@ -463,8 +470,7 @@ if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
|
||||
xhost +SI:localuser:root
|
||||
git clone --depth 10 https://github.com/rbreaves/xkeysnail.git
|
||||
cd xkeysnail
|
||||
git pull --depth 10
|
||||
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
|
||||
git checkout kinto
|
||||
giturl=$(git ls-remote --get-url)
|
||||
if [ "$giturl" != "https://github.com/rbreaves/xkeysnail.git" ];then
|
||||
echo -e "\nreplacing xkeysnail with fork...\n"
|
||||
@@ -472,7 +478,7 @@ if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
|
||||
rm -rf ./xkeysnail
|
||||
git clone --depth 10 https://github.com/rbreaves/xkeysnail.git
|
||||
cd xkeysnail
|
||||
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
|
||||
git checkout kinto
|
||||
fi
|
||||
sudo pip3 install --upgrade .
|
||||
cd ..
|
||||
@@ -483,12 +489,12 @@ if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
|
||||
echo -e "Run 'sudo pip3 install --upgrade .' to debug issue"
|
||||
exit 0
|
||||
fi
|
||||
sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./xkeysnail-config/xkeysnail.service.new
|
||||
sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./xkeysnail-config/limitedadmins.new
|
||||
sudo mv ./xkeysnail-config/xkeysnail.service.new "$xkeypath"xkeysnail.service && echo "Service file added to "$xkeypath"xkeysnail.service"
|
||||
sudo chown root:root ./xkeysnail-config/limitedadmins.new
|
||||
sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./linux/xkeysnail.service.new
|
||||
sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./linux/limitedadmins.new
|
||||
sudo mv ./linux/xkeysnail.service.new "$xkeypath"xkeysnail.service && echo "Service file added to "$xkeypath"xkeysnail.service"
|
||||
sudo chown root:root ./linux/limitedadmins.new
|
||||
# Add a check here for xkeysnail path resolving
|
||||
sudo mv ./xkeysnail-config/limitedadmins.new /etc/sudoers.d/limitedadmins
|
||||
sudo mv ./linux/limitedadmins.new /etc/sudoers.d/limitedadmins
|
||||
sudo chown -R root:root "$xkeypath"xkeysnail.service && echo "Ownership set for root..." || echo "Failed to set ownership..."
|
||||
sudo chmod 644 "$xkeypath"xkeysnail.service && echo "Permissions set to 644..." || echo "Failed to set permissions..."
|
||||
sudo ln -s "$xkeypath"xkeysnail.service /etc/systemd/system/xkeysnail.service && echo "Created soft symlink..." || echo "Failed to create soft symlink..."
|
||||
|