Compare commits

...

26 Commits

Author SHA1 Message Date
Ben Reaves
36740e4b3e Merge pull request #55 from rbreaves/hotfix
- Adds ibus-setup & Epiphany. Closes issue #53
2020-03-09 12:22:47 -05:00
Ben Reaves
7c74dcca71 - Added package install of ibus for manjaro 2020-03-09 12:14:49 -05:00
Ben Reaves
8827b37ef3 Merge branch 'master' into hotfix 2020-03-09 11:29:14 -05:00
Ben Reaves
6631cd25a9 - Added ibus-setup fix for some distros and added Epiphany to chrome 2020-03-09 11:29:09 -05:00
Ben Reaves
c5ff1f2513 - Revisions to readme 2020-03-06 15:29:02 -06:00
Ben Reaves
f0851a949c - Typo correction 2020-03-06 15:26:07 -06:00
Ben Reaves
332607765e Updated readme, how to add setxkbmap options 2020-03-06 15:24:36 -06:00
Ben Reaves
7e676938ee Merge pull request #51 from rbreaves/hotfix
- Added capslock swap option to mac_gui
2020-03-06 14:23:37 -06:00
Ben Reaves
7a706305c1 - Added capslock swap option to mac_gui 2020-03-06 14:14:46 -06:00
Ben Reaves
e7f0db4107 - Updated readme 2020-03-06 13:14:17 -06:00
Ben Reaves
031eaf7e9f Updated Readme with uninstall info 2020-03-05 23:42:09 -06:00
Ryan Reaves
40b521ce09 Merge branch 'hotfix' 2020-02-25 16:40:51 -06:00
Ryan Reaves
c5f1764dfa - Added both x11 checks to further compatibility 2020-02-25 16:39:47 -06:00
Ben Reaves
0196cc323a Merge pull request #46 from rbreaves/hotfix
- Resolved possible issue with Display env variable
2020-02-25 15:58:50 -06:00
Ryan Reaves
c8ca073875 - Resolved possible issue with Display env variable 2020-02-25 15:56:29 -06:00
Ryan Reaves
0e23aae082 - Updated installer to check for x11 more reliably 2020-02-25 15:22:48 -06:00
Ben Reaves
8086a56b7d Merge pull request #43 from rbreaves/dev
- Added giattributes file to set the language of the program to c
2020-02-22 14:11:53 -06:00
Ryan Reaves
bb357f23e6 - Added giattributes file to set the language of the program to c, instead of python. 2020-02-22 14:10:40 -06:00
Ben Reaves
bdf607e907 - Added Manjaro and Arch support to the readme 2020-02-21 23:58:04 -06:00
Ben Reaves
b8eb341d62 Merge pull request #42 from rbreaves/dev
- Added Support for Manjaro and Arch distros using pacman
2020-02-21 23:50:36 -06:00
Ben Reaves
9060cffbff - Added Support for Manjaro and Arch distros using pacman 2020-02-21 23:49:07 -06:00
Ben Reaves
08d8a90555 - Misc readme corrections 2020-02-21 17:26:42 -06:00
Ben Reaves
d7ef767a18 - Corrected typo 2020-02-21 17:19:59 -06:00
Ben Reaves
549e9c3a48 - Updated readme to include mention of Fedora/REHL support 2020-02-21 16:06:48 -06:00
Ben Reaves
1c51db9078 Merge pull request #41 from rbreaves/dev
- Added support for Fedora and rpm/dnf based distros
2020-02-21 15:25:13 -06:00
Ben Reaves
524fe93d1c - Added support for Fedora and rpm/dnf based distros 2020-02-21 15:22:15 -06:00
8 changed files with 95 additions and 17 deletions

3
.gitattributes vendored Normal file
View File

@@ -0,0 +1,3 @@
*.py linguist-detectable=false
*.json liguist-detectable=false
*.c linguist-detectable=true

View File

