Compare commits

..

5 Commits

Author SHA1 Message Date
Ben Reaves
0e76f8ed19 Added required dependencies for openSUSE tumbleweed 2021-04-04 16:52:26 -04:00
Ben Reaves
70606b187a Merge branch 'feature/display-opensuse' into feature/zypper-opensuse 2021-04-04 15:54:07 -04:00
Ben Reaves
4e1aa8b731 Adding support for opensuse, vte 2021-04-04 15:51:01 -04:00
RedBearAK
5c35bf032b Inline export DISPLAY on openSUSE Tumbleweed
OpenSUSE Tumbleweed has an error where install completes but the xkeysnail service won't run due to "display not found". Double quotes together indicates display environment variable inside the command is nonexistent or empty. 

This patch inlines `export DISPLAY=` [ insert actual DISPLAY variable value] at the beginning of the main command in the xkeysnail service file, just before the file is copied into its destination. 

Don't know of any other way to fix the issue on Tumbleweed. Tried moving the "Environment" line before the "ExecStart" line in the service file, that of course made no difference.
2021-04-01 12:02:19 -08:00
RedBearAK
33151bfe44 Add zypper support, make output easier to read
Removing "--allow-downgrades --allow-remove-essential --allow-change-held-packages" as a replacement for "--force-yes" because none of those options are really recommended. They can potentially break the system entirely, and shouldn't actually be necessary in any normal situation when installing packages. 

This adds some strategic blank lines and "descriptions" of what is happening so things are far more clear in the terminal during install. Aids in troubleshooting which parts go wrong. 

Adds support for the zypper package manager used by openSUSE Tumbleweed.
2021-03-31 23:58:26 -08:00
21 changed files with 346 additions and 1063 deletions

View File

@@ -1,34 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ staging ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!
# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.

View File

