mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-02 09:06:40 +02:00
Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 |
18
README.md
18
README.md
@@ -73,7 +73,9 @@ Additionally, if you are using a cross-platform app and if it happens to have a
|
||||
|
||||
## How to install (Linux)
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/10969616/96675561-c20e3100-1330-11eb-8472-813de1edec90.png" width="50%">
|
||||
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
|
||||
```
|
||||
@@ -93,7 +95,12 @@ sudo apt install python3
|
||||
./setup.py
|
||||
```
|
||||
|
||||
Note: You can actually press Enter to agree to the wizard setup, and to finish it. No mouse is required to complete the setup, every element is properly focused.
|
||||
Troubleshoot
|
||||
|
||||
If the wizard does not appear then either type in "kinto.sh" in your application overview search bar or run this following command.
|
||||
```
|
||||
~/.config/kinto/gui/kinto-gui.py
|
||||
```
|
||||
|
||||
To Uninstall Kinto
|
||||
|
||||
@@ -248,7 +255,7 @@ The older xkb shortcut method info can be read about in ticket [#125](https://gi
|
||||
|
||||
## How to Upgrade Kinto
|
||||
|
||||
Simply bring down the latest in either the master branch or dev, but dev is sometimes in flux as new features are being developed. Then you can re-run the setup.py installer, it will stop the service and re-install 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.
|
||||
|
||||
@@ -300,14 +307,11 @@ To disable keyboard mapping:
|
||||
|
||||
### Does not start when you log in or after you reboot?
|
||||
|
||||
Kinto
|
||||
|
||||
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)
|
||||
|
||||
|
||||
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.
|
||||
To reset the display variable
|
||||
|
||||
```
|
||||
echo $DISPLAY
|
||||
|
344
keycheck.py
344
keycheck.py
@@ -1,344 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# pip3 install pynput
|
||||
# pip3 install --no-deps pynput
|
||||
|
||||
# from pynput.keyboard import Key, Listener
|
||||
import sys, subprocess, time, os
|
||||
from subprocess import PIPE, Popen
|
||||
delay=3
|
||||
|
||||
def cmdline(command):
|
||||
process = Popen(
|
||||
args=command,
|
||||
stdout=PIPE,
|
||||
universal_newlines=True,
|
||||
shell=True
|
||||
)
|
||||
return process.communicate()[0]
|
||||
|
||||
class color:
|
||||
PURPLE = '\033[95m'
|
||||
CYAN = '\033[96m'
|
||||
DARKCYAN = '\033[36m'
|
||||
BLUE = '\033[94m'
|
||||
GREEN = '\033[92m'
|
||||
YELLOW = '\033[93m'
|
||||
RED = '\033[91m'
|
||||
BOLD = '\033[1m'
|
||||
UNDERLINE = '\033[4m'
|
||||
END = '\033[0m'
|
||||
|
||||
def countdown(secs):
|
||||
for i in range(0,secs):
|
||||
print(secs-i, end="\r", flush=True)
|
||||
time.sleep(1)
|
||||
|
||||
def on_press(key):
|
||||
print('{0} pressed'.format(key))
|
||||
|
||||
def on_release(key):
|
||||
# print('{0} release'.format(key))
|
||||
if key == Key.esc:
|
||||
# Stop listener
|
||||
return False
|
||||
|
||||
def yn_choice(message, default='y'):
|
||||
choices = 'Y/n' if default.lower() in ('y', 'yes') else 'y/N'
|
||||
choice = input("%s (%s) " % (message, choices))
|
||||
values = ('y', 'yes', '') if choices == 'Y/n' else ('y', 'yes')
|
||||
return choice.strip().lower() in values
|
||||
|
||||
modifier_keys = {
|
||||
"primary":"",
|
||||
"secondary":"",
|
||||
"rprimary":"",
|
||||
"rsecondary":"",
|
||||
"capslock":"",
|
||||
"capswap":""
|
||||
}
|
||||
|
||||
def set_key(key):
|
||||
global modifier_keys
|
||||
print("\nWhich key would you like to set?\n")
|
||||
|
||||
while True:
|
||||
try:
|
||||
keytype = int(input(
|
||||
"1) Ctrl\n" +
|
||||
"2) Alt\n" +
|
||||
"3) Super/Win/Cmd/Chrome search key\n"))
|
||||
if keytype < 4 and keytype > 0:
|
||||
break
|
||||
except:
|
||||
print("That's not a valid option!")
|
||||
print("")
|
||||
if keytype == 1:
|
||||
modifier_keys[key] = "Ctrl"
|
||||
elif keytype == 2:
|
||||
modifier_keys[key] = "Alt"
|
||||
elif keytype == 3:
|
||||
modifier_keys[key] = "Cmd"
|
||||
|
||||
def set_cap():
|
||||
global modifier_keys
|
||||
print("\nWhich key would you like to swap?\n")
|
||||
|
||||
while True:
|
||||
try:
|
||||
keytype = int(input(
|
||||
"1) Ctrl (swap)\n" +
|
||||
"2) Ctrl (duplicate)\n" +
|
||||
"3) Esc (swap)\n"))
|
||||
if keytype < 4 and keytype > 0:
|
||||
break
|
||||
except:
|
||||
print("That's not a valid option!")
|
||||
print("")
|
||||
if keytype == 1:
|
||||
modifier_keys["capslock"] = "Ctrl-swap"
|
||||
elif keytype == 2:
|
||||
modifier_keys["capslock"] = "Ctrl-dup"
|
||||
elif keytype == 3:
|
||||
modifier_keys["capswap"] = "Escape"
|
||||
|
||||
def is_primary(key):
|
||||
global modifier_keys
|
||||
if not (str(key).replace("Key.", "").title() == "Enter" or str(key).replace("Key.", "").title() == "Escape"):
|
||||
print(str(key).replace("Key.", "").title() + " will be remapped to Ctrl, the Cmd ⌘ key position.")
|
||||
# countdown(3)
|
||||
modifier_keys["primary"] = str(key).replace("Key.", "").title()
|
||||
elif str(key).replace("Key.", "").title() == "Escape":
|
||||
modifier_keys["primary"] = "Escape"
|
||||
# countdown(3)
|
||||
else:
|
||||
return True
|
||||
return False
|
||||
|
||||
def is_secondary(key):
|
||||
global modifier_keys
|
||||
if not (str(key).replace("Key.", "").title() == "Enter" or str(key).replace("Key.", "").title() == "Escape"):
|
||||
print(str(key).replace("Key.", "").title() + " will be remapped to Alt, the Option ⌥ key position.")
|
||||
# countdown(3)
|
||||
modifier_keys["secondary"] = str(key).replace("Key.", "").title()
|
||||
return False
|
||||
elif str(key).replace("Key.", "").title() == "Escape":
|
||||
modifier_keys["secondary"] = "Escape"
|
||||
# countdown(3)
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def is_rprimary(key):
|
||||
global modifier_keys
|
||||
if not (str(key).replace("Key.", "").title() == "Enter" or str(key).replace("Key.", "").title() == "Escape"):
|
||||
print(str(key).replace("Key.", "").title() + " will be remapped to Ctrl, the Cmd ⌘ key position.")
|
||||
# countdown(3)
|
||||
modifier_keys["rprimary"] = str(key).replace("Key.", "").title()
|
||||
return False
|
||||
elif str(key).replace("Key.", "").title() == "Escape":
|
||||
modifier_keys["rprimary"] = "Escape"
|
||||
# countdown(3)
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def is_rsecondary(key):
|
||||
global modifier_keys
|
||||
if not (str(key).replace("Key.", "").title() == "Enter" or str(key).replace("Key.", "").title() == "Escape"):
|
||||
print(str(key).replace("Key.", "").title() + " will be remapped to Alt, the Option ⌥ key position.")
|
||||
# countdown(3)
|
||||
modifier_keys["rsecondary"] = str(key).replace("Key.", "").title()
|
||||
return False
|
||||
elif str(key).replace("Key.", "").title() == "Escape":
|
||||
modifier_keys["rsecondary"] = "Escape"
|
||||
# countdown(3)
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
print(color.UNDERLINE + color.YELLOW + "\n\nPlease ignore the FN key." + color.END + " FN cannot be remapped by software, some Thinkpads can swap it with Ctrl in the BIOS.\n")
|
||||
input("Press Enter to continue...\n\n")
|
||||
print(chr(27) + "[2J")
|
||||
|
||||
counter = 0
|
||||
|
||||
while True:
|
||||
|
||||
print(color.UNDERLINE + color.YELLOW + "\n\nPress the 1st key Left of the spacebar" + color.END + " (Press Esc to set manaully)\n")
|
||||
print(" 👇")
|
||||
print(" □ □ ▣ ░░░░░░░\n")
|
||||
# listener = Listener(on_release=is_primary,suppress=True)
|
||||
# listener.start()
|
||||
|
||||
# with Listener(
|
||||
# on_release=is_primary,suppress=True) as listener:
|
||||
# try:
|
||||
# listener.join()
|
||||
# except MyException as e:
|
||||
# print('{0} was pressed'.format(e.args[0]))
|
||||
|
||||
modifier_keys["primary"] = cmdline("xbindkeys -k | awk 'END {print $NF}'").strip()
|
||||
print(modifier_keys["primary"] + " will be remapped to Ctrl, the Cmd ⌘ key position.")
|
||||
|
||||
if modifier_keys["primary"] != "Escape":
|
||||
choice = yn_choice("Is this correct?")
|
||||
if(choice):
|
||||
# print("Left Physical " + modifier_keys["primary"] + " = Ctrl/Cmd ⌘")
|
||||
# listener.stop()
|
||||
# input("Press Enter to continue...\n\n")
|
||||
break
|
||||
else:
|
||||
set_key("primary")
|
||||
print("Left Physical " + modifier_keys["primary"] + " = Ctrl/Cmd ⌘\n")
|
||||
# listener.stop()
|
||||
input("Press Enter to continue...\n\n")
|
||||
break
|
||||
counter += 1
|
||||
print(str(counter)+"\n")
|
||||
time.sleep(1)
|
||||
|
||||
print(chr(27) + "[2J")
|
||||
|
||||
while True:
|
||||
print(color.UNDERLINE + color.YELLOW + "\n\nPress the 2nd key Left of the spacebar" + color.END + " (Press Esc to set manaully)\n")
|
||||
print(" 👇")
|
||||
print(" □ ▣ □ ░░░░░░░\n")
|
||||
|
||||
# with Listener(
|
||||
# on_release=is_secondary,suppress=True) as listener:
|
||||
# try:
|
||||
# listener.join()
|
||||
# except MyException as e:
|
||||
# print('{0} was pressed'.format(e.args[0]))
|
||||
modifier_keys["secondary"] = cmdline("xbindkeys -k | awk 'END {print $NF}'").strip()
|
||||
print(modifier_keys["secondary"] + " will be remapped to Alt, the Option ⌥ key position.")
|
||||
|
||||
if modifier_keys["secondary"] != "Escape":
|
||||
choice = yn_choice("Is this correct?")
|
||||
if(choice):
|
||||
# listener.stop()
|
||||
# print("Left Physical " + modifier_keys["secondary"] + " = Alt/Option ⌥")
|
||||
# input("Press Enter to continue...\n\n")
|
||||
break
|
||||
else:
|
||||
set_key("secondary")
|
||||
print("Left Physical " + modifier_keys["secondary"] + " = Alt/Option ⌥\n")
|
||||
# listener.stop()
|
||||
input("Press Enter to continue...\n\n")
|
||||
break
|
||||
|
||||
print(chr(27) + "[2J")
|
||||
|
||||
while True:
|
||||
print(color.UNDERLINE + color.YELLOW + "\n\nPress the 1st key Right of the spacebar" + color.END + " (Press Esc to set manaully)\n")
|
||||
print(" 👇")
|
||||
print(" ░░░░░░░ ▣ □")
|
||||
|
||||
# with Listener(
|
||||
# on_release=is_rprimary,suppress=True) as listener:
|
||||
# try:
|
||||
# listener.join()
|
||||
# except MyException as e:
|
||||
# print('{0} was pressed'.format(e.args[0]))
|
||||
modifier_keys["rprimary"] = cmdline("xbindkeys -k | awk 'END {print $NF}'").strip()
|
||||
print(modifier_keys["rprimary"] + " will be remapped to Ctrl, the Cmd ⌘ key position.")
|
||||
|
||||
if modifier_keys["rprimary"] != "Escape":
|
||||
choice = yn_choice("Is this correct?")
|
||||
if(choice):
|
||||
# listener.stop()
|
||||
# print("Right Physical " + modifier_keys["rprimary"] + " = Ctrl/Cmd ⌘")
|
||||
# input("Press Enter to continue...\n\n")
|
||||
break
|
||||
else:
|
||||
set_key("rprimary")
|
||||
print("Right Physical " + modifier_keys["rprimary"] + " = Ctrl/Cmd ⌘\n")
|
||||
# listener.stop()
|
||||
input("Press Enter to continue...\n\n")
|
||||
break
|
||||
|
||||
print(chr(27) + "[2J")
|
||||
|
||||
while True:
|
||||
print(color.UNDERLINE + color.YELLOW + "\n\nPress the 2nd key Right of the spacebar" + color.END + " (Press Esc to set manaully)\n")
|
||||
print(" 👇")
|
||||
print(" ░░░░░░░ □ ▣")
|
||||
|
||||
# with Listener(
|
||||
# on_release=is_rsecondary,suppress=True) as listener:
|
||||
# try:
|
||||
# listener.join()
|
||||
# except MyException as e:
|
||||
# print('{0} was pressed'.format(e.args[0]))
|
||||
modifier_keys["rsecondary"] = cmdline("xbindkeys -k | awk 'END {print $NF}'").strip()
|
||||
print(modifier_keys["rsecondary"] + " will be remapped to Alt, the Option ⌥ key position.")
|
||||
|
||||
if modifier_keys["rsecondary"] != "Escape":
|
||||
choice = yn_choice("Is this correct?")
|
||||
if(choice):
|
||||
# listener.stop()
|
||||
# print("Right Physical " + modifier_keys["rsecondary"] + " = Alt/Option ⌥")
|
||||
# modifier_keys["rsecondary"] = str(os.system("xbindkeys -k | awk 'END {print $NF}'"))
|
||||
break
|
||||
else:
|
||||
set_key("rsecondary")
|
||||
print("Right Physical " + modifier_keys["rsecondary"] + " = Alt/Option ⌥\n")
|
||||
# listener.stop()
|
||||
input("Press Enter to continue...\n\n")
|
||||
break
|
||||
|
||||
print(chr(27) + "[2J")
|
||||
|
||||
if not (modifier_keys["secondary"] == "Ctrl" or modifier_keys["secondary"] == "Control_R"):
|
||||
print(color.UNDERLINE + color.YELLOW + "GUI Usage (Physical Ctrl key)\n"+ color.END)
|
||||
print("Ctrl key will be mapped to Super. (Search key on chromebooks)")
|
||||
print("👇")
|
||||
print(" ▣ □ □ ░░░░░░░\n")
|
||||
|
||||
print("Note: Super may still activate Ctrl based shortcuts\n")
|
||||
print("at times depending on application or system level shortcuts.\n")
|
||||
print("This will only be done to align shortcuts to their expected functionality.\n")
|
||||
|
||||
input("Press Enter to continue...\n\n")
|
||||
# print(chr(27) + "[2J")
|
||||
|
||||
print(color.UNDERLINE + color.YELLOW + "Terminal Usage" + color.END + "\n")
|
||||
print("Ctrl key will be the Ctrl key.")
|
||||
print("👇")
|
||||
print(" ▣ □ □ ░░░░░░░\n")
|
||||
print("The Cmd ⌘ key position during terminal usage will usually be Ctrl+Shift.")
|
||||
print(" 👇 ")
|
||||
print(" □ □ ▣ ░░░░░░░\n")
|
||||
input("Press Enter to continue...\n")
|
||||
else:
|
||||
print("Chromebook detected.")
|
||||
|
||||
print(color.UNDERLINE + color.YELLOW + "GUI Usage\n"+ color.END)
|
||||
print("Search key (capslock position) on chromebooks will be Super\n")
|
||||
|
||||
print("Note: Super may still activate Ctrl based shortcuts")
|
||||
print("at times depending on application or system level shortcuts.\n")
|
||||
print("Efforts have been made though to use the physical Ctrl key")
|
||||
print("when it makes sense to do so, and more often than standard")
|
||||
print("keyboards. How it feels to type is more important than technical")
|
||||
print("accuracy.\n")
|
||||
print("If you believe an improvement can be made or an error was made")
|
||||
print("please let me know on github or you can fork this project.\n")
|
||||
|
||||
input("Press Enter to continue...\n\n")
|
||||
|
||||
print(color.UNDERLINE + color.YELLOW + "Terminal Usage" + color.END + "\n")
|
||||
print(" □ capslock/search key = Alt")
|
||||
print(" shift")
|
||||
print(" ▣ □ ░░░░░░░")
|
||||
print("☝️\n")
|
||||
|
||||
input("Press Enter to continue...\n\n")
|
||||
|
||||
print(chr(27) + "[2J")
|
||||
|
||||
choice = yn_choice(color.UNDERLINE + color.YELLOW + "Do you want to swap Capslock with another key?" + color.END + "\n","n")
|
||||
if(choice):
|
||||
set_cap()
|
BIN
kinto-demo.gif
BIN
kinto-demo.gif
Binary file not shown.
Before Width: | Height: | Size: 116 KiB |
0
keyswap_service.sh → kinto_old/keyswap_service.sh
Executable file → Normal file
0
keyswap_service.sh → kinto_old/keyswap_service.sh
Executable file → Normal file
0
kintox11/binary/kintox11 → kinto_old/kintox11/binary/kintox11
Executable file → Normal file
0
kintox11/binary/kintox11 → kinto_old/kintox11/binary/kintox11
Executable file → Normal file
0
system-config/caret_status.sh → kinto_old/system-config/caret_status.sh
Executable file → Normal file
0
system-config/caret_status.sh → kinto_old/system-config/caret_status.sh
Executable file → Normal file
0
system-config/caret_status_xkey.sh → kinto_old/system-config/caret_status_xkey.sh
Executable file → Normal file
0
system-config/caret_status_xkey.sh → kinto_old/system-config/caret_status_xkey.sh
Executable file → Normal file
0
system-config/cleanup.sh → kinto_old/system-config/cleanup.sh
Executable file → Normal file
0
system-config/cleanup.sh → kinto_old/system-config/cleanup.sh
Executable file → Normal file
0
system-config/keyswap.service → kinto_old/system-config/keyswap.service
Executable file → Normal file
0
system-config/keyswap.service → kinto_old/system-config/keyswap.service
Executable file → Normal file
0
system-config/keyswap_toggle.sh → kinto_old/system-config/keyswap_toggle.sh
Executable file → Normal file
0
system-config/keyswap_toggle.sh → kinto_old/system-config/keyswap_toggle.sh
Executable file → Normal file
0
system-config/xactive.sh → kinto_old/system-config/xactive.sh
Executable file → Normal file
0
system-config/xactive.sh → kinto_old/system-config/xactive.sh
Executable file → Normal file
7
setup.py
7
setup.py
@@ -121,9 +121,14 @@ if os.path.isdir(homedir + "/.config/kinto") == False:
|
||||
os.mkdir(homedir + "/.config/kinto")
|
||||
time.sleep(0.5)
|
||||
|
||||
|
||||
cmdline("git fetch")
|
||||
|
||||
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)"')
|
||||
|
||||
print("\nKinto " + kintover + "Type in Linux like it's a Mac.\n")
|
||||
|
||||
if args.uninstall:
|
||||
subprocess.check_call(shlex.split("./xkeysnail_service.sh uninstall"))
|
||||
|
BIN
splash.png
BIN
splash.png
Binary file not shown.
Before Width: | Height: | Size: 40 KiB |
@@ -235,11 +235,13 @@ GroupAdd, intellij, ahk_exe idea64.exe
|
||||
|
||||
; $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
|
||||
|
||||
|
@@ -43,6 +43,8 @@ class MyWindow(Gtk.Window):
|
||||
bgerror = Gtk.Image()
|
||||
bguninstall = Gtk.Image()
|
||||
last_onward = Gtk.Button()
|
||||
first_onward = Gtk.ToggleButton()
|
||||
page = 1
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_alignment(1, 0)
|
||||
@@ -78,6 +80,7 @@ class MyWindow(Gtk.Window):
|
||||
|
||||
homedir = os.path.expanduser("~")
|
||||
self.kconfig = homedir+"/.config/kinto/kinto.py"
|
||||
autostart_bool = False
|
||||
|
||||
path = os.environ['HOME']+'/.config/kinto/kinto-color.svg'
|
||||
width = -1
|
||||
@@ -397,6 +400,7 @@ class MyWindow(Gtk.Window):
|
||||
self.setupwin.set_position(Gtk.WindowPosition.CENTER)
|
||||
|
||||
self.setupwin.add(self.overlay)
|
||||
self.setupwin.signal_id = 0
|
||||
|
||||
from PIL import Image
|
||||
|
||||
@@ -987,55 +991,63 @@ class MyWindow(Gtk.Window):
|
||||
self.label.set_markup(" " + status + " ")
|
||||
return self.kinto_status.poll() is None
|
||||
|
||||
def key_press_event(self, widget, event, page):
|
||||
def key_press_event(self, widget, event):
|
||||
global openWin
|
||||
trigger = "None"
|
||||
keyname = Gdk.keyval_name(event.keyval)
|
||||
current = self.second_page
|
||||
bg = self.bgsuccess4
|
||||
onward = self.success_page
|
||||
print("page value: "+str(self.page))
|
||||
|
||||
if page == 1 and "Control" in keyname:
|
||||
if self.page == 1 and "Control" in keyname and openWin == False:
|
||||
print("IBM or Chromebook")
|
||||
print("Continue to page 2")
|
||||
bg = self.bgcaps
|
||||
onward = self.caps_page
|
||||
trigger = "Half"
|
||||
elif page == 2 and "Caps_Lock" in keyname and event.state & Gdk.ModifierType.LOCK_MASK:
|
||||
self.page += 1
|
||||
elif self.page == 2 and "Caps_Lock" in keyname and event.state & Gdk.ModifierType.LOCK_MASK:
|
||||
print("Set IBM Keyboard")
|
||||
current = self.caps_page
|
||||
self.options["kbtype"] = "ibm"
|
||||
trigger = "Done"
|
||||
elif page == 2 and "Super" in keyname:
|
||||
elif self.page == 2 and "Super" in keyname:
|
||||
print("Set Chromebook Keyboard")
|
||||
current = self.caps_page
|
||||
self.options["kbtype"] = "cbk"
|
||||
trigger = "Done"
|
||||
elif page == 1 and "Alt" in keyname:
|
||||
elif self.page == 1 and "Alt" in keyname:
|
||||
print("Set Mac Keyboard")
|
||||
self.options["kbtype"] = "mac"
|
||||
trigger = "Done"
|
||||
elif page == 1 and "Super" in keyname:
|
||||
elif self.page == 1 and "Super" in keyname:
|
||||
print("Set Win Keyboard")
|
||||
self.options["kbtype"] = "win"
|
||||
trigger = "Done"
|
||||
|
||||
if trigger == "Half" or trigger == "Done":
|
||||
if trigger == "Half" or trigger == "Done" and openWin == False:
|
||||
for grandkid in self.overlay.get_children():
|
||||
self.overlay.remove(grandkid)
|
||||
self.overlay.add(bg)
|
||||
self.overlay.add_overlay(self.container)
|
||||
self.container.add(onward)
|
||||
self.container.remove(current)
|
||||
self.setupwin.disconnect(self.setupwin.signal_id)
|
||||
if trigger == "Half":
|
||||
self.setupwin.signal_id = self.setupwin.connect("key_press_event", self.key_press_event,2)
|
||||
# self.setupwin.disconnect(self.setupwin.signal_id)
|
||||
if trigger == "Half" and openWin == False:
|
||||
# print("reset key_press_event")
|
||||
# self.setupwin.signal_id = self.setupwin.connect("key_press_event", self.key_press_event)
|
||||
self.setupwin.show_all()
|
||||
elif trigger == "Done":
|
||||
elif trigger == "Done" and openWin == False:
|
||||
print("in Done")
|
||||
self.setKinto()
|
||||
self.setupwin.show_all()
|
||||
openWin = True
|
||||
self.last_onward.grab_focus()
|
||||
# print(self.setupwin.signal_id)
|
||||
self.setupwin.disconnect(self.setupwin.signal_id)
|
||||
# print(self.setupwin.signal_id)
|
||||
print("key press event is on")
|
||||
|
||||
def InputToTerm(self,cmd):
|
||||
# Not clearly known which VTE versions
|
||||
@@ -1144,15 +1156,22 @@ class FirstPage(Gtk.Box):
|
||||
scroller.add(vbox)
|
||||
|
||||
hbox = Gtk.HBox()
|
||||
previous = Gtk.Button("Decline")
|
||||
previous = Gtk.Button("")
|
||||
for child in previous.get_children():
|
||||
child.set_label("<b>Decline</b>")
|
||||
child.set_use_markup(True)
|
||||
previous.connect("clicked", self.goback)
|
||||
previous.set_margin_right(245)
|
||||
hbox.add(previous)
|
||||
|
||||
onward = Gtk.Button("Agree")
|
||||
onward.connect("clicked", self.forward)
|
||||
self.__parent_window.first_onward.set_label("")
|
||||
for child in self.__parent_window.first_onward.get_children():
|
||||
child.set_label("<b>Agree</b>")
|
||||
child.set_use_markup(True)
|
||||
self.__parent_window.first_onward.set_active(True)
|
||||
self.__parent_window.first_onward.connect("clicked", self.forward)
|
||||
|
||||
hbox.add(onward)
|
||||
hbox.add(self.__parent_window.first_onward)
|
||||
hbox.set_hexpand(False)
|
||||
hbox.set_vexpand(False)
|
||||
hbox.set_margin_bottom(6)
|
||||
@@ -1170,19 +1189,22 @@ class FirstPage(Gtk.Box):
|
||||
self.grid.add(vbox_container)
|
||||
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
|
||||
self.add(self.grid)
|
||||
onward.grab_focus()
|
||||
self.__parent_window.first_onward.grab_focus()
|
||||
|
||||
def goback(self, *args):
|
||||
Gtk.main_quit()
|
||||
self.hide()
|
||||
|
||||
def forward(self, button):
|
||||
self.__parent_window.first_onward.set_active(True)
|
||||
for grandkid in self.__parent_window.overlay.get_children():
|
||||
self.__parent_window.overlay.remove(grandkid)
|
||||
self.__parent_window.overlay.add(self.__parent_window.bgspace)
|
||||
self.__parent_window.overlay.add_overlay(self.__parent_window.container)
|
||||
self.__parent_window.container.add(self.__parent_window.second_page)
|
||||
self.__parent_window.setupwin.signal_id = self.__parent_window.setupwin.connect("key_press_event", self.__parent_window.key_press_event,1)
|
||||
# print(self.__parent_window.setupwin.signal_id)
|
||||
self.__parent_window.setupwin.signal_id = self.__parent_window.setupwin.connect("key_press_event", self.__parent_window.key_press_event)
|
||||
# print(self.__parent_window.setupwin.signal_id)
|
||||
self.__parent_window.container.remove(self.__parent_window.first_page)
|
||||
self.__parent_window.setupwin.show_all()
|
||||
self.hide()
|
||||
@@ -1206,7 +1228,10 @@ class SecondPage(Gtk.Box):
|
||||
scroller.add(vbox)
|
||||
|
||||
hbox = Gtk.HBox()
|
||||
previous = Gtk.Button("Go Back")
|
||||
previous = Gtk.Button("")
|
||||
for child in previous.get_children():
|
||||
child.set_label("<b>Go Back</b>")
|
||||
child.set_use_markup(True)
|
||||
previous.connect("clicked", self.goback)
|
||||
previous.set_margin_right(315)
|
||||
hbox.add(previous)
|
||||
@@ -1242,29 +1267,31 @@ class SecondPage(Gtk.Box):
|
||||
self.__parent_window.container.remove(self.__parent_window.second_page)
|
||||
self.__parent_window.setupwin.disconnect(self.__parent_window.setupwin.signal_id)
|
||||
self.__parent_window.setupwin.show_all()
|
||||
self.__parent_window.first_onward.grab_focus()
|
||||
self.hide()
|
||||
|
||||
def capsforward(self, *args):
|
||||
for grandkid in self.__parent_window.overlay.get_children():
|
||||
self.__parent_window.overlay.remove(grandkid)
|
||||
self.__parent_window.overlay.add(self.__parent_window.bgcaps)
|
||||
self.__parent_window.overlay.add_overlay(self.__parent_window.container)
|
||||
self.__parent_window.container.add(self.__parent_window.caps_page)
|
||||
self.__parent_window.container.remove(self.__parent_window.second_page)
|
||||
self.__parent_window.setupwin.signal_id = self.__parent_window.setupwin.connect("key_press_event", self.__parent_window.key_press_event,2)
|
||||
self.__parent_window.setupwin.show_all()
|
||||
self.hide()
|
||||
# def capsforward(self, *args):
|
||||
# for grandkid in self.__parent_window.overlay.get_children():
|
||||
# self.__parent_window.overlay.remove(grandkid)
|
||||
# self.__parent_window.overlay.add(self.__parent_window.bgcaps)
|
||||
# self.__parent_window.overlay.add_overlay(self.__parent_window.container)
|
||||
# self.__parent_window.container.add(self.__parent_window.caps_page)
|
||||
# self.__parent_window.container.remove(self.__parent_window.second_page)
|
||||
# self.__parent_window.setupwin.disconnect(self.__parent_window.setupwin.signal_id)
|
||||
# self.__parent_window.setupwin.signal_id = self.__parent_window.setupwin.connect("key_press_event", self.__parent_window.key_press_event,2)
|
||||
# self.__parent_window.setupwin.show_all()
|
||||
# self.hide()
|
||||
|
||||
def forward(self, *args):
|
||||
for grandkid in self.__parent_window.overlay.get_children():
|
||||
self.__parent_window.overlay.remove(grandkid)
|
||||
self.__parent_window.overlay.add(self.__parent_window.bgsuccess4)
|
||||
self.__parent_window.overlay.add_overlay(self.__parent_window.container)
|
||||
self.__parent_window.container.add(self.__parent_window.success_page)
|
||||
self.__parent_window.container.remove(self.__parent_window.second_page)
|
||||
self.__parent_window.setupwin.disconnect(self.__parent_window.setupwin.signal_id)
|
||||
self.__parent_window.setupwin.show_all()
|
||||
self.hide()
|
||||
# def forward(self, *args):
|
||||
# for grandkid in self.__parent_window.overlay.get_children():
|
||||
# self.__parent_window.overlay.remove(grandkid)
|
||||
# self.__parent_window.overlay.add(self.__parent_window.bgsuccess4)
|
||||
# self.__parent_window.overlay.add_overlay(self.__parent_window.container)
|
||||
# self.__parent_window.container.add(self.__parent_window.success_page)
|
||||
# self.__parent_window.container.remove(self.__parent_window.second_page)
|
||||
# self.__parent_window.setupwin.disconnect(self.__parent_window.setupwin.signal_id)
|
||||
# self.__parent_window.setupwin.show_all()
|
||||
# self.hide()
|
||||
|
||||
class CapsPage(Gtk.Box):
|
||||
def __init__(self, parent_window):
|
||||
@@ -1285,7 +1312,10 @@ class CapsPage(Gtk.Box):
|
||||
scroller.add(vbox)
|
||||
|
||||
hbox = Gtk.HBox()
|
||||
previous = Gtk.Button("Go Back")
|
||||
previous = Gtk.Button("")
|
||||
for child in previous.get_children():
|
||||
child.set_label("<b>Go Back</b>")
|
||||
child.set_use_markup(True)
|
||||
previous.connect("clicked", self.goback)
|
||||
previous.set_margin_right(315)
|
||||
hbox.add(previous)
|
||||
@@ -1318,22 +1348,23 @@ class CapsPage(Gtk.Box):
|
||||
self.__parent_window.overlay.add(self.__parent_window.bgspace)
|
||||
self.__parent_window.overlay.add_overlay(self.__parent_window.container)
|
||||
self.__parent_window.container.add(self.__parent_window.second_page)
|
||||
self.__parent_window.setupwin.disconnect(self.__parent_window.setupwin.signal_id)
|
||||
self.__parent_window.setupwin.signal_id = self.__parent_window.setupwin.connect("key_press_event", self.__parent_window.key_press_event,1)
|
||||
self.__parent_window.page = 1
|
||||
# self.__parent_window.setupwin.disconnect(self.__parent_window.setupwin.signal_id)
|
||||
# self.__parent_window.setupwin.signal_id = self.__parent_window.setupwin.connect("key_press_event", self.__parent_window.key_press_event)
|
||||
self.__parent_window.container.remove(self.__parent_window.caps_page)
|
||||
self.__parent_window.setupwin.show_all()
|
||||
self.hide()
|
||||
|
||||
def forward(self, *args):
|
||||
for grandkid in self.__parent_window.overlay.get_children():
|
||||
self.__parent_window.overlay.remove(grandkid)
|
||||
self.__parent_window.overlay.add(self.__parent_window.bgsuccess4)
|
||||
self.__parent_window.overlay.add_overlay(self.__parent_window.container)
|
||||
self.__parent_window.container.add(self.__parent_window.success_page)
|
||||
self.__parent_window.container.remove(self.__parent_window.caps_page)
|
||||
self.__parent_window.setupwin.disconnect(self.__parent_window.setupwin.signal_id)
|
||||
self.__parent_window.setupwin.show_all()
|
||||
self.hide()
|
||||
# def forward(self, *args):
|
||||
# for grandkid in self.__parent_window.overlay.get_children():
|
||||
# self.__parent_window.overlay.remove(grandkid)
|
||||
# self.__parent_window.overlay.add(self.__parent_window.bgsuccess4)
|
||||
# self.__parent_window.overlay.add_overlay(self.__parent_window.container)
|
||||
# self.__parent_window.container.add(self.__parent_window.success_page)
|
||||
# self.__parent_window.container.remove(self.__parent_window.caps_page)
|
||||
# self.__parent_window.setupwin.disconnect(self.__parent_window.setupwin.signal_id)
|
||||
# self.__parent_window.setupwin.show_all()
|
||||
# self.hide()
|
||||
|
||||
class SuccessPage(Gtk.Box):
|
||||
def __init__(self, parent_window):
|
||||
@@ -1349,6 +1380,7 @@ class SuccessPage(Gtk.Box):
|
||||
|
||||
def forward(self, *args):
|
||||
self.hide()
|
||||
# self.__parent_window.setupwin.disconnect(self.__parent_window.setupwin.signal_id)/
|
||||
self.__parent_window.setupwin.close()
|
||||
|
||||
|
||||
|
@@ -4,7 +4,7 @@ Description=xkeysnail
|
||||
[Service]
|
||||
Type=simple
|
||||
KillMode=process
|
||||
ExecStart=/usr/bin/sudo /bin/bash -c '/usr/bin/xhost +SI:localuser:root && {homedir}/.config/kinto/killdups.sh && /usr/local/bin/xkeysnail --quiet --watch {homedir}/.config/kinto/kinto.py'
|
||||
ExecStart=/usr/bin/sudo /bin/bash -c '/usr/bin/xhost +SI:localuser:root && {homedir}/.config/kinto/killdups.sh && {xkeysnail} --quiet --watch {homedir}/.config/kinto/kinto.py'
|
||||
ExecStop=/usr/bin/sudo /bin/bash -c '/usr/bin/sudo pkill -f bin/xkeysnail && exit 0'
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
|
@@ -8,90 +8,17 @@ distro=$(awk -F= '$1=="NAME" { gsub("[\",!,_, ]","",$2);print $2 ;}' /etc/os-rel
|
||||
typeset -l dename
|
||||
dename=$(./system-config/dename.sh | cut -d " " -f1)
|
||||
|
||||
|
||||
# Add additional shortcuts if needed, does not modify existing ones
|
||||
|
||||
if [[ $dename == 'gnome' || $dename == 'budgie' ]];then
|
||||
if [[ $(gsettings get org.gnome.mutter overlay-key | grep "''\|' '" | wc -l) != 1 ]];then
|
||||
bound=$(gsettings get org.gnome.mutter overlay-key)
|
||||
echo "Overlay key, " $bound ", detected. Will be removing so Super-Space can remap to Cmd-Space for app launching.."
|
||||
echo "Overlay key, Super, detected. Will be removing so Super-Space can remap to Cmd-Space for app launching.."
|
||||
gsettings set org.gnome.mutter overlay-key ''
|
||||
fi
|
||||
fi
|
||||
|
||||
# if ls /etc/apt/sources.list.d/system76* 1> /dev/null 2>&1; then
|
||||
if [[ $distro == 'popos' ]]; then
|
||||
pip3 install pillow
|
||||
# Addition, does not overwrite existing
|
||||
if [[ $(gsettings get org.gnome.desktop.wm.keybindings minimize | grep "\[\]" | wc -l) != 1 ]];then
|
||||
echo "Adding Super-h (Cmd+h) to hide/minimize Window."
|
||||
gsettings set org.gnome.desktop.wm.keybindings minimize "['<Super>h','<Alt>F9']"
|
||||
# work around to make sure settings survive reboot
|
||||
dconf dump /org/gnome/desktop/wm/keybindings/ > tempkb.conf
|
||||
dconf load /org/gnome/desktop/wm/keybindings/ < tempkb.conf
|
||||
else
|
||||
bound=$(gsettings get org.gnome.desktop.wm.keybindings minimize)
|
||||
echo "Hide/minimize Window is already bound to " $bound " , please remap it to Super-H for kinto."
|
||||
echo "gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\""
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $dename == "kde" ]]; then
|
||||
if [[ $distroy == "manjarolinux" ]]; then
|
||||
sudo ./system-config/unipkg.sh vte3
|
||||
else
|
||||
sudo ./system-config/unipkg.sh libvte-2.91-dev
|
||||
fi
|
||||
fi
|
||||
if [[ $distro == 'kdeneon' ]]; then
|
||||
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Show Desktop" "Meta+D,none,Show Desktop"
|
||||
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Close" "Alt+F4,none,Close Window"
|
||||
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Minimize" "Meta+PgDown,none,Minimize Window"
|
||||
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Maximize" "Meta+PgUp,none,Maximize Window"
|
||||
kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &
|
||||
fi
|
||||
|
||||
if [[ $distro == 'fedora' ]]; then
|
||||
echo "Checking SELinux status..."
|
||||
if [[ $(perl -ne 'print if /^SELINUX=enforcing/' /etc/selinux/config | wc -l) != 0 ]]; then
|
||||
while true; do
|
||||
read -rep $'\nWould you like to update your SELinux state from enforcing to permissive? (y/n)\n' yn
|
||||
case $yn in
|
||||
[Yy]* ) setSE='yes'; break;;
|
||||
[Nn]* ) exp='no'; expsh=" " break;;
|
||||
# * ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $yn == "yes" ]]; then
|
||||
sed -i "s/SELINUX=enforcing/SELINUX=permissive/g" /etc/selinux/config
|
||||
echo "/etc/selinux/config has been updated. Please reboot your computer before continuing."
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo "SELinux state should be ok for Kinto to install"
|
||||
fi
|
||||
if [[ $(gsettings get org.gnome.desktop.wm.keybindings show-desktop | grep "\[\]" | wc -l) == 1 ]];then
|
||||
gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d']"
|
||||
else
|
||||
if [[ $(gsettings get org.gnome.desktop.wm.keybindings show-desktop | grep "<Super>d" | wc -l) == 0 ]]; then
|
||||
echo 'Kinto will not set your "Show Desktop" hotkey due to it already being set.\nPlease set Show Desktop to Super-D, or Edit Kinto'"'"'s config.'
|
||||
echo "Did not run the following."
|
||||
echo "gsettings set org.gnome.desktop.wm.keybindings show-desktop \"['<Super>d']\""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
function uninstall {
|
||||
|
||||
echo -e "\nNote: Restoring keys is only relevant if you had installed a version prior to 1.2 of Kinto. You should skip this step if 1.2+ is all you have installed."
|
||||
|
||||
while true; do
|
||||
read -rep $'\nPress R to restore your original shortcuts.\nPress F to reset to factory shortcuts. (f/r)\n' yn
|
||||
read -rep $'\nPress R to restore your original shortcuts.\nPress F to reset to factory shortcuts.\nPress N to skip. (f/r/N)\n' yn
|
||||
case $yn in
|
||||
[Ff]* ) yn="f"; break;;
|
||||
[Rr]* ) yn="r";break;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Nn]* ) yn="n";break;;
|
||||
* ) yn="n";break;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -103,8 +30,6 @@ function uninstall {
|
||||
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
|
||||
@@ -145,6 +70,13 @@ function uninstall {
|
||||
xfcekeys=$(ls | grep -m1 "xfce4-keyboard")
|
||||
cp ./"$xfcekeys" ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
|
||||
fi
|
||||
elif [ "$yn" == "n" ]; then
|
||||
echo "Skipping..."
|
||||
fi
|
||||
if [[ $dename == "gnome" || $dename == "budgie" ]]; then
|
||||
echo -e "\nWill still be restoring the overlay key"
|
||||
echo -e "gsettings set org.gnome.mutter overlay-key 'super'\n"
|
||||
gsettings set org.gnome.mutter overlay-key 'super'
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -226,6 +158,134 @@ function budgieUpdate {
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
|
||||
echo "Uninstalling Kinto - xkeysnail (udev)"
|
||||
uninstall
|
||||
echo "Removing any Apple driver settings Kinto may have have set..."
|
||||
removeAppleKB
|
||||
echo "Killing the Kinto tray..."
|
||||
pkill -f kintotray >/dev/null 2>&1
|
||||
echo "Stopping the Kinto service..."
|
||||
sudo systemctl stop xkeysnail >/dev/null 2>&1
|
||||
echo "Disabling the Kinto service..."
|
||||
sudo systemctl disable xkeysnail >/dev/null 2>&1
|
||||
echo "Killing any remaining xkeysnail processes..."
|
||||
sudo pkill -f bin/xkeysnail >/dev/null 2>&1
|
||||
echo "Killing any Kinto related threads from Kinto tray or the gui..."
|
||||
sudo pkill -f "is-active xkeysnail" >/dev/null 2>&1
|
||||
echo -e "\nRemoving Kinto..."
|
||||
echo "rm /etc/sudoers.d/limitedadmins"
|
||||
echo "rm ~/.config/autostart/xkeysnail.desktop"
|
||||
echo "rm ~/.config/autostart/kintotray.desktop"
|
||||
echo "rm -rf ~/.config/kinto"
|
||||
echo "rm /usr/share/applications/kinto.desktop"
|
||||
sudo rm /etc/sudoers.d/limitedadmins >/dev/null 2>&1
|
||||
rm ~/.config/autostart/xkeysnail.desktop >/dev/null 2>&1
|
||||
rm ~/.config/autostart/kintotray.desktop >/dev/null 2>&1
|
||||
rm -rf ~/.config/kinto >/dev/null 2>&1
|
||||
sudo rm /usr/share/applications/kinto.desktop >/dev/null 2>&1
|
||||
echo -e "\nRemoving Kinto's systemd service files..."
|
||||
echo "rm /etc/systemd/system/xkeysnail.service"
|
||||
echo "rm /etc/systemd/system/graphical.target.wants/xkeysnail.service"
|
||||
echo "rm /usr/lib/systemd/system/xkeysnail.service"
|
||||
echo "rm /lib/systemd/system/xkeysnail.service"
|
||||
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
|
||||
sudo rm /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
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sudo systemctl stop xkeysnail >/dev/null 2>&1
|
||||
sudo systemctl disable xkeysnail >/dev/null 2>&1
|
||||
sudo pkill -f bin/xkeysnail >/dev/null 2>&1
|
||||
sudo pkill -f "is-active xkeysnail" >/dev/null 2>&1
|
||||
|
||||
pip3 install pillow
|
||||
|
||||
# Add additional shortcuts if needed, does not modify existing ones
|
||||
|
||||
if [[ $dename == 'gnome' || $dename == 'budgie' ]];then
|
||||
if [[ $(gsettings get org.gnome.mutter overlay-key | grep "''\|' '" | wc -l) != 1 ]];then
|
||||
bound=$(gsettings get org.gnome.mutter overlay-key)
|
||||
echo "Overlay key, " $bound ", detected. Will be removing so Super-Space can remap to Cmd-Space for app launching.."
|
||||
gsettings set org.gnome.mutter overlay-key ''
|
||||
fi
|
||||
fi
|
||||
|
||||
# if ls /etc/apt/sources.list.d/system76* 1> /dev/null 2>&1; then
|
||||
if [[ $distro == 'popos' ]]; then
|
||||
# Addition, does not overwrite existing
|
||||
if [[ $(gsettings get org.gnome.desktop.wm.keybindings minimize | grep "\[\]" | wc -l) != 1 ]];then
|
||||
echo "Adding Super-h (Cmd+h) to hide/minimize Window."
|
||||
gsettings set org.gnome.desktop.wm.keybindings minimize "['<Super>h','<Alt>F9']"
|
||||
# work around to make sure settings survive reboot
|
||||
dconf dump /org/gnome/desktop/wm/keybindings/ > tempkb.conf
|
||||
dconf load /org/gnome/desktop/wm/keybindings/ < tempkb.conf
|
||||
else
|
||||
bound=$(gsettings get org.gnome.desktop.wm.keybindings minimize)
|
||||
echo "Hide/minimize Window is already bound to " $bound " , please remap it to Super-H for kinto."
|
||||
echo "gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\""
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then
|
||||
if [ "$distro" == "manjarolinux" ]; then
|
||||
sudo ./system-config/unipkg.sh "xorg-xhost gcc"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $dename == "kde" ]]; then
|
||||
if [[ $distro == "manjarolinux" ]]; then
|
||||
sudo ./system-config/unipkg.sh vte3
|
||||
else
|
||||
sudo ./system-config/unipkg.sh libvte-2.91-dev
|
||||
fi
|
||||
fi
|
||||
if [[ $distro == 'kdeneon' ]]; then
|
||||
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Show Desktop" "Meta+D,none,Show Desktop"
|
||||
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Close" "Alt+F4,none,Close Window"
|
||||
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Minimize" "Meta+PgDown,none,Minimize Window"
|
||||
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Maximize" "Meta+PgUp,none,Maximize Window"
|
||||
kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &
|
||||
fi
|
||||
|
||||
if [[ $distro == 'fedora' ]]; then
|
||||
echo "Checking SELinux status..."
|
||||
if [[ $(perl -ne 'print if /^SELINUX=enforcing/' /etc/selinux/config | wc -l) != 0 ]]; then
|
||||
while true; do
|
||||
read -rep $'\nWould you like to update your SELinux state from enforcing to permissive? (y/n)\n' yn
|
||||
case $yn in
|
||||
[Yy]* ) setSE='yes'; break;;
|
||||
[Nn]* ) exp='no'; expsh=" " break;;
|
||||
# * ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $yn == "yes" ]]; then
|
||||
sed -i "s/SELINUX=enforcing/SELINUX=permissive/g" /etc/selinux/config
|
||||
echo "/etc/selinux/config has been updated. Please reboot your computer before continuing."
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo "SELinux state should be ok for Kinto to install"
|
||||
fi
|
||||
if [[ $(gsettings get org.gnome.desktop.wm.keybindings show-desktop | grep "\[\]" | wc -l) == 1 ]];then
|
||||
gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d']"
|
||||
else
|
||||
if [[ $(gsettings get org.gnome.desktop.wm.keybindings show-desktop | grep "<Super>d" | wc -l) == 0 ]]; then
|
||||
echo 'Kinto will not set your "Show Desktop" hotkey due to it already being set.\nPlease set Show Desktop to Super-D, or Edit Kinto'"'"'s config.'
|
||||
echo "Did not run the following."
|
||||
echo "gsettings set org.gnome.desktop.wm.keybindings show-desktop \"['<Super>d']\""
|
||||
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)"
|
||||
@@ -274,6 +334,9 @@ if ! [ -x "$(command -v python3-config)" ]; then
|
||||
sudo ./system-config/unipkg.sh "$pydev"
|
||||
fi
|
||||
fi
|
||||
# if [ "$distro" == "ubuntu" ] && [ "$dename" == "gnome" ];then
|
||||
# sudo ./system-config/unipkg.sh gnome-tweaks gnome-shell-extension-appindicator gir1.2-appindicator3-0.1
|
||||
# fi
|
||||
if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then
|
||||
if [ "$distro" == "\"manjaro linux\"" ]; then
|
||||
sudo ./system-config/unipkg.sh "xorg-xhost gcc"
|
||||
@@ -307,7 +370,7 @@ yes | cp -rf ./xkeysnail-config/xkeysnail.desktop ~/.config/kinto/xkeysnail.desk
|
||||
# logoff fix - not solid for every os. Prevents missed 1 character input on login
|
||||
# yes | sudo cp -rf xkeysnail-config/gnome_logoff.sh ~/.config/kinto/logoff.sh
|
||||
|
||||
git describe --tags --always origin master | perl -ne "print \"\$1 build `git rev-parse --short HEAD`\n\" for m/\b(.*)-\w+-\w{8}/" | head -n 1 > ~/.config/kinto/version
|
||||
echo "$(git describe --tag --abbrev=0 | head -n 1)" "build" "$(git rev-parse --short HEAD)" > ~/.config/kinto/version
|
||||
yes | cp -rf ./xkeysnail-config/kinto.py ./xkeysnail-config/kinto.py.new
|
||||
yes | cp -rf ./xkeysnail-config/limitedadmins ./xkeysnail-config/limitedadmins.new
|
||||
yes | cp -rf ./xkeysnail-config/gui/ ~/.config/kinto/
|
||||
@@ -337,10 +400,11 @@ sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/gui/kinto-gui.py
|
||||
sed -i "s#{homedir}#`echo "$HOME"`#g" ./xkeysnail-config/gui/kinto.desktop.new
|
||||
sudo mv ./xkeysnail-config/gui/kinto.desktop.new /usr/share/applications/kinto.desktop
|
||||
sed -i "s#{xhost}#`\\which xhost`#g" ./xkeysnail-config/xkeysnail.service.new
|
||||
sed -i "s#{xkeysnail}#`which xkeysnail`#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
|
||||
sed -i "s#{xkeysnail}#`which 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/kinto/xkeysnail.desktop
|
||||
@@ -431,9 +495,8 @@ if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
|
||||
# sudo systemctl enable xkeysnail.service
|
||||
# fi
|
||||
# sudo systemctl restart xkeysnail
|
||||
if ! [[ $dename == "gnome" || $dename == "kde" ]];then
|
||||
sudo pkill -f kintotray >/dev/null 2>&1
|
||||
else
|
||||
sudo pkill -f kintotray >/dev/null 2>&1
|
||||
if [[ $dename == "gnome" || $dename == "kde" ]];then
|
||||
sed -i "s/systray = true/systray = false/g" ~/.config/kinto/initkb
|
||||
fi
|
||||
nohup python3 ~/.config/kinto/gui/kinto-gui.py >/dev/null 2>&1 &
|
||||
@@ -460,33 +523,21 @@ if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
|
||||
|
||||
echo -e "Kinto install is \e[1m\e[32mcomplete\e[0m.\n"
|
||||
|
||||
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 pkill -f bin/xkeysnail >/dev/null 2>&1
|
||||
sudo pkill -f "is-active xkeysnail" >/dev/null 2>&1
|
||||
sudo rm /etc/sudoers.d/limitedadmins >/dev/null 2>&1
|
||||
rm ~/.config/autostart/xkeysnail.desktop >/dev/null 2>&1
|
||||
rm ~/.config/autostart/kintotray.desktop >/dev/null 2>&1
|
||||
rm -rf ~/.config/kinto >/dev/null 2>&1
|
||||
sudo rm /etc/systemd/system/xkeysnail.service >/dev/null 2>&1
|
||||
sudo rm /usr/share/applications/kinto.desktop >/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
|
||||
sudo rm /lib/systemd/system/xkeysnail.service >/dev/null 2>&1
|
||||
if [ -f /usr/local/bin/logoff.sh ];then
|
||||
sudo rm /usr/local/bin/logoff.sh
|
||||
echo "If the setup wizard fails to appear then please run this command."
|
||||
echo -e "~/.config/kinto/gui/kinto-gui.py\n"
|
||||
echo -e "You can then either \e]8;;https://google.com\a\e[1m\e[36mG\033[0;91mo\033[0;93mo\e[1m\e[36mg\e[1m\e[32ml\033[0;91me\e[0m\e]8;;\a what dependencies you may be missing\nor \e]8;;https://github.com/rbreaves/kinto/issues/new\?assignees=rbreaves&labels=bug&template=bug_report.md&title=\aopen an issue ticket.\e]8;;\a\n"
|
||||
|
||||
if [ "$distro" == "manjarolinux" ]; then
|
||||
echo "If you are using Manjaro and see an error about 'GLIBC_2.xx not found' appears then please update your system."
|
||||
echo "sudo pacman -Syu"
|
||||
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"
|
||||
|
||||
if [ "$dename" == "gnome" ];then
|
||||
echo "Gnome may not support appindicators well, so by default you may need to install packages before enabling the System Tray."
|
||||
echo "You may try one of the following extensions."
|
||||
echo -e " 1) \e]8;;https://extensions.gnome.org/extension/615/appindicator-support/\aAppIndicator and KStatusNotifierItem Support\e]8;;\a"
|
||||
echo -e " 2) \e]8;;https://extensions.gnome.org/extension/1031/topicons/\aTopIcons Plus\e]8;;\a"
|
||||
echo -e "\nNote: you may want these supporting packages\n'sudo apt install gnome-tweaks gnome-shell-extension-appindicator gir1.2-appindicator3-0.1'"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
Reference in New Issue
Block a user