@@ -1,3 +1,8 @@
hidden partial modifier_keys
xkb_symbols "swapescape" {
key <CAPS> { [ Escape ] };
key <ESC> { [ Caps_Lock ] };
};
default partial xkb_symbols "mac_levelssym" {
// LEFT to Begin Line or Beginning of word
replace key <LEFT> {

View File

@@ -26,13 +26,13 @@ Kinto works for standard Windows, Apple and Chromebook keyboards. The following
- systemd
- x11
- IBus*
- Debian/Ubuntu based distro 16.04+
- Fedora/RHEL/Manjaro/Arch/Debian/Ubuntu based distro 16.04+
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.
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.
*IBUS is needed to support wordwise during browser app usage as the keymap will need to change slightly depending if the cursor/caret is on screen waiting for input. Setup.py will set it but you can manually set it as well or check your current Input Method.
*IBus is needed to support wordwise during browser app usage as the keymap will need to change slightly depending if the cursor/caret is on screen waiting for input. Setup.py will set it but you can manually set it as well or check your current Input Method.
To confirm navigate to your "Language Support" and set "Keyboard input method system:" to IBus for full word-wise support with web browsers.
@@ -57,8 +57,39 @@ sudo apt install python3
./setup.py
```
To Uninstall Kinto
```
./uninstall.sh
```
## How to Add Setxkbmap Option inside Kinto
To summarize you'll need to pull the partial out of the symbols file the option resides in and then add that to the mac_gui file and lastly reference it in the keymap file(s) you want it in.
symbols directory
```
/usr/share/X11/xkb/symbols/
```
symbols file
```
~/.xkb/symbols/mac_gui
```
keymap files
```
~/.xkb/keymap/kbd.mac.gui
~/.xkb/keymap/kbd.mac.term
```
A more detailed explaination is here.
https://github.com/rbreaves/kinto/issues/50#issuecomment-595953373
## How to Add or Change keymaps for Applications
Note: All of the following is already done in Kinto (but may also change as improvements are made). The following is purely for documentation and example sake as they are real examples of how to leverage the json config to support additional keymaps.
**First it is important to understand how Kinto operates.**
1. It listens for any focus/active window changes
@@ -450,7 +481,7 @@ I would just like to thank a few people here directly that have helped me tremen
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.
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 based solution, but he definitely went over it well.
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.

View File

@@ -18,7 +18,7 @@
},
{
"id": 2,
"name":"Mac - hid driver",
"name":"Mac - hid driver (Recommended - Also supports Windows keyboards)",
"type":"mac",
"active": false,
"description":"Standard Mac Keyboards with Apple driver",
@@ -32,7 +32,7 @@
},
{
"id": 3,
"name":"Mac Only",
"name":"Mac Only (VMs & non-official Apple keyboards)",
"type":"mac",
"active": true,
"description":"Standard Mac Keyboards",

View File

@@ -4,8 +4,6 @@ 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
swapcmd="\/bin\/bash -c \"\/home\/`whoami`\/.config\/kinto\/xactive.sh carrots\""
swapstopcmd="\/bin\/bash \/home\/`whoami`\/.config\/kinto\/cleanup.sh"
mkdir -p ~/.config/systemd/user
mkdir -p ~/.config/autostart
cp ./system-config/keyswap.service ~/.config/systemd/user/keyswap.service
@@ -16,6 +14,11 @@ 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
systemctl --user enable keyswap
systemctl --user start keyswap

View File

@@ -15,41 +15,76 @@ def cmdline(command):
)
return process.communicate()[0]
def requirements():
def requirements(pkgm):
print(bcolors.CYELLOW + "You need to install some packages, " +run_pkg+ ", for Kinto to fully remap browsers during input focus.\n" + bcolors.ENDC)
print("sudo apt-get install -y " + run_pkg + "\n")
print("sudo " + pkgm + " " + run_pkg + "\n")
run_install = yn_choice(bcolors.CYELLOW + "Would you like to run it now? (Will require sudo privileges.)\n" + bcolors.ENDC)
if(run_install):
os.system("sudo apt-get install -y " + run_pkg)
os.system("sudo " + pkgm + run_pkg)
print("\n")
def install_ibus():
print(bcolors.CYELLOW + "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.CYELLOW + "Confirm the IBus Setup by saying Yes and then closing the window.\n" + bcolors.ENDC)
print("ibus-setup\n")
print("im-config -n ibus\n")
run_install = yn_choice(bcolors.CYELLOW + "Would you like to run it now? (Will require logoff and logon.)\n" + bcolors.ENDC)
if(run_install):
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()
check_xbind = symbols_gui_line = cmdline("which xbindkeys").strip()
check_xdotool = symbols_gui_line = cmdline("which xdotool").strip()
# check_x11 = cmdline("env | grep -i x11").strip()
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:
print("You are not using x11, please logout and back in using x11/Xorg")
sys.exit()
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 += " 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
run_pkg = ""
if len(check_xbind) > 0 and len(check_xdotool) > 0:
print("Xbindkeys, and xdotool requirement is installed.")
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:
requirements()
requirements(pkgm)
if os.path.exists(homedir + '/.config/ibus/bus') and cmdline("ls ~/.config/ibus/bus -1rt") == "":
install_ibus()

View File

@@ -5,7 +5,8 @@ PartOf=graphical-session.target
[Service]
Type=simple
Restart=always
#Environment=DISPLAY=:0.0
# eg DISPLAY=:0.0
#Environment=DISPLAY={displayid}
RestartSec=1
WorkingDirectory=/home/{username}/.config/kinto
ExecStart=/bin/bash -c "/home/{username}/.config/kinto/xactive.sh carrots"

View File

@@ -36,7 +36,7 @@
"symbols": "",
"types": "",
"de": [],
"appnames": [ "Chromium","Chromium-browser","Google-chrome" ]
"appnames": [ "Chromium","Chromium-browser","Google-chrome","Epiphany" ]
}],
"init": [],
"detypes":["gnome2","gnome3","kde4","kde5","xfce","i3wm"],