@@ -13,10 +13,6 @@ v1.2 Release - Kinto now includes a system tray and simple wizard to setup the i
Kinto is powered by [xkeysnail](https://github.com/mooz/xkeysnail) for Linux & by [Autohotkey](https://github.com/Lexikos/AutoHotkey_L) for Windows 10. Kinto is powered by [xkeysnail](https://github.com/mooz/xkeysnail) for Linux & by [Autohotkey](https://github.com/Lexikos/AutoHotkey_L) for Windows 10.
Note: If you plan to remote into Linux via VNC, xRDP, Synergy or other remote desktop solutions then remove the current release & try an earlier [v1.0.7-3](https://github.com/rbreaves/kinto/releases/tag/1.0.7-3) release. It uses xkb so it'll work with virtual xinput devices. Some v1.1-x releases may offer both, but all v1.2.x releases ended support for xkb. I do plan to bring offical support back for virtual input devices.
Additionally VMware, Virtualbox, KVM and other virtualization technologies work best with the current release - so *this note only applies to remote desktop into Linux* - not virtualization.
### [Table of Contents ](#Table-of-Contents) ### [Table of Contents ](#Table-of-Contents)
## Donations ## Donations
@@ -26,9 +22,7 @@ If you like or appreciate this project then please consider donating.
|**Wishlists**|[Amazon](https://smile.amazon.com/hz/wishlist/ls/3EVXR21VFKD9Z?ref_=wl_share)|[Adafruit](https://www.adafruit.com/wishlists/515932)|[eBay](https://www.ebay.com/mye/myebay/WatchList?custom_list_id=636668138019)| |**Wishlists**|[Amazon](https://smile.amazon.com/hz/wishlist/ls/3EVXR21VFKD9Z?ref_=wl_share)|[Adafruit](https://www.adafruit.com/wishlists/515932)|[eBay](https://www.ebay.com/mye/myebay/WatchList?custom_list_id=636668138019)|
|---|---|---|---| |---|---|---|---|
I have received some really great letters with donations & email. I've also posted some of them with redacted first names to kinto.sh. If you would like to send me a keyboard directly then please reach out to me over [twitter](https://twitter.com/gbit86) and send me a DM.
Also if you would like to send me a keyboard directly then please reach out to me over [twitter](https://twitter.com/gbit86) and send me a DM.
## How to install (Linux) ## How to install (Linux)
@@ -38,25 +32,21 @@ Video Tutorial: [Install Kinto.sh for Linux in less than a minute](https://www.y
<img src="https://user-images.githubusercontent.com/10969616/97070698-179c4500-15a0-11eb-8064-c03aa7f4d4a5.png" width="75%"> <img src="https://user-images.githubusercontent.com/10969616/97070698-179c4500-15a0-11eb-8064-c03aa7f4d4a5.png" width="75%">
### Quick Install Method 1. clone this repo
Paste the following into your Terminal
```
/bin/bash -c "$(wget -qO- https://raw.githubusercontent.com/rbreaves/kinto/HEAD/install/linux.sh || curl -fsSL https://raw.githubusercontent.com/rbreaves/kinto/HEAD/install/linux.sh)"
```
Uninstall
```
/bin/bash <( wget -qO- https://raw.githubusercontent.com/rbreaves/kinto/HEAD/install/linux.sh || curl -fsSL https://raw.githubusercontent.com/rbreaves/kinto/HEAD/install/linux.sh ) -r
```
### Old Install Method
``` ```
git clone https://github.com/rbreaves/kinto.git git clone https://github.com/rbreaves/kinto.git
cd kinto cd kinto
```
2. Install python3 (If needed)
Debian or Ubuntu 16.04 or 18.04
```
sudo apt update sudo apt update
sudo apt install python3 sudo apt install python3
```
3. Run the script, press 1 or 2 keys and you are done.
```
./setup.py ./setup.py
``` ```
@@ -82,16 +72,13 @@ Try toggling numlock on & off (clear key on official mac keyboards). If it still
If you want a global menu app similar to what mac users have then I strongly recommend Ubuntu Budgie as it has the Vala Appmenu built in and ready for activation. Short of that Vala-AppMenu can be installed in various distros, mileage will vary. If you try to activate it in the latest 20.xx releases with XFCE then you may need to run the following commands. If you want a global menu app similar to what mac users have then I strongly recommend Ubuntu Budgie as it has the Vala Appmenu built in and ready for activation. Short of that Vala-AppMenu can be installed in various distros, mileage will vary. If you try to activate it in the latest 20.xx releases with XFCE then you may need to run the following commands.
``` ```
sudo apt install xfce4-appmenu-plugin vala-panel-appmenu-common appmenu-gtk2-module appmenu-gtk3-module appmenu-gtk-module-common sudo apt install xfce4-appmenu-plugin vala-panel-appmenu-common
xfconf-query -c xsettings -p /Gtk/Modules -n -t string -s "appmenu-gtk-module" xfconf-query -c xsettings -p /Gtk/Modules -n -t string -s "appmenu-gtk-module"
``` ```
**Fractional HiDPI Scaling for Gnome/Budgie w/ x11** **Perfect HiDPI fractional scaling on Ubuntu Budgie 20.04 under x11**
https://github.com/rbreaves/betterScale
Use this with autorandr to save your settings as a profile that will auto re-apply when needed.
https://discourse.ubuntubudgie.org/t/ubuntu-budgie-20-04-fractional-hidpi-for-x11/4777
## How to Install (Windows) ## How to Install (Windows)
@@ -102,14 +89,10 @@ Video Tutorial: [How to Install Kinto.sh on Windows 10](https://youtu.be/sRk8A8k
### Quick install ### Quick install
Open Powershell as Administrator and copy and paste the following. This will download & extract Kinto, install chocolatey, python3 and then install Kinto. Open Powershell as Administrator and copy and paste the following. This will download & extract Kinto, install chocolatey, python3 and then install Kinto.
**⚠ NOTE: Please inspect https://raw.githubusercontent.com/rbreaves/kinto/master/install/windows.ps1 and https://chocolatey.org/install.ps1 before running scripts directly. More information about running powershell scripts in this context can be found [here](https://chocolatey.org/install).**
``` ```
Set-ExecutionPolicy Bypass -Scope Process -Force Invoke-WebRequest -Uri https://github.com/rbreaves/kinto/archive/refs/heads/master.zip -OutFile $env:USERPROFILE\Downloads\kinto.zip;Expand-Archive -LiteralPath "$env:USERPROFILE\Downloads\kinto.zip" -DestinationPath "$env:USERPROFILE\Downloads" -Force;Set-ExecutionPolicy Bypass -Scope Process -Force; iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex; choco install -y python3;cd "$env:USERPROFILE\Downloads\kinto-master";py .\setup.py
iwr https://raw.githubusercontent.com/rbreaves/kinto/master/install/windows.ps1 -UseBasicParsing | iex
``` ```
Update system tray to show Kinto icon at all times (optional) Update system tray to show Kinto icon at all times (optional)
``` ```
cmd /c "explorer shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}" cmd /c "explorer shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}"
@@ -149,7 +132,6 @@ RDP fully works as long as the entire keyboard input is being captured. RDP had
|Program|Src/Remote Client ⇒|Dst/Remote Server|Works? |Notes| |Program|Src/Remote Client ⇒|Dst/Remote Server|Works? |Notes|
|---|---|---|---|---| |---|---|---|---|---|
|Official MS RDP (mstsc.exe)| ❖Windows ⇒| 🐧Linux | ✅ Yes| Note: [v1.0.7-3 Only](https://github.com/rbreaves/kinto/releases/tag/1.0.7-3). Should work for xRDP/VNC and other remote server protocols. |
|Official MS RDP (mstsc.exe)| ❖Windows ⇒| ❖Windows | ✅ Yes| | |Official MS RDP (mstsc.exe)| ❖Windows ⇒| ❖Windows | ✅ Yes| |
|Official MS RDP| ChromeOS 87+⇒| ❖Windows | ✅ Yes|May work on earlier versions as well, if they support Android apps| |Official MS RDP| ChromeOS 87+⇒| ❖Windows | ✅ Yes|May work on earlier versions as well, if they support Android apps|
|Remmina| 🐧Linux*/ChromeOS 87+⇒| ❖Windows | ✅ Yes|*Use hover menu to enable "Grab all keyboard events"| |Remmina| 🐧Linux*/ChromeOS 87+⇒| ❖Windows | ✅ Yes|*Use hover menu to enable "Grab all keyboard events"|
@@ -162,10 +144,6 @@ RDP fully works as long as the entire keyboard input is being captured. RDP had
|Royal TSX Client| 🍎macOS⇒| ❖Windows | ❌ No|Initial Cmd key press not being passed| |Royal TSX Client| 🍎macOS⇒| ❖Windows | ❌ No|Initial Cmd key press not being passed|
|Official MS RDP| 🍎🤖iOS/Android⇒| ❖Windows | ❌ No|No workaround atm| |Official MS RDP| 🍎🤖iOS/Android⇒| ❖Windows | ❌ No|No workaround atm|
## How to Remap Windows keyboards for remote access to macOS
Quick summary - Swap Alt & Win to conform with Apple keyboard layouts. Sharpkeys for Windows, Setkeycodes for Linux, then install Kinto.sh or change/update the Keyboard Type to Apple in the system tray.
https://benreaves.medium.com/macos-to-linux-back-again-c6151200f4dc
## FreeRDP for macOS ## FreeRDP for macOS
1. Install [brew.sh](https://brew.sh). 1. Install [brew.sh](https://brew.sh).
@@ -266,7 +244,7 @@ Additionally, if you are using a cross-platform app and if it happens to have a
## What does Kinto require? ## What does Kinto require?
- Python - Python
- systemd or sysvinit - systemd
- x11 - x11
- xkeysnail - xkeysnail
@@ -324,16 +302,10 @@ In the above example I am also showing that you can define a single shortcut to
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. 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.
systemd
``` ```
sudo systemctl restart xkeysnail sudo systemctl restart xkeysnail
``` ```
sysvinit
```
sudo -E /etc/init.d/kinto restart
```
More information can be seen on the readme page of [xkeysnail](https://github.com/mooz/xkeysnail). More information can be seen on the readme page of [xkeysnail](https://github.com/mooz/xkeysnail).
## Windows (Autohotkey) ## Windows (Autohotkey)
@@ -395,53 +367,25 @@ git pull origin master
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. 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 Status
systemd
``` ```
sudo systemctl status xkeysnail sudo systemctl status xkeysnail
``` ```
sysvinit
```
tail -f /tmp/kinto.log
```
Stop (your keymap will return to normal) Stop (your keymap will return to normal)
systemd
``` ```
sudo systemctl stop xkeysnail sudo systemctl stop xkeysnail
``` ```
sysvinit
```
sudo -E /etc/init.d/kinto stop
```
Start Start
systemd
``` ```
sudo systemctl start xkeysnail sudo systemctl start xkeysnail
``` ```
sysvinit
```
sudo -E /etc/init.d/kinto start
```
Restart Restart
systemd
``` ```
sudo systemctl restart xkeysnail sudo systemctl restart xkeysnail
``` ```
sysvinit
```
sudo -E /etc/init.d/kinto restart
```
## Troubleshooting ## Troubleshooting
### Installed successfully, but modifier keys are not properly remapped? ### Installed successfully, but modifier keys are not properly remapped?

View File

@@ -1,21 +0,0 @@
#!/usr/bin/env bash
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/rbreaves/kinto/master/install/linux.sh)"
wget https://github.com/rbreaves/kinto/archive/refs/heads/master.zip -O ~/Downloads/kinto.zip || curl https://github.com/rbreaves/kinto/archive/refs/heads/master.zip -J -L -o ~/Downloads/kinto.zip
unzip ~/Downloads/kinto.zip -d ~/Downloads/
cd ~/Downloads/kinto-master/
kintorelease=`wget -qO- https://api.github.com/repos/rbreaves/kinto/releases/latest | awk -F'tag_name": ' '{if ($2) print $2}' | tr -d \", || curl -s https://api.github.com/repos/rbreaves/kinto/releases/latest | awk -F'tag_name": ' '{if ($2) print $2}' | tr -d \",`
kintohash=`unzip -z ~/Downloads/kinto.zip | tail -n1`
kintoshort=${kintohash::7}
echo "$kintorelease" "build" "$kintoshort" > ./dl_version
if [ $# -eq 0 ];then
echo "Installing Kinto..."
./setup.py
elif [ $1 == "-r" ];then
echo "Uninstall Kinto..."
./setup.py -r
fi

View File

@@ -1,7 +0,0 @@
Invoke-WebRequest -Uri https://github.com/rbreaves/kinto/archive/refs/heads/master.zip -OutFile $env:USERPROFILE\Downloads\kinto.zip
Expand-Archive -LiteralPath "$env:USERPROFILE\Downloads\kinto.zip" -DestinationPath "$env:USERPROFILE\Downloads" -Force
Set-ExecutionPolicy Bypass -Scope Process -Force
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
choco install -y python3
cd "$env:USERPROFILE\Downloads\kinto-master"
py .\setup.py

View File

@@ -1,50 +0,0 @@
# Keyboard options
# - "IBM", "Chromebook","WinMac", "Mac"
keyboard: ""
# Possible options
# - ["altgr","caps2cmd"]
options: []
Any:
default: []
altgr: []
caps2cmd: ["Key.CAPSLOCK: Key.RIGHT_CTRL,"]
IBM:
default: [
"Key.LEFT_ALT: Key.RIGHT_CTRL,",
"Key.LEFT_CTRL: Key.LEFT_ALT,",
"Key.CAPSLOCK: Key.LEFT_META,"
]
altgr: [
"Key.RIGHT_ALT: Key.RIGHT_CTRL,",
"Key.RIGHT_CTRL: Key.RIGHT_ALT,"
]
Chromebook:
default: [
"Key.LEFT_ALT: Key.RIGHT_CTRL,",
"Key.LEFT_CTRL: Key.LEFT_ALT,"
]
altgr: [
"Key.RIGHT_ALT: Key.RIGHT_CTRL,",
"Key.RIGHT_CTRL: Key.RIGHT_ALT,"
]
caps2cmd: ["Key.LEFT_META: Key.RIGHT_CTRL,"]
WinMac:
default: [
"Key.LEFT_ALT: Key.RIGHT_CTRL,",
"Key.LEFT_META: Key.LEFT_ALT,",
"Key.LEFT_CTRL: Key.LEFT_META,"
]
altgr: [
"Key.RIGHT_ALT: Key.RIGHT_CTRL,",
"Key.RIGHT_META: Key.RIGHT_ALT,",
"Key.RIGHT_CTRL: Key.RIGHT_META,"
]
Mac:
default: [
"Key.LEFT_META: Key.RIGHT_CTRL,",
"Key.LEFT_CTRL: Key.LEFT_META,"
]
altgr: [
"Key.RIGHT_META: Key.RIGHT_CTRL,",
"Key.RIGHT_CTRL: Key.RIGHT_META,"
]

View File

@@ -1,49 +0,0 @@
# Keyboard options
# - "IBM", "Chromebook","WinMac", "Mac"
keyboard: ""
# Possible options
# - ["altgr","caps2cmd"]
options: []
Any:
default: []
altgr: []
caps2cmd: ["Key.CAPSLOCK: Key.RIGHT_CTRL,"]
IBM:
default: [
"Key.LEFT_ALT: Key.RIGHT_CTRL,",
"Key.CAPSLOCK: Key.LEFT_ALT,",
"Key.RIGHT_CTRL: Key.RIGHT_ALT,"
]
altgr: [
"Key.RIGHT_ALT: Key.RIGHT_CTRL,",
"Key.RIGHT_CTRL: Key.RIGHT_ALT,"
]
Chromebook:
default: [
"Key.LEFT_ALT: Key.RIGHT_CTRL,",
"Key.LEFT_META: Key.LEFT_ALT,",
"Key.RIGHT_CTRL: Key.RIGHT_ALT,"
]
altgr: [
"Key.RIGHT_ALT: Key.RIGHT_CTRL,"
]
caps2cmd: ["Key.LEFT_META: Key.RIGHT_CTRL,"]
WinMac:
default: [
"Key.LEFT_ALT: Key.RIGHT_CTRL,",
"Key.LEFT_META: Key.LEFT_ALT,",
"Key.LEFT_CTRL: Key.LEFT_CTRL,"
]
altgr: [
"Key.RIGHT_ALT: Key.RIGHT_CTRL,",
"Key.RIGHT_META: Key.RIGHT_ALT,",
"Key.RIGHT_CTRL: Key.LEFT_CTRL,"
]
Mac:
default: [
"Key.LEFT_META: Key.RIGHT_CTRL,"
]
altgr: [
"Key.RIGHT_META: Key.RIGHT_CTRL,",
"Key.RIGHT_CTRL: Key.LEFT_CTRL,"
]

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import gi,os,time,fcntl,argparse,re import gi,os,time,fcntl,argparse,re
import warnings
warnings.filterwarnings("ignore")
gi.require_version('Gtk', '3.0') gi.require_version('Gtk', '3.0')
gi.require_version('Vte', '2.91') gi.require_version('Vte', '2.91')
from gi.repository import Gtk,Gdk,GdkPixbuf from gi.repository import Gtk,Gdk,GdkPixbuf
@@ -50,20 +48,12 @@ class MyWindow(Gtk.Window):
page = 1 page = 1
label = Gtk.Label() label = Gtk.Label()
label.set_halign(Gtk.Align.END) label.set_alignment(1, 0)
ostype = os.environ.get('XDG_CURRENT_DESKTOP') ostype = os.environ.get('XDG_CURRENT_DESKTOP')
global openWin global openWin
openWin = False openWin = False
global child_pid global child_pid
global sysv
try:
sysv = int(Popen("pidof systemd >/dev/null 2>&1 && echo '0' || echo '1'", stdout=PIPE, shell=True).communicate()[0].strip().decode('UTF-8'))
except:
sysv = 2
if sysv:
kinto_status = Popen("while :; do clear; pgrep 'xkeysnail' && echo 'active'; sleep 2; done", stdout=PIPE, shell=True)
else:
kinto_status = Popen("while :; do clear; systemctl is-active xkeysnail; sleep 2; done", stdout=PIPE, shell=True) kinto_status = Popen("while :; do clear; systemctl is-active xkeysnail; sleep 2; done", stdout=PIPE, shell=True)
child_pid = kinto_status.pid child_pid = kinto_status.pid
@@ -124,13 +114,7 @@ class MyWindow(Gtk.Window):
None, None,
) )
if self.args.debug: if self.args.debug:
if sysv:
self.command = 'sudo /etc/init.d/kinto stop && sudo pkill -f bin/xkeysnail && sudo xkeysnail ~/.config/kinto/kinto.py\n'
else:
self.command = 'sudo systemctl stop xkeysnail && sudo pkill -f bin/xkeysnail && sudo xkeysnail ~/.config/kinto/kinto.py\n' self.command = 'sudo systemctl stop xkeysnail && sudo pkill -f bin/xkeysnail && sudo xkeysnail ~/.config/kinto/kinto.py\n'
else:
if sysv:
self.command = "tail -f /tmp/kinto.log\n"
else: else:
self.command = "journalctl -f --unit=xkeysnail.service -b\n" self.command = "journalctl -f --unit=xkeysnail.service -b\n"
@@ -197,19 +181,19 @@ class MyWindow(Gtk.Window):
menubar.append(menuitem_edit) menubar.append(menuitem_edit)
submenu_edit = Gtk.Menu() submenu_edit = Gtk.Menu()
menuitem_edit.set_submenu(submenu_edit) menuitem_edit.set_submenu(submenu_edit)
edititem_tweaks = Gtk.MenuItem(label="Tweaks") edititem_tweaks = Gtk.MenuItem("Tweaks")
edititem_tweaks.connect('activate',self.setTweaks) edititem_tweaks.connect('activate',self.setTweaks)
submenu_edit.append(edititem_tweaks) submenu_edit.append(edititem_tweaks)
edititem_config = Gtk.MenuItem(label="Kinto Config (shortcuts)") edititem_config = Gtk.MenuItem("Kinto Config (shortcuts)")
edititem_config.connect('activate',self.setConfig) edititem_config.connect('activate',self.setConfig)
submenu_edit.append(edititem_config) submenu_edit.append(edititem_config)
edititem_service = Gtk.MenuItem(label="Kinto Service") edititem_service = Gtk.MenuItem("Kinto Service")
edititem_service.connect('activate',self.setService) edititem_service.connect('activate',self.setService)
submenu_edit.append(edititem_service) submenu_edit.append(edititem_service)
edititem_shortcuts = Gtk.MenuItem(label="System Shortcuts") edititem_shortcuts = Gtk.MenuItem("System Shortcuts")
edititem_shortcuts.connect('activate',self.setSysKB) edititem_shortcuts.connect('activate',self.setSysKB)
submenu_edit.append(edititem_shortcuts) submenu_edit.append(edititem_shortcuts)
edititem_language = Gtk.MenuItem(label="Change Language") edititem_language = Gtk.MenuItem("Change Language")
edititem_language.connect('activate',self.setRegion) edititem_language.connect('activate',self.setRegion)
submenu_edit.append(edititem_language) submenu_edit.append(edititem_language)
@@ -223,11 +207,11 @@ class MyWindow(Gtk.Window):
helpitem_debug = Gtk.MenuItem(label="Debug") helpitem_debug = Gtk.MenuItem(label="Debug")
helpitem_debug.connect('activate',self.runDebug) helpitem_debug.connect('activate',self.runDebug)
submenu_help.append(helpitem_debug) submenu_help.append(helpitem_debug)
helpitem_support = Gtk.MenuItem(label="Support") helpitem_support = Gtk.MenuItem("Support")
helpitem_support.connect('activate',self.openSupport) helpitem_support.connect('activate',self.openSupport)
submenu_help.append(helpitem_support) submenu_help.append(helpitem_support)
menuitem_help.set_submenu(submenu_help) menuitem_help.set_submenu(submenu_help)
helpitem_about = Gtk.MenuItem(label="About") helpitem_about = Gtk.MenuItem("About")
helpitem_about.connect('activate',self.runAbout) helpitem_about.connect('activate',self.runAbout)
submenu_help.append(helpitem_about) submenu_help.append(helpitem_about)
@@ -353,13 +337,14 @@ class MyWindow(Gtk.Window):
self.queryConfig('cp '+os.environ['HOME']+'/.config/kinto/xkeysnail.desktop '+os.environ['HOME']+'/.config/autostart/xkeysnail.desktop') self.queryConfig('cp '+os.environ['HOME']+'/.config/kinto/xkeysnail.desktop '+os.environ['HOME']+'/.config/autostart/xkeysnail.desktop')
if self.options["systray"]: if self.options["systray"]:
self.queryConfig('cp '+os.environ['HOME']+'/.config/kinto/kintotray.desktop '+os.environ['HOME']+'/.config/autostart/kintotray.desktop') self.queryConfig('cp '+os.environ['HOME']+'/.config/kinto/kintotray.desktop '+os.environ['HOME']+'/.config/autostart/kintotray.desktop')
self.queryConfig("nohup /usr/bin/python3 ~/.config/kinto/kintotray.py >/dev/null 2>&1 &") self.queryConfig("nohup python3 ~/.config/kinto/kintotray.py >/dev/null 2>&1 &")
self.menuitem_systray.disconnect(self.menuitem_systray.signal_id) self.menuitem_systray.disconnect(self.menuitem_systray.signal_id)
self.menuitem_systray.set_active(True) self.menuitem_systray.set_active(True)
self.menuitem_systray.signal_id = self.menuitem_systray.connect('activate',self.checkTray,False) self.menuitem_systray.signal_id = self.menuitem_systray.connect('activate',self.checkTray,False)
restartsvc = True restartsvc = True
def initSetup(self): def initSetup(self):
global win,openWin,restartsvc global win,openWin,restartsvc
@@ -435,20 +420,21 @@ class MyWindow(Gtk.Window):
pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.environ['HOME']+'/.config/kinto/gui/tuxcry4.png') pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.environ['HOME']+'/.config/kinto/gui/tuxcry4.png')
pixbuf = pixbuf.scale_simple(600, 360, GdkPixbuf.InterpType.BILINEAR) pixbuf = pixbuf.scale_simple(600, 360, GdkPixbuf.InterpType.BILINEAR)
self.bgsuccess4 = self.bgsuccess4.new_from_pixbuf(pixbuf) self.bgsuccess4 = self.bgsuccess4.new_from_pixbuf(pixbuf)
self.bgsuccess4.set_valign(Gtk.Align.END) self.bgsuccess4.set_alignment(0, 1)
pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.environ['HOME']+'/.config/kinto/gui/tuxuninstall.png') pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.environ['HOME']+'/.config/kinto/gui/tuxuninstall.png')
pixbuf = pixbuf.scale_simple(600, 360, GdkPixbuf.InterpType.BILINEAR) pixbuf = pixbuf.scale_simple(600, 360, GdkPixbuf.InterpType.BILINEAR)
self.bguninstall = self.bguninstall.new_from_pixbuf(pixbuf) self.bguninstall = self.bguninstall.new_from_pixbuf(pixbuf)
self.bguninstall.set_valign(Gtk.Align.END) self.bguninstall.set_alignment(0, 1)
pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.environ['HOME']+'/.config/kinto/gui/tuxbg.png') pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.environ['HOME']+'/.config/kinto/gui/tuxbg.png')
pixbuf = pixbuf.scale_simple(600, 360, GdkPixbuf.InterpType.BILINEAR) pixbuf = pixbuf.scale_simple(600, 360, GdkPixbuf.InterpType.BILINEAR)
self.background = self.background.new_from_pixbuf(pixbuf) self.background = self.background.new_from_pixbuf(pixbuf)
self.background.set_valign(Gtk.Align.END) self.background.set_alignment(0, 1)
self.bgcaps = self.bgcaps.new_from_pixbuf(pixbuf2) self.bgcaps = self.bgcaps.new_from_pixbuf(pixbuf2)
self.bgcaps.set_alignment(0, 1)
self.bgspace = self.bgspace.new_from_pixbuf(pixbuf3) self.bgspace = self.bgspace.new_from_pixbuf(pixbuf3)
self.bgspace.set_valign(Gtk.Align.END) self.bgspace.set_alignment(0, 1)
self.overlay.add(self.background) self.overlay.add(self.background)
self.overlay.add_overlay(self.container) self.overlay.add_overlay(self.container)
self.setupwin.add(self.container) self.setupwin.add(self.container)
@@ -470,7 +456,7 @@ class MyWindow(Gtk.Window):
def image2pixbuf(self,im): def image2pixbuf(self,im):
data = im.tobytes() data = im.tobytes()
w, h = im.size w, h = im.size
# print(im.size) print(im.size)
data = GLib.Bytes.new(data) data = GLib.Bytes.new(data)
pix = GdkPixbuf.Pixbuf.new_from_bytes(data, GdkPixbuf.Colorspace.RGB,True, 8, w, h, w * 4) pix = GdkPixbuf.Pixbuf.new_from_bytes(data, GdkPixbuf.Colorspace.RGB,True, 8, w, h, w * 4)
return pix return pix
@@ -531,9 +517,6 @@ class MyWindow(Gtk.Window):
return return
def runDebug(self,button): def runDebug(self,button):
if sysv:
command = 'send \003 sudo /etc/init.d/kinto stop && sudo pkill -f bin/xkeysnail && sudo xkeysnail ~/.config/kinto/kinto.py\n'
else:
command = 'send \003 sudo systemctl stop xkeysnail && sudo pkill -f bin/xkeysnail && sudo xkeysnail ~/.config/kinto/kinto.py\n' command = 'send \003 sudo systemctl stop xkeysnail && sudo pkill -f bin/xkeysnail && sudo xkeysnail ~/.config/kinto/kinto.py\n'
self.InputToTerm(command) self.InputToTerm(command)
@@ -616,7 +599,7 @@ class MyWindow(Gtk.Window):
if tray_bool: if tray_bool:
Popen(['cp',os.environ['HOME']+'/.config/kinto/kintotray.desktop',os.environ['HOME']+'/.config/autostart/kintotray.desktop']) Popen(['cp',os.environ['HOME']+'/.config/kinto/kintotray.desktop',os.environ['HOME']+'/.config/autostart/kintotray.desktop'])
if not kintotray: if not kintotray:
Popen(['/usr/bin/python3',os.environ['HOME']+'/.config/kinto/kintotray.py']) Popen([os.environ['HOME']+'/.config/kinto/kintotray.py'])
self.menuitem_systray.disconnect(self.menuitem_systray.signal_id) self.menuitem_systray.disconnect(self.menuitem_systray.signal_id)
self.menuitem_systray.set_active(True) self.menuitem_systray.set_active(True)
self.menuitem_systray.signal_id = self.menuitem_systray.connect('activate',self.checkTray,False) self.menuitem_systray.signal_id = self.menuitem_systray.connect('activate',self.checkTray,False)
@@ -627,10 +610,7 @@ class MyWindow(Gtk.Window):
self.queryConfig(killspawn) self.queryConfig(killspawn)
time.sleep(1) time.sleep(1)
global child_pid global child_pid
if sysv: self.kinto_status = Popen("while :; do clear; systemctl is-active xkeysnail; sleep 2; done", stdout=PIPE, shell=True)
self.kinto_status = Popen("export TERM=xterm-color;while :; do clear; pgrep 'xkeysnail'; sleep 2; done", stdout=PIPE, shell=True)
else:
self.kinto_status = Popen("export TERM=xterm-color;while :; do clear; systemctl is-active xkeysnail; sleep 2; done", stdout=PIPE, shell=True)
child_pid = self.kinto_status.pid child_pid = self.kinto_status.pid
self.menuitem_systray.disconnect(self.menuitem_systray.signal_id) self.menuitem_systray.disconnect(self.menuitem_systray.signal_id)
self.menuitem_systray.set_active(False) self.menuitem_systray.set_active(False)
@@ -638,7 +618,6 @@ class MyWindow(Gtk.Window):
return return
def setKB(self,button,kbtype): def setKB(self,button,kbtype):
global sysv
try: try:
if kbtype == "win": if kbtype == "win":
setkb = 's/^(\s{3})(\s{1}#)(.*# WinMac.*)|^(?!\s{4}#)(\s{3})(\s{1})(.*)( # )(Mac.*)|^(?!\s{4}#)(\s{3})(\s{1})(.*)( # )(IBM.*)|^(?!\s{4}#)(\s{3})(\s{1})(.*)( # )(Chromebook.*)|^(\s{3})(\s{1}# )(-)( Default Win)|^(\s{3})(\s{1}# )(-)(- Default Mac*)/ $3$7$6$7$8$12$11$12$13$17$16$17$18$20$21$21$22$24$26/g' setkb = 's/^(\s{3})(\s{1}#)(.*# WinMac.*)|^(?!\s{4}#)(\s{3})(\s{1})(.*)( # )(Mac.*)|^(?!\s{4}#)(\s{3})(\s{1})(.*)( # )(IBM.*)|^(?!\s{4}#)(\s{3})(\s{1})(.*)( # )(Chromebook.*)|^(\s{3})(\s{1}# )(-)( Default Win)|^(\s{3})(\s{1}# )(-)(- Default Mac*)/ $3$7$6$7$8$12$11$12$13$17$16$17$18$20$21$21$22$24$26/g'
@@ -675,9 +654,6 @@ class MyWindow(Gtk.Window):
elif kbtype == "ibm": elif kbtype == "ibm":
setkb ='s/^(\s{3})(\s{1}#)(.*# IBM.*)|^(?!\s{4}#)(\s{3})(\s{1})(.*)( # )(WinMac.*)|^(?!\s{4}#)(\s{3})(\s{1})(.*)( # )(Mac.*)|^(?!\s{4}#)(\s{3})(\s{1})(.*)( # )(Chromebook.*)|^(\s{3})(\s{1}# )(-)(- Default (Win|Mac.*))/ $3$7$6$7$8$12$11$12$13$17$16$17$18$20$22/g' setkb ='s/^(\s{3})(\s{1}#)(.*# IBM.*)|^(?!\s{4}#)(\s{3})(\s{1})(.*)( # )(WinMac.*)|^(?!\s{4}#)(\s{3})(\s{1})(.*)( # )(Mac.*)|^(?!\s{4}#)(\s{3})(\s{1})(.*)( # )(Chromebook.*)|^(\s{3})(\s{1}# )(-)(- Default (Win|Mac.*))/ $3$7$6$7$8$12$11$12$13$17$16$17$18$20$22/g'
if sysv:
restart = ['sudo', '-E','/etc/init.d/kinto','restart']
else:
restart = ['sudo', 'systemctl','restart','xkeysnail'] restart = ['sudo', 'systemctl','restart','xkeysnail']
cmds = ['perl','-pi','-e',setkb,self.kconfig] cmds = ['perl','-pi','-e',setkb,self.kconfig]
@@ -770,13 +746,10 @@ class MyWindow(Gtk.Window):
} }
def on_delete_event(event, self, widget): def on_delete_event(event, self, widget):
global restartsvc, openWin, sysv global restartsvc, openWin
if restartsvc == True: if restartsvc == True:
try: try:
if sysv:
restartcmd = ['sudo', '-E','/etc/init.d/kinto','restart']
else:
restartcmd = ['sudo', 'systemctl','restart','xkeysnail'] restartcmd = ['sudo', 'systemctl','restart','xkeysnail']
Popen(restartcmd) Popen(restartcmd)
restartsvc = False restartsvc = False
@@ -897,11 +870,7 @@ class MyWindow(Gtk.Window):
return return
def runRestart(self,button): def runRestart(self,button):
global sysv
try: try:
if sysv:
stop = Popen(['sudo', '-E','/etc/init.d/kinto','stop'])
else:
stop = Popen(['sudo', 'systemctl','stop','xkeysnail']) stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
stop.wait() stop.wait()
time.sleep(1) time.sleep(1)
@@ -911,10 +880,6 @@ class MyWindow(Gtk.Window):
if res.returncode == 0: if res.returncode == 0:
pkillxkey = Popen(['sudo', 'pkill','-f','bin/xkeysnail']) pkillxkey = Popen(['sudo', 'pkill','-f','bin/xkeysnail'])
pkillxkey.wait() pkillxkey.wait()
if sysv:
Popen(['sudo','-E','/etc/init.d/kinto','start'])
self.command = "send \003 tail -f /tmp/kinto.log\n"
else:
Popen(['sudo', 'systemctl','start','xkeysnail']) Popen(['sudo', 'systemctl','start','xkeysnail'])
self.command = "send \003 journalctl -f --unit=xkeysnail.service -b\n" self.command = "send \003 journalctl -f --unit=xkeysnail.service -b\n"
self.InputToTerm(self.command) self.InputToTerm(self.command)
@@ -922,11 +887,7 @@ class MyWindow(Gtk.Window):
Popen(['notify-send','Kinto: Errror restarting Kinto!']) Popen(['notify-send','Kinto: Errror restarting Kinto!'])
def runStop(self,button): def runStop(self,button):
global sysv
try: try:
if sysv:
stop = Popen(['sudo', '-E','/etc/init.d/kinto','stop'])
else:
stop = Popen(['sudo', 'systemctl','stop','xkeysnail']) stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
stop.wait() stop.wait()
time.sleep(1) time.sleep(1)
@@ -1116,7 +1077,7 @@ class MyWindow(Gtk.Window):
except: except:
pass pass
# print(Vte.get_minor_version()) print(Vte.get_minor_version())
# def on_menu_auto(self, widget): # def on_menu_auto(self, widget):
# print("add file open dialog") # print("add file open dialog")
@@ -1145,36 +1106,34 @@ class UninstallPage(Gtk.Box):
label_start = Gtk.Label() label_start = Gtk.Label()
label_start.set_markup('<b>Uninstall</b>\n\n\n\nWould you like to uninstall kinto?\n\n If you need support please visit <a href="http://kinto.sh">kinto.sh</a>.') label_start.set_markup('<b>Uninstall</b>\n\n\n\nWould you like to uninstall kinto?\n\n If you need support please visit <a href="http://kinto.sh">kinto.sh</a>.')
label_start.set_valign(Gtk.Align.START) label_start.set_alignment(0,0)
label_start.set_halign(Gtk.Align.START)
label_start.set_line_wrap(True) label_start.set_line_wrap(True)
vbox.add(label_start) vbox.add(label_start)
scroller.add(vbox) scroller.add(vbox)
hbox = Gtk.HBox() hbox = Gtk.HBox()
previous = Gtk.Button(label="Uninstall") previous = Gtk.Button("Uninstall")
previous.connect("clicked", self.goback) previous.connect("clicked", self.goback)
previous.set_margin_end(206) previous.set_margin_right(206)
hbox.add(previous) hbox.add(previous)
onward = Gtk.Button(label="Continue") onward = Gtk.Button("Continue")
onward.connect("clicked", self.forward) onward.connect("clicked", self.forward)
hbox.add(onward) hbox.add(onward)
hbox.set_hexpand(False) hbox.set_hexpand(False)
hbox.set_vexpand(False) hbox.set_vexpand(False)
hbox.set_margin_bottom(6) hbox.set_margin_bottom(6)
hbox.set_margin_end(25) hbox.set_margin_right(25)
scroller.set_hexpand(True) scroller.set_hexpand(True)
scroller.set_vexpand(True) scroller.set_vexpand(True)
vbox_container.add(scroller) vbox_container.add(scroller)
vbox_container.set_margin_top(55) vbox_container.set_margin_top(55)
vbox_container.set_margin_end(25) vbox_container.set_margin_right(25)
self.grid.set_margin_start(157) self.grid.set_margin_left(157)
vbox_container.set_margin_bottom(18) vbox_container.set_margin_bottom(18)
vbox.set_margin_end(10) vbox.set_margin_right(10)
vbox.set_margin_bottom(18) vbox.set_margin_bottom(18)
self.grid.add(vbox_container) self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1) self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1206,19 +1165,18 @@ class FirstPage(Gtk.Box):
label_start = Gtk.Label() label_start = Gtk.Label()
label_start.set_markup("Before we continue please make sure you do not have any other remappers running. Kinto works best when it is the only application remapping your keys.\n\nBy continuing you also agree that Kinto is not held liable for any harm, damage(s) or unexpected behaviors.\nThis software is free, open-source, and provided as-is.\n\n<sup><b>© 2019, 2020 by Ben Reaves ~ Kinto is licensed on GPLv2.</b></sup>") label_start.set_markup("Before we continue please make sure you do not have any other remappers running. Kinto works best when it is the only application remapping your keys.\n\nBy continuing you also agree that Kinto is not held liable for any harm, damage(s) or unexpected behaviors.\nThis software is free, open-source, and provided as-is.\n\n<sup><b>© 2019, 2020 by Ben Reaves ~ Kinto is licensed on GPLv2.</b></sup>")
label_start.set_valign(Gtk.Align.START) label_start.set_alignment(0,0)
label_start.set_halign(Gtk.Align.START)
label_start.set_line_wrap(True) label_start.set_line_wrap(True)
vbox.add(label_start) vbox.add(label_start)
scroller.add(vbox) scroller.add(vbox)
hbox = Gtk.HBox() hbox = Gtk.HBox()
previous = Gtk.Button(label="") previous = Gtk.Button("")
for child in previous.get_children(): for child in previous.get_children():
child.set_label("<b>Decline</b>") child.set_label("<b>Decline</b>")
child.set_use_markup(True) child.set_use_markup(True)
previous.connect("clicked", self.goback) previous.connect("clicked", self.goback)
previous.set_margin_end(245) previous.set_margin_right(245)
hbox.add(previous) hbox.add(previous)
self.__parent_window.first_onward.set_label("") self.__parent_window.first_onward.set_label("")
@@ -1232,16 +1190,16 @@ class FirstPage(Gtk.Box):
hbox.set_hexpand(False) hbox.set_hexpand(False)
hbox.set_vexpand(False) hbox.set_vexpand(False)
hbox.set_margin_bottom(6) hbox.set_margin_bottom(6)
hbox.set_margin_end(25) hbox.set_margin_right(25)
scroller.set_hexpand(True) scroller.set_hexpand(True)
scroller.set_vexpand(True) scroller.set_vexpand(True)
vbox_container.add(scroller) vbox_container.add(scroller)
vbox_container.set_margin_top(55) vbox_container.set_margin_top(55)
vbox_container.set_margin_end(28) vbox_container.set_margin_right(28)
self.grid.set_margin_start(157) self.grid.set_margin_left(157)
vbox_container.set_margin_bottom(18) vbox_container.set_margin_bottom(18)
vbox.set_margin_end(10) vbox.set_margin_right(10)
vbox.set_margin_bottom(18) vbox.set_margin_bottom(18)
self.grid.add(vbox_container) self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1) self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1280,38 +1238,37 @@ class SecondPage(Gtk.Box):
label_start = Gtk.Label() label_start = Gtk.Label()
label_start.set_markup('<b>Identifying your Keyboard...</b>\n\nPress the <b>2nd</b> key <b>Left</b> of the spacebar.\n\n<sub>If stuck here then unset Overlay (Super) key on your DE.</sub>') label_start.set_markup('<b>Identifying your Keyboard...</b>\n\nPress the <b>2nd</b> key <b>Left</b> of the spacebar.\n\n<sub>If stuck here then unset Overlay (Super) key on your DE.</sub>')
label_start.set_valign(Gtk.Align.START) label_start.set_alignment(0,0)
label_start.set_halign(Gtk.Align.START)
label_start.set_line_wrap(True) label_start.set_line_wrap(True)
vbox.add(label_start) vbox.add(label_start)
scroller.add(vbox) scroller.add(vbox)
hbox = Gtk.HBox() hbox = Gtk.HBox()
previous = Gtk.Button(label="") previous = Gtk.Button("")
for child in previous.get_children(): for child in previous.get_children():
child.set_label("<b>Go Back</b>") child.set_label("<b>Go Back</b>")
child.set_use_markup(True) child.set_use_markup(True)
previous.connect("clicked", self.goback) previous.connect("clicked", self.goback)
previous.set_margin_end(315) previous.set_margin_right(315)
hbox.add(previous) hbox.add(previous)
# onward = Gtk.Button(label="Continue") # onward = Gtk.Button("Continue")
# onward.connect("clicked", self.forward) # onward.connect("clicked", self.forward)
# hbox.add(onward) # hbox.add(onward)
hbox.set_hexpand(False) hbox.set_hexpand(False)
hbox.set_vexpand(False) hbox.set_vexpand(False)
hbox.set_margin_bottom(6) hbox.set_margin_bottom(6)
hbox.set_margin_end(25) hbox.set_margin_right(25)
scroller.set_hexpand(True) scroller.set_hexpand(True)
scroller.set_vexpand(True) scroller.set_vexpand(True)
vbox_container.add(scroller) vbox_container.add(scroller)
vbox_container.set_margin_top(55) vbox_container.set_margin_top(55)
vbox_container.set_margin_end(25) vbox_container.set_margin_right(25)
self.grid.set_margin_start(157) self.grid.set_margin_left(157)
vbox_container.set_margin_bottom(18) vbox_container.set_margin_bottom(18)
vbox.set_margin_end(10) vbox.set_margin_right(10)
vbox.set_margin_bottom(18) vbox.set_margin_bottom(18)
self.grid.add(vbox_container) self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1) self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1365,38 +1322,37 @@ class CapsPage(Gtk.Box):
label_start = Gtk.Label() label_start = Gtk.Label()
label_start.set_markup('<b>Identifying your Keyboard...</b>\n\nPress the <b>capslock</b> key twice.') label_start.set_markup('<b>Identifying your Keyboard...</b>\n\nPress the <b>capslock</b> key twice.')
label_start.set_valign(Gtk.Align.START) label_start.set_alignment(0,0)
label_start.set_halign(Gtk.Align.START)
label_start.set_line_wrap(True) label_start.set_line_wrap(True)
vbox.add(label_start) vbox.add(label_start)
scroller.add(vbox) scroller.add(vbox)
hbox = Gtk.HBox() hbox = Gtk.HBox()
previous = Gtk.Button(label="") previous = Gtk.Button("")
for child in previous.get_children(): for child in previous.get_children():
child.set_label("<b>Go Back</b>") child.set_label("<b>Go Back</b>")
child.set_use_markup(True) child.set_use_markup(True)
previous.connect("clicked", self.goback) previous.connect("clicked", self.goback)
previous.set_margin_end(315) previous.set_margin_right(315)
hbox.add(previous) hbox.add(previous)
# onward = Gtk.Button(label="Continue") # onward = Gtk.Button("Continue")
# onward.connect("clicked", self.forward) # onward.connect("clicked", self.forward)
# hbox.add(onward) # hbox.add(onward)
hbox.set_hexpand(False) hbox.set_hexpand(False)
hbox.set_vexpand(False) hbox.set_vexpand(False)
hbox.set_margin_bottom(6) hbox.set_margin_bottom(6)
hbox.set_margin_end(25) hbox.set_margin_right(25)
scroller.set_hexpand(True) scroller.set_hexpand(True)
scroller.set_vexpand(True) scroller.set_vexpand(True)
vbox_container.add(scroller) vbox_container.add(scroller)
vbox_container.set_margin_top(55) vbox_container.set_margin_top(55)
vbox_container.set_margin_end(25) vbox_container.set_margin_right(25)
self.grid.set_margin_start(157) self.grid.set_margin_left(157)
vbox_container.set_margin_bottom(18) vbox_container.set_margin_bottom(18)
vbox.set_margin_end(10) vbox.set_margin_right(10)
vbox.set_margin_bottom(18) vbox.set_margin_bottom(18)
self.grid.add(vbox_container) self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1) self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1433,9 +1389,9 @@ class SuccessPage(Gtk.Box):
self.grid = Gtk.Grid() self.grid = Gtk.Grid()
hbox = Gtk.HBox() hbox = Gtk.HBox()
previous = Gtk.Button(label=" ") previous = Gtk.Button(" ")
previous.props.relief = Gtk.ReliefStyle.NONE previous.props.relief = Gtk.ReliefStyle.NONE
previous.set_margin_end(245) previous.set_margin_right(245)
hbox.add(previous) hbox.add(previous)
self.__parent_window.last_onward.set_label("") self.__parent_window.last_onward.set_label("")
@@ -1448,7 +1404,7 @@ class SuccessPage(Gtk.Box):
hbox.set_hexpand(False) hbox.set_hexpand(False)
hbox.set_vexpand(False) hbox.set_vexpand(False)
hbox.set_margin_bottom(6) hbox.set_margin_bottom(6)
hbox.set_margin_end(25) hbox.set_margin_right(25)
scroller = Gtk.ScrolledWindow() scroller = Gtk.ScrolledWindow()
scroller.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER) scroller.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER)
@@ -1457,11 +1413,11 @@ class SuccessPage(Gtk.Box):
vbox = Gtk.VBox() vbox = Gtk.VBox()
vbox_container = Gtk.VBox() vbox_container = Gtk.VBox()
vbox_container.set_margin_top(55) vbox_container.set_margin_top(55)
vbox_container.set_margin_end(28) vbox_container.set_margin_right(28)
vbox_container.add(scroller) vbox_container.add(scroller)
self.grid.set_margin_start(157) self.grid.set_margin_left(157)
vbox_container.set_margin_bottom(18) vbox_container.set_margin_bottom(18)
vbox.set_margin_end(10) vbox.set_margin_right(10)
vbox.set_margin_bottom(18) vbox.set_margin_bottom(18)
self.grid.add(vbox_container) self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1) self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)

