mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-06 10:58:26 +02:00
- Added Kinto xkeysnail to the official setup.py file. Updated installer to use mooz xkeysnail over my own fork of it.
This commit is contained in:
10
setup.py
10
setup.py
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import json, time, os, sys
|
import json, time, os, sys, subprocess, shlex
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from subprocess import PIPE, Popen
|
from subprocess import PIPE, Popen
|
||||||
from prekinto import *
|
from prekinto import *
|
||||||
@@ -329,10 +329,18 @@ if os.path.isdir(homedir + "/.config/kinto") == False:
|
|||||||
with open('defaults.json') as json_file:
|
with open('defaults.json') as json_file:
|
||||||
data = json.load(json_file)
|
data = json.load(json_file)
|
||||||
|
|
||||||
|
|
||||||
color_arr = [bcolors.CBEIGE,bcolors.CRED2,bcolors.CGREEN,bcolors.CYELLOW ]
|
color_arr = [bcolors.CBEIGE,bcolors.CRED2,bcolors.CGREEN,bcolors.CYELLOW ]
|
||||||
|
|
||||||
print("\nKinto - Type in Linux like it's a Mac.\n")
|
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\n" + bcolors.ENDC))
|
||||||
|
print("")
|
||||||
|
if(kintotype == 1):
|
||||||
|
setShortcuts()
|
||||||
|
subprocess.check_call(shlex.split("./xkeysnail_service.sh"))
|
||||||
|
exit()
|
||||||
|
|
||||||
for index, item in enumerate(data['defaulttypes']):
|
for index, item in enumerate(data['defaulttypes']):
|
||||||
ossym = ""
|
ossym = ""
|
||||||
if item == "windows":
|
if item == "windows":
|
||||||
|
@@ -17,7 +17,7 @@ fi
|
|||||||
|
|
||||||
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
|
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
|
||||||
while true; do
|
while true; do
|
||||||
read -p "Would you like to enable experimental support for mac back/forward hotkeys in Firefox & Chrome (shares the same hotkey combo as wordwise when needed)? (y/n)" yn
|
read -rep $'\nExperimental Support for Firefox/Chrome Back/Forward buttons (Cmd+Left/Right)? (y/n)\n' yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) exp='/sbin/runuser -l {username} -c "export DISPLAY={displayid};/home/{username}/.config/kinto/caret_status_xkey.sh\&";'; expsh='"/home/{username}/.config/kinto/caret_status_xkey.sh"'; break;;
|
[Yy]* ) exp='/sbin/runuser -l {username} -c "export DISPLAY={displayid};/home/{username}/.config/kinto/caret_status_xkey.sh\&";'; expsh='"/home/{username}/.config/kinto/caret_status_xkey.sh"'; break;;
|
||||||
[Nn]* ) exp=" "; expsh=" " break;;
|
[Nn]* ) exp=" "; expsh=" " break;;
|
||||||
@@ -82,14 +82,14 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
|||||||
mv ./xkeysnail-config/kinto.py.new ~/.config/kinto/kinto.py
|
mv ./xkeysnail-config/kinto.py.new ~/.config/kinto/kinto.py
|
||||||
sudo mv ./xkeysnail-config/xkeysnail.service.new /etc/systemd/system/xkeysnail.service
|
sudo mv ./xkeysnail-config/xkeysnail.service.new /etc/systemd/system/xkeysnail.service
|
||||||
xhost +SI:localuser:root
|
xhost +SI:localuser:root
|
||||||
git clone --depth 1 https://github.com/rbreaves/xkeysnail.git
|
git clone --depth 1 https://github.com/mooz/xkeysnail.git
|
||||||
cd xkeysnail
|
cd xkeysnail
|
||||||
sudo pip3 install --upgrade .
|
sudo pip3 install --upgrade .
|
||||||
sudo systemctl enable xkeysnail.service
|
sudo systemctl enable xkeysnail.service
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl restart xkeysnail
|
sudo systemctl restart xkeysnail
|
||||||
|
|
||||||
echo "Adding xhost fix..."
|
echo -e "Adding xhost fix...\n"
|
||||||
|
|
||||||
LINE='xhost +SI:localuser:root'
|
LINE='xhost +SI:localuser:root'
|
||||||
|
|
||||||
@@ -108,6 +108,19 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
|||||||
if test -f "~/.config/autostart/kinto.desktop"; then
|
if test -f "~/.config/autostart/kinto.desktop"; then
|
||||||
rm ~/.config/autostart/kinto.desktop
|
rm ~/.config/autostart/kinto.desktop
|
||||||
fi
|
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"
|
||||||
|
fi
|
||||||
elif ! [[ $1 == "4" || $1 == "uninstall" ]]; then
|
elif ! [[ $1 == "4" || $1 == "uninstall" ]]; then
|
||||||
echo "Expected argument was not provided"
|
echo "Expected argument was not provided"
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user