Compare commits
713 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c71714e0c2 | ||
![]() |
ef6dc65a20 | ||
![]() |
525aa91cbf | ||
![]() |
b29ec9d936 | ||
![]() |
94595a3324 | ||
![]() |
a9afdac847 | ||
![]() |
39f65c0e2b | ||
![]() |
1aa23c239c | ||
![]() |
b6fb4ba828 | ||
![]() |
9ce8612f54 | ||
![]() |
1419646e9c | ||
![]() |
464ba631cb | ||
![]() |
d709a7de20 | ||
![]() |
80627807f5 | ||
![]() |
cbee0f8f33 | ||
![]() |
f34d9b57f6 | ||
![]() |
969427bf5b | ||
![]() |
adc62fc71b | ||
![]() |
0baef33cf6 | ||
![]() |
0f1f05d379 | ||
![]() |
157ea9a116 | ||
![]() |
3cc1146954 | ||
![]() |
d2ae2a0b1d | ||
![]() |
89701595fb | ||
![]() |
3f573c6d61 | ||
![]() |
6a20ac5932 | ||
![]() |
34a94306ca | ||
![]() |
9adf85cbde | ||
![]() |
18ddc4da01 | ||
![]() |
76e6186d54 | ||
![]() |
b3984244f8 | ||
![]() |
ef385a29f3 | ||
![]() |
1e59d89494 | ||
![]() |
f7c02dc52f | ||
![]() |
bf3ea4e358 | ||
![]() |
07be0f826f | ||
![]() |
21dd05415e | ||
![]() |
ef4b7f8b01 | ||
![]() |
9d57c1f841 | ||
![]() |
6b0801eef6 | ||
![]() |
145e2a45b0 | ||
![]() |
92519e31e8 | ||
![]() |
cb60322517 | ||
![]() |
11c3195c48 | ||
![]() |
5f6c498f90 | ||
![]() |
c7dfbff27f | ||
![]() |
e67f8964a1 | ||
![]() |
7db6862f4f | ||
![]() |
ff58059770 | ||
![]() |
64c96e38c7 | ||
![]() |
f7c0876e83 | ||
![]() |
9b5ae88fe4 | ||
![]() |
87011ddb18 | ||
![]() |
ab4551d22f | ||
![]() |
fc6b590965 | ||
![]() |
91dd44b6ba | ||
![]() |
d7fc4b9277 | ||
![]() |
006a61a242 | ||
![]() |
bafea4cef1 | ||
![]() |
437a2141ff | ||
![]() |
aff4d46abc | ||
![]() |
8460f869a0 | ||
![]() |
05683dad2e | ||
![]() |
1c9302cb7a | ||
![]() |
33e39a8068 | ||
![]() |
d4992fe00a | ||
![]() |
be0cfbce2d | ||
![]() |
7574338d3a | ||
![]() |
a692377c0a | ||
![]() |
1e956287c0 | ||
![]() |
ca76a46372 | ||
![]() |
6f314d44b4 | ||
![]() |
cce00a26a3 | ||
![]() |
64b012ac65 | ||
![]() |
29a77f74de | ||
![]() |
0c1b83ecb7 | ||
![]() |
58a2ac4f35 | ||
![]() |
5f9a6f7a31 | ||
![]() |
b72def92ce | ||
![]() |
0b849d21e8 | ||
![]() |
03029e22dc | ||
![]() |
b87dfdab9c | ||
![]() |
1bdef2f519 | ||
![]() |
f4daa29040 | ||
![]() |
cd9f3042bd | ||
![]() |
139cff181f | ||
![]() |
d642966ba8 | ||
![]() |
dc98778439 | ||
![]() |
5d0454a22f | ||
![]() |
2420518c60 | ||
![]() |
90b27a3e85 | ||
![]() |
b2284aa970 | ||
![]() |
3ad2a7f518 | ||
![]() |
b029d1fbb3 | ||
![]() |
2df52c8e37 | ||
![]() |
fea76528cd | ||
![]() |
0d8310670b | ||
![]() |
e43df230f3 | ||
![]() |
231f537b0d | ||
![]() |
2a396325f2 | ||
![]() |
7fe35cdec3 | ||
![]() |
e702e461ac | ||
![]() |
f7e3011b8c | ||
![]() |
45e637a2a6 | ||
![]() |
a4dca21c22 | ||
![]() |
40c3d68336 | ||
![]() |
9f2815d73b | ||
![]() |
52f2112abd | ||
![]() |
efe01c94d4 | ||
![]() |
0a5c526941 | ||
![]() |
0c7ca8586b | ||
![]() |
b1c361080a | ||
![]() |
b1d5aa68f3 | ||
![]() |
4dd1c26563 | ||
![]() |
c38cccdb44 | ||
![]() |
558e86dd78 | ||
![]() |
463730fe1b | ||
![]() |
79bcdeb89d | ||
![]() |
a84afd5b10 | ||
![]() |
2e99c023bb | ||
![]() |
98a1d8a0f1 | ||
![]() |
72f2f93657 | ||
![]() |
9ea909af33 | ||
![]() |
f37d7d09ec | ||
![]() |
d180b94bd9 | ||
![]() |
f5dc41589d | ||
![]() |
4f562357d5 | ||
![]() |
91b58f0100 | ||
![]() |
8795783d16 | ||
![]() |
be0f2e67bb | ||
![]() |
2270ea5d0d | ||
![]() |
73f2b44c73 | ||
![]() |
dafaaeb2a4 | ||
![]() |
791ab4e94a | ||
![]() |
333c8b387b | ||
![]() |
6da72654ba | ||
![]() |
57d56261ed | ||
![]() |
83aaca7f6b | ||
![]() |
394454aee2 | ||
![]() |
b1d4aad618 | ||
![]() |
77e0a7fe19 | ||
![]() |
52990b5bbe | ||
![]() |
7e69d6c03f | ||
![]() |
6f83fafc66 | ||
![]() |
eab147bd88 | ||
![]() |
0c5a9775ec | ||
![]() |
0df6d85571 | ||
![]() |
03d5df306c | ||
![]() |
c4dcd3febc | ||
![]() |
7c289b7d0c | ||
![]() |
48ef1c596a | ||
![]() |
8c677e8ef0 | ||
![]() |
bd8ea9c4e1 | ||
![]() |
9df95e8b8d | ||
![]() |
e654929d1e | ||
![]() |
f1b37a8cbd | ||
![]() |
f922caff78 | ||
![]() |
68173fb5b6 | ||
![]() |
53f320e0b9 | ||
![]() |
dfec4f7eb1 | ||
![]() |
e8d9ae9e8e | ||
![]() |
d727489d4a | ||
![]() |
619a395b65 | ||
![]() |
1fb5bf2a4b | ||
![]() |
656e2fafc9 | ||
![]() |
3af5eb286d | ||
![]() |
3945d5c29e | ||
![]() |
afefc5b0f1 | ||
![]() |
b66f2c591a | ||
![]() |
e12c51f98f | ||
![]() |
8690436629 | ||
![]() |
0eadd9b3a4 | ||
![]() |
1d6d367c39 | ||
![]() |
1e46a4dc74 | ||
![]() |
7aeb3dc44c | ||
![]() |
6968e08f2f | ||
![]() |
40ea2b6175 | ||
![]() |
367d55b04b | ||
![]() |
2864ae409a | ||
![]() |
e477848b59 | ||
![]() |
26dacc7984 | ||
![]() |
a3d8ac782a | ||
![]() |
acd0b8031e | ||
![]() |
9543eba753 | ||
![]() |
738aee9465 | ||
![]() |
dc826b8454 | ||
![]() |
8bd6ed242f | ||
![]() |
d96e238550 | ||
![]() |
e1948dcb08 | ||
![]() |
7e0680ff75 | ||
![]() |
45d413a1ba | ||
![]() |
a46bb911c9 | ||
![]() |
f4cad2a1e3 | ||
![]() |
ba10ff6ced | ||
![]() |
089fe469a5 | ||
![]() |
f39323071a | ||
![]() |
85d6653261 | ||
![]() |
c7c063ada5 | ||
![]() |
6a866dec54 | ||
![]() |
d52d8cc34f | ||
![]() |
70774c3431 | ||
![]() |
da22daf1f3 | ||
![]() |
918f4bbf94 | ||
![]() |
065dad7ce3 | ||
![]() |
032c317c7e | ||
![]() |
80735aefaa | ||
![]() |
39bd27ec25 | ||
![]() |
f57b02849a | ||
![]() |
da98afe154 | ||
![]() |
bbb1429c8e | ||
![]() |
9a1e66620b | ||
![]() |
d527347bdc | ||
![]() |
efc772d687 | ||
![]() |
7fcd94fda5 | ||
![]() |
5a46aad268 | ||
![]() |
c66dcbca9a | ||
![]() |
72bedf856d | ||
![]() |
3d9d2524a2 | ||
![]() |
8848f8cbea | ||
![]() |
f5318c9807 | ||
![]() |
de42816a01 | ||
![]() |
1acc948fbc | ||
![]() |
7174904434 | ||
![]() |
b5ab41de9d | ||
![]() |
86582466cf | ||
![]() |
cc05da2f59 | ||
![]() |
2b9598c84f | ||
![]() |
7f9ccabf77 | ||
![]() |
2249c4538d | ||
![]() |
fb630a7d33 | ||
![]() |
28e5141079 | ||
![]() |
d29579e0a5 | ||
![]() |
dcd8191bfb | ||
![]() |
5b4269fc1f | ||
![]() |
1fc62a54da | ||
![]() |
4c8d8412b8 | ||
![]() |
6cb66a6b72 | ||
![]() |
7c36021642 | ||
![]() |
3622eeb279 | ||
![]() |
a82632fc63 | ||
![]() |
3d55b232a9 | ||
![]() |
d68ca6226c | ||
![]() |
9d5ac9142b | ||
![]() |
87a4c6934d | ||
![]() |
7b67a4988e | ||
![]() |
f0404299ac | ||
![]() |
894c7b7a69 | ||
![]() |
bcabd5d65b | ||
![]() |
ffab720b50 | ||
![]() |
57d430ae36 | ||
![]() |
49613ec470 | ||
![]() |
7c1f92db5b | ||
![]() |
329e821440 | ||
![]() |
046eaa05cd | ||
![]() |
7c0a431472 | ||
![]() |
1b2e7ab57b | ||
![]() |
ea78de7909 | ||
![]() |
dae728d04a | ||
![]() |
6578065024 | ||
![]() |
8f22bc63ff | ||
![]() |
1ed7fa5f73 | ||
![]() |
c9f7b81796 | ||
![]() |
4f259481f4 | ||
![]() |
3143f11d4b | ||
![]() |
520ea7683b | ||
![]() |
ba1471e397 | ||
![]() |
a00998b1e3 | ||
![]() |
cbb60668e3 | ||
![]() |
1a0c99a763 | ||
![]() |
0275669be1 | ||
![]() |
e741989128 | ||
![]() |
0adc44907c | ||
![]() |
7a2aac9d79 | ||
![]() |
3899fcf596 | ||
![]() |
f3df35662b | ||
![]() |
20c93600e1 | ||
![]() |
1ab00452b0 | ||
![]() |
c0bfec035f | ||
![]() |
712b2e0e69 | ||
![]() |
eb576a6217 | ||
![]() |
06180c3517 | ||
![]() |
8b07fb9037 | ||
![]() |
b34dc4e928 | ||
![]() |
7a07382d30 | ||
![]() |
2ffe639024 | ||
![]() |
8dc05e7ace | ||
![]() |
4c5cb36503 | ||
![]() |
8fdaaf592d | ||
![]() |
6b4c697dd0 | ||
![]() |
e2a767fbec | ||
![]() |
7fe9230b5f | ||
![]() |
1d088b2e1d | ||
![]() |
e63d8ee5b5 | ||
![]() |
e3d42651b7 | ||
![]() |
42c04d062e | ||
![]() |
ca54bf89d6 | ||
![]() |
772413a9c3 | ||
![]() |
bbd7b3fc93 | ||
![]() |
98120062eb | ||
![]() |
637a8fecaa | ||
![]() |
ad53b7034d | ||
![]() |
896c6fd6a1 | ||
![]() |
dbaf02f884 | ||
![]() |
79857af79c | ||
![]() |
53206855f4 | ||
![]() |
6298c6c9cc | ||
![]() |
318efcc3fd | ||
![]() |
2567f5006e | ||
![]() |
fd648d3850 | ||
![]() |
ac34350392 | ||
![]() |
8df691a52d | ||
![]() |
11f8e33fdf | ||
![]() |
7de111726b | ||
![]() |
5a12521b58 | ||
![]() |
ad196c4d6b | ||
![]() |
17a877c693 | ||
![]() |
0c3e03a81b | ||
![]() |
163117d4fb | ||
![]() |
4c8ae68027 | ||
![]() |
ed771f4ae4 | ||
![]() |
9d5c7b6230 | ||
![]() |
b85b786dcc | ||
![]() |
7904be6d5c | ||
![]() |
df5d2d8c0e | ||
![]() |
a556f1afa9 | ||
![]() |
61fe293af8 | ||
![]() |
3ac264ea99 | ||
![]() |
32111fe5a4 | ||
![]() |
dff590e7df | ||
![]() |
bc27f3c205 | ||
![]() |
4c820d9f67 | ||
![]() |
8e6f1962e0 | ||
![]() |
59521772af | ||
![]() |
099b3cea88 | ||
![]() |
e1b3911546 | ||
![]() |
7bf3ccdda3 | ||
![]() |
029d83ad5b | ||
![]() |
5da49257dc | ||
![]() |
b529a5b14a | ||
![]() |
fcb823bb2f | ||
![]() |
69acc58487 | ||
![]() |
50e6dfd863 | ||
![]() |
0843103eda | ||
![]() |
a52bf9959d | ||
![]() |
fbea226894 | ||
![]() |
e6db6a9726 | ||
![]() |
05b0694776 | ||
![]() |
d6c98a345c | ||
![]() |
bf84cb3153 | ||
![]() |
c98268c287 | ||
![]() |
a48246d3e3 | ||
![]() |
ad35946adb | ||
![]() |
3de9a1dd9d | ||
![]() |
6aa77a30a8 | ||
![]() |
376a7edd6f | ||
![]() |
e22cc5b6c7 | ||
![]() |
a7e6ff2374 | ||
![]() |
4cae4d2d6f | ||
![]() |
9d3cd94ca0 | ||
![]() |
9e379363d0 | ||
![]() |
e6b1793348 | ||
![]() |
ae36d7f955 | ||
![]() |
af9036ec24 | ||
![]() |
6a4ad3f92a | ||
![]() |
954049a251 | ||
![]() |
78efb69287 | ||
![]() |
49d9cee349 | ||
![]() |
da711e2421 | ||
![]() |
b2dd812f3f | ||
![]() |
39df46ff5e | ||
![]() |
45801d9ff0 | ||
![]() |
17db80f54c | ||
![]() |
a0cfff7395 | ||
![]() |
650ff78b92 | ||
![]() |
7c0e22e33f | ||
![]() |
48170b9ad7 | ||
![]() |
1626443290 | ||
![]() |
670d948ab0 | ||
![]() |
b5f533a83b | ||
![]() |
31d7c736b0 | ||
![]() |
268a1bdbff | ||
![]() |
c0b12f1627 | ||
![]() |
76e69ecc25 | ||
![]() |
bae786c3af | ||
![]() |
701bf25c69 | ||
![]() |
fc551d265b | ||
![]() |
4e428e79c1 | ||
![]() |
da1e38d751 | ||
![]() |
303023d90f | ||
![]() |
e4d710d5ae | ||
![]() |
3f5064c28c | ||
![]() |
00cc80036c | ||
![]() |
2f3e59b80c | ||
![]() |
ce125d4c1f | ||
![]() |
31baab1b34 | ||
![]() |
c442a0fceb | ||
![]() |
bd84ad9cfc | ||
![]() |
15f9195da6 | ||
![]() |
1743b7d46d | ||
![]() |
496240dfe1 | ||
![]() |
cb6cf4f886 | ||
![]() |
655a5f9027 | ||
![]() |
aff8253831 | ||
![]() |
1113378617 | ||
![]() |
6230c189fa | ||
![]() |
ca153cca93 | ||
![]() |
362c48953e | ||
![]() |
754b18066f | ||
![]() |
d8b1d2b684 | ||
![]() |
5593fdfe5a | ||
![]() |
315a6a0541 | ||
![]() |
0e53a36f99 | ||
![]() |
477d276639 | ||
![]() |
406f57e61b | ||
![]() |
4d5aba930f | ||
![]() |
2eb5a33b93 | ||
![]() |
f0f152e21f | ||
![]() |
696fb6ad7f | ||
![]() |
a66c82d84c | ||
![]() |
f134e9d13b | ||
![]() |
6eedd8b4f7 | ||
![]() |
162aa3e5d0 | ||
![]() |
c1e2db9a2e | ||
![]() |
3b802d1d49 | ||
![]() |
81ecd3f031 | ||
![]() |
a646ae8227 | ||
![]() |
21991b8479 | ||
![]() |
079cb6e54a | ||
![]() |
3f493c0472 | ||
![]() |
059f5bea26 | ||
![]() |
e1745c0362 | ||
![]() |
08e5a01a89 | ||
![]() |
5e0fccae5d | ||
![]() |
ac87e8f144 | ||
![]() |
4cbc665cd3 | ||
![]() |
d11598077d | ||
![]() |
7197b5bb39 | ||
![]() |
543a10884d | ||
![]() |
6c8bcb8d7c | ||
![]() |
7ec0b0ad7e | ||
![]() |
e885fa0033 | ||
![]() |
97e6ed076a | ||
![]() |
e3d693cfcd | ||
![]() |
a06d983b97 | ||
![]() |
eb691d5174 | ||
![]() |
5922e1b5a9 | ||
![]() |
f9e000ef23 | ||
![]() |
eb5e77ffd6 | ||
![]() |
8ae3d3b792 | ||
![]() |
e36fa9216b | ||
![]() |
58d3273f3d | ||
![]() |
0f6cfb95cc | ||
![]() |
d2e5f25c8d | ||
![]() |
6529d3b909 | ||
![]() |
eeb87d3434 | ||
![]() |
fe8b0a2027 | ||
![]() |
4be9043f10 | ||
![]() |
65df97e8bf | ||
![]() |
9f3b4b0072 | ||
![]() |
e35e92fdbd | ||
![]() |
9c87cb2774 | ||
![]() |
3bd45bc627 | ||
![]() |
3b9ce890dc | ||
![]() |
a6688ffc44 | ||
![]() |
94128f7dbf | ||
![]() |
9a451bd93c | ||
![]() |
3dd930d1e5 | ||
![]() |
462ceb578c | ||
![]() |
b958668853 | ||
![]() |
1ae333f0ed | ||
![]() |
0baf62a261 | ||
![]() |
f35f75bd30 | ||
![]() |
e34ff1c86e | ||
![]() |
89500c97c6 | ||
![]() |
d9225a73ef | ||
![]() |
5f75f66852 | ||
![]() |
7e6011a0a9 | ||
![]() |
9608ef95ae | ||
![]() |
ab637704de | ||
![]() |
ed7c68a388 | ||
![]() |
f8f2df0d65 | ||
![]() |
ea70936454 | ||
![]() |
4849fb55ac | ||
![]() |
fb2f6674ad | ||
![]() |
dc2f9c332d | ||
![]() |
42218a3172 | ||
![]() |
6965d81c79 | ||
![]() |
74c66d91cc | ||
![]() |
08c02c2b8f | ||
![]() |
05ead51322 | ||
![]() |
deac0cfb0a | ||
![]() |
087d7a7d0e | ||
![]() |
e755c84b27 | ||
![]() |
1a07a55fa9 | ||
![]() |
192a640e6c | ||
![]() |
ccc081adba | ||
![]() |
336d883b03 | ||
![]() |
61e357b5da | ||
![]() |
407f781af0 | ||
![]() |
4250967d5a | ||
![]() |
c0785ac045 | ||
![]() |
c57b5a3603 | ||
![]() |
4d423de14b | ||
![]() |
ca4f9be6ee | ||
![]() |
a144a47836 | ||
![]() |
afcb4c3a73 | ||
![]() |
2846125c23 | ||
![]() |
25ce34a2fc | ||
![]() |
e1226afad8 | ||
![]() |
ead90abf94 | ||
![]() |
5bf6b06917 | ||
![]() |
e892f045f5 | ||
![]() |
00cfd67996 | ||
![]() |
c1c473c097 | ||
![]() |
969b74adda | ||
![]() |
7e6f872983 | ||
![]() |
b50522c5b1 | ||
![]() |
6a887ebdea | ||
![]() |
d7433092ff | ||
![]() |
d670579db8 | ||
![]() |
3389c512e2 | ||
![]() |
703f6131d4 | ||
![]() |
f3ab1e043b | ||
![]() |
78e537ac71 | ||
![]() |
b1851316de | ||
![]() |
812d2a4bcd | ||
![]() |
997d2dd39f | ||
![]() |
39c40bc315 | ||
![]() |
16f8b237d5 | ||
![]() |
7013d81686 | ||
![]() |
daaa1fd352 | ||
![]() |
87ca8e7566 | ||
![]() |
0e4160622f | ||
![]() |
47037d9619 | ||
![]() |
564360e9fa | ||
![]() |
91e692c76b | ||
![]() |
ce31232015 | ||
![]() |
6c46696bd4 | ||
![]() |
40c8d20513 | ||
![]() |
6b6e448e76 | ||
![]() |
f73a2c8420 | ||
![]() |
c6605c68cf | ||
![]() |
153c5e7b91 | ||
![]() |
548e248515 | ||
![]() |
4a51232b9d | ||
![]() |
4da8f97bf7 | ||
![]() |
bfd363107d | ||
![]() |
6a2948e8a5 | ||
![]() |
16d5531035 | ||
![]() |
5870f6b987 | ||
![]() |
557ba01eac | ||
![]() |
fd2234fae4 | ||
![]() |
21bfb6faae | ||
![]() |
b904235653 | ||
![]() |
36740e4b3e | ||
![]() |
7c74dcca71 | ||
![]() |
8827b37ef3 | ||
![]() |
6631cd25a9 | ||
![]() |
1d59d8d643 | ||
![]() |
c5ff1f2513 | ||
![]() |
f0851a949c | ||
![]() |
332607765e | ||
![]() |
7e676938ee | ||
![]() |
7a706305c1 | ||
![]() |
df9b8d974e | ||
![]() |
e7f0db4107 | ||
![]() |
031eaf7e9f | ||
![]() |
4078094e33 | ||
![]() |
c8ab5eb4ba | ||
![]() |
2c1fb05920 | ||
![]() |
48b3d3f7bd | ||
![]() |
68a2d95b72 | ||
![]() |
89beeb427b | ||
![]() |
d45b8e29dc | ||
![]() |
7cb14dfbf3 | ||
![]() |
19381a5528 | ||
![]() |
4a9ced9478 | ||
![]() |
51e86149bc | ||
![]() |
f9647a5476 | ||
![]() |
92b4315da7 | ||
![]() |
5003d6fa9b | ||
![]() |
4140a06d53 | ||
![]() |
3cf480d724 | ||
![]() |
2a467f2a26 | ||
![]() |
d695c3f734 | ||
![]() |
8c2c53cdcd | ||
![]() |
0f064360a4 | ||
![]() |
998c9bdf28 | ||
![]() |
393f45d1d3 | ||
![]() |
e8a8c0ed56 | ||
![]() |
c4db31bdf0 | ||
![]() |
40b521ce09 | ||
![]() |
c5f1764dfa | ||
![]() |
0196cc323a | ||
![]() |
c8ca073875 | ||
![]() |
0e23aae082 | ||
![]() |
c6292ee34a | ||
![]() |
470541d5f8 | ||
![]() |
5152c0ee6e | ||
![]() |
9b97bd9ea6 | ||
![]() |
3f4b5241eb | ||
![]() |
324e4d83c6 | ||
![]() |
eb49a4859f | ||
![]() |
8086a56b7d | ||
![]() |
bb357f23e6 | ||
![]() |
bdf607e907 | ||
![]() |
b8eb341d62 | ||
![]() |
9060cffbff | ||
![]() |
08d8a90555 | ||
![]() |
d7ef767a18 | ||
![]() |
549e9c3a48 | ||
![]() |
1c51db9078 | ||
![]() |
524fe93d1c | ||
![]() |
4bb6f89a22 | ||
![]() |
3185bc068a | ||
![]() |
c2b8304991 | ||
![]() |
03f4cd5bbe | ||
![]() |
3b4e02525d | ||
![]() |
b8b588e727 | ||
![]() |
f77610e6a1 | ||
![]() |
7007cbefc5 | ||
![]() |
2419511da4 | ||
![]() |
07f74e478b | ||
![]() |
b038d2a065 | ||
![]() |
86a92cf836 | ||
![]() |
38b4521023 | ||
![]() |
2c7f20df63 | ||
![]() |
e014c2bc95 | ||
![]() |
3e9b93dcad | ||
![]() |
d8da8d3b31 | ||
![]() |
ce99f4da23 | ||
![]() |
5207428abd | ||
![]() |
b846b29ff1 | ||
![]() |
1a482e3c8c | ||
![]() |
1e0f7259c1 | ||
![]() |
e6dbd5ea13 | ||
![]() |
6b0f3fc0dd | ||
![]() |
c9bf5c1937 | ||
![]() |
0f0c86af0f | ||
![]() |
ce937065c9 | ||
![]() |
acf6bd9317 | ||
![]() |
19d58a3a05 | ||
![]() |
cf8e78073a | ||
![]() |
86c5715853 | ||
![]() |
4e75cfb047 | ||
![]() |
159d2b63f0 | ||
![]() |
5a2299d8dc | ||
![]() |
83ae169fb7 | ||
![]() |
5c6e42b811 | ||
![]() |
cd57efd89b | ||
![]() |
28bad9ed42 | ||
![]() |
ddfcd57c6b | ||
![]() |
4b4fc7fc3f | ||
![]() |
16c4378c2e | ||
![]() |
9dc026695b | ||
![]() |
c65d68d816 | ||
![]() |
3983107be5 | ||
![]() |
56391169ff | ||
![]() |
ac5c5f6648 | ||
![]() |
778d1df1ba | ||
![]() |
fbe2451a3c | ||
![]() |
5a56ea823f | ||
![]() |
5d5d8de92e | ||
![]() |
086ab8bb35 | ||
![]() |
dc016d9270 | ||
![]() |
8f1795339e | ||
![]() |
4fb65d7025 | ||
![]() |
93daf8707e | ||
![]() |
50885a7e78 | ||
![]() |
ea60bb6db5 | ||
![]() |
4281d97c3d | ||
![]() |
364536b8ea | ||
![]() |
2585ab9f45 | ||
![]() |
7969bd007d | ||
![]() |
5d135afe5e | ||
![]() |
a4fa9b225e | ||
![]() |
eac62fb605 | ||
![]() |
ab679ddf9d | ||
![]() |
f4cef736be | ||
![]() |
2179176881 | ||
![]() |
26f70ccd31 | ||
![]() |
0ff7a42f9b | ||
![]() |
58da4fcd90 | ||
![]() |
20170f0a7d | ||
![]() |
d90829928b | ||
![]() |
6f913538e8 | ||
![]() |
7dfbe884ff | ||
![]() |
3a115f91ae | ||
![]() |
4c218b55bd | ||
![]() |
94cd3ed907 | ||
![]() |
b0bde4fecf | ||
![]() |
b930b96066 | ||
![]() |
2df4920344 | ||
![]() |
ce9c80a02f | ||
![]() |
e599562ec1 | ||
![]() |
b8b81bd907 | ||
![]() |
22e5462fbc | ||
![]() |
72d2007267 | ||
![]() |
3c5b49324c | ||
![]() |
3f37ef6e28 | ||
![]() |
35cfcce748 | ||
![]() |
d288048ed4 | ||
![]() |
a30671b08c | ||
![]() |
2f2afecb6d | ||
![]() |
072249d5d4 | ||
![]() |
a6b9b1ffbb | ||
![]() |
d8c516c13c | ||
![]() |
b763703d70 | ||
![]() |
ecaf413fa4 | ||
![]() |
48e01750e5 | ||
![]() |
5ec8c076a3 | ||
![]() |
c620b299bd | ||
![]() |
496cb4d340 |
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*.py linguist-detectable=true
|
||||
*.json liguist-detectable=false
|
||||
*.c linguist-detectable=true
|
37
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: rbreaves
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Install Type:** Bare Metal or VM
|
||||
**Distro:** Name + Version
|
||||
**DE:** Gnome, XFCE, KDE
|
||||
**Branch:** master, dev
|
||||
**Commit:** git rev-parse --short HEAD
|
||||
|
||||
Logs and status if relevant
|
||||
```
|
||||
# xkeysnail
|
||||
sudo systemctl status xkeysnail
|
||||
sudo journalctl --unit=xkeysnail.service -b
|
||||
|
||||
# xkb
|
||||
systemctl --user status keyswap
|
||||
journalctl --user-unit=keyswap.service -b
|
||||
```
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: rbreaves
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
10
.github/ISSUE_TEMPLATE/gratitude.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Gratitude
|
||||
about: Just wants to give a shout out!
|
||||
title: ''
|
||||
labels: gratitude
|
||||
assignees: rbreaves
|
||||
|
||||
---
|
||||
|
||||
|
10
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Question
|
||||
about: Question about Kinto functionality
|
||||
title: ''
|
||||
labels: question
|
||||
assignees: rbreaves
|
||||
|
||||
---
|
||||
|
||||
|
3
.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
.env/
|
||||
.DS_Store
|
||||
__pycache__/
|
||||
xkeysnail/
|
||||
keybindings_*
|
||||
mutter_*
|
||||
|
@@ -1,32 +1,781 @@
|
||||
// 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" {
|
||||
// LEFT to Begin Line
|
||||
// // 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]= [ Left, Left, NoSymbol ],
|
||||
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<HOME>,clearmods=Control)]
|
||||
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
|
||||
|
||||
// Right to End of Line or end of word
|
||||
replace key <RGHT> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [ Right, Right, NoSymbol ],
|
||||
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<END>,clearmods=Control)]
|
||||
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
|
||||
|
||||
//Up to Mac Home
|
||||
replace key <UP> {
|
||||
type[Group1]= "ONE_LEVEL_CTRL",
|
||||
symbols[Group1]= [ Up, Up, NoSymbol ],
|
||||
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<HOME>)]
|
||||
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, NoSymbol ],
|
||||
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<END>)]
|
||||
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)
|
||||
]
|
||||
};
|
||||
// CTRL BKSP to DELETE
|
||||
// replace key <BKSP> {
|
||||
// type[Group1]= "TWO_LEVEL_CTRL",
|
||||
// symbols[Group1]= [ BackSpace, BackSpace, NoSymbol ],
|
||||
// actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<DELE>,clearmods=Control)]
|
||||
// };
|
||||
};
|
||||
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,14 +1,210 @@
|
||||
default partial xkb_symbols "mac_levelssym" {
|
||||
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 <RWIN> {
|
||||
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)
|
||||
]
|
||||
};
|
||||
};
|
@@ -11,4 +11,90 @@ default partial xkb_symbols "mac_levelssym" {
|
||||
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,20 +1,53 @@
|
||||
default partial xkb_types "addmac_levels" {
|
||||
Virtual_modifiers Super;
|
||||
type "ONE_LEVEL_CTRL" {
|
||||
modifiers= Shift+Control;
|
||||
map[Shift]= Level2;
|
||||
map[Control]= Level3;
|
||||
map[Shift+Control]= Level3;
|
||||
level_name[Level1]= "Base";
|
||||
level_name[Level2]= "Caps";
|
||||
level_name[Level3]= "With Control";
|
||||
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 "TWO_LEVEL_CTRL" {
|
||||
modifiers= Shift+Control;
|
||||
map[Shift]= Level2;
|
||||
map[Control]= Level3;
|
||||
map[Shift+Control]= Level3;
|
||||
level_name[Level1]= "Base";
|
||||
level_name[Level2]= "Caps";
|
||||
level_name[Level3]= "With Control";
|
||||
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";
|
||||
};
|
||||
};
|
||||
|
53
.xkb/types/mac_term
Normal file
@@ -0,0 +1,53 @@
|
||||
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";
|
||||
};
|
||||
};
|
503
README.md
@@ -1,50 +1,86 @@
|
||||
# Kinto
|
||||
# Kinto.sh
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
[](https://github.com/rbreaves/kinto/releases/latest)
|
||||
|
||||

|
||||
\- Type in Linux & Windows like it's a Mac. \-
|
||||
|
||||
\- Type in Linux like it's a Mac. \-
|
||||
Seamless copy and paste with all apps and terminals. The zero effort solution.
|
||||
|
||||
Cmd = Ctrl+Shift for all terminals.
|
||||
v1.2 Release - Kinto now includes a system tray and simple wizard to setup the install with minimal effort.
|
||||
|
||||
Note: As of version 1.0 Kinto no longer maps Cmd/Alt to Super while using the Terminal, it is now mapping to Ctrl+Shift by default. Please reset your terminal's keymaps back to their defaults.
|
||||
## Table of Contents
|
||||
|
||||
Gnome-terminal reset
|
||||
```
|
||||
dconf reset -f /org/gnome/terminal/legacy/keybindings/
|
||||
```
|
||||
[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 Kinto require?](#What-does-Kinto-require)
|
||||
|
||||
[Shortcut Creation](#Shortcut-Creation)
|
||||
|
||||
[How to Upgrade/Control Kinto](#How-to-Upgrade-Kinto)
|
||||
|
||||
[Troubleshooting](#Troubleshooting)
|
||||
|
||||
[Language Support](#Language-Support)
|
||||
|
||||
[Related or Useful Resources](#Related-or-Useful-Resources)
|
||||
|
||||
[Contributing](#Contributing)
|
||||
|
||||
[More information about Kinto](#More-information-about-Kinto)
|
||||
|
||||
[License](#License)
|
||||
|
||||
[Credits and Contributions](#Credits-and-Contributions)
|
||||
|
||||
## What does this do exactly?
|
||||
|
||||
Kinto works for standard Windows, Apple and Chromebook keyboards. The following however describes the dynamic rebinding based on a standard Windows keyboard. (Alt location is Cmd for Apple keyboards)
|
||||
|
||||
- Normal apps - Alt will be Ctrl, Win/Super will be Alt, Ctrl will be Win/Super
|
||||
|
||||
- Terminal apps - Alt will be Ctrl+Shift, Win/Super will be Alt, Ctrl will be Ctrl
|
||||
Kinto works for standard Windows, Apple and Chromebook keyboards. The following however describes the dynamic rebinding based on a standard Windows/Mac keyboard.
|
||||
|
||||
- Cursor/word-wise shortcut keys have been added to align with macOS keyboard shortcuts.
|
||||
|
||||
## What does Kinto require?
|
||||
**GUI**
|
||||
|**Physical**| Ctrl | Win/Alt | Alt/Cmd | Spacebar|
|
||||
|---|---|---|---|---|
|
||||
|**Virtual**| Win/Super* | Alt | RCtrl |Spacebar|
|
||||
|
||||
- Python (initial install only)
|
||||
- systemd
|
||||
- x11
|
||||
- Debian/Ubuntu based distro 16.04+
|
||||
*Win/Super will properly remap to LCtrl when needed to fully support expected keymaps.
|
||||
|
||||
If you need kintox11 recompiled for your distro please let me know and I will add a binary for your distro if my binary fails.
|
||||
**Terminal**
|
||||
|**Physical**| Ctrl | Win/Alt | Alt/Cmd | Spacebar|
|
||||
|---|---|---|---|---|
|
||||
|**Virtual**| LCtrl | Alt | RCtrl |Spacebar|
|
||||
|
||||
You can also attempt to compile kintox11.c on your system as well, but you will need to compile and install json-c first as its libraries will be required to compile and run the program.
|
||||
Note: RCtrl for terminals is also adding in Shift most of the time, however it depends on the specific terminal in use and will change itself to the expected keymaps of that terminal application.
|
||||
|
||||
Wayland support is planned, but not ready yet.
|
||||
## What's different?
|
||||
|
||||
## How to install
|
||||
Compared to most other remappers ***this is a complete system-wide remap of your base level modifier keys***, this saves time. You're not going to die a death of a thousand papercuts from trying to support every shortcut key under the sun.
|
||||
|
||||
It also retains some of the most commonly used system level shortcut keys, such as Cmd-C/V, Cmd-Tab, and Ctrl-Tab among others. You will keep seamless copy & paste between all apps, ability to switch Windows while still using the physical Cmd/Alt key position; switch tabs in your favorite terminals, code editors, or web browsers. Depending on your OS and/or Desktop Environment you may also be able to switch Virtual Desktop environments the same way as well and other basic system level shortcuts.
|
||||
|
||||
If your OS and macOS have similar functionality on the system level, but only differ by a slight difference of a shortcut command then Kinto likely supports it already. If Kinto doesn't have what you need then you can open up a support ticket and it will be added. You can also fork the project to add the fix and I will merge it via a PR you make.
|
||||
|
||||
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 (Xkeysnail)](#Shortcut-Creation-Xkeysnail) for Linux.
|
||||
|
||||
## 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)
|
||||
|
||||
@@ -54,136 +90,357 @@ sudo apt update
|
||||
sudo apt install python3
|
||||
```
|
||||
|
||||
3. Follow the prompts and the script will guide you through the rest of the setup.
|
||||
3. Run the script, press 1 or 2 keys and you are done.
|
||||
```
|
||||
./setup.py
|
||||
```
|
||||
|
||||
## JSON config files
|
||||
Troubleshoot
|
||||
|
||||
Features
|
||||
- Unlimited keyboard configurations per App/category (user_config.json - config -> create app object)
|
||||
- Dynamic Desktop Environment shortcut capabilities (user_config.json - de -> create DE tweak/remap)
|
||||
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
|
||||
```
|
||||
|
||||
Located at ~/.config/kinto/ you will find user_config.json which will look like the following after an install. You can modify the defaults.json file in the root directory of kinto to create additional keyboard layout types/support without needing to modify any of the underlying Kinto code.
|
||||
|
||||
You can also add additional Desktop Environment related tweaks to user_config.json in the install directory as well and the installer will prompt you to install them. You may also fork and submit any json or additional .xkb configurations to me for approval if you believe it makes Linux more like typing on a Mac.
|
||||
To Uninstall Kinto
|
||||
|
||||
```
|
||||
{"config":[{
|
||||
"name":"gui",
|
||||
"run":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY",
|
||||
"de":[2],
|
||||
"appnames":[ "" ]
|
||||
},
|
||||
{
|
||||
"name":"term",
|
||||
"run":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
|
||||
"de":[2],
|
||||
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm" ]
|
||||
}],
|
||||
"init": [1],
|
||||
"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":""
|
||||
}]
|
||||
./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
|
||||
- systemd
|
||||
- x11
|
||||
- xkeysnail
|
||||
|
||||
On most distros you can confirm Input Methods by navigating to "Language Support" and set "Keyboard input method system:" to IBus for full word-wise support with web browsers.
|
||||
|
||||
### Kinto for Windows 10 Requirements
|
||||
|
||||
- [Git for Windows](https://git-scm.com/download/win)
|
||||
- Powershell - run as Administrator
|
||||
- [Python3](https://www.python.org/downloads/windows/)
|
||||
|
||||
Other programs that will be installed when you run ./setup.py
|
||||
- Chocolatey
|
||||
- Autohotkey
|
||||
- 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.
|
||||
|
||||
Users can now hotswap between Apple and Windows based keyboards without having to logoff and back on, and Windows is currently the only implementation with a system tray (but this feature is coming to Budgie, XFCE, Mate, Gnome, and lastly KDE).
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/10969616/84471498-100c7d00-ac4b-11ea-972d-60c1907831ec.png" width="50%">
|
||||
<img src="https://user-images.githubusercontent.com/10969616/84471501-10a51380-ac4b-11ea-9e0e-c19a7ebfad6d.png" width="50%">
|
||||
|
||||
## Shortcut Creation
|
||||
|
||||
Note: A new project, [Universal Keys](https://github.com/rbreaves/Universal-Keys), has been created that will be updated to contain all current remaps - plus many more. Once that is done, Kinto will be updated to programmatically pull the latest keymaps from simple csv comma delimited files & will build out key remaps from there. This will also allow for more types of remaps within an application category, Sublime Text 3 to VS Code or VS Code to Sublime Text 3, Photoshop to Gimp, Gimp to Photoshop, etc & it will ensure that xkeysnail (linux) & autohotkey (windows) are pulling from the same data set.
|
||||
|
||||
[Linux Shortcut Creation (Xkeysnail)](#Linux-Xkeysnail)
|
||||
|
||||
[Windows Shortcut Creation (Autohotkey)](#Windows-Autohotkey)
|
||||
|
||||
|
||||
## Linux (Xkeysnail)
|
||||
|
||||
**GUI Keys**
|
||||
| Value| Description|Mac/Kinto Equivalent|
|
||||
| ----- |:--------:|:--------:|
|
||||
|C,Ctrl|Control|Cmd|
|
||||
|M,Alt| Alt/Option|Alt/Option|
|
||||
|Super | Win/Super|Ctrl|
|
||||
|
||||
**Terminal Keys**
|
||||
| Value| Description|Mac/Kinto Equivalent|
|
||||
| ----- |:--------:|:--------:|
|
||||
|RC,RCtrl|Right Control → Left & Right Alt/Cmd key|Cmd|
|
||||
|M,Alt|Alt/Option|Alt/Option|
|
||||
|LC,LCtrl |Left Control|Ctrl|
|
||||
|
||||
You can define new keymaps for your specific app via this method. You also do not have to cancel out the original keybinding if you do not need or want to, but you can do so with "pass_through_key".
|
||||
|
||||
### Defining Keymaps Per App
|
||||
```
|
||||
# Keybindings for Sublime Text
|
||||
define_keymap(re.compile("Sublime_text"),{
|
||||
K("C-h"): pass_through_key, # cancel replace
|
||||
K("Ctrl-Alt-f"): K("Ctrl-h"), # replace
|
||||
K("C-M-v"): [K("C-k"), K("C-v")], # paste_from_history
|
||||
}
|
||||
```
|
||||
|
||||
In the above example I am also showing that you can define a single shortcut to enact multiple shortcut keys if needed by defining an array of shortcuts to trigger.
|
||||
|
||||
You can also make changes to the file in your /tmp/kinto/xkeysnail/kinto.py location and see them take affect in real time, but for your changes to be permanent you will need to make your changes in the ~/.config/kinto/kinto.py location & restart the xkeysnail service.
|
||||
|
||||
```
|
||||
sudo systemctl restart xkeysnail
|
||||
```
|
||||
|
||||
More information can be seen on the readme page of [xkeysnail](https://github.com/mooz/xkeysnail).
|
||||
|
||||
## Windows (Autohotkey)
|
||||
|
||||
This applies to the Windows version of Kinto and how to add additional support for Applications. The configuration file location is `~/.kinto/kinto.ahk` and after updating it you will want to right click on the tray icon and click on setting your keyboard type again and it will re-apply the latest changes.
|
||||
|
||||
Windows 10 has a couple of ways that you need to be aware of when trying to add a specific application, the typical method of how to add any exe program, but then there is also the newer UWP app format that some applications use which will require a similar but different method, both will be discussed.
|
||||
|
||||
### Defining Keymaps Per App by EXE Name
|
||||
You can use the following legend **but** realize that these remaps reference the Virtual keys in the diagrams mentioned near the beginning of this document, so **do not** confuse it with the physical key unless they happen to be the same key.
|
||||
|
||||
|Autohotkey Symbol|Virtual key|Description|
|
||||
|---|---|---|
|
||||
|^,Ctrl|Control|Primary modifier, 1st rock from the spacebar|
|
||||
|!,Alt|Alt|Secondary modifier, 2nd rock from the spacebar|
|
||||
|#,Win|Win/Super|Tertiary modifier, 3rd rock from the spacebar|
|
||||
|
||||
```
|
||||
...
|
||||
#IfWinActive ahk_exe sublime_text.exe
|
||||
#^Up::send !{O} ; Switch file
|
||||
#^f::send {F11} ; toggle_full_screen
|
||||
^!v::send {Ctrl Down}k{Ctrl Up}{Ctrl Down}v{Ctrl Up} ; paste_from_history
|
||||
...
|
||||
#If
|
||||
...
|
||||
```
|
||||
|
||||
With this being Autohotkey you can easily pull knowledge from the Autohotkey forums for just about any issue you may have as well.
|
||||
|
||||
### Defining Keymaps Per UWP App
|
||||
|
||||
```
|
||||
#If WinActive("- OneNote ahk_class ApplicationFrameWindow", "OneNote")
|
||||
...
|
||||
; Add your keymaps here
|
||||
...
|
||||
#If
|
||||
```
|
||||
|
||||
I don't have too many examples on this one, most developers seem to be shying away from UWP. Kinto currently supports "Fluent Terminal" which is a UWP app, but it is also being grouped with other Terminal apps for hotkey remapping. You may take a look at that, but you may also want to try creating a new Autohotkey file and use the Window Spy feature built into Autohotkey to help you discover the full name and class names of any application.
|
||||
|
||||
## Shortcut Creation (XKB)
|
||||
The older xkb shortcut method info can be read about in ticket [#125](https://github.com/rbreaves/kinto/issues/125).
|
||||
|
||||
## How to Upgrade Kinto
|
||||
|
||||
Simply bring down the latest then you can re-run the setup.py installer, it will stop the service and re-install Kinto.
|
||||
|
||||
Note: If you have made any custom changes to ~/.config/kinto then you will need to backup or rename those directories before running an update.
|
||||
|
||||
```
|
||||
git pull origin master
|
||||
./setup.py
|
||||
```
|
||||
|
||||
## How to Control Kinto
|
||||
|
||||
Under systemd this is how you control Kinto.
|
||||
This info is now superceded by the fact that linux has a full fledge GUI and system tray app that is very easy to use, but I will keep the command line options for those that want to know what they are.
|
||||
|
||||
Status
|
||||
```
|
||||
systemctl --user status keyswap
|
||||
sudo systemctl status xkeysnail
|
||||
```
|
||||
|
||||
Stop
|
||||
Stop (your keymap will return to normal)
|
||||
```
|
||||
systemctl --user stop keyswap
|
||||
sudo systemctl stop xkeysnail
|
||||
```
|
||||
|
||||
Start
|
||||
```
|
||||
systemctl --user start keyswap
|
||||
sudo systemctl start xkeysnail
|
||||
```
|
||||
|
||||
Restart
|
||||
```
|
||||
systemctl --user restart keyswap
|
||||
```
|
||||
|
||||
Enable
|
||||
```
|
||||
systemctl --user enable keyswap
|
||||
```
|
||||
|
||||
Disable
|
||||
```
|
||||
systemctl --user disable keyswap
|
||||
```
|
||||
|
||||
## Learning macOS style hotkeys on Linux
|
||||
|
||||
You can use websites like https://www.shortcutfoo.com in Google Chrome while using the terminal style keymap, but Firefox is not compatible due to detecting "cmd" as keycode 224. Chrome detects Win/Super/Cmd as keycode 91 on all OS's.
|
||||
|
||||
To make sure you are in the terminal style keymap you can just simply open the terminal and turn off the kinto service, and then switch back to Chrome.
|
||||
```
|
||||
systemctl --user stop keyswap && setxkbmap -option;setxkbmap -option altwin:swap_alt_win
|
||||
sudo systemctl restart xkeysnail
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Keyswap is not occurring, but it was working.
|
||||
### Installed successfully, but modifier keys are not properly remapped?
|
||||
|
||||
Now that Kinto is using a custom written C program I am not aware of any specific bugs or issues, but you can start here if you having difficulties and please report it if it is reproducible.
|
||||
Are you using a VM on macOS? If so you may need to disable automatic remapping of the Cmd key when using Vmware Fusion of Parallels.
|
||||
|
||||
Disable Parallels Re-mapping:
|
||||
1) Open Parallels and go to Preferences.
|
||||
2) Click Keyboard and disable the Virtual machine shortcuts.
|
||||
3) Close Preferences.
|
||||
|
||||
To disable keyboard mapping:
|
||||
1) From Fusion's menu bar, click VMware Fusion > Preferences...
|
||||
2) Click Keyboard & Mouse.
|
||||
3) Click the Key Mappings tab.
|
||||
4) Deselect Enable Key Mapping.
|
||||
|
||||
### Does not start when you log in or after you reboot?
|
||||
|
||||
You may need to manually set your DISPLAY in the systemd service file. Normally it pulls in the proper DISPLAY value but if it doesn't you can try this.
|
||||
|
||||
Another possibility is the SELinux could be enabled and needs to be set to permissive. (aka /etc/selinux/config)
|
||||
|
||||
To reset the display variable
|
||||
|
||||
1. Restart Kinto
|
||||
```
|
||||
systemctl --user restart keyswap
|
||||
echo $DISPLAY
|
||||
|
||||
# :0.0
|
||||
```
|
||||
2. Check the Status of Kinto and open a ticket with the output.
|
||||
|
||||
You can use the Kinto.sh app or system tray to edit your service file.
|
||||
|
||||
kinto.sh gui
|
||||
1. Edit -> Edit Service
|
||||
kinto tray
|
||||
1. Customize -> Edit Service
|
||||
|
||||
or you can use your terminal.
|
||||
|
||||
sudo nano /etc/systemd/system/xkeysnail.service
|
||||
```
|
||||
systemctl --user status keyswap
|
||||
...
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
Environment=DISPLAY=:0.0
|
||||
...
|
||||
```
|
||||
|
||||
If you continue to have issues then open a ticket and send me the info.
|
||||
|
||||
## Language Support
|
||||
I'd appreciate any help from people with non-US based keyboards, to help ensure that these keymaps and keyswap methods work in all or most languages.
|
||||
|
||||
If you would like to attempt adding additional custom keymaps for other languages then I strongly recommend reading Glen Whitney's post here.
|
||||
https://superuser.com/questions/385748/binding-superc-superv-to-copy-and-paste
|
||||
|
||||
## Related or Useful Resources
|
||||
|
||||
[Xkeysnail](https://github.com/mooz/xkeysnail) by mooz
|
||||
|
||||
Yet another keyboard remapping tool for X environment
|
||||
|
||||
[mac-precision-touchpad](https://github.com/imbushuo/mac-precision-touchpad) by imbushuo
|
||||
|
||||
Windows 10 touchpad to precision touchpad driver
|
||||
|
||||
[fusuma](https://github.com/iberianpig/fusuma) by iberianpig
|
||||
|
||||
Multitouch gestures with libinput driver on Linux
|
||||
|
||||
[Facetime HD Camera for Linux](https://github.com/patjak/bcwc_pcie) by patjak
|
||||
|
||||
Linux driver for Facetime HD on macbooks
|
||||
|
||||
[Fluent Terminal - Windows only](https://github.com/felixse/FluentTerminal) by felixse
|
||||
|
||||
|
||||
A Terminal Emulator based on UWP and web technologies.
|
||||
|
||||
[PowerToys - Windows only](https://github.com/microsoft/PowerToys) by microsoft
|
||||
|
||||
Windows system utilities to maximize productivity
|
||||
|
||||
[AutoHotKey - Windows only](https://github.com/AutoHotkey/AutoHotkey) by AutoHotkey
|
||||
|
||||
AutoHotkey is a powerful and easy to use scripting language for desktop automation on Windows.
|
||||
|
||||
[pykeymacs](https://github.com/zhanghai/pykeymacs) by zhanghai
|
||||
|
||||
Emacs style keyboard macros implemented in Python
|
||||
|
||||
[Dynamic Wallpapers](https://github.com/adi1090x/dynamic-wallpaper) by adi1090x
|
||||
|
||||
Simple bash script to set a Dynamic Wallpaper according to certain conditions.
|
||||
|
||||
[macify-linux](https://github.com/Jonchun/macify-linux) by JonChun
|
||||
|
||||
Automated setup scripts to transform Linux into macOS. (Uses Kinto for key remaps)
|
||||
|
||||
[ibus-typing-booster](https://github.com/mike-fabian/ibus-typing-booster) by mike-fabian
|
||||
|
||||
ibus-typing-booster is a completion input method for faster typing
|
||||
|
||||
[twemoji color font](https://github.com/eosrei/twemoji-color-font) by eosrei
|
||||
|
||||
Twitter Unicode 12 emoji color SVGinOT font for Linux/MacOS/Windows
|
||||
|
||||
[iTerm2 Color Schemes](https://github.com/mbadolato/iTerm2-Color-Schemes) by mbadolato
|
||||
|
||||
Over 225 terminal color schemes/themes for iTerm/iTerm2. Includes ports to Terminal, Konsole, PuTTY, Xresources, XRDB, Remmina, Termite, XFCE, Tilda, FreeBSD VT, Terminator, Kitty...
|
||||
|
||||
[espanso](https://github.com/federico-terzi/espanso) by federico-terzi
|
||||
|
||||
Cross-platform Text Expander written in Rust
|
||||
|
||||
[GalliumOS](https://github.com/GalliumOS/galliumos-distro) by GalliumOS
|
||||
|
||||
Docs, issues, and artwork sources for GalliumOS
|
||||
|
||||
[eOS-X](https://github.com/ipproductions/eOS-X) by ipproductions
|
||||
|
||||
Dark & Light Theme w/ OSX controls for Elementary OS
|
||||
|
||||
[Autorandr](https://github.com/phillipberndt/autorandr) by phillipberndt
|
||||
|
||||
Auto-detect the connected display hardware and load the appropriate X11 setup using xrandr
|
||||
|
||||
[Barrier](https://github.com/debauchee/barrier) by debauchee
|
||||
|
||||
Open-source KVM software
|
||||
|
||||
[Synergy Free Binaries](https://github.com/amankhoza/synergy-binaries) by amankhoza
|
||||
|
||||
The latest freely available Synergy binaries
|
||||
|
||||
[Synergy Official](https://symless.com/) by Symless
|
||||
|
||||
Latest Official Synergy
|
||||
|
||||
[Karabiner-Elements](https://github.com/pqrs-org/Karabiner-Elements) by pqrs-org
|
||||
|
||||
Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
|
||||
|
||||
[mbpfan](https://github.com/linux-on-mac/mbpfan) by linux-on-mac
|
||||
|
||||
A simple daemon to control fan speed on all MacBook/MacBook Pros (probably all Apple computers) for Linux Kernel 3 and newer
|
||||
|
||||
[vala-panel](https://github.com/rilian-la-te/vala-panel) by rilian-la-te
|
||||
|
||||
Vala rewrite of SimplePanel - GitHub mirror (Global Menu for XFCE)
|
||||
|
||||
## Contributing
|
||||
|
||||
I welcome any and all contributors who want to contribute something to this project.
|
||||
@@ -194,8 +451,34 @@ https://superuser.com/questions/385748/binding-superc-superv-to-copy-and-paste
|
||||
|
||||
## More information about Kinto
|
||||
|
||||
https://medium.com/@benreaves/kinto-v1-0-released-2018e6401d2e
|
||||
https://medium.com/@benreaves/kinto-a-mac-inspired-keyboard-mapping-for-linux-58f731817c0
|
||||
|
||||
## License
|
||||
|
||||
GPL v2
|
||||
|
||||
## Credits and Contributions
|
||||
|
||||
I would just like to thank a few people here directly that have helped me tremendously with completing this project and without their support, direct, indirect or otherwise I would have had difficulty completing this undertaking. I will list these things off in chronological order mostly.
|
||||
|
||||
First off I'd like to thank the Stackoverflow and Stackexchange community. I have probably rubbed some mods the wrong way over there, but the people from the community in general are extremely helpful and gracious and without their contributions would have made this much more difficult. The person I'd like to thank most though from over there is Glen Whitney. Without his detailed explaining of how to rebind keys in xkb this would not have come together at all, as every other remapping solution were non-starters as complexity increases. *Kinto today no longer uses xkb, but Glen Whitney did provide the basis of a workable method that helped me pursue this method and think it was a worthwhile project to pursue, so for that I thank him.*
|
||||
|
||||
Secondarily I'd like to thank Christian Eriksson*, as he provided information that kept me up at night.. literally. Even after I implemented a similar bash script to one he had suggested I knew that fully implementing a c/c++ solution was where Kinto needed to head to and his explaination was better than I remember it being now that I have gone back to read it again. He also never provided a full implementation of a c/c++ solution - he did hit on the pain points pretty well of what one would need to do and watch out for. I am not sure where I got the first example code of implementing a c based solution, but he definitely went over it well.
|
||||
|
||||
|
||||
Kui and his gist file** was really the c based solution that I found had the fewest issues to resolve to making it a reliable solution. It didn't account for all failures very well, aka BadWindow issues, but it made for a great foundation on which Kintox11 is built. I cannot thank him enough for putting it out there for others to work with.
|
||||
|
||||
Lastly these four people were also very helpful to me as well. @probonopd for being one of the first people to install and use Kinto and gave me the initial feedback to include wordwise support! He also has really great articles*** posted on HackerNews & Medium about UI/UX design. Another person I'd like to thank is @owzim, his feedback allowed me to rapidly iterate and fix several bugs to support additional platforms better. The last two are members of the #ubuntu channel in IRC on freenode, tarzeau ( @alexmyczko ) and sarnold. Alex contributing a proper Makefile, so the project can be packaged properly, and sarnold help me find that IBus could resolve an issue I was having with needing to detect the caret status.
|
||||
|
||||
**Updated 6/13/2020**
|
||||
|
||||
I would also like to thank Jonathan Chun for his patience in helping me work through a very difficult problem related to Alt-Tab switching, which led to the current xkeysnail iteration of Kinto for Linux that far exceeds the original xkb implementation. There are also several others that have created issue tickets that have contributed greatly.
|
||||
|
||||
If I left anyone out then I apologize, that was not intentional. I am happy to say that this project is at a state of completion. Bug fixes will primarily be the only activity happening going forward and possibly a rewrite for Wayland at some point. Contributions as mentioned above are welcomed, and will be merged into master if they help with the goal of making typing on linux more like a mac.
|
||||
|
||||
*https://askubuntu.com/questions/1010276/can-i-act-on-the-event-that-a-window-opens-without-polling
|
||||
|
||||
**https://gist.github.com/kui/2622504
|
||||
|
||||
***https://medium.com/@probonopd/make-it-simple-linux-desktop-usability-part-1-5fa0fb369b42
|
||||
|
BIN
assets/kinto-black-invert.ico
Normal file
After Width: | Height: | Size: 99 KiB |
BIN
assets/kinto-black.ico
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
assets/kinto-color-black-invert.ico
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
assets/kinto-color-black.ico
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
assets/kinto-color-invert-border.ico
Normal file
After Width: | Height: | Size: 104 KiB |
BIN
assets/kinto-color-invert.ico
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
assets/kinto-color-white-invert.ico
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
assets/kinto-color.ico
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
assets/kinto-white-invert.ico
Normal file
After Width: | Height: | Size: 101 KiB |
BIN
assets/kinto-white.ico
Normal file
After Width: | Height: | Size: 102 KiB |
@@ -1,86 +0,0 @@
|
||||
{"defaultapps":[{
|
||||
"name":"term",
|
||||
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm" ]
|
||||
}],
|
||||
"defaulttypes":["windows","mac","chromebook"],
|
||||
"defaults":[{
|
||||
"id": 1,
|
||||
"name":"Windows",
|
||||
"type":"windows",
|
||||
"active": false,
|
||||
"description":"Standard Windows 104 Keyboards",
|
||||
"gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY",
|
||||
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
|
||||
"xkb_symbols_gui":"+altwin(ctrl_alt_win)+mac_gui(mac_levelssym)",
|
||||
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term(mac_levelssym)",
|
||||
"xkb_types_gui":"+mac_gui(addmac_levels)",
|
||||
"xkb_types_term":""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name":"Mac - hid driver",
|
||||
"type":"mac",
|
||||
"active": false,
|
||||
"description":"Standard Mac Keyboards with Apple driver",
|
||||
"gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY",
|
||||
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
|
||||
"xkb_symbols_gui":"+altwin(ctrl_alt_win)+mac_gui(mac_levelssym)",
|
||||
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term(mac_levelssym)",
|
||||
"xkb_types_gui":"+mac_gui(addmac_levels)",
|
||||
"xkb_types_term":"",
|
||||
"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",
|
||||
"type":"mac",
|
||||
"active": true,
|
||||
"description":"Standard Mac Keyboards",
|
||||
"gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY",
|
||||
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
|
||||
"xkb_symbols_gui":"+ctrl(swap_lwin_lctl)+ctrl(swap_rwin_rctl)+mac_gui(mac_levelssym)",
|
||||
"xkb_symbols_term":"+altwin(alt_super_win)+mac_term(mac_levelssym)",
|
||||
"xkb_types_gui":"+mac_gui(addmac_levels)",
|
||||
"xkb_types_term":""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"name":"Chromebook",
|
||||
"type":"chromebook",
|
||||
"active": false,
|
||||
"description":"Standard Chromebook Keyboards",
|
||||
"gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY",
|
||||
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
|
||||
"xkb_symbols_gui":"+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)",
|
||||
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term_chromebook(mac_levelssym)",
|
||||
"xkb_types_gui":"+mac_gui(addmac_levels)",
|
||||
"xkb_types_term":""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"name":"Chromebook - Windows",
|
||||
"type":"chromebook",
|
||||
"active": false,
|
||||
"description":"Chromebook with Windows 104 Keyboard",
|
||||
"gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY; setxkbmap -device $usbid -option altwin:ctrl_alt_win",
|
||||
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
|
||||
"fallbackgui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY",
|
||||
"xkb_symbols_gui":"+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)",
|
||||
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term_chromebook(mac_levelssym)",
|
||||
"xkb_types_gui":"+mac_gui(addmac_levels)",
|
||||
"xkb_types_term":""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"name":"Chromebook - 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.chromebook.gui $DISPLAY",
|
||||
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
|
||||
"xkb_symbols_gui":"+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)",
|
||||
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term_chromebook(mac_levelssym)",
|
||||
"xkb_types_gui":"+mac_gui(addmac_levels)",
|
||||
"xkb_types_term":""
|
||||
}]
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
swapcmd="\/bin\/bash\ \/home\/`whoami`\/.config\/kinto\/xactive.sh"
|
||||
mkdir -p ~/.config/systemd/user
|
||||
mkdir -p ~/.config/autostart
|
||||
cp ./system-config/keyswap.service ~/.config/systemd/user/keyswap.service
|
||||
cp ./system-config/keyswap.sh ~/.config/autostart/keyswap.sh
|
||||
cp ./kintox11/binary/kintox11 ~/.config/kinto/kintox11
|
||||
cp ./system-config/xactive.sh ~/.config/kinto/xactive.sh
|
||||
sed -i "s/{username}/`whoami`/g" ~/.config/systemd/user/keyswap.service
|
||||
sed -i "s/ExecStart=/ExecStart=${swapcmd}/g" ~/.config/systemd/user/keyswap.service
|
||||
systemctl --user enable keyswap
|
||||
systemctl --user start keyswap
|
BIN
kinto-demo.gif
Before Width: | Height: | Size: 116 KiB |
86
kinto_old/defaults.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{"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)"
|
||||
}]
|
||||
}
|
26
kinto_old/keyswap_service.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
BIN
kinto_old/kintox11/binary/kintox11
Normal file
5
kinto_old/kintox11/src/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
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
|
694
kinto_old/kintox11/src/kintox11.c
Normal file
@@ -0,0 +1,694 @@
|
||||
// -*- 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);
|
||||
}
|
||||
}
|
631
kinto_old/setup.py
Normal file
@@ -0,0 +1,631 @@
|
||||
#!/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")
|
7
kinto_old/system-config/.chrome-nw
Normal file
@@ -0,0 +1,7 @@
|
||||
"xdotool key --delay 0 --clearmodifiers Alt+Left"
|
||||
Control + Left + Release
|
||||
#Home + release
|
||||
|
||||
"xdotool key --delay 0 --clearmodifiers Alt+Right"
|
||||
Control + Right + Release
|
||||
#End + release
|
5
kinto_old/system-config/.chrome-ww
Normal file
@@ -0,0 +1,5 @@
|
||||
"xdotool key --delay 0 --clearmodifiers Home"
|
||||
Control + Left + Release
|
||||
|
||||
"xdotool key --delay 0 --clearmodifiers End"
|
||||
Control + Right + Release
|
7
kinto_old/system-config/.firefox-nw
Normal file
@@ -0,0 +1,7 @@
|
||||
#"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
kinto_old/system-config/budgie-daemon_10.5.1.md5
Normal file
@@ -0,0 +1 @@
|
||||
3cd35e15350ca7dac0c3cbfce1c661f7 /usr/bin/budgie-daemon
|
1
kinto_old/system-config/budgie-desktop_10.5.1.md5
Normal file
@@ -0,0 +1 @@
|
||||
8660c2f8e0a9d3cff896254f6c0f9159 /usr/bin/budgie-desktop
|
10
kinto_old/system-config/caret_status.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/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
|
78
kinto_old/system-config/caret_status_xkey.sh
Normal file
@@ -0,0 +1,78 @@
|
||||
#!/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
|
10
kinto_old/system-config/cleanup.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/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
|
3630
kinto_old/system-config/keyboard.ids
Normal file
16
kinto_old/system-config/keyswap.service
Normal file
@@ -0,0 +1,16 @@
|
||||
[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
|
11
kinto_old/system-config/keyswap.timer
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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
|
0
system-config/keyswap_toggle.sh → kinto_old/system-config/keyswap_toggle.sh
Executable file → Normal file
8
kinto_old/system-config/kinto.desktop
Normal file
@@ -0,0 +1,8 @@
|
||||
[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
|
10
kinto_old/system-config/xactive.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
# No arguments
|
||||
./kintox11
|
||||
else
|
||||
./caret_status.sh &
|
||||
./kintox11
|
||||
fi
|
@@ -1,15 +1,43 @@
|
||||
{"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" ]
|
||||
}],
|
||||
"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":[{
|
||||
@@ -45,4 +73,4 @@
|
||||
"run_term":"",
|
||||
"run_gui":""
|
||||
}]
|
||||
}
|
||||
}
|
508
kinto_old/xkeysnail_service.sh
Executable file
@@ -0,0 +1,508 @@
|
||||
#!/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
|
@@ -1,340 +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 -o kintox11
|
||||
//
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
#include <ctype.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`
|
||||
|
||||
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(){
|
||||
Display* d = XOpenDisplay(NULL);
|
||||
if(d == NULL){
|
||||
printf("fail to open X server display...\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 0;
|
||||
}
|
||||
|
||||
Window get_focus_window(Display* d){
|
||||
Window w;
|
||||
int revert_to;
|
||||
XGetInputFocus(d, &w, &revert_to); // see man
|
||||
if(xerror){
|
||||
printf("Error getting focused window\n");
|
||||
exit(1);
|
||||
}else if(w == None){
|
||||
printf("no focus window\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
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(void){
|
||||
|
||||
FILE *fp;
|
||||
char buffer[10240];
|
||||
struct json_object *parsed_json, *config, *config_obj,
|
||||
*config_obj_name, *config_obj_run, *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;
|
||||
|
||||
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];
|
||||
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");
|
||||
name_array[i] = json_object_get_string(config_obj_name);
|
||||
run_array[i] = json_object_get_string(config_obj_run);
|
||||
// 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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
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]);
|
||||
}
|
||||
|
||||
Display* d;
|
||||
Window w;
|
||||
|
||||
// for XmbTextPropertyToTextList
|
||||
setlocale(LC_ALL, ""); // see man locale
|
||||
|
||||
d = open_display();
|
||||
XSelectInput(d, DefaultRootWindow(d), SubstructureNotifyMask);
|
||||
XSetErrorHandler(handle_error);
|
||||
|
||||
char * prior_app;
|
||||
prior_app = malloc(sizeof(char)*100);
|
||||
strcpy(prior_app,"none");
|
||||
|
||||
int remap_bool = 2;
|
||||
|
||||
// get active window
|
||||
w = get_focus_window(d);
|
||||
|
||||
int breakouter;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
breakouter = 0;
|
||||
// printf("%s\n","1");
|
||||
// printf("%s\n",str_window_class(d, w,prior_app));
|
||||
if(strcmp(str_window_class(d, w,prior_app),prior_app)){
|
||||
// printf("%s\n","2");
|
||||
for(i = 0; i < arraylen; ++i){
|
||||
if(breakouter == 0){
|
||||
if(strcmp(name_array[i],"gui")){
|
||||
// printf("%s\n","3");
|
||||
for(n = 0; n < appnames_max; ++n){
|
||||
if (appnames_array[i][n] != NULL){
|
||||
// printf("%s\n",appnames_array[i][n]);
|
||||
// If statement for triggering terminal config
|
||||
if((strcicmp(appnames_array[i][n], str_window_class(d, w,prior_app)) == 0 && (remap_bool == 1 || remap_bool == 2))) {
|
||||
// printf("1st if %s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
|
||||
printf("%s\n",name_array[i]);
|
||||
system(run_array[i]);
|
||||
for(r = 0; r < config_de_max; r++){
|
||||
if(config_de_array[i][r] != -1){
|
||||
int de_id_idx = in_int(de_id_array, de_len, config_de_array[i][r]);
|
||||
// printf("Running de command: %s\n",de_run_array[de_id_idx]);
|
||||
system(de_runterm_array[de_id_idx]);
|
||||
}
|
||||
}
|
||||
remap_bool = 0;
|
||||
fflush(stdout);
|
||||
breakouter = 1;
|
||||
break;
|
||||
} // Else command for ignoring similar app category based on config
|
||||
else if((strcicmp(appnames_array[i][n], str_window_class(d, w,prior_app)) == 0 && remap_bool == 0)){
|
||||
// printf("2nd elseif %s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
|
||||
// printf("%s\n","4");
|
||||
breakouter = 1;
|
||||
break;
|
||||
} // Else command for triggering gui config
|
||||
else if ((i == arraylen-1 || appnames_array[i][n+1] == NULL) && (remap_bool == 0 || remap_bool == 2)){
|
||||
char *find = "gui";
|
||||
int gui_idx = in(name_array, arraylen, find);
|
||||
|
||||
if(gui_idx >= 0) {
|
||||
printf("%s\n",name_array[gui_idx]);
|
||||
system(run_array[gui_idx]);
|
||||
}
|
||||
for(r = 0; r < config_de_max; r++){
|
||||
if(config_de_array[gui_idx][r] != -1){
|
||||
int de_id_idx = in_int(de_id_array, de_len, config_de_array[gui_idx][r]);
|
||||
// printf("Running de command: %s\n",de_run_array[de_id_idx]);
|
||||
system(de_rungui_array[de_id_idx]);
|
||||
}
|
||||
}
|
||||
// printf("3rd elseif %s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
|
||||
remap_bool = 1;
|
||||
fflush(stdout);
|
||||
breakouter = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// printf("%s\n","5");
|
||||
strcpy(prior_app,str_window_class(d, w, prior_app));
|
||||
|
||||
XEvent e;
|
||||
XNextEvent(d, &e);
|
||||
w = get_focus_window(d);
|
||||
|
||||
}
|
||||
}
|
432
references/builtin-keyboard.json
Normal file
@@ -0,0 +1,432 @@
|
||||
{"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"}
|
115
references/kintopy/kinto.py
Normal file
@@ -0,0 +1,115 @@
|
||||
#!/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())
|
75
references/shortcuts
Normal file
@@ -0,0 +1,75 @@
|
||||
# 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 &
|
1411
references/symbol_names.txt
Normal file
244
setup.py
@@ -1,10 +1,91 @@
|
||||
#!/usr/bin/env python3
|
||||
import json, time, os
|
||||
import json, time, os, sys, subprocess, shlex, platform,argparse
|
||||
from shutil import copyfile
|
||||
from subprocess import PIPE, Popen
|
||||
from prekinto import *
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument('-r', dest='uninstall', action='store_true', help="uninstall kinto")
|
||||
parser.add_argument('--remove', dest='uninstall', action='store_true', help="uninstall kinto")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
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(
|
||||
@@ -15,151 +96,44 @@ def cmdline(command):
|
||||
)
|
||||
return process.communicate()[0]
|
||||
|
||||
try:
|
||||
f = open("defaults.json")
|
||||
except IOError:
|
||||
print("defaults.json file is missing. Will exit.\n")
|
||||
exit()
|
||||
f.close()
|
||||
if platform.system() == 'Windows':
|
||||
print("\nYou are detected as running Windows.")
|
||||
windows_setup()
|
||||
sys.exit()
|
||||
|
||||
try:
|
||||
f = open("user_config.json")
|
||||
except IOError:
|
||||
print("user_config.json file is missing. Will exit.\n")
|
||||
exit()
|
||||
f.close()
|
||||
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 = ""
|
||||
|
||||
if os.path.isdir(homedir + "/.config/kinto") == False:
|
||||
os.mkdir(homedir + "/.config/kinto")
|
||||
time.sleep(0.5)
|
||||
|
||||
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()
|
||||
|
||||
with open('defaults.json') as json_file:
|
||||
data = json.load(json_file)
|
||||
cmdline("git fetch")
|
||||
|
||||
color_arr = [bcolors.CBLUE,bcolors.CRED,bcolors.CGREEN]
|
||||
color_arr = [bcolors.CBEIGE,bcolors.CRED2,bcolors.CGREEN,bcolors.CYELLOW ]
|
||||
|
||||
print("\nKinto - Type in Linux like it's a Mac.\n")
|
||||
kintover = cmdline('echo "$(git describe --tag --abbrev=0 | head -n 1)" "build" "$(git rev-parse --short HEAD)"')
|
||||
|
||||
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("\nKinto " + kintover + "Type in Linux like it's a Mac.\n")
|
||||
|
||||
default = 0
|
||||
while not int(default) in range(1,len(data['defaulttypes'])+1):
|
||||
default = int(input(bcolors.CYELLOW + "\nPlease enter your keyboard type (1 - " + str(len(data['defaulttypes'])) + ") : " + bcolors.ENDC))
|
||||
print("")
|
||||
if args.uninstall:
|
||||
subprocess.check_call(shlex.split("./xkeysnail_service.sh uninstall"))
|
||||
exit()
|
||||
|
||||
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.CYELLOW + 'Description: ' + k['description'] + bcolors.ENDC)
|
||||
|
||||
print("")
|
||||
defaultkb = 0
|
||||
while not int(defaultkb) in range(1,len(keyboardconfigs)+1):
|
||||
defaultkb = int(input(bcolors.CYELLOW + "Please enter your keyboard config (1 - " + str(len(keyboardconfigs)) + ") : " + bcolors.ENDC))
|
||||
print("")
|
||||
|
||||
if 'hack' in keyboardconfigs[defaultkb-1]:
|
||||
print(bcolors.CYELLOW + "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.CYELLOW + "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 -rf ./.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.term')
|
||||
time.sleep(0.5)
|
||||
|
||||
symbols_gui_line = cmdline("cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_symbols' | cut -f1 -d:").strip()
|
||||
types_gui_line = cmdline("cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_types' | cut -f1 -d:").strip()
|
||||
symbols_term_line = cmdline("cat ~/.xkb/keymap/kbd.mac.term | grep -n 'xkb_symbols' | cut -f1 -d:").strip()
|
||||
|
||||
cmdline('sed -i '' -e "' + symbols_gui_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_gui'] + '\\"/2" ~/.xkb/keymap/kbd.mac.gui')
|
||||
cmdline('sed -i '' -e "' + types_gui_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_types_gui'] + '\\"/2" ~/.xkb/keymap/kbd.mac.gui')
|
||||
cmdline('sed -i '' -e "' + symbols_term_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_term'] + '\\"/2" ~/.xkb/keymap/kbd.mac.term')
|
||||
subprocess.check_call(shlex.split("./xkeysnail_service.sh"))
|
||||
|
||||
|
||||
user_file = homedir + '/.config/kinto/user_config.json'
|
||||
with open(user_file, 'r') as f:
|
||||
user_config = json.load(f)
|
||||
|
||||
onetime = yn_choice("One 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.CYELLOW + 'Description: ' + k['description'] + bcolors.ENDC)
|
||||
print(bcolors.CYELLOW + 'run: ' + k['run'].replace(";", "\n") + bcolors.ENDC + '\n')
|
||||
|
||||
print(bcolors.CYELLOW + "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'] = defaultinit
|
||||
|
||||
print("\nDynamic shortcut tweaks\n")
|
||||
|
||||
intents = [obj for obj in user_config['de'] if(obj['intent'] == "gui_term")]
|
||||
|
||||
for index, k in enumerate(intents):
|
||||
print(color_arr[default-1] + bcolors.BOLD + str(index+1) + '. ' + k['name'] + bcolors.ENDC)
|
||||
print(bcolors.CYELLOW + 'Description: ' + k['description'] + bcolors.ENDC)
|
||||
print(bcolors.CYELLOW + 'run in gui mode: ' + k['run_gui'].replace(";", "\n") + bcolors.ENDC)
|
||||
print(bcolors.CYELLOW + 'run in terminal mode: ' + k['run_term'].replace(";", "\n") + bcolors.ENDC + '\n')
|
||||
|
||||
print(bcolors.CYELLOW + "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()]
|
||||
if len(defaultde) != 0:
|
||||
# gui
|
||||
user_config['config'][0]['de'] = defaultde
|
||||
# term
|
||||
user_config['config'][1]['de'] = defaultde
|
||||
|
||||
for d in defaultde:
|
||||
user_config['de'][d-1]['active'] = True
|
||||
|
||||
user_config['config'][0]['run'] = keyboardconfigs[defaultkb-1]['gui']
|
||||
user_config['config'][1]['run'] = keyboardconfigs[defaultkb-1]['term']
|
||||
|
||||
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")
|
BIN
splash.png
Before Width: | Height: | Size: 40 KiB |
182
system-config/dename.sh
Executable file
@@ -0,0 +1,182 @@
|
||||
#!/bin/bash
|
||||
|
||||
function detect_budgie()
|
||||
{
|
||||
ps -e | grep -E '^.* budgie-wm' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`dpkg-query -l | grep budgie-core | awk '{print $3}'`
|
||||
DESKTOP="budgie"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_gnome()
|
||||
{
|
||||
ps -e | grep -E '^.* gnome-session' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`gnome-session --version | awk '{print $2}'`
|
||||
DESKTOP="gnome"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_kde4()
|
||||
{
|
||||
ps -e | grep -E '^.* kded4$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
else
|
||||
VERSION=`kded4 --version | grep -m 1 'KDE' | awk -F ':' '{print $2}' | awk '{print $1}'`
|
||||
DESKTOP="KDE"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function detect_kde()
|
||||
{
|
||||
ps -e | grep -E '^.* kded5$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
else
|
||||
VERSION=`kded5 --version | grep -m 1 'KDE' | awk -F ':' '{print $2}' | awk '{print $1}'`
|
||||
DESKTOP="KDE"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function detect_unity()
|
||||
{
|
||||
ps -e | grep -E 'unity-panel' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`unity --version | awk '{print $2}'`
|
||||
DESKTOP="unity"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_xfce()
|
||||
{
|
||||
ps -e | grep -E '^.* xfce4-session$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`xfce4-session --version | grep xfce4-session | awk '{print $2}'`
|
||||
DESKTOP="xfce"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_cinnamon()
|
||||
{
|
||||
ps -e | grep -E '^.* cinnamon$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`cinnamon --version | awk '{print $2}'`
|
||||
DESKTOP="cinnamon"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_mate()
|
||||
{
|
||||
ps -e | grep -E '^.* mate-panel$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`mate-about --version | awk '{print $4}'`
|
||||
DESKTOP="mate"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_lxde()
|
||||
{
|
||||
ps -e | grep -E '^.* lxsession$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# We can detect LXDE version only thru package manager
|
||||
which apt-cache > /dev/null 2> /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
which yum > /dev/null 2> /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
VERSION='unknown'
|
||||
else
|
||||
# For Fedora
|
||||
VERSION=`yum list lxde-common | grep lxde-common | awk '{print $2}' | awk -F '-' '{print $1}'`
|
||||
fi
|
||||
else
|
||||
# For Lubuntu and Knoppix
|
||||
VERSION=`apt-cache show lxde-common /| grep 'Version:' | awk '{print $2}' | awk -F '-' '{print $1}'`
|
||||
fi
|
||||
DESKTOP="lxde"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_sugar()
|
||||
{
|
||||
if [ "$DESKTOP_SESSION" == "sugar" ];
|
||||
then
|
||||
VERSION=`python -c "from jarabe import config; print config.version"`
|
||||
DESKTOP="sugar"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
DESKTOP="unknown"
|
||||
if detect_unity;
|
||||
then
|
||||
if detect_kde;
|
||||
then
|
||||
if detect_kde4;
|
||||
then
|
||||
if detect_budgie;
|
||||
then
|
||||
if detect_gnome;
|
||||
then
|
||||
if detect_xfce;
|
||||
then
|
||||
if detect_cinnamon;
|
||||
then
|
||||
if detect_mate;
|
||||
then
|
||||
if detect_lxde;
|
||||
then
|
||||
detect_sugar
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ "$1" == '-v' ];
|
||||
then
|
||||
echo $VERSION
|
||||
else
|
||||
if [ "$1" == '-n' ];
|
||||
then
|
||||
echo $DESKTOP
|
||||
else
|
||||
echo $DESKTOP $VERSION
|
||||
fi
|
||||
fi
|
@@ -1,15 +0,0 @@
|
||||
[Unit]
|
||||
Description=keyswap for Terminal and GUI
|
||||
PartOf=graphical-session.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
#User={username}
|
||||
#Group={username}
|
||||
Environment=DISPLAY=:0
|
||||
Restart=always
|
||||
WorkingDirectory=/home/{username}/.config/kinto
|
||||
ExecStart=
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
@@ -1,3 +0,0 @@
|
||||
#/bin/bash
|
||||
|
||||
systemctl --user start keyswap
|
21
system-config/unipkg.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
if pkgmgr="$( which apt-get )" 2> /dev/null; then
|
||||
echo "Debian"
|
||||
$pkgmgr update
|
||||
$pkgmgr --yes --force-yes install $1
|
||||
elif pkgmgr="$( which dnf )" 2> /dev/null; then
|
||||
echo "dnf"
|
||||
$pkgmgr check-update; $pkgmgr install -y $1
|
||||
elif pkgmgr="$( which pacman )" 2> /dev/null; then
|
||||
echo "Arch-based"
|
||||
$pkgmgr -Syy;yes | $pkgmgr -S $1
|
||||
else
|
||||
echo "Package manager not found, please install $1" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ 1 -ne $# ]]; then
|
||||
echo "Syntax: $0 PACKAGE"
|
||||
exit 1
|
||||
fi
|
||||
exit $?
|
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
./kintox11
|
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
systemctl --user stop keyswap
|
||||
systemctl --user disable keyswap
|
||||
rm -rf ~/.config/autostart/keyswap.sh
|
||||
rm -rf ~/.config/kinto
|
||||
rm -rf ~/.xkb
|
||||
|
||||
sed -i '/xkb/d' ~/.Xsession
|
14
windows/NoShell.vbs
Normal file
@@ -0,0 +1,14 @@
|
||||
If WScript.Arguments.Count >= 1 Then
|
||||
ReDim arr(WScript.Arguments.Count-1)
|
||||
prog = WScript.Arguments(0)
|
||||
For i = 1 To WScript.Arguments.Count-1
|
||||
Arg = WScript.Arguments(i)
|
||||
If InStr(Arg, " ") > 1 Then Arg = """" & Arg & """"
|
||||
arr(i) = Arg
|
||||
Next
|
||||
|
||||
RunCmd = Join(arr)
|
||||
' CreateObject("Wscript.Shell").Run RunCmd, 0, True
|
||||
Set oShell = CreateObject("Shell.Application")
|
||||
oShell.ShellExecute prog, RunCmd, , "runas", 0
|
||||
End If
|
22
windows/autohotkey.ps1
Normal file
@@ -0,0 +1,22 @@
|
||||
if(-not(Get-Command "choco" -errorAction SilentlyContinue)){
|
||||
Write-Output "Seems Chocolatey is not installed, installing now"
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
refreshenv
|
||||
}
|
||||
else{
|
||||
Write-Output "Chocolatey is already installed"
|
||||
}
|
||||
|
||||
if(-not(test-path "C:\Program Files\AutoHotkey\AutoHotkey.exe")){
|
||||
choco install autohotkey.install
|
||||
}
|
||||
else{
|
||||
Write-Output "Autohotkey is already installed"
|
||||
}
|
||||
if(-not(test-path "C:\Strawberry\")){
|
||||
choco install strawberryperl
|
||||
refreshenv
|
||||
}
|
||||
else{
|
||||
Write-Output "Perl is already installed"
|
||||
}
|
38
windows/detectUSB.ahk
Normal file
@@ -0,0 +1,38 @@
|
||||
#SingleInstance, force
|
||||
#NoTrayIcon
|
||||
OnMessage(0x219, "notify_change")
|
||||
Return
|
||||
|
||||
lastkb = ""
|
||||
|
||||
DllCall("AllocConsole")
|
||||
WinHide % "ahk_id " DllCall("GetConsoleWindow", "ptr")
|
||||
|
||||
notify_change(wParam, lParam, msg, hwnd)
|
||||
{
|
||||
global lastkb
|
||||
DetectHiddenWindows On
|
||||
Run %ComSpec%,, Hide, pid
|
||||
WinWait ahk_pid %pid%
|
||||
DllCall("AttachConsole", "UInt", pid)
|
||||
WshShell := ComObjCreate("Wscript.Shell")
|
||||
exec := WshShell.Exec("cscript /nologo ""%userprofile%\.kinto\usb.vbs""")
|
||||
kbtype := exec.StdOut.ReadAll()
|
||||
DllCall("FreeConsole")
|
||||
Process Close, %pid%
|
||||
if lastkb != %kbtype%
|
||||
{
|
||||
|
||||
if InStr(kbtype, "Apple")
|
||||
{
|
||||
; MsgBox, Apple
|
||||
Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" mac, "%A_ScriptDir%"
|
||||
}
|
||||
else{
|
||||
; MsgBox, Windows
|
||||
Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" win, "%A_ScriptDir%"
|
||||
}
|
||||
; MsgBox % kbtype
|
||||
}
|
||||
lastkb = %kbtype%
|
||||
}
|
7
windows/kinto-start.vbs
Normal file
@@ -0,0 +1,7 @@
|
||||
Set oShell = CreateObject("Shell.Application")
|
||||
Set wShell = WScript.CreateObject("WScript.Shell")
|
||||
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
path = wShell.ExpandEnvironmentStrings("""%userprofile%")
|
||||
strFolder = fso.BuildPath( path, "\.kinto\kinto.ahk"" {kbtype}")
|
||||
oShell.ShellExecute "C:\Program Files\AutoHotkey\AutoHotkey.exe", strFolder, , "runas", 0
|
635
windows/kinto.ahk
Normal file
@@ -0,0 +1,635 @@
|
||||
#SingleInstance force
|
||||
#NoEnv
|
||||
#Persistent
|
||||
|
||||
; DetectHiddenWindows, On ; Autodetect
|
||||
; Run, %A_ScriptDir%\detectUSB.ahk ; Autodetect
|
||||
|
||||
; Enable Left clicks on Kinto Icon
|
||||
; https://www.autohotkey.com/boards/viewtopic.php?t=9501
|
||||
OnMessage(0x404, "AHK_NOTIFYICON")
|
||||
|
||||
AHK_NOTIFYICON(wParam, lParam)
|
||||
{
|
||||
if (lParam = 0x202) { ; user left-clicked tray icon
|
||||
;ADD ANY SUBROUTINE OR FUNCTION HERE
|
||||
Menu, Tray, Show
|
||||
return
|
||||
}
|
||||
else if (lParam = 0x203) { ; user double left-clicked tray icon
|
||||
;ADD ANY SUBROUTINE OR FUNCTION HERE
|
||||
Menu, Tray, Show
|
||||
return
|
||||
}
|
||||
}
|
||||
; End Enable Left clicks
|
||||
|
||||
; I_Icon = %A_ScriptDir%\assets\kinto-white-invert.ico ; MacModifiers
|
||||
; IfExist, %I_Icon% ; MacModifiers
|
||||
; Menu, Tray, Icon, %I_Icon%,, 1 ; MacModifiers
|
||||
; Menu, Tray, Tip, Mac - Kinto ; MacModifiers
|
||||
|
||||
; I_Icon = %A_ScriptDir%\assets\kinto-white-invert.ico ; WinModifiers/CB/IBM
|
||||
; IfExist, %I_Icon% ; WinModifiers/CB/IBM
|
||||
; Menu, Tray, Icon, %I_Icon%,, 1 ; WinModifiers/CB/IBM
|
||||
; Menu, Tray, Tip, Windows - Kinto ; WinModifiers
|
||||
; Menu, Tray, Tip, Chromebook - Kinto ; Chromebook
|
||||
; Menu, Tray, Tip, IBM - Kinto ; IBM
|
||||
|
||||
Menu, Keyboards, Add, Windows, winkb
|
||||
Menu, Keyboards, Add, Apple, mackb
|
||||
Menu, Keyboards, Add, Chromebook, chromekb
|
||||
Menu, Keyboards, Add, IBM (No Super/Win key), ibmkb
|
||||
|
||||
paramkb=%1%
|
||||
|
||||
if paramkb = mac
|
||||
checkKB = Apple
|
||||
if paramkb = win
|
||||
checkKB = Windows
|
||||
if paramkb = chrome
|
||||
checkKB = Chromebook
|
||||
if paramkb = ibm
|
||||
checkKB = IBM (No Super/Win key)
|
||||
|
||||
menu, Keyboards, check, %checkKB%
|
||||
|
||||
; Set Tray menu
|
||||
; Menu, Tray, Standard
|
||||
Menu, Tray, NoStandard ; to remove default menu
|
||||
Menu, Tray, Add, Keyboard Types, :Keyboards
|
||||
Menu, Tray, Add, Autodetect Keyboards, autodetect
|
||||
; Menu, Tray, check, Autodetect Keyboards ; Autodetect
|
||||
; Menu, Tray, disable, Autodetect Keyboards ; CB/IBM
|
||||
Menu, Tray, Add, Suspend Kinto, tray_suspend
|
||||
; Menu, Tray, Add, Returns to Desktop, min
|
||||
Menu, Tray, Add
|
||||
Menu, Tray, Add, Close, Exit
|
||||
Menu, Tray, Click, 1
|
||||
|
||||
winkb(){
|
||||
Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" win, "%A_ScriptDir%"
|
||||
}
|
||||
|
||||
mackb(){
|
||||
Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" mac, "%A_ScriptDir%"
|
||||
}
|
||||
|
||||
chromekb(){
|
||||
Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" chrome, "%A_ScriptDir%"
|
||||
}
|
||||
|
||||
ibmkb(){
|
||||
Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" ibm, "%A_ScriptDir%"
|
||||
}
|
||||
|
||||
autodetect(){
|
||||
IfWinExist, detectUSB.ahk
|
||||
WinClose
|
||||
Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" auto, "%A_ScriptDir%"
|
||||
}
|
||||
|
||||
min(){
|
||||
; Refocus last active Window
|
||||
Send {LAlt down}{tab}{LAlt up}
|
||||
}
|
||||
|
||||
tray_suspend(){
|
||||
suspend toggle
|
||||
if (a_isSuspended = 1){
|
||||
Gosub ReleaseModifiers
|
||||
menu, tray, check , Suspend Kinto
|
||||
I_Icon = %A_ScriptDir%\assets\kinto-white.ico
|
||||
Menu, Tray, Icon, %I_Icon%,, 1
|
||||
Menu, Tray, Tip, Suspended - Kinto
|
||||
IfWinExist, detectUSB.ahk
|
||||
WinClose
|
||||
}
|
||||
else{
|
||||
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, Icon, %I_Icon%,,1
|
||||
Run, %A_ScriptDir%\detectUSB.ahk
|
||||
}
|
||||
; Refocus last active Window
|
||||
Send {LAlt down}{tab}{LAlt up}
|
||||
}
|
||||
|
||||
Exit() {
|
||||
Gosub ReleaseModifiers
|
||||
IfWinExist, detectUSB.ahk
|
||||
WinClose
|
||||
|
||||
ExitApp
|
||||
}
|
||||
|
||||
SetTitleMatchMode, 2
|
||||
|
||||
GroupAdd, terminals, ahk_exe ubuntu.exe
|
||||
GroupAdd, terminals, ahk_exe ConEmu.exe
|
||||
GroupAdd, terminals, ahk_exe ConEmu64.exe
|
||||
GroupAdd, terminals, ahk_exe powershell.exe
|
||||
GroupAdd, terminals, ahk_exe WindowsTerminal.exe
|
||||
GroupAdd, terminals, ahk_exe Hyper.exe
|
||||
GroupAdd, terminals, ahk_exe mintty.exe
|
||||
GroupAdd, terminals, ahk_exe Cmd.exe
|
||||
GroupAdd, terminals, ahk_exe box.exe
|
||||
GroupAdd, terminals, ahk_exe Terminus.exe
|
||||
GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow
|
||||
|
||||
GroupAdd, posix, ahk_exe ubuntu.exe
|
||||
GroupAdd, posix, ahk_exe ConEmu.exe
|
||||
GroupAdd, posix, ahk_exe ConEmu64.exe
|
||||
GroupAdd, posix, ahk_exe Hyper.exe
|
||||
GroupAdd, posix, ahk_exe mintty.exe
|
||||
GroupAdd, posix, ahk_exe Terminus.exe
|
||||
GroupAdd, posix, Fluent Terminal ahk_class ApplicationFrameWindow
|
||||
|
||||
GroupAdd, ConEmu, ahk_exe ConEmu.exe
|
||||
GroupAdd, ConEmu, ahk_exe ConEmu64.exe
|
||||
GroupAdd, ConEmu, ahk_exe WindowsTerminal.exe
|
||||
|
||||
GroupAdd, ExcPaste, ahk_exe Cmd.exe
|
||||
GroupAdd, ExcPaste, ahk_exe mintty.exe
|
||||
|
||||
GroupAdd, editors, ahk_exe sublime_text.exe
|
||||
GroupAdd, editors, ahk_exe VSCodium.exe
|
||||
GroupAdd, editors, ahk_exe Code.exe
|
||||
|
||||
GroupAdd, browsers, ahk_exe chrome.exe
|
||||
GroupAdd, browsers, ahk_exe opera.exe
|
||||
GroupAdd, browsers, ahk_exe firefox.exe
|
||||
|
||||
; Disable Key Remapping for Virtual Machines
|
||||
; Disable for Remote desktop solutions too
|
||||
GroupAdd, virtm, ahk_exe VirtualBoxVM.exe
|
||||
GroupAdd, virtm, ahk_exe mstsc.exe
|
||||
|
||||
; Disabled Edge for now - no ability to close all instances
|
||||
; GroupAdd, browsers, Microsoft Edge ahk_class ApplicationFrameWindow
|
||||
|
||||
GroupAdd, vscode, ahk_exe VSCodium.exe
|
||||
GroupAdd, vscode, ahk_exe Code.exe
|
||||
|
||||
GroupAdd, vstudio, ahk_exe devenv.exe
|
||||
|
||||
GroupAdd, intellij, ahk_exe idea.exe
|
||||
GroupAdd, intellij, ahk_exe idea64.exe
|
||||
|
||||
; SetCapsLockState, AlwaysOff ; CB/IBM
|
||||
|
||||
#IfWinNotActive ahk_group virtm
|
||||
|
||||
; New AltTab and CtrlTab fix
|
||||
*tab::
|
||||
{
|
||||
; Tertiary
|
||||
if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P") = false) {
|
||||
; Secondary
|
||||
; Send {LCtrl down}{Secondary up}{tab}
|
||||
; Send {LCtrl down}{LWin up}{tab} ; WinModifiers
|
||||
; Send {LCtrl down}{LAlt up}{tab} ; MacModifiers
|
||||
; Send {LCtrl down}{CapsLock up}{tab} ; CB/IBM
|
||||
KeyWait, tab
|
||||
; Tertiary
|
||||
} else if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P")) {
|
||||
; Secondary
|
||||
; Send {LCtrl down}{Secondary up}{LShift down}{tab}
|
||||
; Send {LCtrl down}{LWin up}{LShift down}{tab} ; WinModifiers/CB
|
||||
; Send {LCtrl down}{LAlt up}{LShift down}{tab} ; MacModifiers
|
||||
; Send {LCtrl down}{CapsLock up}{LShift down}{tab} ; IBM
|
||||
KeyWait, tab
|
||||
; Primary
|
||||
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; WinModifiers/CB/IBM
|
||||
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
|
||||
Send {LAlt down}{tab}
|
||||
KeyWait, tab
|
||||
; Primary
|
||||
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers/CB/IBM
|
||||
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
|
||||
Send {LAlt down}{LShift down}{tab}
|
||||
KeyWait, tab
|
||||
; Secondary
|
||||
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) = false { ; WinModifiers/CB
|
||||
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
|
||||
; } else if (GetKeyState("CapsLock", "P") AND GetKeyState("LShift", "P")) = false { ; IBM
|
||||
return
|
||||
; Secondary
|
||||
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers/CB
|
||||
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
|
||||
; } else if (GetKeyState("CapsLock", "P") AND GetKeyState("LShift", "P")) { ; IBM
|
||||
return
|
||||
} else {
|
||||
send {Blind}{tab}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
tab::Send {tab}
|
||||
|
||||
+tab::Send {Shift down}{tab}{Shift up}
|
||||
|
||||
; Basic Remap
|
||||
;
|
||||
; Primary::LCtrl
|
||||
; Secondary::LAlt
|
||||
; Tertiary::LWin
|
||||
|
||||
; $LAlt::LCtrl ; CB/IBM
|
||||
; $RAlt::RCtrl ; CB/IBM
|
||||
; $RCtrl::RAlt ; CB/IBM
|
||||
; $CapsLock::LWin ; IBM
|
||||
; $LCtrl::LAlt ; CB/IBM
|
||||
|
||||
; $LAlt::LCtrl ; WinModifiers
|
||||
; $RAlt::RCtrl ; WinModifiers
|
||||
; $RCtrl::RAlt ; WinModifiers
|
||||
; $LWin::LAlt ; WinModifiers
|
||||
; $LCtrl::LWin ; WinModifiers
|
||||
|
||||
; $LWin::LCtrl ; MacModifiers
|
||||
; $RWin::RCtrl ; MacModifiers
|
||||
; $LCtrl::LWin ; MacModifiers
|
||||
|
||||
; Hack to disable start menu on winkey
|
||||
; Static
|
||||
$LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up}
|
||||
|
||||
; temporary hack to ensure keys don't get stuck
|
||||
; impacts Alt-Tab fix
|
||||
; Primary
|
||||
; $LAlt up::Send {LWin up}{LAlt up}{LCtrl up} ; WinModifiers
|
||||
; $LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; MacModifiers
|
||||
; $LAlt up::Send {LWin up}{CapsLock up}{LAlt up}{LCtrl up} ; CB/IBM
|
||||
|
||||
; Close Apps
|
||||
^q::Send !{F4}
|
||||
|
||||
; Minimize specific Window
|
||||
^m::WinMinimize, A
|
||||
|
||||
; Minimize all but Active Window
|
||||
!^m::
|
||||
WinGet, winid ,, A
|
||||
WinMinimizeAll
|
||||
WinActivate ahk_id %winid%
|
||||
return
|
||||
|
||||
; hide all instances of active Program
|
||||
^h::
|
||||
WinGetClass, class, A
|
||||
WinGet, AllWindows, List
|
||||
loop %AllWindows% {
|
||||
WinGetClass, WinClass, % "ahk_id " AllWindows%A_Index%
|
||||
if(InStr(WinClass,class)){
|
||||
WinMinimize, % "ahk_id " AllWindows%A_Index%
|
||||
}
|
||||
}
|
||||
return
|
||||
|
||||
; hide all but active program
|
||||
!^h::
|
||||
WinGetClass, class, A
|
||||
WinMinimizeAll
|
||||
WinGet, AllWindows, List
|
||||
loop %AllWindows% {
|
||||
WinGetClass, WinClass, % "ahk_id " AllWindows%A_Index%
|
||||
if(InStr(WinClass,class)){
|
||||
WinRestore, % "ahk_id " AllWindows%A_Index%
|
||||
}
|
||||
}
|
||||
return
|
||||
|
||||
; Show Desktop
|
||||
^F3::Send #d
|
||||
|
||||
; Emoji Panel
|
||||
#^Space::Send {LWin down};{LWin up}
|
||||
|
||||
; Full Screenshot
|
||||
^+3::Send {PrintScreen}
|
||||
|
||||
; Region Screenshot
|
||||
^+4::Send #+{S}
|
||||
|
||||
; wordwise support
|
||||
$^Left::Send {Home}
|
||||
$^+Left::Send +{Home}
|
||||
$^Right::Send {End}
|
||||
$^+Right::Send +{End}
|
||||
^Up::Send ^{Home}
|
||||
^+Up::Send ^+{Home}
|
||||
^Down::Send ^{End}
|
||||
^+Down::Send ^+{End}
|
||||
$^Backspace::Send +{Home}{Delete}
|
||||
!Backspace::Send ^{Backspace}
|
||||
!Left::Send ^{Left}
|
||||
!+Left::Send ^+{Left}
|
||||
!Right::Send ^{Right}
|
||||
!+Right::Send ^+{Right}
|
||||
|
||||
; Cmd+Space Alternative
|
||||
$^Space::Send ^{Esc}
|
||||
|
||||
#IfWinActive ahk_group intellij
|
||||
; General
|
||||
^0::Send !{0} ;Open corresponding tool window
|
||||
^1::Send !{1} ;Open corresponding tool window
|
||||
^2::Send !{2} ;Open corresponding tool window
|
||||
^3::Send !{3} ;Open corresponding tool window
|
||||
^4::Send !{4} ;Open corresponding tool window
|
||||
^5::Send !{5} ;Open corresponding tool window
|
||||
^6::Send !{6} ;Open corresponding tool window
|
||||
^7::Send !{7} ;Open corresponding tool window
|
||||
^8::Send !{8} ;Open corresponding tool window
|
||||
^9::Send !{9} ;Open corresponding tool window
|
||||
#`::Send ^` ;Quick switch current scheme
|
||||
^,::Send ^!s ;Open Settings dialog
|
||||
^;::Send ^!+s ;Open Project Structure dialog
|
||||
; Debugging
|
||||
^!r::Send {F9} ;Resume program
|
||||
; Search/Replace
|
||||
^g::Send {F3} ;Find next
|
||||
^+F3::Send +{F3} ;Find previous
|
||||
#g::Send !j ;Select next occurrence
|
||||
^#g::Send ^!+j ;Select all occurrences
|
||||
#+g::Send !+j ;Unselect occurrence
|
||||
; Editing
|
||||
; #Space::Send ^{Space} ; Default - Basic code completion
|
||||
; !Space::Send ^{Space} ; CB/IBM - Basic code completion
|
||||
#+Space::Send ^+{Space} ;Smart code completion
|
||||
#j::Send ^q ;Quick documentation lookup
|
||||
^n::Send !{Insert} ;Generate code...
|
||||
#o::Send ^o ;Override methods
|
||||
#i::Send ^i ;Implement methods
|
||||
!Up::Send ^w ;Extend selection
|
||||
!Down::Send ^+w ;Shrink selection
|
||||
#+q::Send !q ;Context info
|
||||
#!o::Send ^!o ;Optimize imports
|
||||
#!i::Send ^!i ;Auto-indent line(s)
|
||||
$^Backspace::Send ^y ;Delete line at caret
|
||||
#+j::Send ^+j ;Smart line join
|
||||
!Delete::Send ^{Delete} ;Delete to word end
|
||||
!Backspace::Send ^{Backspace} ;Delete to word start
|
||||
^+::Send ^{NumpadAdd} ;Expand code block
|
||||
^-::Send ^{NumpadSub} ;Collapse code block
|
||||
^++::Send ^+{NumpadAdd} ;Expand all
|
||||
^+-::Send ^+{NumpadSub} ;Collapse all
|
||||
^w::Send ^{F4} ;Close active editor tab
|
||||
; Refactoring
|
||||
^Delete::Send !{Delete} ;Safe Delete
|
||||
^T::Send ^!+T ;Refactor this
|
||||
; Navigation
|
||||
^o::Send ^n ;Go to class
|
||||
^+o::Send ^+n ;Go to file
|
||||
^!o::Send ^!+n ;Go to symbol
|
||||
#Right::Send !{Right} ;Go to next editor tab
|
||||
#Left::Send !{Left} ;Go to previous editor tab
|
||||
#l::Send ^g ;Go to line
|
||||
#e::Send ^e ;Recent files popup
|
||||
; !Space::Send ^+i ; Default - Open quick definition lookup
|
||||
; #Space::Send ^+i ; CB/IBM - Open quick definition lookup
|
||||
^Y::Send ^+i ;Open quick definition lookup
|
||||
#+b::Send ^+b ;Go to type declaration
|
||||
#Up::Send !{Up} ;Go to previous
|
||||
#Down::Send !{Down} ;Go to next method
|
||||
#h::Send ^h ;Type hierarchy
|
||||
#!h::Send ^!h ;Call hierarchy
|
||||
^Down::Send ^{Enter} ;Edit source/View source
|
||||
!Home::Send !{Home} ;Show navigation bar
|
||||
F2::Send {F11} ;Toggle bookmark
|
||||
#F3::Send ^{F11} ;Toggle bookmark with mnemonic
|
||||
#0::Send ^{0} ;Go to numbered bookmark
|
||||
#1::Send ^{1} ;Go to numbered bookmark
|
||||
#2::Send ^{2} ;Go to numbered bookmark
|
||||
#3::Send ^{3} ;Go to numbered bookmark
|
||||
#4::Send ^{4} ;Go to numbered bookmark
|
||||
#5::Send ^{5} ;Go to numbered bookmark
|
||||
#6::Send ^{6} ;Go to numbered bookmark
|
||||
#7::Send ^{7} ;Go to numbered bookmark
|
||||
#8::Send ^{8} ;Go to numbered bookmark
|
||||
#9::Send ^{9} ;Go to numbered bookmark
|
||||
^F3::Send +{F11} ;Show bookmarks
|
||||
; Compile and Run
|
||||
#!r::Send !+{F10} ;Select configuration and run
|
||||
#!d::Send !+{F9} ;Select configuration and debug
|
||||
#r::Send +{F10} ;Run
|
||||
#d::Send +{F9} ;Debug
|
||||
#+r::Send ^+{F10} ;Run context configuration from editor
|
||||
#+d::Send ^+{F9} ;Debug context configuration from editor
|
||||
; VCS/Local History
|
||||
#v::Send !` ;VCS quick popup
|
||||
#If
|
||||
|
||||
; Close all browsers
|
||||
#IfWinActive ahk_group browsers
|
||||
^q::send {Alt Down}f{Alt Up}x ; exit all windows
|
||||
#If
|
||||
|
||||
; Sublime Text Remaps for VS Code
|
||||
#IfWinActive ahk_group vscode
|
||||
#p::send {Up} ; Allow for traversing quick list
|
||||
#n::send {Down} ; Allow for traversing quick list
|
||||
; Remap Ctrl+Shift to behave like macOS Sublimetext
|
||||
; Will extend cursor to multiple lines
|
||||
; #+Up::send ^!{Up} ; Default - ST2CODE
|
||||
; !+Up::send ^!{Up} ; CB/IBM - ST2CODE
|
||||
; #+Down::send ^!{Down} ; Default - ST2CODE
|
||||
; !+Down::send ^!{Down} ; CB/IBM - ST2CODE
|
||||
; Remap Ctrl+Cmd+G to select all matches
|
||||
; #^g::send ^+{L} ; Default - ST2CODE
|
||||
; !^g::send ^+{L} ; CB/IBM - ST2CODE
|
||||
!+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
|
||||
|
||||
; #Space::Send ^{Space} ; Default - Basic code completion
|
||||
; !Space::Send ^{Space} ; CB/IBM - Basic code completion
|
||||
#If
|
||||
|
||||
#IfWinActive ahk_exe sublime_text.exe
|
||||
; #Space::Send ^{Space} ; Default - Basic code completion
|
||||
; !Space::Send ^{Space} ; CB/IBM - Basic code completion
|
||||
#^Up::send !{O} ; Switch file
|
||||
#^f::send {F11} ; toggle_full_screen
|
||||
^!v::send {Ctrl Down}k{Ctrl Up}{Ctrl Down}v{Ctrl Up} ; paste_from_history
|
||||
^Up::Return ; cancel scroll_lines up
|
||||
^!Up::send ^{Up} ; scroll_lines up
|
||||
^Down::Return ; cancel scroll_lines down
|
||||
^!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
|
||||
^PgDn::Return ; cancel next_view
|
||||
^PgUp::Return ; cancel prev_view
|
||||
^+{::send ^{PgDn} ; next_view
|
||||
^+}::send ^{PgUp} ; prev_view
|
||||
^!Right::send ^{PgDn} ; next_view
|
||||
^!Left::send ^{PgUp} ; prev_view
|
||||
Insert::Return ; cancel toggle_overwrite
|
||||
^!O::send {Insert} ; toggle_overwrite
|
||||
!c::Return ; cancel toggle_case_sensitive
|
||||
^!c::send !{c} ; toggle_case_sensitive
|
||||
; ^h::Return ; cancel replace
|
||||
^!f::send ^{h} ; replace
|
||||
^+h::Return ; cancel replace_next
|
||||
^!e::send ^+{h} ; replace_next
|
||||
F3::Return ; cancel find_next
|
||||
^g::send {F3} ; find_next
|
||||
*F3::Return ; cancel find_prev, find_under, find_all_under
|
||||
^+g::send +{F3} ; find_prev
|
||||
#!g::send ^{F3} ; find_under
|
||||
#!+g::send ^+{F3} ; find_under_prev
|
||||
; #^g::send !{F3} ; Default - find_all_under
|
||||
; !^g::send !{F3} ; CB/IBM - find_all_under
|
||||
^+Up::Return ; cancel swap_line_up
|
||||
#!Up::send ^+{Up} ; swap_line_up
|
||||
^+Down::Return ; cancel swap_line_down
|
||||
#!Down::send ^+{Down} ; swap_line_down
|
||||
^Pause::Return ; cancel 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
|
||||
#F5::send #{F9} ; sort_lines case_s true
|
||||
!+1::Return ; cancel set_layout
|
||||
^!1::send !+1 ; set_layout
|
||||
!+2::Return ; cancel set_layout
|
||||
^!2::send !+2 ; set_layout
|
||||
!+3::Return ; cancel set_layout
|
||||
^!3::send !+3 ; set_layout
|
||||
!+4::Return ; cancel set_layout
|
||||
^!4::send !+4 ; set_layout
|
||||
!+5::Return ; cancel set_layout
|
||||
^!5::send !+5 ; set_layout
|
||||
!+8::Return ; cancel set_layout
|
||||
^!8::send !+8 ; set_layout
|
||||
!+9::Return ; cancel set_layout
|
||||
^!9::send !+9 ; set_layout
|
||||
#If
|
||||
|
||||
#IfWinActive ahk_group terminals
|
||||
|
||||
; End of Line
|
||||
; #e:: ; Default
|
||||
; !e:: ; CB/IBM
|
||||
Send {End}
|
||||
return
|
||||
|
||||
; Beginning of Line
|
||||
; #a:: ; Default
|
||||
; !a:: ; CB/IBM
|
||||
Send {Home}
|
||||
return
|
||||
|
||||
; Copy
|
||||
^c::
|
||||
If WinActive("ahk_exe cmd.exe") OR WinActive("ahk_exe box.exe"){
|
||||
Send {Enter}
|
||||
}
|
||||
else if WinActive("ahk_exe mintty.exe"){
|
||||
SetKeyDelay -1
|
||||
Send {Blind}{Insert}
|
||||
}
|
||||
else{
|
||||
SetKeyDelay -1
|
||||
Send {Blind}{LShift down}{c DownTemp}
|
||||
}
|
||||
return
|
||||
|
||||
^c up::
|
||||
If not WinActive("ahk_group cmd.exe") OR WinActive("ahk_exe box.exe"){
|
||||
SetKeyDelay -1
|
||||
Send {Blind}{c Up}{LShift Up}
|
||||
}
|
||||
return
|
||||
|
||||
; Sigints - interrupt
|
||||
; $#c::Send {Ctrl down}c{Ctrl up} ; Default
|
||||
; $!c::Send {Ctrl down}c{Ctrl up} ; CB/IBM
|
||||
|
||||
; Paste
|
||||
$^v::
|
||||
If WinActive("ahk_exe mintty.exe"){
|
||||
Send {Shift down}{Insert}{Shift up}
|
||||
}
|
||||
else if WinActive("ahk_group posix"){
|
||||
Send {Blind}{Shift down}v{Shift up}
|
||||
}
|
||||
else if WinActive("ahk_exe box.exe"){
|
||||
SendEvent {RButton}
|
||||
}
|
||||
else{
|
||||
Send {Blind}v
|
||||
}
|
||||
return
|
||||
#If
|
||||
|
||||
#IfWinActive ahk_group posix
|
||||
; Open/Close Tab for those that support it
|
||||
$^t::
|
||||
If not WinActive("ahk_group ConEmu"){
|
||||
Send {LCtrl down}{LShift down}t{LCtrl Up}{LShift Up}
|
||||
}
|
||||
else{
|
||||
Send ^t
|
||||
}
|
||||
return
|
||||
|
||||
$^w::
|
||||
If not WinActive("ahk_group ConEmu"){
|
||||
Send {LCtrl down}{LShift down}w{LCtrl Up}{LShift Up}
|
||||
}
|
||||
else{
|
||||
Send ^w
|
||||
}
|
||||
return
|
||||
|
||||
^l::Send clear{Enter}
|
||||
; #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
|
||||
#If
|
||||
#If
|
||||
|
||||
ReleaseModifiers:
|
||||
Send {RCtrl up}
|
||||
Send {LCtrl up}
|
||||
Send {RAlt up}
|
||||
Send {LAlt up}
|
||||
Send {RWin up}
|
||||
Send {LWin up}
|
||||
Send {RShift up}
|
||||
Send {LShift up}
|
||||
return
|
BIN
windows/macbook_winctrl_capsesc_swap.reg
Normal file
BIN
windows/macbook_winctrl_swap.reg
Normal file
BIN
windows/macbook_winctrl_swap.skl
Executable file
4
windows/remove_keyswap.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
|
||||
"Scancode Map"=-
|
BIN
windows/standard_ctrlalt_capsesc_swap.reg
Normal file
BIN
windows/standard_ctrlalt_swap.reg
Normal file
BIN
windows/standard_ctrlalt_swap.skl
Executable file
BIN
windows/theme_campbell.reg
Normal file
BIN
windows/theme_legacy.reg
Normal file
BIN
windows/theme_onehalfdark.reg
Normal file
BIN
windows/theme_onehalflight.reg
Normal file
BIN
windows/theme_ubuntu.reg
Normal file
65
windows/toggle_kb.bat
Normal file
@@ -0,0 +1,65 @@
|
||||
@echo off
|
||||
|
||||
IF "%1"=="mac" goto mac
|
||||
IF "%1"=="win" goto win
|
||||
IF "%1"=="chrome" goto chrome
|
||||
IF "%1"=="ibm" goto ibm
|
||||
IF "%1"=="auto" goto auto
|
||||
|
||||
echo Not found.
|
||||
goto commonexit
|
||||
|
||||
:auto
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(;)( )(.*)(; Autodetect)|^(?!; )(.*)(; )(Autodetect)/$6$5$6$7$3$4/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
"%userprofile%\.kinto\kinto-start.vbs"
|
||||
goto commonexit
|
||||
|
||||
:win
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; Default)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; MacModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; CB\/IBM)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; Chromebook)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; IBM)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(ahk\"\" )(\w*)/$1win/gm" "%userprofile%\.kinto\kinto-start.vbs"
|
||||
"C:\Program Files\AutoHotkey\AutoHotkey.exe" "%userprofile%\.kinto\kinto.ahk" win
|
||||
goto commonexit
|
||||
|
||||
:mac
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; Default)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; WinModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; CB\/IBM)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; Chromebook)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; IBM)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(ahk\"\" )(\w*)/$1mac/gm" "%userprofile%\.kinto\kinto-start.vbs"
|
||||
"C:\Program Files\AutoHotkey\AutoHotkey.exe" "%userprofile%\.kinto\kinto.ahk" mac
|
||||
goto commonexit
|
||||
|
||||
:chrome
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!; )(.*)(; Autodetect)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; WinModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; MacModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; Default)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; Chromebook)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; WinModifiers\/CB)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; CB\/IBM)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(ahk\"\" )(\w*)/$1chrome/gm" "%userprofile%\.kinto\kinto-start.vbs"
|
||||
"C:\Program Files\AutoHotkey\AutoHotkey.exe" "%userprofile%\.kinto\kinto.ahk" chrome
|
||||
goto commonexit
|
||||
|
||||
:ibm
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!; )(.*)(; Autodetect)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; WinModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; Chromebook)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; MacModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; Default)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; IBM)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; WinModifiers\/CB\/IBM)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; CB\/IBM)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(ahk\"\" )(\w*)/$1ibm/gm" "%userprofile%\.kinto\kinto-start.vbs"
|
||||
"C:\Program Files\AutoHotkey\AutoHotkey.exe" "%userprofile%\.kinto\kinto.ahk" ibm
|
||||
goto commonexit
|
||||
|
||||
:commonexit
|
||||
exit
|
73
windows/usb.vbs
Normal file
@@ -0,0 +1,73 @@
|
||||
Option Explicit
|
||||
Dim oWMISrv, collDvcs, iUSBDvc , iDvc, sDvcID, sPID, sVID, deviceID
|
||||
|
||||
' add item to array
|
||||
Function AddItem(arr, val)
|
||||
ReDim Preserve arr(UBound(arr) + 1)
|
||||
arr(UBound(arr)) = val
|
||||
AddItem = arr
|
||||
End Function
|
||||
|
||||
' returns an array of the unique items in for-each-able collection fex
|
||||
Function uniqFE(fex)
|
||||
Dim dicTemp : Set dicTemp = CreateObject("Scripting.Dictionary")
|
||||
Dim xItem
|
||||
For Each xItem In fex
|
||||
dicTemp(xItem) = 0
|
||||
Next
|
||||
uniqFE = dicTemp.Keys()
|
||||
End Function
|
||||
|
||||
Function ReplaceX(ByVal sValue, ByVal sPattern, ByVal sNValue)
|
||||
Dim oReg : Set oReg = New RegExp
|
||||
oReg.Pattern = sPattern
|
||||
ReplaceX = oReg.Replace(sValue, sNValue)
|
||||
Set oReg = Nothing
|
||||
End Function
|
||||
|
||||
Set oWMISrv = GetObject("winmgmts:\\.\root\cimv2")
|
||||
Set collDvcs = oWMISrv.ExecQuery("Select * From Win32_PnPEntity WHERE Service='kbdhid'")
|
||||
|
||||
Dim deviceVID : deviceVID=Array()
|
||||
Dim devicePID : devicePID=Array()
|
||||
Dim deviceDesc : deviceDesc=Array()
|
||||
Dim counter: counter=0
|
||||
|
||||
For Each iUSBDvc In collDvcs
|
||||
sVID = ReplaceX(iUSBDvc.DeviceID, ".*VID_(.{4}).*", "$1")
|
||||
sPID = ReplaceX(iUSBDvc.DeviceID, ".*PID_(.{4}).*", "$1")
|
||||
deviceVID = AddItem(deviceVID, sVID)
|
||||
devicePID = AddItem(devicePID, sPID)
|
||||
deviceDesc = AddItem(deviceDesc, iUSBDvc.Description)
|
||||
counter = counter + 1
|
||||
' Wscript.Echo "Name : "& iUSBDvc.Description &"VID_PID : "& sVID & sPID
|
||||
Next
|
||||
|
||||
Dim uniqueVID: uniqueVID = uniqFE(deviceVID)
|
||||
Dim vcount: vcount = UBound(uniqueVID) + 1
|
||||
Dim nonApple: nonApple = 0
|
||||
Dim i
|
||||
|
||||
If vcount = 1 Then
|
||||
deviceID = deviceVID(0)
|
||||
If StrComp(deviceVID(0), "05AC") = 0 Then
|
||||
Wscript.Echo "Apple " & deviceID
|
||||
Else
|
||||
Wscript.Echo "Windows " & deviceID
|
||||
End If
|
||||
Else
|
||||
For i = 0 To counter-1
|
||||
deviceID = deviceVID(i)
|
||||
If StrComp(deviceVID(i), "05AC") = -1 Then
|
||||
nonApple = 1
|
||||
End If
|
||||
Next
|
||||
If nonApple = 1 Then
|
||||
Wscript.Echo "Windows " & deviceID
|
||||
Else
|
||||
Wscript.Echo "Apple " & deviceID
|
||||
End If
|
||||
End If
|
||||
|
||||
Set collDvcs = Nothing
|
||||
Set oWMISrv = Nothing
|
7
xkeysnail-config/gnome_logoff.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
dbus-monitor --session "type='signal',interface='org.gnome.SessionManager.Logout'" | grep '1' |
|
||||
while read x; do
|
||||
# echo "$x"
|
||||
sudo systemctl stop xkeysnail
|
||||
exit 0
|
||||
done
|
BIN
xkeysnail-config/gui/capslock_1200x720.png
Executable file
After Width: | Height: | Size: 7.0 KiB |
BIN
xkeysnail-config/gui/keys_1200x720.png
Executable file
After Width: | Height: | Size: 8.4 KiB |
1394
xkeysnail-config/gui/kinto-gui.py
Executable file
11
xkeysnail-config/gui/kinto.desktop
Normal file
@@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
# /.local/share/applications
|
||||
Name=Kinto.sh
|
||||
GenericName=Kinto.sh
|
||||
Categories=Utility;
|
||||
Type=Application
|
||||
Exec={homedir}/.config/kinto/gui/kinto-gui.py
|
||||
Icon={homedir}/.config/kinto/kinto-color-48.svg
|
||||
# Icon=/usr/share/icons/Pocillo/kinto-color.svg
|
||||
Terminal=false
|
||||
NoDisplay=false
|