View File

@@ -4,7 +4,7 @@ Name=Kinto.sh
GenericName=Kinto.sh GenericName=Kinto.sh
Categories=Utility; Categories=Utility;
Type=Application Type=Application
Exec=/usr/bin/python3 {homedir}/.config/kinto/gui/kinto-gui.py Exec={homedir}/.config/kinto/gui/kinto-gui.py
Icon={homedir}/.config/kinto/kinto-color-48.svg Icon={homedir}/.config/kinto/kinto-color-48.svg
# Icon=/usr/share/icons/Pocillo/kinto-color.svg # Icon=/usr/share/icons/Pocillo/kinto-color.svg
Terminal=false Terminal=false

View File

@@ -1,57 +0,0 @@
#!/bin/bash
#
# chkconfig: 35 90 12
# description: Kinto service
#
# Get function from functions library
# . /etc/init.d/functions
# Start the service
start() {
echo -n "Starting Kinto (xkeynsail)" | logger
xkeycount=$(pgrep 'xkeysnail' | wc -l)
if [[ $xkeycount -eq 0 ]]; then
/usr/bin/xhost +SI:localuser:root && script -q -c "xkeysnail --quiet --watch `echo $HOME`/.config/kinto/kinto.py" /dev/null | tee -a /tmp/kinto.log &
### Create the lock file ###
touch /var/lock/subsys/kinto
success $"Kinto (xkeynsail) started"
else
echo "Kinto (xkeynsail) service is already running."
fi
echo
}
# Restart the service
stop() {
echo -n "Stopping Kinto (xkeynsail)" | logger
sudo pkill -f bin/xkeysnail >/dev/null 2>&1
### Now, delete the lock file ###
rm -f /var/lock/subsys/kinto
echo
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart|reload|condrestart)
stop
sleep 5
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0

View File

