diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a2a8dea --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env/ diff --git a/.xkb/symbols/myswap b/.xkb/symbols/myswap new file mode 100644 index 0000000..34585ce --- /dev/null +++ b/.xkb/symbols/myswap @@ -0,0 +1,5 @@ +partial modifier_keys +xkb_symbols "swap_lalt_lctrl" { + replace key { [ Control_L, Control_L ] }; + replace key { [ Alt_L, Meta_L ] }; +}; diff --git a/README.md b/README.md index 3bc95b9..f5622db 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,19 @@ No more spiderhands for programmers and developers. This project is only about o 1. clone this repo ``` - -``` -2. Install via shell file +git clone https://github.com/rbreaves/kinto.git ``` +2. Install python3 (If needed, most current distros have it already) +Debian or Ubuntu 16.04 +``` +sudo apt update +sudo apt install python3.6 ``` 3. Follow the prompts and the script will guide you through the rest of the setup. +``` +./install.py +``` ## Troubleshooting If your keyboard is not being autodetected and configured then please run `xinput list`, if you are on linux, and copy the output into a ticket under issues. diff --git a/install.py b/install.py index 039bf46..f6948b6 100755 --- a/install.py +++ b/install.py @@ -1,21 +1,63 @@ -import os, platform, sysconfig, sys +#!/usr/bin/env python3 +import os, platform, sysconfig, sys, subprocess yellow = "\033[1;33m" green = "\033[0;32m" red = "\033[1;31m" +italic = "\033[3m" reset = "\033[0;0m" platform_name = platform.system() # print sysconfig.get_platform() sys.stdout.write(yellow) -cloud = '\u2601'.decode('unicode-escape') -circle = '\u25CE'.decode('unicode-escape') -heart = '\u2765'.decode('unicode-escape') +cloud = '\u2601' +circleo = '\u25CE' +clocko = '\u2B6E' +syme = '\u0250' +syma = '\u0251' # bang = '\u1F589'.decode('unicode-escape') -print " K!nt" + circle -sys.stdout.write(reset) -print " - F!x the damn keyb" + circle + "ard. - " -print -print " You are using: " + platform_name + +def hwinfo(): + print("Requires user password to display hardware information...") + result = subprocess.check_output('sudo dmidecode | grep -A 9 "System Information" | grep -v "UUID\|Serial\|SKU\|Wake"', shell=True).decode('ascii') + print(result) + +def kblist(): + result = subprocess.check_output('xinput list', shell=True).decode('ascii') + print(result) + +print() +print() +print(" K!nt" + circleo) +sys.stdout.write(reset) +print(italic + " - F!x the d" + syma + "mn k" + syme + "yb" + circleo + syma + "rd. - ") +sys.stdout.write(reset) +print() +input("Press Enter to begin...") +print() +print("Checking for OS and system information...") +print() +print("OS Type") +# print(" Platform: " + platform_name) +if platform_name == 'Linux': + result = subprocess.check_output("lsb_release -a | grep -v LSB ", shell=True).decode('ascii') + print(result) +print() +print("Looking for keyboards...") +print() +result = subprocess.check_output('xinput list | grep -iv "Virtual\|USB" | grep -i "keyboard.*keyboard";exit 0', shell=True).decode('utf-8') +if result != "": + print("Built in keyboard") + print(result) + +result = subprocess.check_output('udevadm info -e | grep -o -P "(?<=by-id/usb-).*(?=-event-kbd)" | head -1;exit 0', shell=True).decode('utf-8') +if result != "": + print("USB keyboard") + print(result) + +internalid = subprocess.check_output('xinput list | grep -iv "Virtual\|USB" | grep -i "keyboard.*keyboard" | cut -d "=" -f 2- | awk \'{print $1}\';exit 0', shell=True).decode('utf-8') +usbid = subprocess.check_output('udevadm info -e | stdbuf -oL grep -o -P "(?<=event-kbd /dev/input/by-path/pci-0000:00:).*(?=.0-usb)";exit 0', shell=True).decode('utf-8') + +print("Internal Keyboard ID: " + internalid + "USB Keyboard ID: " + usbid)