@@ -9,8 +9,6 @@ from xkeysnail.transform import *
# xbindkeys -mk # xbindkeys -mk
terminals = [ terminals = [
"alacritty", "alacritty",
"cutefish-terminal",
"deepin-terminal",
"eterm", "eterm",
"gnome-terminal", "gnome-terminal",
"guake", "guake",
@@ -19,40 +17,26 @@ terminals = [
"kinto-gui.py", "kinto-gui.py",
"kitty", "kitty",
"konsole", "konsole",
"lxterminal",
"mate-terminal", "mate-terminal",
"qterminal", "qterminal",
"st",
"sakura", "sakura",
"station",
"tabby",
"terminator", "terminator",
"termite",
"tilda", "tilda",
"tilix", "tilix",
"urxvt",
"xfce4-terminal", "xfce4-terminal",
"xterm", "xterm",
] ]
terminals = [term.casefold() for term in terminals] terminals = [term.casefold() for term in terminals]
termStr = "|".join(str('^'+x+'$') for x in terminals) termStr = "|".join(str(x) for x in terminals)
mscodes = ["code","vscodium"] mscodes = ["code","vscodium"]
codeStr = "|".join(str('^'+x+'$') for x in mscodes) codeStr = "|".join(str(x) for x in mscodes)
# Add remote desktop clients & VM software here # Add remote desktop clients & VM software here
# Ideally we'd only exclude the client window, # Ideally we'd only exclude the client window,
# but that may not be easily done. # but that may not be easily done.
remotes = [ remotes = [
"Gnome-boxes",
"org.remmina.Remmina", "org.remmina.Remmina",
"remmina",
"qemu-system-.*",
"qemu",
"Spicy",
"Virt-manager",
"VirtualBox",
"VirtualBox Machine",
"xfreerdp", "xfreerdp",
] ]
remotes = [client.casefold() for client in remotes] remotes = [client.casefold() for client in remotes]
@@ -68,14 +52,12 @@ browsers = [
"Discord", "Discord",
"Epiphany", "Epiphany",
"Firefox", "Firefox",
"Firefox Developer Edition",
"Waterfox",
"Google-chrome", "Google-chrome",
"microsoft-edge", "microsoft-edge",
"microsoft-edge-dev", "microsoft-edge-dev",
] ]
browsers = [browser.casefold() for browser in browsers] browsers = [browser.casefold() for browser in browsers]
browserStr = "|".join(str('^'+x+'$') for x in browsers) browserStr = "|".join(str(x) for x in browsers)
chromes = [ chromes = [
"Chromium", "Chromium",
@@ -85,13 +67,11 @@ chromes = [
"microsoft-edge-dev", "microsoft-edge-dev",
] ]
chromes = [chrome.casefold() for chrome in chromes] chromes = [chrome.casefold() for chrome in chromes]
chromeStr = "|".join(str('^'+x+'$') for x in chromes) chromeStr = "|".join(str(x) for x in chromes)
# Reference group-name-custom.yaml
# edges = ["microsoft-edge-dev","microsoft-edge"] # edges = ["microsoft-edge-dev","microsoft-edge"]
# edges = [edge.casefold() for edge in edges] # edges = [edge.casefold() for edge in edges]
# edgeStr = "|".join(str('^'+x+'$') for x in edges) # edgeStr = "|".join(str(x) for x in edges)
define_multipurpose_modmap( define_multipurpose_modmap(
# {Key.ENTER: [Key.ENTER, Key.RIGHT_CTRL] # Enter2Cmd # {Key.ENTER: [Key.ENTER, Key.RIGHT_CTRL] # Enter2Cmd
@@ -232,7 +212,8 @@ define_keymap(re.compile("^jetbrains-(?!.*toolbox).*$", re.IGNORECASE),{
K("C-M-o"): K("C-M-Shift-n"), # Go to symbol K("C-M-o"): K("C-M-Shift-n"), # Go to symbol
K("Super-Right"): K("M-Right"), # Go to next editor tab K("Super-Right"): K("M-Right"), # Go to next editor tab
K("Super-Left"): K("M-Left"), # Go to previous editor tab K("Super-Left"): K("M-Left"), # Go to previous editor tab
K("C-l"): K("C-g"), # Go to line K("Super-l"): K("C-g"), # Go to line
K("Super-e"): K("C-e"), # Recent files popup
K("M-Space"): K("C-Shift-i"), # Open quick definition lookup K("M-Space"): K("C-Shift-i"), # Open quick definition lookup
K("C-Y"): K("C-Shift-i"), # Open quick definition lookup K("C-Y"): K("C-Shift-i"), # Open quick definition lookup
K("Super-Shift-b"): K("C-Shift-b"), # Go to type declaration K("Super-Shift-b"): K("C-Shift-b"), # Go to type declaration
@@ -267,183 +248,15 @@ define_keymap(re.compile("^jetbrains-(?!.*toolbox).*$", re.IGNORECASE),{
K("Super-c"): K("LC-c"), # Sigints - interrupt K("Super-c"): K("LC-c"), # Sigints - interrupt
},"Jetbrains") },"Jetbrains")
############################################## # Keybindings for Nautilus
### START OF FILE MANAGER GROUP OF KEYMAPS ### define_keymap(re.compile("org.gnome.nautilus", re.IGNORECASE),{
############################################## K("RC-Up"): K("M-Up"), # Go Up dir
K("RC-Down"): K("M-Down"), # Go Down dir
# Keybindings overrides for Caja
# (overrides some bindings from general file manager code block below)
define_keymap(re.compile("caja", re.IGNORECASE),{
# K("RC-Super-o"): K("RC-Shift-Enter"), # Open in new tab
K("RC-Super-o"): K("RC-Shift-W"), # Open in new window
},"Overrides for Caja - Finder Mods")
# Keybindings overrides for DDE (Deepin) File Manager
# (overrides some bindings from general file manager code block below)
define_keymap(re.compile("dde-file-manager", re.IGNORECASE),{
K("RC-i"): K("RC-i"), # File properties dialog (Get Info)
K("RC-comma"): None, # Disable preferences shortcut (no shortcut available)
K("RC-Up"): K("RC-Up"), # Go Up dir
K("RC-Shift-Left_Brace"): K("C-Shift-Tab"), # Go to prior tab
K("RC-Shift-Right_Brace"): K("C-Tab"), # Go to next tab
K("RC-Shift-Left"): K("C-Shift-Tab"), # Go to prior tab
K("RC-Shift-Right"): K("C-Tab"), # Go to next tab
},"Overrides for DDE File Manager - Finder Mods")
# Keybindings overrides for Dolphin
# (overrides some bindings from general file manager code block below)
define_keymap(re.compile("dolphin", re.IGNORECASE),{
K("RC-KEY_2"): K("C-KEY_3"), # View as List (Detailed)
K("RC-KEY_3"): K("C-KEY_2"), # View as List (Compact)
##########################################################################################
### "Open in new window" requires manually setting custom shortcut of Ctrl+Shift+o
### in Dolphin's keyboard shortcuts. There is no default shortcut set for this function.
##########################################################################################
### "Open in new tab" requires manually setting custom shortcut of Ctrl+Shift+o in
### Dolphin's keyboard shortcuts. There is no default shortcut set for this function.
##########################################################################################
K("RC-Super-o"): K("RC-Shift-o"), # Open in new window (or new tab, user's choice, see above)
K("RC-Shift-N"): K("F10"), # Create new folder
K("RC-comma"): K("RC-Shift-comma"), # Open preferences dialog
},"Overrides for Dolphin - Finder Mods")
# Keybindings overrides for elementary OS Files (Pantheon)
# (overrides some bindings from general file manager code block below)
define_keymap(re.compile("io.elementary.files", re.IGNORECASE),{
# K("RC-Super-o"): K("Shift-Enter"), # Open folder in new tab
K("RC-comma"): None, # Disable preferences shortcut since none available
},"Overrides for Pantheon - Finder Mods")
# Keybindings overrides for Nautilus
# (overrides some bindings from general file manager code block below)
define_keymap(re.compile("org.gnome.nautilus|nautilus", re.IGNORECASE),{
# K("RC-N"): K("C-M-Space"), # macOS Finder search window shortcut Cmd+Option+Space
# For this ^^^^^^^^^^^ to work, a custom shortcut must be set up in the Settings app in GNOME
# to run command: "nautilus --new-window /home/USER" [ replace "USER" ]
K("RC-KEY_1"): K("C-KEY_2"), # View as Icons
K("RC-KEY_2"): K("C-KEY_1"), # View as List (Detailed)
K("RC-Super-o"): K("Shift-Enter"), # Open in new window
# K("RC-Super-o"): K("RC-Enter"), # Open in new tab
K("RC-comma"): K("RC-comma"), # Overrides "Open preferences dialog" shortcut below
},"Overrides for Nautilus - Finder Mods")
# Keybindings overrides for PCManFM and PCManFM-Qt
# (overrides some bindings from general file manager code block below)
define_keymap(re.compile("pcmanfm|pcmanfm-qt", re.IGNORECASE),{
K("RC-KEY_2"): K("C-KEY_4"), # View as List (Detailed) [Not in PCManFM-Qt]
K("RC-Backspace"): [K("Delete"),K("Enter")], # Move to Trash (delete, bypass dialog)
},"Overrides for PCManFM - Finder Mods")
# Keybindings overrides for SpaceFM
# (overrides some bindings from general file manager code block below)
define_keymap(re.compile("spacefm", re.IGNORECASE),{
K("RC-Page_Up"): K("C-Shift-Tab"), # Go to prior tab
K("RC-Page_Down"): K("C-Tab"), # Go to next tab
K("RC-Shift-Left_Brace"): K("C-Shift-Tab"), # Go to prior tab
K("RC-Shift-Right_Brace"): K("C-Tab"), # Go to next tab
K("RC-Shift-Left"): K("C-Shift-Tab"), # Go to prior tab
K("RC-Shift-Right"): K("C-Tab"), # Go to next tab
K("RC-Shift-N"): K("RC-F"), # Create new folder is Ctrl+F by default
K("RC-Backspace"): [K("Delete"),K("Enter")], # Move to Trash (delete, bypass dialog)
K("RC-comma"): [K("M-V"),K("p")], # Overrides "Open preferences dialog" shortcut below
# This shortcut ^^^^^^^^^^^^^^^ is not fully working in SpaceFM. Opens "View" menu but not Preferences.
# SpaceFM seems to be doing some nasty binding that blocks things like Alt+Tab while the menu is open.
},"Overrides for SpaceFM - Finder Mods")
# Keybindings overrides for Thunar
# (overrides some bindings from general file manager code block below)
define_keymap(re.compile("thunar", re.IGNORECASE),{
K("RC-Super-o"): K("RC-Shift-P"), # Open in new tab
K("RC-comma"): [K("M-E"),K("E")], # Overrides "Open preferences dialog" shortcut below
},"Overrides for Thunar - Finder Mods")
filemanagers = [
"caja",
"cutefish-filemanager",
"dde-file-manager",
"dolphin",
"io.elementary.files",
"nautilus",
"nemo",
"org.gnome.nautilus",
"pcmanfm",
"pcmanfm-qt",
"spacefm",
"thunar",
]
filemanagers = [filemanager.casefold() for filemanager in filemanagers]
filemanagerStr = "|".join(str('^'+x+'$') for x in filemanagers)
# Currently supported Linux file managers (file browsers):
#
# Caja File Browser (MATE file manager, fork of Nautilus)
# DDE File Manager (Deepin Linux file manager)
# Dolphin (KDE file manager)
# Nautilus (GNOME file manager, may be named "Files")
# Nemo (Cinnamon file manager, fork of Nautilus, may be named "Files")
# Pantheon Files (elementary OS file manager, may be named "Files")
# PCManFM (LXDE file manager)
# PCManFM-Qt (LXQt file manager)
# SpaceFM (Fork of PCManFM file manager)
# Thunar File Manager (Xfce file manager)
#
# Keybindings for general Linux file managers group:
define_keymap(re.compile(filemanagerStr, re.IGNORECASE),{
###########################################################################################################
### Show Properties (Get Info) | Open Settings/Preferences | Show/Hide hidden files ###
###########################################################################################################
K("RC-i"): K("M-Enter"), # File properties dialog (Get Info)
K("RC-comma"): [K("M-E"),K("N")], # Open preferences dialog
K("RC-Shift-dot"): K("RC-H"), # Show/hide hidden files ("dot" files)
###########################################################################################################
### Navigation ###
###########################################################################################################
K("RC-Left_Brace"): K("M-Left"), # Go Back
K("RC-Right_Brace"): K("M-Right"), # Go Forward
K("RC-Left"): K("M-Left"), # Go Back K("RC-Left"): K("M-Left"), # Go Back
K("RC-Right"): K("M-Right"), # Go Forward K("RC-Right"): K("M-Right"), # Go Forward
K("RC-Up"): K("M-Up"), # Go Up dir },"Nautilus - Finder")
# K("RC-Down"): K("M-Down"), # Go Down dir (only works on folders) [not universal]
# K("RC-Down"): K("RC-O"), # Go Down dir (open folder/file) [not universal]
K("RC-Down"): K("Enter"), # Go Down dir (open folder/file) [universal]
K("RC-Shift-Left_Brace"): K("C-Page_Up"), # Go to prior tab
K("RC-Shift-Right_Brace"): K("C-Page_Down"), # Go to next tab
K("RC-Shift-Left"): K("C-Page_Up"), # Go to prior tab
K("RC-Shift-Right"): K("C-Page_Down"), # Go to next tab
###########################################################################################################
### Open in New Window | Move to Trash | Duplicate file/folder ###
###########################################################################################################
K("RC-Super-o"): K("RC-Shift-o"), # Open in new window (or tab, depends on FM setup) [not universal]
K("RC-Backspace"): K("Delete"), # Move to Trash (delete)
# K("RC-D"): [K("RC-C"),K("RC-V")], # Duplicate file/folder (Copy, then Paste) [conflicts with "Add Bookmark"]
###########################################################################################################
### To enable renaming files with the Enter key, uncomment the two keymapping lines just below this. ###
### Use Ctrl+Shift+Enter to escape or activate text fields such as "[F]ind" and "[L]ocation" fields. ###
###########################################################################################################
# K("Enter"): K("F2"), # Rename with Enter key
# K("RC-Shift-Enter"): K("Enter"), # Remap alternative "Enter" key to easily activate/exit text fields
# K("RC-Shift-Enter"): K("F2"), # Rename with Cmd+Shift+Enter
},"General File Managers - Finder Mods")
############################################ # Keybindings for Browsers
### END OF FILE MANAGER GROUP OF KEYMAPS ###
############################################
# Open preferences in browsers
define_keymap(re.compile("Firefox", re.IGNORECASE),{
K("C-comma"): [
K("C-T"),K("a"),K("b"),K("o"),K("u"),K("t"),
K("Shift-SEMICOLON"),K("p"),K("r"),K("e"),K("f"),
K("e"),K("r"),K("e"),K("n"),K("c"),K("e"),K("s"),K("Enter")
],
K("RC-Shift-N"): K("RC-Shift-P"), # Open private window with Ctrl+Shift+N like other browsers
})
define_keymap(re.compile(chromeStr, re.IGNORECASE),{
K("C-comma"): [K("M-e"), K("s"),K("Enter")],
}, "Browsers")
# Opera C-F12
# Keybindings for General Web Browsers
define_keymap(re.compile(browserStr, re.IGNORECASE),{ define_keymap(re.compile(browserStr, re.IGNORECASE),{
K("RC-Q"): K("RC-Q"), # Close all browsers Instances K("RC-Q"): K("RC-Q"), # Close all browsers Instances
K("M-RC-I"): K("RC-Shift-I"), # Dev tools K("M-RC-I"): K("RC-Shift-I"), # Dev tools
@@ -457,40 +270,22 @@ define_keymap(re.compile(browserStr, re.IGNORECASE),{
K("RC-Key_7"): K("M-Key_7"), K("RC-Key_7"): K("M-Key_7"),
K("RC-Key_8"): K("M-Key_8"), K("RC-Key_8"): K("M-Key_8"),
K("RC-Key_9"): K("M-Key_9"), # Jump to last tab K("RC-Key_9"): K("M-Key_9"), # Jump to last tab
# Enable Cmd+Shift+Braces for tab navigation K("C-Left_Brace"): K("C-Page_Up"),
K("RC-Shift-Left_Brace"): K("C-Page_Up"), # Go to prior tab K("C-Right_Brace"): K("C-Page_Down"),
K("RC-Shift-Right_Brace"): K("C-Page_Down"), # Go to next tab })
# Enable Cmd+Option+Left/Right for tab navigation
K("RC-M-Left"): K("C-Page_Up"), # Go to prior tab
K("RC-M-Right"): K("C-Page_Down"), # Go to next tab
# Enable Ctrl+PgUp/PgDn for tab navigation
K("Super-Page_Up"): K("C-Page_Up"), # Go to prior tab
K("Super-Page_Down"): K("C-Page_Down"), # Go to next tab
# Use Cmd+Braces keys for tab navigation instead of page navigation
# K("C-Left_Brace"): K("C-Page_Up"),
# K("C-Right_Brace"): K("C-Page_Down"),
}, "General Web Browsers")
define_keymap(re.compile("ulauncher", re.IGNORECASE),{ # Open preferences in browsers
K("RC-Key_1"): K("M-Key_1"), # Remap Ctrl+[1-9] and Ctrl+[a-z] to Alt+[1-9] and Alt+[a-z] define_keymap(re.compile("Firefox", re.IGNORECASE),{
K("RC-Key_2"): K("M-Key_2"), K("C-comma"): [
K("RC-Key_3"): K("M-Key_3"), K("C-T"),K("a"),K("b"),K("o"),K("u"),K("t"),
K("RC-Key_4"): K("M-Key_4"), K("Shift-SEMICOLON"),K("p"),K("r"),K("e"),K("f"),
K("RC-Key_5"): K("M-Key_5"), K("e"),K("r"),K("e"),K("n"),K("c"),K("e"),K("s"),K("Enter")
K("RC-Key_6"): K("M-Key_6"), ],
K("RC-Key_7"): K("M-Key_7"), })
K("RC-Key_8"): K("M-Key_8"), define_keymap(re.compile(chromeStr, re.IGNORECASE),{
K("RC-Key_9"): K("M-Key_9"), K("C-comma"): [K("M-e"), K("s"),K("Enter")],
K("RC-Key_0"): K("M-Key_0"), }, "Browsers")
# K("RC-a"): K("M-a"), # Opera C-F12
K("RC-b"): K("M-b"),
# K("RC-c"): K("M-c"),
K("RC-d"): K("M-d"),
K("RC-e"): K("M-e"),
K("RC-f"): K("M-f"),
K("RC-g"): K("M-g"),
K("RC-h"): K("M-h"),
}, "Ulauncher")
# Note: terminals extends to remotes as well # Note: terminals extends to remotes as well
define_keymap(lambda wm_class: wm_class.casefold() not in terminals,{ define_keymap(lambda wm_class: wm_class.casefold() not in terminals,{
@@ -504,18 +299,15 @@ define_keymap(lambda wm_class: wm_class.casefold() not in remotes,{
K("RC-Space"): K("Alt-F1"), # Default SL - Launch Application Menu (gnome/kde) K("RC-Space"): K("Alt-F1"), # Default SL - Launch Application Menu (gnome/kde)
K("RC-F3"):K("Super-d"), # Default SL - Show Desktop (gnome/kde,eos) K("RC-F3"):K("Super-d"), # Default SL - Show Desktop (gnome/kde,eos)
K("RC-Super-f"):K("M-F10"), # Default SL - Maximize app (gnome/kde) K("RC-Super-f"):K("M-F10"), # Default SL - Maximize app (gnome/kde)
# K("RC-Super-f"): K("Super-Page_Up"), # SL - Toggle maximized window state (kde_neon)
# K("Super-Right"):K("C-M-Right"), # Default SL - Change workspace (budgie) # K("Super-Right"):K("C-M-Right"), # Default SL - Change workspace (budgie)
# K("Super-Left"):K("C-M-Left"), # Default SL - Change workspace (budgie) # K("Super-Left"):K("C-M-Left"), # Default SL - Change workspace (budgie)
K("RC-Q"): K("M-F4"), # Default SL - not-popos K("RC-Q"): K("M-F4"), # Default SL - not-popos
K("RC-H"):K("Super-h"), # Default SL - Minimize app (gnome/budgie/popos/fedora) K("RC-H"):K("Super-h"), # Default SL - Minimize app (gnome/budgie/popos/fedora)
K("M-Tab"): pass_through_key, # Default - Cmd Tab - App Switching Default K("M-Tab"): pass_through_key, # Default not-xfce4 - Cmd Tab - App Switching Default
K("RC-Tab"): K("M-Tab"), # Default - Cmd Tab - App Switching Default K("RC-Tab"): K("M-Tab"), # Default not-xfce4 - Cmd Tab - App Switching Default
K("RC-Shift-Tab"): K("M-Shift-Tab"), # Default - Cmd Tab - App Switching Default K("RC-Shift-Tab"): K("M-Shift-Tab"), # Default not-xfce4 - Cmd Tab - App Switching Default
K("RC-Grave"): K("M-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching K("RC-Grave"): K("M-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching
K("RC-Shift-Grave"): K("M-Shift-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching K("RC-Shift-Grave"): K("M-Shift-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching
# K("RC-Grave"): K("Super-Tab"), # xfce4 Switch within app group
# K("RC-Shift-Grave"): K("Super-Shift-Tab"), # xfce4 Switch within app group
# K("Super-Right"):K("Super-Page_Up"), # SL - Change workspace (ubuntu/fedora) # K("Super-Right"):K("Super-Page_Up"), # SL - Change workspace (ubuntu/fedora)
# K("Super-Left"):K("Super-Page_Down"), # SL - Change workspace (ubuntu/fedora) # K("Super-Left"):K("Super-Page_Down"), # SL - Change workspace (ubuntu/fedora)
# K("Super-Right"):K("Super-C-Up"), # SL - Change workspace (popos) # K("Super-Right"):K("Super-C-Up"), # SL - Change workspace (popos)
@@ -531,6 +323,10 @@ define_keymap(lambda wm_class: wm_class.casefold() not in remotes,{
# Basic App hotkey functions # Basic App hotkey functions
# K("RC-H"):K("M-F9"), # SL - Minimize app xfce4 # K("RC-H"):K("M-F9"), # SL - Minimize app xfce4
# K("RC-LC-f"):K("Super-PAGE_DOWN"), # SL - Minimize app manjaro # K("RC-LC-f"):K("Super-PAGE_DOWN"), # SL - Minimize app manjaro
# Cmd Tab - App Switching Default
# K("RC-Tab"): K("RC-backslash"), # xfce4
# K("RC-Shift-Tab"): K("RC-Shift-backslash"), # xfce4
# K("RC-Grave"): K("RC-Shift-backslash"), # xfce4
# In-App Tab switching # In-App Tab switching
# K("M-Tab"): K("C-Tab"), # Chromebook/IBM - In-App Tab switching # K("M-Tab"): K("C-Tab"), # Chromebook/IBM - In-App Tab switching
# K("M-Shift-Tab"): K("C-Shift-Tab"), # Chromebook/IBM - In-App Tab switching # K("M-Shift-Tab"): K("C-Shift-Tab"), # Chromebook/IBM - In-App Tab switching
@@ -614,8 +410,6 @@ define_keymap(re.compile(codeStr, re.IGNORECASE),{
# K("C-PAGE_UP"): pass_through_key, # cancel prev_view # K("C-PAGE_UP"): pass_through_key, # cancel prev_view
K("C-M-Left"): K("C-PAGE_UP"), # next_view K("C-M-Left"): K("C-PAGE_UP"), # next_view
K("C-M-Right"): K("C-PAGE_DOWN"), # prev_view K("C-M-Right"): K("C-PAGE_DOWN"), # prev_view
K("RC-Shift-Left_Brace"): K("C-PAGE_UP"), # next_view
K("RC-Shift-Right_Brace"): K("C-PAGE_DOWN"), # prev_view
# VS Code Shortcuts # VS Code Shortcuts
K("C-g"): pass_through_key, # cancel Go to Line... K("C-g"): pass_through_key, # cancel Go to Line...
@@ -728,9 +522,6 @@ define_keymap(re.compile("Io.elementary.terminal|kitty", re.IGNORECASE),{
}, "Elementary Terminal tab switching") }, "Elementary Terminal tab switching")
define_keymap(re.compile(termStr, re.IGNORECASE),{ define_keymap(re.compile(termStr, re.IGNORECASE),{
K("LC-RC-f"): K("M-F10"), # Toggle window maximized state
# K("RC-Grave"): K("Super-Tab"), # xfce4 Switch within app group
# K("RC-Shift-Grave"): K("Super-Shift-Tab"), # xfce4 Switch within app group
# K("LC-Right"):K("C-M-Right"), # Default SL - Change workspace (budgie) # K("LC-Right"):K("C-M-Right"), # Default SL - Change workspace (budgie)
# K("LC-Left"):K("C-M-Left"), # Default SL - Change workspace (budgie) # K("LC-Left"):K("C-M-Left"), # Default SL - Change workspace (budgie)
# K("LC-Left"):K("C-M-End"), # SL - Change workspace xfce4 # K("LC-Left"):K("C-M-End"), # SL - Change workspace xfce4
@@ -745,11 +536,15 @@ define_keymap(re.compile(termStr, re.IGNORECASE),{
K("LC-Tab") : K("LC-PAGE_DOWN"), K("LC-Tab") : K("LC-PAGE_DOWN"),
K("LC-Shift-Tab") : K("LC-PAGE_UP"), K("LC-Shift-Tab") : K("LC-PAGE_UP"),
K("LC-Grave") : K("LC-PAGE_UP"), K("LC-Grave") : K("LC-PAGE_UP"),
# K("M-Tab"): pass_through_key, # Default - Cmd Tab - App Switching Default # K("M-Tab"): pass_through_key, # Default not-xfce4 - Cmd Tab - App Switching Default
# K("RC-Tab"): K("M-Tab"), # Default - Cmd Tab - App Switching Default # K("RC-Tab"): K("M-Tab"), # Default not-xfce4 - Cmd Tab - App Switching Default
# K("RC-Shift-Tab"): K("M-Shift-Tab"), # Default - Cmd Tab - App Switching Default # K("RC-Shift-Tab"): K("M-Shift-Tab"), # Default not-xfce4 - Cmd Tab - App Switching Default
# Cmd Tab - App Switching Default
# K("RC-Tab"): K("RC-backslash"), # xfce4
# K("RC-Shift-Tab"): K("RC-Shift-backslash"), # xfce4
# K("RC-Grave"): K("RC-Shift-backslash"), # xfce4
# Converts Cmd to use Ctrl-Shift # Converts Cmd to use Ctrl-Shift
K("RC-MINUS"): K("C-MINUS"), K("RC-MINUS"): K("C-Shift-MINUS"),
K("RC-EQUAL"): K("C-Shift-EQUAL"), K("RC-EQUAL"): K("C-Shift-EQUAL"),
K("RC-BACKSPACE"): K("C-Shift-BACKSPACE"), K("RC-BACKSPACE"): K("C-Shift-BACKSPACE"),
K("RC-W"): K("C-Shift-W"), K("RC-W"): K("C-Shift-W"),
@@ -763,8 +558,6 @@ define_keymap(re.compile(termStr, re.IGNORECASE),{
K("RC-P"): K("C-Shift-P"), K("RC-P"): K("C-Shift-P"),
K("RC-LEFT_BRACE"): K("C-Shift-LEFT_BRACE"), K("RC-LEFT_BRACE"): K("C-Shift-LEFT_BRACE"),
K("RC-RIGHT_BRACE"): K("C-Shift-RIGHT_BRACE"), K("RC-RIGHT_BRACE"): K("C-Shift-RIGHT_BRACE"),
K("RC-Shift-Left_Brace"): K("C-Page_Up"), # Go to prior tab (Left)
K("RC-Shift-Right_Brace"): K("C-Page_Down"), # Go to next tab (Right)
K("RC-A"): K("C-Shift-A"), K("RC-A"): K("C-Shift-A"),
K("RC-S"): K("C-Shift-S"), K("RC-S"): K("C-Shift-S"),
K("RC-D"): K("C-Shift-D"), K("RC-D"): K("C-Shift-D"),
@@ -777,6 +570,7 @@ define_keymap(re.compile(termStr, re.IGNORECASE),{
K("RC-SEMICOLON"): K("C-Shift-SEMICOLON"), K("RC-SEMICOLON"): K("C-Shift-SEMICOLON"),
K("RC-APOSTROPHE"): K("C-Shift-APOSTROPHE"), K("RC-APOSTROPHE"): K("C-Shift-APOSTROPHE"),
K("RC-GRAVE"): K("C-Shift-GRAVE"), K("RC-GRAVE"): K("C-Shift-GRAVE"),
K("RC-BACKSLASH"): K("C-Shift-BACKSLASH"),
K("RC-Z"): K("C-Shift-Z"), K("RC-Z"): K("C-Shift-Z"),
K("RC-X"): K("C-Shift-X"), K("RC-X"): K("C-Shift-X"),
K("RC-C"): K("C-Shift-C"), K("RC-C"): K("C-Shift-C"),

View File

@@ -1,7 +1,4 @@
# /etc/sudoers.d/limitedadmins # /etc/sudoers.d/limitedadmins
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11/bin"
Defaults!/etc/init.d/kinto setenv,env_reset,env_delete+=PATH,env_delete+=LD_PRELOAD,env_delete+=LD_LIBRARY_PATH,env_delete+=SSH_AUTH_SOCK,env_delete+=PYTHONPATH,env_delete+=PERL5LIB
%{username} ALL=NOPASSWD: /etc/init.d/kinto *
%{username} ALL=NOPASSWD: {systemctl} restart xkeysnail %{username} ALL=NOPASSWD: {systemctl} restart xkeysnail
%{username} ALL=NOPASSWD: {systemctl} start xkeysnail %{username} ALL=NOPASSWD: {systemctl} start xkeysnail
%{username} ALL=NOPASSWD: {systemctl} stop xkeysnail %{username} ALL=NOPASSWD: {systemctl} stop xkeysnail
@@ -9,6 +6,5 @@ Defaults!/etc/init.d/kinto setenv,env_reset,env_delete+=PATH,env_delete+=LD_PREL
%{username} ALL=(root) NOPASSWD: /usr/local/bin/logoff.sh %{username} ALL=(root) NOPASSWD: /usr/local/bin/logoff.sh
%{username} ALL=NOPASSWD: {pkill} -f logoff %{username} ALL=NOPASSWD: {pkill} -f logoff
%{username} ALL=NOPASSWD: {pkill} -f bin/xkeysnail %{username} ALL=NOPASSWD: {pkill} -f bin/xkeysnail
%{username} ALL=NOPASSWD: {xkeysnail} * %{username} ALL=NOPASSWD: {xkeysnail} /home/{username}/.config/kinto/kinto.py
%{username} ALL=NOPASSWD: {systemctl} is-active --quiet xkeysnail %{username} ALL=NOPASSWD: {systemctl} is-active --quiet xkeysnail
%{username} ALL=NOPASSWD: /usr/lib/systemd/system/xkeysnail.service

View File

@@ -1,15 +1,31 @@
#!/bin/bash #!/bin/bash
if pkgmgr="$( which apt-get )" 2> /dev/null; then if pkgmgr="$( which apt-get )" 2> /dev/null; then
echo "Debian" echo
echo "Debian apt-get package manager detected... "
echo "Installing $1... "
echo
$pkgmgr update $pkgmgr update
$pkgmgr --yes --force-yes install $1 $pkgmgr --yes install $1
elif pkgmgr="$( which dnf )" 2> /dev/null; then elif pkgmgr="$( which dnf )" 2> /dev/null; then
echo "dnf" echo
echo "dnf package manager detected... "
echo "Installing $1... "
echo
$pkgmgr check-update; $pkgmgr install -y $1 $pkgmgr check-update; $pkgmgr install -y $1
elif pkgmgr="$( which pacman )" 2> /dev/null; then elif pkgmgr="$( which pacman )" 2> /dev/null; then
echo "Arch-based" echo
echo "Arch-based pacman package manager detected... "
echo "Installing $1... "
echo
$pkgmgr -Syy;yes | $pkgmgr -S $1 $pkgmgr -Syy;yes | $pkgmgr -S $1
elif pkgmgr="$( which zypper )" 2> /dev/null; then
echo
echo "zypper package manager detected... "
echo "Installing $1... "
echo
$pkgmgr refresh
$pkgmgr -n install $1
else else
echo "Package manager not found, please install $1" >&2 echo "Package manager not found, please install $1" >&2
exit 1 exit 1

View File

@@ -29,15 +29,7 @@ APPINDICATOR_ID = 'Kinto'
class Indicator(): class Indicator():
global child_pid global child_pid
global sysv kinto_status = Popen("while :; do clear; systemctl is-active xkeysnail; sleep 2s; done", stdout=PIPE, shell=True)
try:
sysv = int(Popen("pidof systemd >/dev/null 2>&1 && echo '0' || echo '1'", stdout=PIPE, shell=True).communicate()[0].strip().decode('UTF-8'))
except:
sysv = 2
if sysv:
kinto_status = Popen("export TERM=xterm-color;while :; do clear; pgrep 'xkeysnail' && echo 'active'; sleep 2; done", stdout=PIPE, shell=True)
else:
kinto_status = Popen("export TERM=xterm-color;while :; do clear; systemctl is-active xkeysnail; sleep 2; done", stdout=PIPE, shell=True)
child_pid = kinto_status.pid child_pid = kinto_status.pid
homedir = os.path.expanduser("~") homedir = os.path.expanduser("~")
@@ -50,51 +42,43 @@ class Indicator():
autostart_bool = False autostart_bool = False
menu = Gtk.Menu() menu = Gtk.Menu()
menukb = Gtk.Menu() menukb = Gtk.Menu()
checkbox_autostart = Gtk.CheckMenuItem(label='Autostart') checkbox_autostart = Gtk.CheckMenuItem('Autostart')
restart = Gtk.MenuItem(label='Restart') restart = Gtk.MenuItem('Restart')
stop = Gtk.MenuItem(label='Stop') stop = Gtk.MenuItem('Stop')
keyboards = Gtk.MenuItem(label='Keyboard Types') keyboards = Gtk.MenuItem('Keyboard Types')
keyboards.set_submenu(menukb) keyboards.set_submenu(menukb)
winkb = Gtk.RadioMenuItem(label='Windows') winkb = Gtk.RadioMenuItem(label='Windows')
mackb = Gtk.RadioMenuItem(label='Apple',group=winkb) mackb = Gtk.RadioMenuItem(label='Apple',group=winkb)
chromekb = Gtk.RadioMenuItem(label='Chromebook',group=winkb) chromekb = Gtk.RadioMenuItem(label='Chromebook',group=winkb)
ibmkb = Gtk.RadioMenuItem(label='IBM (No Super/Win key)',group=winkb) ibmkb = Gtk.RadioMenuItem(label='IBM (No Super/Win key)',group=winkb)
winmackb = Gtk.RadioMenuItem(label='Windows & Apple*',group=winkb) winmackb = Gtk.RadioMenuItem(label='Windows & Apple*',group=winkb)
edit = Gtk.MenuItem(label='Customize') edit = Gtk.MenuItem('Customize')
edit_submenu = Gtk.Menu() edit_submenu = Gtk.Menu()
edit.set_submenu(edit_submenu) edit.set_submenu(edit_submenu)
tweaks = Gtk.MenuItem(label='Tweaks') tweaks = Gtk.MenuItem('Tweaks')
rightmod = Gtk.CheckButton(label='AltGr on Right Cmd') rightmod = Gtk.CheckButton('AltGr on Right Cmd')
vsc2st3 = Gtk.CheckButton(label='ST3 hotkeys for VS Code') vsc2st3 = Gtk.CheckButton('ST3 hotkeys for VS Code')
caps2esc = Gtk.CheckButton(label='Capslock is Escape when tapped, Cmd when held') caps2esc = Gtk.CheckButton('Capslock is Escape when tapped, Cmd when held')
caps2cmd = Gtk.CheckButton(label='Capslock is Cmd') caps2cmd = Gtk.CheckButton('Capslock is Cmd')
button_config = Gtk.MenuItem(label='Kinto Config (shortcuts)') button_config = Gtk.MenuItem('Kinto Config (shortcuts)')
service = Gtk.MenuItem(label='Kinto Service') service = Gtk.MenuItem('Kinto Service')
# Keyboard type set below # Keyboard type set below
button_syskb = Gtk.MenuItem(label='System Shortcuts') button_syskb = Gtk.MenuItem('System Shortcuts')
button_region = Gtk.MenuItem(label='Change Language') button_region = Gtk.MenuItem('Change Language')
systray = Gtk.CheckMenuItem(label='Tray Enabled') systray = Gtk.CheckMenuItem('Tray Enabled')
helpm = Gtk.MenuItem(label='Help') helpm = Gtk.MenuItem('Help')
help_submenu = Gtk.Menu() help_submenu = Gtk.Menu()
helpm.set_submenu(help_submenu) helpm.set_submenu(help_submenu)
debug = Gtk.MenuItem(label='Debug') debug = Gtk.MenuItem('Debug')
opengui = Gtk.MenuItem(label='Open Kinto') opengui = Gtk.MenuItem('Open Kinto')
support = Gtk.MenuItem(label='Support') support = Gtk.MenuItem("Support")
about = Gtk.MenuItem(label='About') about = Gtk.MenuItem('About')
global restartsvc global restartsvc
restartsvc = False restartsvc = False
unixts = int(time.time()) unixts = int(time.time())
last_status = '' last_status = ""
def __init__(self): def __init__(self):
global sysv
try:
sysv = int(Popen("pidof systemd >/dev/null 2>&1 && echo '0' || echo '1'", stdout=PIPE, shell=True).communicate()[0].strip().decode('UTF-8'))
except:
sysv = 1
if sysv:
res = Popen(['pgrep','xkeysnail'])
else:
res = Popen(['sudo', 'systemctl','is-active','--quiet','xkeysnail']) res = Popen(['sudo', 'systemctl','is-active','--quiet','xkeysnail'])
res.wait() res.wait()
@@ -116,8 +100,6 @@ class Indicator():
with open(self.kconfig) as configfile: with open(self.kconfig) as configfile:
autostart_line = configfile.read().split('\n')[1] autostart_line = configfile.read().split('\n')[1]
autostart_bool = False
# Autostart # Autostart
if "autostart = true" in autostart_line.casefold(): if "autostart = true" in autostart_line.casefold():
autostart_bool = True autostart_bool = True
@@ -201,7 +183,7 @@ class Indicator():
# self.button_region.connect('activate',self.setRegion) # self.button_region.connect('activate',self.setRegion)
# self.menu.append(self.button_region) # self.menu.append(self.button_region)
item_quit = Gtk.MenuItem(label='Close') item_quit = Gtk.MenuItem('Close')
item_quit.connect('activate', quit) item_quit.connect('activate', quit)
self.menu.append(item_quit) self.menu.append(item_quit)
self.menu.show_all() self.menu.show_all()
@@ -419,10 +401,10 @@ class Indicator():
self.lbl = Gtk.Label() self.lbl = Gtk.Label()
global restartsvc global restartsvc
restartsvc = False restartsvc = False
self.rightmod = Gtk.CheckButton(label='AltGr on Right Cmd') self.rightmod = Gtk.CheckButton('AltGr on Right Cmd')
self.vsc2st3 = Gtk.CheckButton(label='ST3 hotkeys for VS Code') self.vsc2st3 = Gtk.CheckButton('ST3 hotkeys for VS Code')
self.caps2esc = Gtk.CheckButton(label='Capslock is Escape when tapped, Cmd when held') self.caps2esc = Gtk.CheckButton('Capslock is Escape when tapped, Cmd when held')
self.caps2cmd = Gtk.CheckButton(label='Capslock is Cmd') self.caps2cmd = Gtk.CheckButton('Capslock is Cmd')
if rightmod_result == 0: if rightmod_result == 0:
self.rightmod.set_active(True) self.rightmod.set_active(True)
@@ -464,9 +446,6 @@ class Indicator():
global restartsvc global restartsvc
if restartsvc == True: if restartsvc == True:
try: try:
if sysv:
restartcmd = ['sudo', '-E','/etc/init.d/kinto','restart']
else:
restartcmd = ['sudo', 'systemctl','restart','xkeysnail'] restartcmd = ['sudo', 'systemctl','restart','xkeysnail']
Popen(restartcmd) Popen(restartcmd)
restartsvc = False restartsvc = False
@@ -576,11 +555,7 @@ class Indicator():
return return
def runRestart(self,button): def runRestart(self,button):
global sysv
try: try:
if sysv:
stop = Popen(['sudo', '-E','/etc/init.d/kinto','stop'])
else:
stop = Popen(['sudo', 'systemctl','stop','xkeysnail']) stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
stop.wait() stop.wait()
time.sleep(1) time.sleep(1)
@@ -592,19 +567,12 @@ class Indicator():
pkillxkey = Popen(['sudo', 'pkill','-f','bin/xkeysnail']) pkillxkey = Popen(['sudo', 'pkill','-f','bin/xkeysnail'])
pkillxkey.wait() pkillxkey.wait()
if sysv:
Popen(['sudo', '-E','/etc/init.d/kinto','start'])
else:
Popen(['sudo', 'systemctl','start','xkeysnail']) Popen(['sudo', 'systemctl','start','xkeysnail'])
except: except:
Popen(['notify-send','Kinto: Error restarting Kinto!']) Popen(['notify-send','Kinto: Error restarting Kinto!'])
def runStop(self,button): def runStop(self,button):
global sysv
try: try:
if sysv:
stop = Popen(['sudo', '-E','/etc/init.d/kinto','stop'])
else:
stop = Popen(['sudo', 'systemctl','stop','xkeysnail']) stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
stop.wait() stop.wait()
time.sleep(1) time.sleep(1)
@@ -621,9 +589,9 @@ class Indicator():
def runDebug(self,button,opendebug): def runDebug(self,button,opendebug):
try: try:
if opendebug: if opendebug:
Popen(['/usr/bin/python3',os.environ['HOME']+'/.config/kinto/gui/kinto-gui.py','-d']) Popen([os.environ['HOME']+'/.config/kinto/gui/kinto-gui.py','-d'])
else: else:
Popen(['/usr/bin/python3',os.environ['HOME']+'/.config/kinto/gui/kinto-gui.py']) Popen([os.environ['HOME']+'/.config/kinto/gui/kinto-gui.py'])
except: except:
Popen(['notify-send','Kinto: Error opening Kinto!']) Popen(['notify-send','Kinto: Error opening Kinto!'])
@@ -721,9 +689,6 @@ class Indicator():
cmdsTerm = Popen(cmds) cmdsTerm = Popen(cmds)
cmdsTerm.wait() cmdsTerm.wait()
if sysv:
restart = ['sudo', '-E','/etc/init.d/kinto','restart']
else:
restart = ['sudo', 'systemctl','restart','xkeysnail'] restart = ['sudo', 'systemctl','restart','xkeysnail']
Popen(restart) Popen(restart)

View File

@@ -4,8 +4,8 @@ Description=xkeysnail
[Service] [Service]
Type=simple Type=simple
KillMode=process KillMode=process
ExecStart={sudo}/bin/bash -c '/usr/bin/xhost +SI:localuser:root && {homedir}/.config/kinto/killdups.sh && {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={sudo}/bin/bash -c '{sudo}pkill -f bin/xkeysnail && exit 0' ExecStop=/usr/bin/sudo /bin/bash -c '/usr/bin/sudo pkill -f bin/xkeysnail && exit 0'
Restart=on-failure Restart=on-failure
RestartSec=3 RestartSec=3
Environment=DISPLAY={displayid} Environment=DISPLAY={displayid}

View File

@@ -1,8 +0,0 @@
[Desktop Entry]
Name=Kinto_xkey
GenericName=Kinto_xkey
Comment=Make Linux Type Like it's a Mac
Exec=/bin/bash -c "grep -q 'autostart = true' {homedir}/.config/kinto/kinto.py && sudo -E /etc/init.d/kinto restart"
Terminal=false
Type=Application
X-GNOME-Autostart-enabled=true

View File

@@ -29,15 +29,15 @@ def windows_setup():
print("This install will fail if you are not running with elevated privileges") print("This install will fail if you are not running with elevated privileges")
os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"') os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"')
print("Copying autohotkey combinations for Terminals & Editors...") print("Copying autohotkey combinations for Terminals & Editors...")
os.system('copy /Y "' + path + '\\windows\\kinto.ahk" "' + homedir + '\\kinto-new.ahk"') os.system('copy /Y "' + path + '\\windows\\kinto.ahk" "' + path + '\\windows\\kinto-new.ahk"')
if default < 3: if default < 3:
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Default)(?!( - ST2CODE))(.*)/$2$3$5/gm" ' + homedir + '\\kinto-new.ahk') os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Default)(?!( - ST2CODE))(.*)/$2$3$5/g" .\\windows\\kinto-new.ahk')
if default == 1: if default == 1:
kbtype = "mac" kbtype = "mac"
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/gm" ' + homedir + '\\kinto-new.ahk') os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" .\\windows\\kinto-new.ahk')
elif default == 2: elif default == 2:
kbtype = "win" kbtype = "win"
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/gm" ' + homedir + '\\kinto-new.ahk') os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" .\\windows\\kinto-new.ahk')
elif default == 5: elif default == 5:
print("Removing any old registry keys from prior versions...") 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) p = subprocess.Popen(['powershell.exe', "Remove-ItemProperty -Path HKLM:'SYSTEM\CurrentControlSet\Control\Keyboard Layout' -Name 'Scancode Map' -ErrorAction SilentlyContinue"], stdout=sys.stdout)
@@ -52,32 +52,32 @@ def windows_setup():
print("Uninstall of Kinto is Complete.") print("Uninstall of Kinto is Complete.")
if default == 3: if default == 3:
kbtype = "chrome" kbtype = "chrome"
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Chromebook)/$2$3/gm" ' + homedir + '\\kinto-new.ahk') 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/gm" ' + homedir + '\\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: if default == 3 or default == 4:
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB\/IBM)/$2$3/gm" ' + homedir + '\\kinto-new.ahk') os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB\/IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers\/CB\/IBM)/$2$3/gm" ' + homedir + '\\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 == 4: if default == 4:
kbtype = "ibm" kbtype = "ibm"
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; IBM)/$2$3/gm" ' + homedir + '\\kinto-new.ahk') os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
if default > 0 and default < 5: 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) 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 Terminal Theme as default...") print("\nWill now install Ubuntu Terminal Theme as default...")
os.system('regedit "' + path + '\\windows\\theme_ubuntu.reg"') os.system('regedit "' + path + '\\windows\\theme_ubuntu.reg"')
os.system('robocopy "'+ path + '\\assets" "%userprofile%\\.kinto\\assets" /E') os.system('robocopy "'+ path + '\\assets" "%userprofile%\\.kinto\\assets" /E')
if (stvscode and (default > 0 or default < 3)): if (stvscode and (default > 0 or default < 3)):
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Default - ST2CODE)/$2$3/gm" ' + homedir + '\\kinto-new.ahk') 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 )): elif (stvscode and (default == 3 or default == 4 )):
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB/IBM - ST2CODE)/$2$3/gm" ' + homedir + '\\kinto-new.ahk') 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('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 + '/gm" "%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\\usb.vbs" "%userprofile%\\.kinto\\usb.vbs"')
os.system('copy /Y "' + path + '\\windows\\detectUSB.ahk" "%userprofile%\\.kinto\\detectUSB.ahk"') os.system('copy /Y "' + path + '\\windows\\detectUSB.ahk" "%userprofile%\\.kinto\\detectUSB.ahk"')
os.system('mklink "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"') os.system('mklink "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\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\\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\\toggle_kb.bat" "%userprofile%\\.kinto\\toggle_kb.bat"')
os.system('copy /Y "'+ homedir + '\\kinto-new.ahk" "%userprofile%\\.kinto\\kinto.ahk"') os.system('copy /Y "'+ path + '\\windows\\kinto-new.ahk" "%userprofile%\\.kinto\\kinto.ahk"')
os.system("del /f " + homedir + "\\kinto-new.ahk") os.system("del /f .\\windows\\kinto-new.ahk")
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\" 2> nul") 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] 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"') print('Starting... "' + userpath + '\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs"')

Binary file not shown.

View File

@@ -172,11 +172,8 @@ GroupAdd, browsers, ahk_exe msedge.exe
; Disable Key Remapping for Virtual Machines ; Disable Key Remapping for Virtual Machines
; Disable for Remote desktop solutions too ; Disable for Remote desktop solutions too
GroupAdd, remotes, ahk_exe VirtualBoxVM.exe GroupAdd, virtm, ahk_exe VirtualBoxVM.exe
GroupAdd, remotes, ahk_exe mstsc.exe GroupAdd, virtm, ahk_exe mstsc.exe
GroupAdd, remotes, ahk_exe msrdc.exe
GroupAdd, remotes, ahk_exe nxplayer.bin
GroupAdd, remotes, ahk_exe vmconnect.exe
; Disabled Edge for now - no ability to close all instances ; Disabled Edge for now - no ability to close all instances
; GroupAdd, browsers, Microsoft Edge ahk_class ApplicationFrameWindow ; GroupAdd, browsers, Microsoft Edge ahk_class ApplicationFrameWindow
@@ -191,57 +188,7 @@ GroupAdd, intellij, ahk_exe idea64.exe
; SetCapsLockState, AlwaysOff ; CB/IBM ; SetCapsLockState, AlwaysOff ; CB/IBM
; Keyboards w/o media keys can use this Remap #IfWinNotActive ahk_group virtm
; This will replace unneeded dedicated keys
; with most commonly used media keys
;
; Insert::SoundSet, +1, , mute ; Toggles Speaker
; +Insert::Insert ; Shift Insert maps to Insert
; Home::SoundSetWaveVolume, -10 ; Decrease volume
; PgUp::SoundSetWaveVolume, +10 ; Increase volume
; Delete::Send {Media_Prev} ; Previous
; End::Send {Media_Play_Pause} ; Pause/Play
; PgDn::Send {Media_Next} ; Next
; Virtual Desktop Hack via TotalSpaces2 - macOS Remote Desktop
; Custom Bind Gestures in Windows
; Shift-F8 on Left Swipe
; Shift-F9 on Right Swipe
#IfWinActive ahk_exe nxplayer.bin
+F8::Send !+- ; macOS TotalSpaces2 - Space Left
+F6::Send !+= ; macOS TotalSpaces2 - Space Right
#If
; +F8::Send {LCtrl down}{LWin down}{left}{LCtrl up}{LWin up} ; Comment out on host machine
; +F6::Send {LCtrl down}{LWin down}{right}{LCtrl up}{LWin up} ; Comment out on host machine
#IfWinNotActive ahk_group remotes
; Lock Workstation
#^q::DllCall("LockWorkStation")
; Conflicts w/ Win-L so will use Ctrl-Shift-L as Ctrl-L replacement
; Helpful for Sublime text lowercasing & VSCode
^+l::Send ^{l}
; Adds Task View to Ctrl-Cmd-Down
#^Down::
Run, "C:\Windows\explorer.exe" "shell:::{3080F90E-D7AD-11D9-BD98-0000947B0257}"
return
; wordwise support
^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}
$^Left::Send {Home}
$^+Left::Send +{Home}
$^Right::Send {End}
$^+Right::Send +{End}
#If
#IfWinNotActive ahk_group remotes
; New AltTab and CtrlTab fix ; New AltTab and CtrlTab fix
*tab:: *tab::
@@ -347,10 +294,8 @@ GroupAdd, intellij, ahk_exe idea64.exe
!Esc::SendInput, {Pause} !Esc::SendInput, {Pause}
; Go up or down a page ; Go up or down a page
#IfWinNotActive ahk_group editors $!Down::Send {PgDn};
$!Down::Send {PgDn} $!Up::Send {PgUp};
$!Up::Send {PgUp}
#If
; Close Apps ; Close Apps
^q::Send !{F4} ^q::Send !{F4}
@@ -407,6 +352,22 @@ GroupAdd, intellij, ahk_exe idea64.exe
; !^space::Send #e ; Default ; !^space::Send #e ; Default
; #^space::Send #e ; CB/IBM ; #^space::Send #e ; CB/IBM
; wordwise support
^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}
$^Left::Send {Home}
$^+Left::Send +{Home}
$^Right::Send {End}
$^+Right::Send +{End}
; #if GetKeyState("LWin", "P") || GetKeyState("RAlt", "P") ; Chromebook ; #if GetKeyState("LWin", "P") || GetKeyState("RAlt", "P") ; Chromebook
; Space::Send ^{Esc} ; Chromebook ; Space::Send ^{Esc} ; Chromebook
; 0::Send #0 ; Chromebook ; 0::Send #0 ; Chromebook
@@ -561,13 +522,6 @@ GroupAdd, intellij, ahk_exe idea64.exe
; Close all browsers ; Close all browsers
#IfWinActive ahk_group browsers #IfWinActive ahk_group browsers
;Tab Navigation
^+[::send ^{PgUp}
^+]::send ^{PgDn}
^!Left::send ^{PgUp}
^!Right::send ^{PgDn}
#Left::send ^{PgUp}
#Right::send ^{PgDn}
^q::send {Alt Down}f{Alt Up}x ; exit all windows ^q::send {Alt Down}f{Alt Up}x ; exit all windows
; Dev Tools ; Dev Tools
!^i::send {Ctrl Down}{Shift Down}i{Shift Up}{Ctrl Up} !^i::send {Ctrl Down}{Shift Down}i{Shift Up}{Ctrl Up}
@@ -575,7 +529,6 @@ GroupAdd, intellij, ahk_exe idea64.exe
; Open preferences ; Open preferences
#IfWinActive ahk_exe firefox.exe #IfWinActive ahk_exe firefox.exe
^,::send, {Ctrl Down}t{Ctrl Up}about:preferences{Enter} ^,::send, {Ctrl Down}t{Ctrl Up}about:preferences{Enter}
^+n::send ^+p
#If #If
#IfWinActive ahk_exe chrome.exe #IfWinActive ahk_exe chrome.exe
^,::send {Alt Down}e{Alt Up}s{Enter} ^,::send {Alt Down}e{Alt Up}s{Enter}
@@ -615,7 +568,7 @@ GroupAdd, intellij, ahk_exe idea64.exe
; #x::Send ^{x} ; Default - Terminal - Ctrl-x ; #x::Send ^{x} ; Default - Terminal - Ctrl-x
; #c::Send ^{c} ; Default - Terminal - Ctrl-c sigint ; #c::Send ^{c} ; Default - Terminal - Ctrl-c sigint
; !x::Send ^{x} ; CB/IBM ; !x::Send ^{x} ; CB/IBM
; !c::Send ^{c} ; CB/IBM - Sigint ; !c::Send ^{c} ; CB/IBM
; #c::send ^{Pause} ; cancel_build ; #c::send ^{Pause} ; cancel_build
; #Space::Send ^{Space} ; Default - Basic code completion ; #Space::Send ^{Space} ; Default - Basic code completion
; !Space::Send ^{Space} ; CB/IBM - Basic code completion ; !Space::Send ^{Space} ; CB/IBM - Basic code completion
@@ -639,6 +592,7 @@ GroupAdd, intellij, ahk_exe idea64.exe
Insert::Return ; cancel toggle_overwrite Insert::Return ; cancel toggle_overwrite
^!O::send {Insert} ; toggle_overwrite ^!O::send {Insert} ; toggle_overwrite
; !c::Return ; Default - cancel toggle_case_sensitive ; !c::Return ; Default - cancel toggle_case_sensitive
; $!c::send ^{c} ; CB/IBM - Sigint
^!c::send !{c} ; toggle_case_sensitive ^!c::send !{c} ; toggle_case_sensitive
; ^h::Return ; cancel replace ; ^h::Return ; cancel replace
^!f::send ^{h} ; replace ^!f::send ^{h} ; replace
@@ -646,7 +600,6 @@ GroupAdd, intellij, ahk_exe idea64.exe
^!e::send ^+{h} ; replace_next ^!e::send ^+{h} ; replace_next
F3::Return ; cancel find_next F3::Return ; cancel find_next
^g::send {F3} ; find_next ^g::send {F3} ; find_next
#g::send ^{g} ; goto line - disable game bar - Start menu -> Game bar shortcuts -> toggle Off
*F3::Return ; cancel find_prev, find_under, find_all_under *F3::Return ; cancel find_prev, find_under, find_all_under
^+g::send +{F3} ; find_prev ^+g::send +{F3} ; find_prev
#!g::send ^{F3} ; find_under #!g::send ^{F3} ; find_under
@@ -776,45 +729,45 @@ GroupAdd, intellij, ahk_exe idea64.exe
; Clear Terminal and Scroll Buffer ; Clear Terminal and Scroll Buffer
^k::Send clear && printf '\e[3J'{Enter} ^k::Send clear && printf '\e[3J'{Enter}
; Remap Physical Ctrl back to Ctrl ; Remap Physical Ctrl back to Ctrl
; #0::Send {LCtrl down}0{Ctrl up} ; Default #0::Send {LCtrl down}0{Ctrl up} ; Default
; #1::Send {LCtrl down}1{Ctrl up} ; Default #1::Send {LCtrl down}1{Ctrl up} ; Default
; #2::Send {LCtrl down}2{Ctrl up} ; Default #2::Send {LCtrl down}2{Ctrl up} ; Default
; #3::Send {LCtrl down}3{Ctrl up} ; Default #3::Send {LCtrl down}3{Ctrl up} ; Default
; #4::Send {LCtrl down}4{Ctrl up} ; Default #4::Send {LCtrl down}4{Ctrl up} ; Default
; #5::Send {LCtrl down}5{Ctrl up} ; Default #5::Send {LCtrl down}5{Ctrl up} ; Default
; #6::Send {LCtrl down}6{Ctrl up} ; Default #6::Send {LCtrl down}6{Ctrl up} ; Default
; #7::Send {LCtrl down}7{Ctrl up} ; Default #7::Send {LCtrl down}7{Ctrl up} ; Default
; #8::Send {LCtrl down}8{Ctrl up} ; Default #8::Send {LCtrl down}8{Ctrl up} ; Default
; #9::Send {LCtrl down}9{Ctrl up} ; Default #9::Send {LCtrl down}9{Ctrl up} ; Default
; #-::Send {LCtrl down}-{Ctrl up} ; Default #-::Send {LCtrl down}-{Ctrl up} ; Default
; #=::Send {LCtrl down}={Ctrl up} ; Default #=::Send {LCtrl down}={Ctrl up} ; Default
; #`::Send {LCtrl down}`{Ctrl up} ; Default #`::Send {LCtrl down}`{Ctrl up} ; Default
; #a::Send {LCtrl down}a{Ctrl up} ; Default #a::Send {LCtrl down}a{Ctrl up} ; Default
; #b::Send {LCtrl down}b{Ctrl up} ; Default #b::Send {LCtrl down}b{Ctrl up} ; Default
; #c::Send {LCtrl down}c{Ctrl up} ; Default #c::Send {LCtrl down}c{Ctrl up} ; Default
; #d::Send {LCtrl down}d{Ctrl up} ; Default #d::Send {LCtrl down}d{Ctrl up} ; Default
; #e::Send {LCtrl down}e{Ctrl up} ; Default #e::Send {LCtrl down}e{Ctrl up} ; Default
; #f::Send {LCtrl down}f{Ctrl up} ; Default #f::Send {LCtrl down}f{Ctrl up} ; Default
; #g::Send {LCtrl down}g{Ctrl up} ; Default #g::Send {LCtrl down}g{Ctrl up} ; Default
; #h::Send {LCtrl down}h{Ctrl up} ; Default #h::Send {LCtrl down}h{Ctrl up} ; Default
; #i::Send {LCtrl down}i{Ctrl up} ; Default #i::Send {LCtrl down}i{Ctrl up} ; Default
; #j::Send {LCtrl down}j{Ctrl up} ; Default #j::Send {LCtrl down}j{Ctrl up} ; Default
; #k::Send {LCtrl down}k{Ctrl up} ; Default #k::Send {LCtrl down}k{Ctrl up} ; Default
; #l::Send {LCtrl down}l{Ctrl up} ; Default #l::Send {LCtrl down}l{Ctrl up} ; Default
; #m::Send {LCtrl down}m{Ctrl up} ; Default #m::Send {LCtrl down}m{Ctrl up} ; Default
; #n::Send {LCtrl down}n{Ctrl up} ; Default #n::Send {LCtrl down}n{Ctrl up} ; Default
; #o::Send {LCtrl down}o{Ctrl up} ; Default #o::Send {LCtrl down}o{Ctrl up} ; Default
; #p::Send {LCtrl down}p{Ctrl up} ; Default #p::Send {LCtrl down}p{Ctrl up} ; Default
; #q::Send {LCtrl down}q{Ctrl up} ; Default #q::Send {LCtrl down}q{Ctrl up} ; Default
; #r::Send {LCtrl down}r{Ctrl up} ; Default #r::Send {LCtrl down}r{Ctrl up} ; Default
; #s::Send {LCtrl down}s{Ctrl up} ; Default #s::Send {LCtrl down}s{Ctrl up} ; Default
; #t::Send {LCtrl down}t{Ctrl up} ; Default #t::Send {LCtrl down}t{Ctrl up} ; Default
; #u::Send {LCtrl down}u{Ctrl up} ; Default #u::Send {LCtrl down}u{Ctrl up} ; Default
; #v::Send {LCtrl down}v{Ctrl up} ; Default #v::Send {LCtrl down}v{Ctrl up} ; Default
; #w::Send {LCtrl down}w{Ctrl up} ; Default #w::Send {LCtrl down}w{Ctrl up} ; Default
; #x::Send {LCtrl down}x{Ctrl up} ; Default #x::Send {LCtrl down}x{Ctrl up} ; Default
; #y::Send {LCtrl down}y{Ctrl up} ; Default #y::Send {LCtrl down}y{Ctrl up} ; Default
; #z::Send {LCtrl down}z{Ctrl up} ; Default #z::Send {LCtrl down}z{Ctrl up} ; Default
; !0::Send {LCtrl down}0{Ctrl up} ; CB/IBM ; !0::Send {LCtrl down}0{Ctrl up} ; CB/IBM
; !1::Send {LCtrl down}1{Ctrl up} ; CB/IBM ; !1::Send {LCtrl down}1{Ctrl up} ; CB/IBM
; !2::Send {LCtrl down}2{Ctrl up} ; CB/IBM ; !2::Send {LCtrl down}2{Ctrl up} ; CB/IBM

View File

@@ -3,18 +3,11 @@
# set about:config?filter=ui.key.menuAccessKeyFocuses # set about:config?filter=ui.key.menuAccessKeyFocuses
# to false for wordwise to work in Firefox # to false for wordwise to work in Firefox
function pause(){
read -s -n 1 -p "Press any key to continue . . ."
echo ""
}
typeset -l distro typeset -l distro
distro=$(awk -F= '$1=="NAME" { gsub("[\",!,_, ]","",$2);print $2 ;}' /etc/os-release) distro=$(awk -F= '$1=="NAME" { gsub("[\",!,_, ]","",$2);print $2 ;}' /etc/os-release)
typeset -l dename typeset -l dename
dename=$(./linux/system-config/dename.sh | cut -d " " -f1) dename=$(./linux/system-config/dename.sh | cut -d " " -f1)
sysv=$(pidof systemd >/dev/null 2>&1 && echo "1" || echo "0")
function uninstall { 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." 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."
@@ -45,12 +38,8 @@ function uninstall {
mv ~/.config/kglobalshortcutsrc ~/.config/kglobalshortcutsrc.kinto mv ~/.config/kglobalshortcutsrc ~/.config/kglobalshortcutsrc.kinto
elif [ "$dename" == "xfce" ];then elif [ "$dename" == "xfce" ];then
echo "Resetting DE hotkeys..." echo "Resetting DE hotkeys..."
if test -f "/etc/mx-version";then
cp /etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
else
cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
fi fi
fi
elif [ "$yn" == "r" ]; then elif [ "$yn" == "r" ]; then
echo "Restore original user shortcuts" echo "Restore original user shortcuts"
if [[ $dename == "gnome" || $dename == "budgie" ]]; then if [[ $dename == "gnome" || $dename == "budgie" ]]; then
@@ -88,12 +77,6 @@ function uninstall {
echo -e "\nWill still be restoring the overlay key" echo -e "\nWill still be restoring the overlay key"
echo -e "gsettings set org.gnome.mutter overlay-key 'super'\n" echo -e "gsettings set org.gnome.mutter overlay-key 'super'\n"
gsettings set org.gnome.mutter overlay-key 'super' gsettings set org.gnome.mutter overlay-key 'super'
# Repetitive - xfce restore factory or backup does this
# Also needs to check if whiskermenu is even being used
# elif [[ $dename == "xfce" ]]; then
# echo -e "\nWill still be restoring the overlay key"
# echo -e "xfconf-query --channel xfce4-keyboard-shortcuts --property \"/commands/custom/Super_L\" --create --type string --set \"xfce4-popup-whiskermenu\""
# xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/Super_L" --create --type string --set "xfce4-popup-whiskermenu"
fi fi
} }
@@ -206,7 +189,6 @@ if [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
echo "rm /etc/systemd/system/graphical.target.wants/xkeysnail.service" echo "rm /etc/systemd/system/graphical.target.wants/xkeysnail.service"
echo "rm /usr/lib/systemd/system/xkeysnail.service" echo "rm /usr/lib/systemd/system/xkeysnail.service"
echo "rm /lib/systemd/system/xkeysnail.service" echo "rm /lib/systemd/system/xkeysnail.service"
sudo rm /etc/init.d/kinto >/dev/null 2>&1
sudo rm /etc/systemd/system/xkeysnail.service >/dev/null 2>&1 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 /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 /usr/lib/systemd/system/xkeysnail.service >/dev/null 2>&1
@@ -225,29 +207,9 @@ fi
sudo systemctl stop xkeysnail >/dev/null 2>&1 sudo systemctl stop xkeysnail >/dev/null 2>&1
sudo systemctl disable 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 bin/xkeysnail >/dev/null 2>&1
sudo pkill -f kinto-gui.py >/dev/null 2>&1
sudo pkill -f kintotray.py >/dev/null 2>&1
ps aux | awk '/[s]h -c while/ {print $2}' | xargs -r -n1 sudo kill
sudo pkill -f "is-active xkeysnail" >/dev/null 2>&1 sudo pkill -f "is-active xkeysnail" >/dev/null 2>&1
if [ "$distro" == "manjarolinux" ]; then pip3 install pillow
while true; do
read -rep $'\nHave you run \"sudo pacman -Syu\" before running Kinto setup? (y/n): ' updated
case $updated in
[Yy]* ) mjupdated='yes'; break;;
[Nn]* ) mjupdated='no'; break;;
* ) echo -e "\nPlease answer [y]es or [n]o.";;
esac
done
if [[ "$mjupdated" == "no" ]]; then
echo
echo "================================================================================"
echo "========== Please run a full system update before installing Kinto. =========="
echo "================================================================================"
echo
exit 0
fi
fi
# Add additional shortcuts if needed, does not modify existing ones # Add additional shortcuts if needed, does not modify existing ones
@@ -257,34 +219,6 @@ if [[ $dename == 'gnome' || $dename == 'budgie' ]];then
echo "Overlay key, " $bound ", detected. Will be removing so Super-Space can remap to Cmd-Space for app launching.." 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 '' gsettings set org.gnome.mutter overlay-key ''
fi fi
elif [[ $dename == 'xfce' ]];then
launcher=$(cat ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml | grep 'name="Super_L"' | sed 's:.*="::')
# echo "${#launcher}"
if [[ "${#launcher}" -eq 0 ]]; then
xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/Super_L" --create --type string --set "xfce4-popup-whiskermenu"
echo "Resetting Super_L, please wait..."
sleep 6
launcher=$(cat ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml | grep 'name="Super_L"' | sed 's:.*="::')
if [[ "${#launcher}" -gt 0 ]]; then
echo "Success."
else
echo "Failed. Skipping setup of Cmd-Space."
fi
fi
if [[ "${#launcher}" -gt 0 ]]; then
nlauncher=${launcher::-3}
# Replace Alt-F1 help file w/ whisker menu alternative hotkey
xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Alt>F1" --reset
# Clear Alt-F3 App Finder for sublime text global replace
xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Alt>F3" --reset
xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Alt>F1" --create --type string --set "$nlauncher" && echo "$nlauncher has been set to Alt-F1 for Cmd-Space to work."
# Unset Super_L to avoid issues during setup, will re-apply at the end
xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/Super_L" --reset
# xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Super>grave" --create --type string --set "switch_window_key"
fi
# Unset Super-Tab, breaks Ctrl-Tab. switch_window_key
sed -i '/.*name=\"&lt;Super&gt;Tab.*$/d' ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
fi fi
# if ls /etc/apt/sources.list.d/system76* 1> /dev/null 2>&1; then # if ls /etc/apt/sources.list.d/system76* 1> /dev/null 2>&1; then
@@ -305,7 +239,6 @@ fi
if [[ $distro == "elementaryos" ]]; then if [[ $distro == "elementaryos" ]]; then
gsettings set io.elementary.terminal.settings natural-copy-paste false gsettings set io.elementary.terminal.settings natural-copy-paste false
sudo ./linux/system-config/unipkg.sh libvte-2.91-dev
fi fi
if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then
@@ -317,6 +250,8 @@ fi
if [[ $dename == "kde" ]]; then if [[ $dename == "kde" ]]; then
if [[ $distro == "manjarolinux" ]]; then if [[ $distro == "manjarolinux" ]]; then
sudo ./linux/system-config/unipkg.sh vte3 sudo ./linux/system-config/unipkg.sh vte3
elif [[ ${distro:0:8} == "opensuse" ]];then
sudo ./linux/system-config/unipkg.sh vte-devel-0.62.3
else else
sudo ./linux/system-config/unipkg.sh libvte-2.91-dev sudo ./linux/system-config/unipkg.sh libvte-2.91-dev
fi fi
@@ -330,6 +265,25 @@ if [[ $distro == 'kdeneon' ]]; then
fi fi
if [[ $distro == 'fedora' ]]; then 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 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']" gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d']"
else else
@@ -374,21 +328,19 @@ expsh=" "
# echo "Will need to install inotify-tools to restart key remapper live for config file changes..." # echo "Will need to install inotify-tools to restart key remapper live for config file changes..."
# sudo ./linux/system-config/unipkg.sh inotify-tools # sudo ./linux/system-config/unipkg.sh inotify-tools
# fi # fi
if ! [ -x "$(command -v git)" ]; then
echo "Will need to install git..."
sudo ./linux/system-config/unipkg.sh git
fi
if ! [ -x "$(command -v pip3)" ]; then if ! [ -x "$(command -v pip3)" ]; then
echo "Will need to install python3-pip..." echo "Will need to install python3-pip..."
sudo ./linux/system-config/unipkg.sh python3-pip sudo ./linux/system-config/unipkg.sh python3-pip
fi fi
if ! [ -x "$(command -v python3-config)" ]; then if ! [ -x "$(command -v python3-config)" ]; then
if [ "$distro" == "ubuntu" ] || [ "${distro::6}" == "debian" ] || [ "$distro" == 'linuxmint' ]; then if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] || [ "$distro" == 'linuxmint' ]; then
pydev="python3-dev" pydev="python3-dev"
elif [ "$distro" == "fedora" ]; then elif [ "$distro" == "fedora" ]; then
pydev="python3-devel" pydev="python3-devel"
elif [ "${distro:0:8}" == "opensuse" ]; then
pydev="python3-devel python3-gobject python3-gobject-Gdk typelib-1_0-Gtk-3_0 libgtk-3-0"
fi fi
if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "${distro::6}" == "debian" ] || [ "$distro" == 'linuxmint' ]; then if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "$distro" == "debian" ] || [ "$distro" == 'linuxmint' ] || [ "${distro:0:8}" == "opensuse" ]; then
echo "Will need to install $pydev..." echo "Will need to install $pydev..."
sudo ./linux/system-config/unipkg.sh "$pydev" sudo ./linux/system-config/unipkg.sh "$pydev"
fi fi
@@ -397,18 +349,16 @@ fi
# sudo ./linux/system-config/unipkg.sh gnome-tweaks gnome-shell-extension-appindicator gir1.2-appindicator3-0.1 # sudo ./linux/system-config/unipkg.sh gnome-tweaks gnome-shell-extension-appindicator gir1.2-appindicator3-0.1
# fi # fi
if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then
if [ "$distro" == "\"manjaro linux\"" ]; then if [ "$distro" == "manjarolinux" ]; then
sudo ./linux/system-config/unipkg.sh "xorg-xhost gcc" sudo ./linux/system-config/unipkg.sh "xorg-xhost gcc"
elif [ "${distro:0:8}" == "opensuse" ]; then
sudo ./linux/system-config/unipkg.sh "gcc"
fi fi
fi fi
if [ "$distro" == 'linuxmint' ]; then if [ "$distro" == 'linuxmint' ]; then
pip3 install setuptools pip3 install setuptools
elif [ "${distro::6}" == "debian" ]; then
sudo pip3 install setuptools wheel
fi fi
pip3 install pillow
# echo "Transferring files..." # echo "Transferring files..."
mkdir -p ~/.config/kinto mkdir -p ~/.config/kinto
@@ -419,11 +369,7 @@ mkdir -p ~/.config/kinto
# KDE startup - xhost fix # KDE startup - xhost fix
mkdir -p ~/.config/autostart mkdir -p ~/.config/autostart
if [ ! "$sysv" -eq 0 ];then
yes | cp -rf ./linux/xkeysnail.desktop ~/.config/kinto/xkeysnail.desktop yes | cp -rf ./linux/xkeysnail.desktop ~/.config/kinto/xkeysnail.desktop
else
yes | cp -rf ./linux/xkeysnail_sysv.desktop ~/.config/kinto/xkeysnail.desktop
fi
# yes | cp -rf ./linux/xkeystart.sh ~/.config/kinto/xkeystart.sh # yes | cp -rf ./linux/xkeystart.sh ~/.config/kinto/xkeystart.sh
@@ -437,17 +383,9 @@ fi
# logoff fix - not solid for every os. Prevents missed 1 character input on login # logoff fix - not solid for every os. Prevents missed 1 character input on login
# yes | sudo cp -rf linux/gnome_logoff.sh ~/.config/kinto/logoff.sh # yes | sudo cp -rf linux/gnome_logoff.sh ~/.config/kinto/logoff.sh
if [ -d "./.git" ]
then
echo "$(git describe --tag --abbrev=0 | head -n 1)" "build" "$(git rev-parse --short HEAD)" > ~/.config/kinto/version echo "$(git describe --tag --abbrev=0 | head -n 1)" "build" "$(git rev-parse --short HEAD)" > ~/.config/kinto/version
elif [ -f "./dl_version" ]; then
cp ./dl_version ~/.config/kinto/version
else
# Not a typo - v is built in
echo "ersion Unknown" > ~/.config/kinto/version
fi
yes | cp -rf ./linux/kinto.py ./linux/kinto.py.new yes | cp -rf ./linux/kinto.py ./linux/kinto.py.new
yes | cp -rf ./linux/limitedadmins ./linux/limitedadmins.new
yes | cp -rf ./linux/gui/ ~/.config/kinto/ yes | cp -rf ./linux/gui/ ~/.config/kinto/
yes | cp -nrf ./linux/initkb ~/.config/kinto/initkb yes | cp -nrf ./linux/initkb ~/.config/kinto/initkb
yes | cp -rf ./linux/killdups.sh ~/.config/kinto/killdups.sh yes | cp -rf ./linux/killdups.sh ~/.config/kinto/killdups.sh
@@ -460,13 +398,6 @@ yes | cp -rf ./linux/trayapps/appindicator/icons/kinto-invert-16.svg ~/.config/k
yes | cp -rf ./linux/trayapps/appindicator/icons/kinto-solid-16.svg ~/.config/kinto/kinto-solid.svg yes | cp -rf ./linux/trayapps/appindicator/icons/kinto-solid-16.svg ~/.config/kinto/kinto-solid.svg
yes | cp -rf ./linux/trayapps/appindicator/icons/kinto.svg ~/.config/kinto/kinto.svg yes | cp -rf ./linux/trayapps/appindicator/icons/kinto.svg ~/.config/kinto/kinto.svg
# yes | cp -rf ./linux/system-config/caret_status_xkey.sh ~/.config/kinto/caret_status_xkey.sh # yes | cp -rf ./linux/system-config/caret_status_xkey.sh ~/.config/kinto/caret_status_xkey.sh
yes | cp -rf ./linux/limitedadmins ./linux/limitedadmins.new
sed -i "s/{username}/`whoami`/g" ./linux/limitedadmins.new
sed -i "s#{systemctl}#`\\which systemctl`#g" ./linux/limitedadmins.new
sed -i "s#{pkill}#`\\which pkill`#g" ./linux/limitedadmins.new
if [ ! "$sysv" -eq 0 ];then
echo "Using systemd..."
yes | cp -rf ./linux/xkeysnail.service ./linux/xkeysnail.service.new yes | cp -rf ./linux/xkeysnail.service ./linux/xkeysnail.service.new
# yes | cp -rf ./linux/xkeysnail.timer ~/.config/systemd/user/xkeysnail.timer # yes | cp -rf ./linux/xkeysnail.timer ~/.config/systemd/user/xkeysnail.timer
sed -i "s#{experimental-caret}#$exp#g" ./linux/xkeysnail.service.new sed -i "s#{experimental-caret}#$exp#g" ./linux/xkeysnail.service.new
@@ -477,19 +408,19 @@ if [ ! "$sysv" -eq 0 ];then
fi fi
sed -i "s/{username}/`whoami`/g" ./linux/xkeysnail.service.new sed -i "s/{username}/`whoami`/g" ./linux/xkeysnail.service.new
sed -i "s#{homedir}#`echo "$HOME"`#g" ./linux/xkeysnail.service.new sed -i "s#{homedir}#`echo "$HOME"`#g" ./linux/xkeysnail.service.new
sed -i "s#{xhost}#`\\which xhost`#g" ./linux/xkeysnail.service.new
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ./linux/xkeysnail.service.new
else
echo "Using sysvinit..."
fi
sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/kintotray.desktop sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/kintotray.desktop
sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/gui/kinto-gui.py sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/gui/kinto-gui.py
sed -i "s#{homedir}#`echo "$HOME"`#g" ./linux/gui/kinto.desktop.new sed -i "s#{homedir}#`echo "$HOME"`#g" ./linux/gui/kinto.desktop.new
sudo mv ./linux/gui/kinto.desktop.new /usr/share/applications/kinto.desktop sudo mv ./linux/gui/kinto.desktop.new /usr/share/applications/kinto.desktop
sed -i "s#{xhost}#`\\which xhost`#g" ./linux/xkeysnail.service.new
sed -i "s/{username}/`whoami`/g" ./linux/limitedadmins.new
sed -i "s#{systemctl}#`\\which systemctl`#g" ./linux/limitedadmins.new
sed -i "s#{pkill}#`\\which pkill`#g" ./linux/limitedadmins.new
sed -i "s#{systemctl}#`\\which systemctl`#g" ~/.config/kinto/xkeysnail.desktop sed -i "s#{systemctl}#`\\which systemctl`#g" ~/.config/kinto/xkeysnail.desktop
sed -i "s#{xhost}#`\\which xhost`#g" ~/.config/kinto/xkeysnail.desktop sed -i "s#{xhost}#`\\which xhost`#g" ~/.config/kinto/xkeysnail.desktop
sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/xkeysnail.desktop sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/xkeysnail.desktop
# sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/prexk.sh # sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/prexk.sh
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ./linux/xkeysnail.service.new
# sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/kinto/prexk.sh # sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/kinto/prexk.sh
if [[ $dename == "budgie" ]]; then if [[ $dename == "budgie" ]]; then
@@ -502,11 +433,6 @@ fi
if [[ $distro == "fedora" ]]; then if [[ $distro == "fedora" ]]; then
perl -pi -e "\s{4}(# )(K.*)(# SL - .*fedora.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1 perl -pi -e "\s{4}(# )(K.*)(# SL - .*fedora.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
sed -i "s#{sudo}##g" ./linux/xkeysnail.service.new
selinuxuser=system_u
selinuxtype=systemd_unit_file_t
else
sed -i "s#{sudo}#`\\which sudo` #g" ./linux/xkeysnail.service.new
fi fi
if [[ $distro == "elementaryos" ]]; then if [[ $distro == "elementaryos" ]]; then
@@ -539,31 +465,26 @@ if [[ $dename == "xfce" ]] && ls /etc/apt/sources.list.d/enso* 1> /dev/null 2>&1
fi fi
if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
mv ./linux/kinto.py.new ~/.config/kinto/kinto.py mv ./linux/kinto.py.new ~/.config/kinto/kinto.py
# if [ "$distro" == "fedora" ];then # if [ "$distro" == "fedora" ];then
if [ ! "$sysv" -eq 0 ];then
# echo "Using systemd..."
sudo rm /etc/systemd/system/xkeysnail.service >/dev/null 2>&1 sudo rm /etc/systemd/system/xkeysnail.service >/dev/null 2>&1
else
# echo "Using sysvinit..."
echo ""
fi
if [ -d /usr/lib/systemd/system ];then if [ -d /usr/lib/systemd/system ];then
xkeypath="/usr/lib/systemd/system/" xkeypath="/usr/lib/systemd/system/"
elif [ -d /lib/systemd/system ];then elif [ -d /lib/systemd/system ];then
xkeypath="/lib/systemd/system/" xkeypath="/lib/systemd/system/"
fi fi
xhost +SI:localuser:root xhost +SI:localuser:root
git clone -b kinto --depth 10 https://github.com/rbreaves/xkeysnail.git git clone --depth 10 https://github.com/rbreaves/xkeysnail.git
cd xkeysnail cd xkeysnail
git checkout kinto
giturl=$(git ls-remote --get-url) giturl=$(git ls-remote --get-url)
if [ "$giturl" != "https://github.com/rbreaves/xkeysnail.git" ];then if [ "$giturl" != "https://github.com/rbreaves/xkeysnail.git" ];then
echo -e "\nreplacing xkeysnail with fork...\n" echo -e "\nreplacing xkeysnail with fork...\n"
cd .. cd ..
rm -rf ./xkeysnail rm -rf ./xkeysnail
git clone -b kinto --depth 10 https://github.com/rbreaves/xkeysnail.git git clone --depth 10 https://github.com/rbreaves/xkeysnail.git
cd xkeysnail cd xkeysnail
git checkout kinto
fi fi
sudo pip3 install --upgrade . sudo pip3 install --upgrade .
cd .. cd ..
@@ -574,42 +495,25 @@ if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
echo -e "Run 'sudo pip3 install --upgrade .' to debug issue" echo -e "Run 'sudo pip3 install --upgrade .' to debug issue"
exit 0 exit 0
fi fi
sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./linux/xkeysnail.service.new
sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./linux/limitedadmins.new sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./linux/limitedadmins.new
if [[ $distro == "fedora" ]]; then
echo "Changing SELinux context" # openSUSE needs DISPLAY exported inside main command to avoid display "" not found error.
sudo chcon -v --user=$selinuxuser --type=$selinuxtype "$xkeypath"xkeysnail.service if [[ ${distro:0:8} == "opensuse" ]];then
sed -i "s#'/usr/bin/xhost#'export DISPLAY=`echo $DISPLAY` \&\& /usr/bin/xhost#g" ./linux/xkeysnail.service.new
fi fi
sudo mv ./linux/xkeysnail.service.new "$xkeypath"xkeysnail.service && echo "Service file added to "$xkeypath"xkeysnail.service"
sudo chown root:root ./linux/limitedadmins.new sudo chown root:root ./linux/limitedadmins.new
# Add a check here for xkeysnail path resolving # Add a check here for xkeysnail path resolving
sudo mv ./linux/limitedadmins.new /etc/sudoers.d/limitedadmins sudo mv ./linux/limitedadmins.new /etc/sudoers.d/limitedadmins
if [ ! "$sysv" -eq 0 ];then
# echo "Using systemd..."
sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./linux/xkeysnail.service.new
sudo mv ./linux/xkeysnail.service.new "$xkeypath"xkeysnail.service && echo "Service file added to "$xkeypath"xkeysnail.service"
if [[ $distro == "fedora" ]]; then
sudo cp "$xkeypath"xkeysnail.service /etc/systemd/system/xkeysnail.service && echo "Copied service file to system..." || echo "Failed to create copy..."
sudo cp "$xkeypath"xkeysnail.service /etc/systemd/system/graphical.target.wants/xkeysnail.service && echo "Copied service file to system for graphical target..." || echo "Failed to create copy for graphical target..."
sudo chown -R root:root /etc/systemd/system/xkeysnail.service && echo "Ownership set for root..." || echo "Failed to set ownership..."
sudo chown -R root:root /etc/systemd/system/graphical.target.wants/xkeysnail.service && echo "Ownership set for root..." || echo "Failed to set ownership..."
sudo chmod 644 /etc/systemd/system/xkeysnail.service && echo "Permissions set to 644..." || echo "Failed to set permissions..."
sudo chmod 644 /etc/systemd/system/graphical.target.wants/xkeysnail.service && echo "Permissions set to 644..." || echo "Failed to set permissions..."
else
sudo chown -R root:root "$xkeypath"xkeysnail.service && echo "Ownership set for root..." || echo "Failed to set ownership..." 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 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/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..." 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..."
fi
sudo systemctl daemon-reload sudo systemctl daemon-reload
sudo systemctl disable xkeysnail sudo systemctl disable xkeysnail
sudo systemctl stop xkeysnail sudo systemctl stop xkeysnail
else
# echo "Using sysvinit..."
echo ""
sudo cp ./linux/kinto-service.sh /etc/init.d/kinto
sudo -E /etc/init.d/kinto stop
mv /tmp/kinto.log /tmp/kinto.log.bak
fi
# sudo systemctl --state=not-found --all | grep xkeysnail # sudo systemctl --state=not-found --all | grep xkeysnail
# if [ "$distro" == "fedora" ];then # if [ "$distro" == "fedora" ];then
# systemctl enable xkeysnail.service # systemctl enable xkeysnail.service
@@ -617,9 +521,8 @@ if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
# sudo systemctl enable xkeysnail.service # sudo systemctl enable xkeysnail.service
# fi # fi
# sudo systemctl restart xkeysnail # sudo systemctl restart xkeysnail
sudo pkill -f kintotray & sudo pkill -f kintotray >/dev/null 2>&1
# >/dev/null 2>&1 if [[ $dename == "gnome" || $dename == "kde" ]];then
if [[ $dename == "kde" ]];then
sed -i "s/systray = true/systray = false/g" ~/.config/kinto/initkb sed -i "s/systray = true/systray = false/g" ~/.config/kinto/initkb
fi fi
nohup python3 ~/.config/kinto/gui/kinto-gui.py >/dev/null 2>&1 & nohup python3 ~/.config/kinto/gui/kinto-gui.py >/dev/null 2>&1 &
@@ -650,24 +553,6 @@ if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
echo -e "~/.config/kinto/gui/kinto-gui.py\n" 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" 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"
# echo -e "\033[0;91mAfter the installer completes press Any key to re-apply your overlay (Super key) menu launcher.\e[0m\n"
# if [[ $dename == 'gnome' || $dename == 'budgie' ]];then
# echo "GNOME: gsettings set org.gnome.mutter overlay-key 'super'"
# elif [[ $dename == 'xfce' ]];then
# echo "XFCE: xfconf-query --channel xfce4-keyboard-shortcuts --property \"/commands/custom/Super_L\" --create --type string --set \"$nlauncher\""
# fi
# read -n 1 -s -r -p ""
# if [[ $dename == 'gnome' || $dename == 'budgie' ]];then
# gsettings set org.gnome.mutter overlay-key 'super'
# elif [[ $dename == 'xfce' ]];then
# echo -e "\nSetting xfce4 launcher $nlauncher back to Super_L."
# xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/Super_L" --create --type string --set "$nlauncher" && echo "Success."
# fi
if [ "$distro" == "manjarolinux" ]; then 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 "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" echo "sudo pacman -Syu"