Compare commits

..

2 Commits

Author SHA1 Message Date
Ben Reaves
b37a6000ee - Updated copy on gui folder for FreeBSD to copy correctly 2021-01-02 19:55:34 -05:00
Ben Reaves
52d2cac4f7 - Updated dename to detect helloSystem and FreeBSD DEs 2021-01-02 19:38:34 -05:00
52 changed files with 901 additions and 2192 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.

227
README.md
View File

@@ -5,30 +5,25 @@
[![GitHub release](https://img.shields.io/github/release/rbreaves/kinto.svg)](https://github.com/rbreaves/kinto/releases/latest)
\- Mac-style shortcut keys for Linux & Windows. \-
\- Type in Linux & Windows like it's a Mac. \-
Seamless copy and paste with all apps and terminals. The zero effort solution.
v1.2 Release - Kinto now includes a system tray and simple wizard to setup the install with minimal effort.
Kinto is powered by [xkeysnail](https://github.com/mooz/xkeysnail) for Linux & by [Autohotkey](https://github.com/Lexikos/AutoHotkey_L) for Windows 10 & 11.
Note: VNC is now experimentally supported on Linux w/ the latest releases, but you must compile & install x11vnc. More info can be [found here](https://gist.github.com/rbreaves/87059f92f030ee4e068f911ddb56a4dd).
~~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.~~
### [Table of Contents ](#Table-of-Contents)
## Donations
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)|
|---|---|---|---|
[Amazon wishlist](https://smile.amazon.com/hz/wishlist/ls/3EVXR21VFKD9Z?ref_=wl_share)
I have received some really great letters with donations & email. I've also posted some of them with redacted first names to kinto.sh.
[Adafruit Wishlist](https://www.adafruit.com/wishlists/515932)
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.
[eBay Wishlist](https://www.ebay.com/mye/myebay/WatchList?custom_list_id=636668138019)
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. I will accept shipments (of keyboards in particular) as well.
## How to install (Linux)
@@ -38,85 +33,52 @@ 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%">
### Quick Install Method
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
1. clone this repo
```
git clone https://github.com/rbreaves/kinto.git
cd kinto
```
2. Install python3 (If needed)
Debian or Ubuntu 16.04 or 18.04
```
sudo apt update
sudo apt install python3
```
3. Run the script, press 1 or 2 keys and you are done.
```
./setup.py
```
**Troubleshoot**
Troubleshoot
If the wizard does not appear then either type in "kinto.sh" in your application overview search bar or run this following command.
```
~/.config/kinto/gui/kinto-gui.py
```
**Issues with Numpad?**
Try toggling numlock on & off (clear key on official mac keyboards). If it still does not work then restart the Kinto service and try toggling the numlock/clear key again, it will likely work after that. #369
**Uninstall Kinto**
To Uninstall Kinto
```
./setup.py -r
```
**Other tips**
Other tips
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"
```
**Fractional HiDPI Scaling for Gnome/Budgie w/ x11**
https://github.com/rbreaves/betterScale
Use this with autorandr to save your settings as a profile that will auto re-apply when needed.
## How to Install (Windows)
Video Tutorial: [How to Install Kinto.sh on Windows 10](https://youtu.be/sRk8A8krz40)
[Windows 10 Requirements](#Kinto-for-Windows-10-Requirements)
### Quick install
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
iwr https://raw.githubusercontent.com/rbreaves/kinto/master/install/windows.ps1 -UseBasicParsing | iex
```
Update system tray to show Kinto icon at all times (optional)
```
cmd /c "explorer shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}"
```
### Old method
1. Open Powershell (Right click and Run as Administrator)
2. clone this repo
@@ -135,80 +97,25 @@ py setup.py
<img src="https://user-images.githubusercontent.com/10969616/85195079-30fd4f80-b295-11ea-8bcd-257990b77dcb.png" width="50%" height="50%">
<img src="https://user-images.githubusercontent.com/10969616/85195082-322e7c80-b295-11ea-8c81-320dab424c3c.png" width="50%" height="50%">
**Uninstall Kinto**
To Uninstall Kinto - Select Uninstall
```
py setup.py
```
Select Uninstall
## How to use in Remote Desktop Solutions
RDP fully works as long as the entire keyboard input is being captured. RDP had been working for awhile with Windows but as of 2/14/2021 Linux & macOS is now supported. VNC & other protocols may work, but is likely most dependent on how the keyboard input is captured on the computer running the client.
Currently this may be limited to Windows RDP Clients and Servers on both ends, but in theory any remote desktop solution that properly handles the Windows key should work is what I am finding. The latest version of Kinto may need to be suspended via the system tray on the computer running the Client software of the Remote Desktop solution you are using - or you can add it to the "virtm" group of the Kinto.ahk script for Windows 10. On the linux side a 3rd, but similar "define_conditional_modmap" terminals like group may need to be added to align with virtm.
|Program|Src/Remote Client ⇒|Dst/Remote Server|Works? |Notes|
|---|---|---|---|---|
|Official MS RDP (mstsc.exe)| ❖Windows ⇒| ❖Windows | ✅ Yes| Note: Make sure to set all keyboard input to go to remote. |
|Official MS RDP (mstsc.exe)| ❖Windows ⇒| 🍎macOS | ✅ Yes| Note: Must compile & install xrdp. |
|Official MS RDC from Store| ❖Windows ⇒| ❖Windows | ✅ Yes| Note: Only when maximized, all modifier keys will not pass in otherwise. |
|Official MS RDC from Store| ❖Windows ⇒| 🍎macOS | ✅ Yes| Note: Must compile & install xrdp. |
|RealVNC| ❖Windows ⇒| 🐧Linux | ✅ Yes| Note: Compile & install my forked [x11vnc](https://gist.github.com/rbreaves/87059f92f030ee4e068f911ddb56a4dd) for compatibility. |
|Official MS RDP (mstsc.exe)| ❖Windows ⇒| 🐧Linux | ✅ Yes | Note: Compile & install my forked [x11vnc](https://gist.github.com/rbreaves/87059f92f030ee4e068f911ddb56a4dd) for compatibility, then setup xrdp like normal & use xrdp 0.9.18+. |
|Official MS RDC from Store| ❖Windows ⇒| 🐧Linux | ✅ Yes | Note: Compile & install my forked [x11vnc](https://gist.github.com/rbreaves/87059f92f030ee4e068f911ddb56a4dd) for compatibility, then setup xrdp like normal & use xrdp 0.9.18+. |
|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"|
|FreeRDP| 🐧Linux/ChromeOS 87+⇒| ❖Windows | ✅ Yes | |
|FreeRDP| 🍎macOS⇒| ❖Windows | ✅ Yes| [FreeRDP for macOS](#FreeRDP-for-macOS)|
|Remote Desktop Manager Free|🍎iOS⇒| ❖Windows | ✅ Yes| |
|Jump Desktop (RDP)| 🍎macOS*/iOS ⇒| ❖Windows | ✅ Yes|*Preferences -> Keyboard -> Disable "Key Conversions", Enabled "Send macOS Shortcuts" under Keyboard shortcuts|
|Jump Desktop (VNC)| 🍎macOS⇒| 🐧Linux | ✅ Yes| Note: Compile & install my forked [x11vnc](https://gist.github.com/rbreaves/87059f92f030ee4e068f911ddb56a4dd) for compatibility & use xrdp 0.9.18+. |
|RealVNC| 🍎macOS⇒| 🐧Linux | ✅ Yes| Note: Compile & install my forked [x11vnc](https://gist.github.com/rbreaves/87059f92f030ee4e068f911ddb56a4dd) for compatibility. |
|Official MS RDP| 🍎macOS⇒| ❖Windows | ❌ No|Initial Cmd key press not being passed|
|Remote Desktop Manager Free| 🍎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|
Note: virtm is just a shortname for virtual machine and remote desktop exceptions - so that remapping can happen within their OS & not on your host machine - if it can be avoided.
## 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
1. Install [brew.sh](https://brew.sh).
```/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"```
2. Install XQuartz (x11/xorg)
```brew install --cask xquartz```
3. log off and back on.
4. Install FreeRDP
```brew install freerdp```
5. Disable [NLA](https://kb.parallels.com/en/123661), if it is enabled on the destination.
6. Run command to access machine
Note: 192.168.x.x = Your IP.
```xfreerdp /u:your_username /v:192.168.x.x /cert-ignore /auto-reconnect-max-retries:0 /f +clipboard -decorations```
7. Click on XQuartz -> Preferences and set these checkmarks so that fullscreen can work, may need to quit it and re-run the xfreerdp command from step 6.
<img src="https://user-images.githubusercontent.com/10969616/108144025-68bfcf80-708e-11eb-96cc-2930b7b1694a.png" width="50%">
More info here
https://medium.com/idomongodb/macos-rdp-to-a-windows-machine-1e0f52f777b
## Jump Desktop for macOS
Screenshots of how to configure Jump Desktop for macOS users accessing a Windows PC with Kinto installed. I apologize that it is not a free RDP client - BUT it does work, and at $15 it is reasonable if you plan to use it frequently.
<img src="https://user-images.githubusercontent.com/10969616/107990246-a2fb7500-6f99-11eb-8c19-0a9b538b996f.png" width="25%">
<img src="https://user-images.githubusercontent.com/10969616/107990265-a8f15600-6f99-11eb-9922-bbcfa0b92031.png" width="50%">
<img src="https://user-images.githubusercontent.com/10969616/107990256-a68efc00-6f99-11eb-9f31-575ed6016944.png" width="50%">
Scenarios confirmed working?
Windows RDP Client -> Windows Computer
Scenarios that don't appear to work?
Microsoft RDP Client on a Mac -> Windows Computer
FreeRDP based client on a Mac -> Windows Computer
Android/iOS RDP Client -> Windows Computer
## Table of Contents
@@ -273,7 +180,7 @@ Additionally, if you are using a cross-platform app and if it happens to have a
## What does Kinto require?
- Python
- systemd or sysvinit
- systemd
- x11
- xkeysnail
@@ -289,9 +196,6 @@ Other programs that will be installed when you run ./setup.py
- Strawberry Perl
Note: Sublime Text users should disable screen rotation hotkeys as they will interfere with multi-cursor and possibly other combos. See https://windowsloop.com/disable-screen-rotation-keyboard-shortcut/ for details.
You may also want to disable the Xbox Game Bar so that Win+G or other shortcuts will not interfere with any of your remaps. Start menu -> Game bar shortcuts -> toggle Off.
## Shortcut Creation
[Linux Shortcut Creation (Xkeysnail)](#Linux-Xkeysnail)
@@ -329,18 +233,12 @@ define_keymap(re.compile("Sublime_text"),{
In the above example I am also showing that you can define a single shortcut to enact multiple shortcut keys if needed by defining an array of shortcuts to trigger.
To make changes you can edit ~/.config/kinto/kinto.py under linux & restart the xkeysnail service via the system tray, app or CLI.
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
```
sysvinit
```
sudo -E /etc/init.d/kinto restart
```
More information can be seen on the readme page of [xkeysnail](https://github.com/mooz/xkeysnail).
## Windows (Autohotkey)
@@ -402,53 +300,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.
Status
systemd
```
sudo systemctl status xkeysnail
```
sysvinit
```
tail -f /tmp/kinto.log
```
Stop (your keymap will return to normal)
systemd
```
sudo systemctl stop xkeysnail
```
sysvinit
```
sudo -E /etc/init.d/kinto stop
```
Start
systemd
```
sudo systemctl start xkeysnail
```
sysvinit
```
sudo -E /etc/init.d/kinto start
```
Restart
systemd
```
sudo systemctl restart xkeysnail
```
sysvinit
```
sudo -E /etc/init.d/kinto restart
```
## Troubleshooting
### Installed successfully, but modifier keys are not properly remapped?
@@ -510,30 +380,10 @@ I'd appreciate any help from people with non-US based keyboards, to help ensure
Yet another keyboard remapping tool for X environment
[libinput-gestures](https://github.com/bulletmark/libinput-gestures)
Three finger gesture or other type of gestures for desktop switching or other features within a Linux distro. More info here for quickly setting it up. Make sure you logoff after setting your user to access input. https://www.reddit.com/r/GalliumOS/comments/5lgrxe/psa_multitouch_gestures_on_galliumos/
[Interception](https://gitlab.com/interception/linux/tools)
Another low level key remapper, not as easily configurable as Xkeysnail, but does not rely on X11.
[Wincent](https://github.com/wincent/wincent) by Greg Hurrell
Dot files and configurations that may help those that want mac-style shortcut keys that work under Wayland, or w/o x11.
[Vim #102: macOS keyboard bindings on Linux](https://www.youtube.com/watch?v=TBqTHesnzkI)
[mac-precision-touchpad](https://github.com/imbushuo/mac-precision-touchpad) by imbushuo
Windows 10 touchpad to precision touchpad driver
[macOS-cursors-for-Windows](https://github.com/antiden/macOS-cursors-for-Windows) by antiden
macOS cursors for Windows
[QuickLook](https://github.com/QL-Win/QuickLook) for Windows by QL-Win
It allows users to peek into a file content in lightning speed by just pressing the Space key
[fusuma](https://github.com/iberianpig/fusuma) by iberianpig
Multitouch gestures with libinput driver on Linux
@@ -542,11 +392,10 @@ Multitouch gestures with libinput driver on Linux
Linux driver for Facetime HD on macbooks
[Windows Terminal Preview](https://aka.ms/terminal-preview) by Microsoft
[Fluent Terminal - Windows only](https://github.com/felixse/FluentTerminal) by felixse
The best Terminal app built for Windows hands down. I have tried countless, but this one actually seems to get everything right, despite the lack of a GUI to configure all aspects of the program. Custom configurations have to be done via a json file - but given the performance and feature set I feel like it is a decent trade off.
I will update Kinto to have custom configurations for this specific Terminal in the future. Will make seamless copy & paste, which already works, work even better (Cmd-C can still trigger sigint - but there is a fix for that that involves updating the json config).
A Terminal Emulator based on UWP and web technologies.
[PowerToys - Windows only](https://github.com/microsoft/PowerToys) by microsoft
@@ -596,7 +445,7 @@ Dark & Light Theme w/ OSX controls for Elementary OS
Auto-detect the connected display hardware and load the appropriate X11 setup using xrandr
[Barrier](https://github.com/debauchee/barrier) by debauchee (Note: Does not appear to work with Kinto v1.2+, may work w/ Kinto v1.1?)
[Barrier](https://github.com/debauchee/barrier) by debauchee
Open-source KVM software
@@ -622,9 +471,11 @@ Vala rewrite of SimplePanel - GitHub mirror (Global Menu for XFCE)
## Contributing
I welcome any and all contributors who want to add something to this project.
I welcome any and all contributors who want to contribute something to this project.
You can read the configuration files and the open issue tickets such as [#44 Shortcut Translation Tables](https://github.com/rbreaves/kinto/issues/44), [#115 Shortcut Creation (xkeysnail)](https://github.com/rbreaves/kinto/issues/115), and [#348 Missing Shortcuts: Post them here](https://github.com/rbreaves/kinto/issues/348) to best understand what's currently happening and how best to contribute.
If you are specifically wanting to contribute additional custom keymaps to help with aligning Kinto's behavior to that of a mac keyboard then I would strongly recommend that you read Glen Whitney's comment on Superuser (the link is below). You may also look at the .xkb directory, mac_wordwise.sh and xactive.sh files to better understand how Kinto operates so that you can test your own keymaps without having to use the systemd service or running the xactive.sh script.
https://superuser.com/questions/385748/binding-superc-superv-to-copy-and-paste
## More information about Kinto
@@ -641,7 +492,7 @@ I would just like to thank a few people here directly that have helped me tremen
First off I'd like to thank the Stackoverflow and Stackexchange community. I have probably rubbed some mods the wrong way over there, but the people from the community in general are extremely helpful and gracious and without their contributions would have made this much more difficult. The person I'd like to thank most though from over there is Glen Whitney. Without his detailed explaining of how to rebind keys in xkb this would not have come together at all, as every other remapping solution were non-starters as complexity increases. *Kinto today no longer uses xkb, but Glen Whitney did provide the basis of a workable method that helped me pursue this method and think it was a worthwhile project to pursue, so for that I thank him.*
Secondarily I'd like to thank Christian Eriksson*, as he provided information that kept me up at night.. literally. Even after I implemented a similar bash script to one he had suggested I knew that fully implementing a c/c++ solution was where Kinto needed to head to and his explanation was better than I remember it being now that I have gone back to read it again. He also never provided a full implementation of a c/c++ solution - he did hit on the pain points pretty well of what one would need to do and watch out for. I am not sure where I got the first example code of implementing a c based solution, but he definitely went over it well.
Secondarily I'd like to thank Christian Eriksson*, as he provided information that kept me up at night.. literally. Even after I implemented a similar bash script to one he had suggested I knew that fully implementing a c/c++ solution was where Kinto needed to head to and his explaination was better than I remember it being now that I have gone back to read it again. He also never provided a full implementation of a c/c++ solution - he did hit on the pain points pretty well of what one would need to do and watch out for. I am not sure where I got the first example code of implementing a c based solution, but he definitely went over it well.
Kui and his gist file** was really the c based solution that I found had the fewest issues to resolve to making it a reliable solution. It didn't account for all failures very well, aka BadWindow issues, but it made for a great foundation on which Kintox11 is built. I cannot thank him enough for putting it out there for others to work with.

View File

@@ -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,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

@@ -1,846 +0,0 @@
# -*- coding: utf-8 -*-
# autostart = true
import re
from xkeysnail.transform import *
# Use the following for testing terminal keymaps
# terminals = [ "", ... ]
# xbindkeys -mk
terminals = [
"alacritty",
"cutefish-terminal",
"deepin-terminal",
"eterm",
"gnome-terminal",
"guake",
"hyper",
"io.elementary.terminal",
"kinto-gui.py",
"kitty",
"Kgx", # GNOME Console terminal app
"konsole",
"lxterminal",
"mate-terminal",
"org.gnome.Console",
"roxterm",
"qterminal",
"st",
"sakura",
"station",
"tabby",
"terminator",
"termite",
"tilda",
"tilix",
"urxvt",
"xfce4-terminal",
"xterm",
"yakuake"
]
terminals = [term.casefold() for term in terminals]
termStr = "|".join(str('^'+x+'$') for x in terminals)
mscodes = ["code","vscodium"]
codeStr = "|".join(str('^'+x+'$') for x in mscodes)
sublimes = ["Sublime_text","subl"]
sublimeStr = "|".join(str('^'+x+'$') for x in sublimes)
# Add remote desktop clients & VM software here
# Ideally we'd only exclude the client window,
# but that may not be easily done.
remotes = [
"Gnome-boxes",
"org.remmina.Remmina",
"remmina",
"qemu-system-.*",
"qemu",
"Spicy",
"Virt-manager",
"VirtualBox",
"VirtualBox Machine",
"xfreerdp",
"Wfica",
"Anydesk",
]
remotes = [client.casefold() for client in remotes]
remotesStr = "|".join(str('^'+x+'$') for x in remotes)
# Add remote desktop clients & VMs for no remapping
terminals.extend(remotes)
mscodes.extend(remotes)
# Use for browser specific hotkeys
browsers = [
"Brave-browser",
"Chromium",
"Chromium-browser",
"Discord",
"Epiphany",
"Firefox",
"Firefox Developer Edition",
"Navigator",
"firefoxdeveloperedition",
"Waterfox",
"Google-chrome",
"microsoft-edge",
"microsoft-edge-dev",
"org.deepin.browser",
]
browsers = [browser.casefold() for browser in browsers]
browserStr = "|".join(str('^'+x+'$') for x in browsers)
chromes = [
"Brave-browser",
"Chromium",
"Chromium-browser",
"Google-chrome",
"microsoft-edge",
"microsoft-edge-dev",
"org.deepin.browser",
]
chromes = [chrome.casefold() for chrome in chromes]
chromeStr = "|".join(str('^'+x+'$') for x in chromes)
# edges = ["microsoft-edge-dev","microsoft-edge"]
# edges = [edge.casefold() for edge in edges]
# edgeStr = "|".join(str('^'+x+'$') for x in edges)
define_multipurpose_modmap(
# {Key.ENTER: [Key.ENTER, Key.RIGHT_CTRL] # Enter2Cmd
# {Key.CAPSLOCK: [Key.ESC, Key.RIGHT_CTRL] # Caps2Esc
# {Key.LEFT_META: [Key.ESC, Key.RIGHT_CTRL] # Caps2Esc - Chromebook
{ # Placeholder
})
# Fix for avoiding modmapping when using Synergy keyboard/mouse sharing.
# Synergy doesn't set a wm_class, so this may cause issues with other
# applications that also don't set the wm_class.
# Enable only if you use Synergy.
# define_conditional_modmap(lambda wm_class: wm_class == '', {})
# [Global modemap] Change modifier keys as in xmodmap
define_conditional_modmap(lambda wm_class: wm_class.casefold() not in terminals,{
# Key.CAPSLOCK: Key.RIGHT_CTRL, # Caps2Cmd
# Key.LEFT_META: Key.RIGHT_CTRL, # Caps2Cmd - Chromebook
# - IBM
# Key.LEFT_ALT: Key.RIGHT_CTRL, # IBM
# Key.LEFT_CTRL: Key.LEFT_ALT, # IBM
# Key.CAPSLOCK: Key.LEFT_META, # IBM
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # IBM - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # IBM - Multi-language (Remove)
# - Chromebook
# Key.LEFT_ALT: Key.RIGHT_CTRL, # Chromebook
# Key.LEFT_CTRL: Key.LEFT_ALT, # Chromebook
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # Chromebook - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # Chromebook - Multi-language (Remove)
# - Default Mac/Win
# - Default Win
# Key.LEFT_ALT: Key.RIGHT_CTRL, # WinMac
# Key.LEFT_META: Key.LEFT_ALT, # WinMac
# Key.LEFT_CTRL: Key.LEFT_META, # WinMac
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac - Multi-language (Remove)
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_META, # WinMac - Multi-language (Remove)
# - Mac Only
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac
# Key.LEFT_CTRL: Key.LEFT_META, # Mac
# Key.RIGHT_META: Key.RIGHT_CTRL, # Mac - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_META, # Mac - Multi-language (Remove)
})
# [Conditional modmap] Change modifier keys in certain applications
define_conditional_modmap(re.compile(termStr, re.IGNORECASE), {
# - IBM
# Key.LEFT_ALT: Key.RIGHT_CTRL, # IBM
# # Left Ctrl Stays Left Ctrl
# Key.CAPSLOCK: Key.LEFT_ALT, # IBM
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # IBM - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # IBM
# # Right Meta does not exist on chromebooks
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # IBM - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # IBM - Multi-language (Remove)
# - Chromebook
# Key.LEFT_ALT: Key.RIGHT_CTRL, # Chromebook
# # Left Ctrl Stays Left Ctrl
# Key.LEFT_META: Key.LEFT_ALT, # Chromebook
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # Chromebook - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # Chromebook
# # Right Meta does not exist on chromebooks
# - Default Mac/Win
# - Default Win
# Key.LEFT_ALT: Key.RIGHT_CTRL, # WinMac
# Key.LEFT_META: Key.LEFT_ALT, # WinMac
# Key.LEFT_CTRL: Key.LEFT_CTRL, # WinMac
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac - Multi-language (Remove)
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # WinMac - Multi-language (Remove)
# - Mac Only
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac
# # Left Ctrl Stays Left Ctrl
# Key.RIGHT_META: Key.RIGHT_CTRL, # Mac - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # Mac - Multi-language (Remove)
})
# Keybindings for IntelliJ
define_keymap(re.compile("^jetbrains-(?!.*toolbox).*$", re.IGNORECASE),{
# General
K("C-Key_0"): K("Alt-Key_0"), # Open corresponding tool window
K("C-Key_1"): K("Alt-Key_1"), # Open corresponding tool window
K("C-Key_2"): K("Alt-Key_2"), # Open corresponding tool window
K("C-Key_3"): K("Alt-Key_3"), # Open corresponding tool window
K("C-Key_4"): K("Alt-Key_4"), # Open corresponding tool window
K("C-Key_5"): K("Alt-Key_5"), # Open corresponding tool window
K("C-Key_6"): K("Alt-Key_6"), # Open corresponding tool window
K("C-Key_7"): K("Alt-Key_7"), # Open corresponding tool window
K("C-Key_8"): K("Alt-Key_8"), # Open corresponding tool window
K("C-Key_9"): K("Alt-Key_9"), # Open corresponding tool window
K("Super-Grave"): K("C-Grave"), # Quick switch current scheme
K("C-Comma"): K("C-Alt-s"), # Open Settings dialog
K("C-Semicolon"): K("C-Alt-Shift-s"), # Open Project Structure dialog
# Debugging
K("C-Alt-r"): K("F9"), # Resume program
# Search/Replace
K("C-g"): K("F3"), # Find next
K("C-Shift-F3"): K("Shift-F3"), # Find previous
K("Super-g"): K("Alt-j"), # Select next occurrence
K("C-Super-g"): K("C-Alt-Shift-j"), # Select all occurrences
K("Super-Shift-g"): K("Alt-Shift-j"), # Unselect occurrence
# Editing
K("Super-Space"): K("LC-Space"), # Basic code completion
K("Super-Shift-Space"): K("LC-Shift-Space"),# Smart code completion
K("Super-j"): K("C-q"), # Quick documentation lookup
K("C-n"): K("Alt-Insert"), # Generate code...
K("Super-o"): K("C-o"), # Override methods
K("Super-i"): K("C-i"), # Implement methods
K("Alt-Up"): K("C-w"), # Extend selection
K("Alt-Down"): K("C-Shift-w"), # Shrink selection
K("Super-Shift-q"): K("Alt-q"), # Context info
K("Super-Alt-o"): K("C-Alt-o"), # Optimize imports
K("Super-Alt-i"): K("C-Alt-i"), # Auto-indent line(s)
K("C-Backspace"): K("C-y"), # Delete line at caret
K("Super-Shift-j"): K("C-Shift-j"), # Smart line join
K("Alt-Delete"): K("C-Delete"), # Delete to word end
K("Alt-Backspace"): K("C-Backspace"), # Delete to word start
K("C-Shift-Equal"): K("C-KPPLUS"), # Expand code block
K("C-Minus"): K("C-KPMINUS"), # Collapse code block
K("C-Shift-Equal"): K("C-Shift-KPPLUS"), # Expand all
K("C-Shift-Minus"): K("C-Shift-KPMINUS"), # Collapse all
K("C-w"): K("C-F4"), # Close active editor tab
# Refactoring
K("C-Delete"): K("Alt-Delete"), # Safe Delete
K("C-T"): K("C-Alt-Shift-t"), # Refactor this
# Navigation
K("C-o"): K("C-n"), # Go to class
K("C-Shift-o"): K("C-Shift-n"), # Go to file
K("C-Alt-o"): K("C-Alt-Shift-n"), # Go to symbol
K("Super-Right"): K("Alt-Right"), # Go to next editor tab
K("Super-Left"): K("Alt-Left"), # Go to previous editor tab
K("C-l"): K("C-g"), # Go to line
K("Alt-Space"): 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-Up"): K("Alt-Up"), # Go to previous
K("Super-Down"): K("Alt-Down"), # Go to next method
K("Super-h"): K("C-h"), # Type hierarchy
K("Super-Alt-h"): K("C-Alt-h"), # Call hierarchy
K("C-Down"): K("C-Enter"), # Edit source/View source
K("Alt-Home"): K("Alt-Home"), # Show navigation bar
K("F2"): K("F11"), # Toggle bookmark
K("Super-F3"): K("C-F11"), # Toggle bookmark with mnemonic
K("Super-Key_0"): K("C-Key_0"), # Go to numbered bookmark
K("Super-Key_1"): K("C-Key_1"), # Go to numbered bookmark
K("Super-Key_2"): K("C-Key_2"), # Go to numbered bookmark
K("Super-Key_3"): K("C-Key_3"), # Go to numbered bookmark
K("Super-Key_4"): K("C-Key_4"), # Go to numbered bookmark
K("Super-Key_5"): K("C-Key_5"), # Go to numbered bookmark
K("Super-Key_6"): K("C-Key_6"), # Go to numbered bookmark
K("Super-Key_7"): K("C-Key_7"), # Go to numbered bookmark
K("Super-Key_8"): K("C-Key_8"), # Go to numbered bookmark
K("Super-Key_9"): K("C-Key_9"), # Go to numbered bookmark
K("C-F3"): K("Shift-F11"), # Show bookmarks
# Compile and Run
K("Super-Alt-r"): K("Alt-Shift-F10"), # Select configuration and run
K("Super-Alt-d"): K("Alt-Shift-F9"), # Select configuration and debug
K("Super-r"): K("Shift-F10"), # Run
K("Super-d"): K("Shift-F9"), # Debug
K("Super-Shift-r"): K("C-Shift-F10"), # Run context configuration from editor
K("Super-Shift-d"): K("C-Shift-F9"), # Debug context configuration from editor
# VCS/Local History
K("Super-v"): K("Alt-Grave"), # VCS quick popup
K("Super-c"): K("LC-c"), # Sigints - interrupt
},"Jetbrains")
##############################################
### START OF FILE MANAGER GROUP OF KEYMAPS ###
##############################################
# 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-Alt-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("Alt-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("Alt-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("Alt-Enter"), # File properties dialog (Get Info)
K("RC-comma"): [K("Alt-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("Alt-Left"), # Go Back
K("RC-Right_Brace"): K("Alt-Right"), # Go Forward
K("RC-Left"): K("Alt-Left"), # Go Back
K("RC-Right"): K("Alt-Right"), # Go Forward
K("RC-Up"): K("Alt-Up"), # Go Up dir
# K("RC-Down"): K("Alt-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")
############################################
### 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("Alt-e"), K("s"),K("Enter")], # Open preferences
K("RC-q"): K("Alt-F4"), # Quit Chrome(s) browsers with Cmd+Q
# K("RC-Left"): K("Alt-Left"), # Page nav: Back to prior page in history (conflict with wordwise)
# K("RC-Right"): K("Alt-Right"), # Page nav: Forward to next page in history (conflict with wordwise)
K("RC-Left_Brace"): K("Alt-Left"), # Page nav: Back to prior page in history
K("RC-Right_Brace"): K("Alt-Right"), # Page nav: Forward to next page in history
}, "Chrome Browsers")
# Opera C-F12
# Keybindings for General Web Browsers
define_keymap(re.compile(browserStr, re.IGNORECASE),{
K("RC-Q"): K("RC-Q"), # Close all browsers Instances
K("Alt-RC-I"): K("RC-Shift-I"), # Dev tools
K("Alt-RC-J"): K("RC-Shift-J"), # Dev tools
K("RC-Key_1"): K("Alt-Key_1"), # Jump to Tab #1-#8
K("RC-Key_2"): K("Alt-Key_2"),
K("RC-Key_3"): K("Alt-Key_3"),
K("RC-Key_4"): K("Alt-Key_4"),
K("RC-Key_5"): K("Alt-Key_5"),
K("RC-Key_6"): K("Alt-Key_6"),
K("RC-Key_7"): K("Alt-Key_7"),
K("RC-Key_8"): K("Alt-Key_8"),
K("RC-Key_9"): K("Alt-Key_9"), # Jump to last tab
# Enable Cmd+Shift+Braces for tab navigation
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
# Enable Cmd+Option+Left/Right for tab navigation
K("RC-Alt-Left"): K("C-Page_Up"), # Go to prior tab
K("RC-Alt-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),{
K("RC-Key_1"): K("Alt-Key_1"), # Remap Ctrl+[1-9] and Ctrl+[a-z] to Alt+[1-9] and Alt+[a-z]
K("RC-Key_2"): K("Alt-Key_2"),
K("RC-Key_3"): K("Alt-Key_3"),
K("RC-Key_4"): K("Alt-Key_4"),
K("RC-Key_5"): K("Alt-Key_5"),
K("RC-Key_6"): K("Alt-Key_6"),
K("RC-Key_7"): K("Alt-Key_7"),
K("RC-Key_8"): K("Alt-Key_8"),
K("RC-Key_9"): K("Alt-Key_9"),
K("RC-Key_0"): K("Alt-Key_0"),
# K("RC-a"): K("Alt-a"),
K("RC-b"): K("Alt-b"),
# K("RC-c"): K("Alt-c"),
K("RC-d"): K("Alt-d"),
K("RC-e"): K("Alt-e"),
K("RC-f"): K("Alt-f"),
K("RC-g"): K("Alt-g"),
K("RC-h"): K("Alt-h"),
}, "Ulauncher")
# Note: terminals extends to remotes as well
define_keymap(lambda wm_class: wm_class.casefold() not in terminals,{
K("RC-Dot"): K("Esc"), # Mimic macOS Cmd+dot = Escape key (not in terminals)
})
# Tab navigation overrides for apps that use Ctrl+Shift+Tab/Ctrl+Tab instead of Ctrl+PgUp/PgDn
define_keymap(re.compile("^org.gnome.Console$|^Kgx$|^deepin-terminal$|^Angry*IP*Scanner$|^jDownloader$", re.IGNORECASE),{
### Tab navigation
K("RC-Shift-Left_Brace"): K("C-Shift-Tab"), # Tab nav: Go to prior tab (left)
K("RC-Shift-Right_Brace"): K("C-Tab"), # Tab nav: Go to next tab (right)
K("RC-Shift-Left"): K("C-Shift-Tab"), # Tab nav: Go to prior tab (left)
K("RC-Shift-Right"): K("C-Tab"), # Tab nav: Go to next tab (right)
},"Tab Navigation for apps that want Ctrl+Shift+Tab/Ctrl+Tab")
# Special overrides for terminals for shortcuts that conflict with General GUI block below.
define_keymap(re.compile(termStr, re.IGNORECASE),{
K("Alt-Backspace"): K("Alt-Shift-Backspace"), # Wordwise delete word left of cursor in terminals
K("Alt-Delete"): [K("Esc"),K("d")], # Wordwise delete word right of cursor in terminals
K("RC-Backspace"): K("C-u"), # Wordwise delete line left of cursor in terminals
K("RC-Delete"): K("C-k"), # Wordwise delete line right of cursor in terminals
### Tab navigation
K("RC-Shift-Left"): K("C-Page_Up"), # Tab nav: Go to prior tab (Left)
K("RC-Shift-Right"): K("C-Page_Down"), # Tab nav: Go to next tab (Right)
},"Special overrides for terminals")
# None referenced here originally
# - but remote clients and VM software ought to be set here
# These are the typical remaps for ALL GUI based apps
define_keymap(lambda wm_class: wm_class.casefold() not in remotes,{
K("RC-Shift-Left_Brace"): K("C-Page_Up"), # Tab nav: Go to prior (left) tab
K("RC-Shift-Right_Brace"): K("C-Page_Down"), # Tab nav: Go to next (right) tab
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-Super-f"):K("Alt-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-Alt-Right"), # Default SL - Change workspace (budgie)
# K("Super-Left"):K("C-Alt-Left"), # Default SL - Change workspace (budgie)
K("RC-Q"): K("Alt-F4"), # Default SL - not-popos
K("RC-H"):K("Super-h"), # Default SL - Minimize app (gnome/budgie/popos/fedora)
K("Alt-Tab"): pass_through_key, # Default - Cmd Tab - App Switching Default
K("RC-Tab"): K("Alt-Tab"), # Default - Cmd Tab - App Switching Default
K("RC-Shift-Tab"): K("Alt-Shift-Tab"), # Default - Cmd Tab - App Switching Default
K("RC-Grave"): K("Alt-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching
K("RC-Shift-Grave"): K("Alt-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-Left"):K("Super-Page_Down"), # SL - Change workspace (ubuntu/fedora)
# K("Super-Right"):K("Super-C-Up"), # SL - Change workspace (popos)
# K("Super-Left"):K("Super-C-Down"), # SL - Change workspace (popos)
# K("RC-Q"):K("Super-q"), # SL - Close Apps (popos)
# K("RC-Space"): K("Super-Space"), # SL - Launch Application Menu (eos)
# K("RC-H"): K("Super-Page_Down"), # SL - Minimize app (kde_neon)
# SL - Default SL - Change workspace (kde_neon)
# K("RC-Space"): K("LC-Esc"), # SL- Launch Application Menu xfce4
# K("RC-F3"):K("C-Alt-d"), # SL- Show Desktop xfce4
# K("RC-LC-f"):K("Super-Up"), # SL- Maximize app eos
# K("RC-LC-f"):K("Super-PAGE_UP"), # SL- Maximize app manjaro
# Basic App hotkey functions
# K("RC-H"):K("Alt-F9"), # SL - Minimize app xfce4
# K("RC-LC-f"):K("Super-PAGE_DOWN"), # SL - Minimize app manjaro
# In-App Tab switching
# K("Alt-Tab"): K("C-Tab"), # Chromebook/IBM - In-App Tab switching
# K("Alt-Shift-Tab"): K("C-Shift-Tab"), # Chromebook/IBM - In-App Tab switching
# K("Alt-Grave") : K("C-Shift-Tab"), # Chromebook/IBM - In-App Tab switching
K("Super-Tab"): K("LC-Tab"), # Default not-chromebook
K("Super-Shift-Tab"): K("LC-Shift-Tab"), # Default not-chromebook
# Fn to Alt style remaps
K("RAlt-Enter"): K("insert"), # Insert
# emacs style
K("Super-a"): K("Home"), # Beginning of Line
K("Super-e"): K("End"), # End of Line
K("Super-b"): K("Left"),
K("Super-f"): K("Right"),
K("Super-n"): K("Down"),
K("Super-p"): K("Up"),
K("Super-k"): [K("Shift-End"), K("Backspace")],
K("Super-d"): K("Delete"),
# K("Alt-RC-Space"): K(""), # Open Finder - Placeholder
# Wordwise
K("RC-Left"): K("Home"), # Beginning of Line
K("RC-Shift-Left"): K("Shift-Home"), # Select all to Beginning of Line
K("RC-Right"): K("End"), # End of Line
K("RC-Shift-Right"): K("Shift-End"), # Select all to End of Line
# K("RC-Left"): K("C-LEFT_BRACE"), # Firefox-nw - Back
# K("RC-Right"): K("C-RIGHT_BRACE"), # Firefox-nw - Forward
# K("RC-Left"): K("Alt-LEFT"), # Chrome-nw - Back
# K("RC-Right"): K("Alt-RIGHT"), # Chrome-nw - Forward
K("RC-Up"): K("C-Home"), # Beginning of File
K("RC-Shift-Up"): K("C-Shift-Home"), # Select all to Beginning of File
K("RC-Down"): K("C-End"), # End of File
K("RC-Shift-Down"): K("C-Shift-End"), # Select all to End of File
# K("RAlt-Backspace"): K("Delete"), # Chromebook/IBM - Delete
K("Super-Backspace"): K("C-Backspace"), # Delete Left Word of Cursor
K("Super-Delete"): K("C-Delete"), # Delete Right Word of Cursor
# K("LAlt-Backspace"): K("C-Backspace"), # Chromebook/IBM - Delete Left Word of Cursor
K("Alt-Backspace"): K("C-Backspace"), # Default not-chromebook
K("RC-Backspace"): K("C-Shift-Backspace"), # Delete Entire Line Left of Cursor
K("Alt-Delete"): K("C-Delete"), # Delete Right Word of Cursor
# K(""): pass_through_key, # cancel
# K(""): K(""), #
}, "General GUI")
define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{
# Wordwise remaining - for Everything but VS Code
K("Alt-Left"): K("C-Left"), # Left of Word
K("Alt-Shift-Left"): K("C-Shift-Left"), # Select Left of Word
K("Alt-Right"): K("C-Right"), # Right of Word
K("Alt-Shift-Right"): K("C-Shift-Right"), # Select Right of Word
K("Alt-Shift-g"): K("C-Shift-g"), # View source control
# ** VS Code fix **
# Electron issue precludes normal keybinding fix.
# Alt menu auto-focus/toggle gets in the way.
#
# refer to ./xkeysnail-config/vscode_keybindings.json
# **
#
# ** Firefox fix **
# User will need to set "ui.key.menuAccessKeyFocuses"
# under about:config to false.
#
# https://superuser.com/questions/770301/pentadactyl-how-to-disable-menu-bar-toggle-by-alt
# **
#
}, "Wordwise - not vscode")
# Keybindings for VS Code
define_keymap(re.compile(codeStr, re.IGNORECASE),{
K("Super-Space"): K("LC-Space"), # Basic code completion
# Override the global Cmd+Dot (Escape/cancel) shortcut
K("RC-Dot"): K("RC-Dot"), # QuickFix
# Wordwise remaining - for VS Code
# Alt-F19 hack fixes Alt menu activation
K("Alt-Left"): [K("Alt-F19"),K("C-Left")], # Left of Word
K("Alt-Right"): [K("Alt-F19"),K("C-Right")], # Right of Word
K("Alt-Shift-Left"): [K("Alt-F19"),K("C-Shift-Left")], # Select Left of Word
K("Alt-Shift-Right"): [K("Alt-F19"),K("C-Shift-Right")], # Select Right of Word
# K("C-PAGE_DOWN"): pass_through_key, # cancel next_view
# K("C-PAGE_UP"): pass_through_key, # cancel prev_view
K("C-Alt-Left"): K("C-PAGE_UP"), # next_view
K("C-Alt-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
K("C-g"): pass_through_key, # cancel Go to Line...
K("Super-g"): K("C-g"), # Go to Line...
K("F3"): pass_through_key, # cancel Find next
K("C-h"): pass_through_key, # cancel replace
K("C-Alt-f"): K("C-h"), # replace
K("C-Shift-h"): pass_through_key, # cancel replace_next
K("C-Alt-e"): K("C-Shift-h"), # replace_next
K("f3"): pass_through_key, # cancel find_next
K("C-g"): K("f3"), # find_next
K("Shift-f3"): pass_through_key, # cancel find_prev
K("C-Shift-g"): K("Shift-f3"), # find_prev
# K("Super-c"): K("LC-c"), # Default - Terminal - Sigint
# K("Super-x"): K("LC-x"), # Default - Terminal - Exit nano
# K("Alt-c"): K("LC-c"), # Chromebook/IBM - Terminal - Sigint
# K("Alt-x"): K("LC-x"), # Chromebook/IBM - Terminal - Exit nano
# K("Super-C-g"): K("C-f2"), # Default - Sublime - find_all_under
# K("C-Alt-g"): K("C-f2"), # Chromebook/IBM - Sublime - find_all_under
# K("Super-Shift-up"): K("Alt-Shift-up"), # multi-cursor up - Sublime
# K("Super-Shift-down"): K("Alt-Shift-down"), # multi-cursor down - Sublime
# K(""): pass_through_key, # cancel
# K(""): K(""), #
}, "Code")
# Keybindings for Sublime Text
define_keymap(re.compile(sublimeStr, re.IGNORECASE),{
# K("Super-c"): K("LC-c"), # Default - Terminal - Sigint
# K("Super-x"): K("LC-x"), # Default - Terminal - Exit nano
# K("Alt-c"): K("LC-c"), # Chromebook/IBM - Terminal - Sigint
# K("Alt-x"): K("LC-x"), # Chromebook/IBM - Terminal - Exit nano
K("Super-Space"): K("C-Space"), # Basic code completion
K("C-Super-up"): K("Alt-o"), # Switch file
K("Super-RC-f"): K("f11"), # toggle_full_screen
K("C-Alt-v"): [K("C-k"), K("C-v")], # paste_from_history
K("C-up"): pass_through_key, # cancel scroll_lines up
K("C-Alt-up"): K("C-up"), # scroll_lines up
K("C-down"): pass_through_key, # cancel scroll_lines down
K("C-Alt-down"): K("C-down"), # scroll_lines down
K("Super-Shift-up"): K("Alt-Shift-up"), # multi-cursor up
K("Super-Shift-down"): K("Alt-Shift-down"), # multi-cursor down
K("C-PAGE_DOWN"): pass_through_key, # cancel next_view
K("C-PAGE_UP"): pass_through_key, # cancel prev_view
K("C-Shift-left_brace"): K("C-PAGE_DOWN"), # next_view
K("C-Shift-right_brace"): K("C-PAGE_UP"), # prev_view
K("C-Alt-right"): K("C-PAGE_DOWN"), # next_view
K("C-Alt-left"): K("C-PAGE_UP"), # prev_view
K("insert"): pass_through_key, # cancel toggle_overwrite
K("C-Alt-o"): K("insert"), # toggle_overwrite
K("Alt-c"): pass_through_key, # cancel toggle_case_sensitive
K("C-Alt-c"): K("Alt-c"), # toggle_case_sensitive
K("C-h"): pass_through_key, # cancel replace
K("C-Alt-f"): K("C-h"), # replace
K("C-Shift-h"): pass_through_key, # cancel replace_next
K("C-Alt-e"): K("C-Shift-h"), # replace_next
K("f3"): pass_through_key, # cancel find_next
K("C-g"): K("f3"), # find_next
K("Shift-f3"): pass_through_key, # cancel find_prev
K("C-Shift-g"): K("Shift-f3"), # find_prev
K("C-f3"): pass_through_key, # cancel find_under
K("Super-Alt-g"): K("C-f3"), # find_under
K("C-Shift-f3"): pass_through_key, # cancel find_under_prev
K("Super-Alt-Shift-g"): K("C-Shift-f3"), # find_under_prev
K("Alt-f3"): pass_through_key, # Default - cancel find_all_under
# K("Alt-Refresh"): pass_through_key, # Chromebook/IBM - cancel find_all_under
# K("Alt-C-g"): K("Alt-Refresh"), # Chromebook/IBM - find_all_under
K("Super-C-g"): K("Alt-f3"), # Default - find_all_under
K("C-Shift-up"): pass_through_key, # cancel swap_line_up
K("Super-Alt-up"): K("C-Shift-up"), # swap_line_up
K("C-Shift-down"): pass_through_key, # cancel swap_line_down
K("Super-Alt-down"): K("C-Shift-down"), # swap_line_down
K("C-Pause"): pass_through_key, # cancel cancel_build
K("Super-c"): K("C-Pause"), # cancel_build
K("f9"): pass_through_key, # cancel sort_lines case_s false
K("f5"): K("f9"), # sort_lines case_s false
K("Super-f9"): pass_through_key, # cancel sort_lines case_s true
K("Super-f5"): K("Super-f9"), # sort_lines case_s true
K("Alt-Shift-Key_1"): pass_through_key, # cancel set_layout
K("C-Alt-Key_1"): K("Alt-Shift-Key_1"), # set_layout
K("Alt-Shift-Key_2"): pass_through_key, # cancel set_layout
K("C-Alt-Key_2"): K("Alt-Shift-Key_2"), # set_layout
K("Alt-Shift-Key_3"): pass_through_key, # cancel set_layout
K("C-Alt-Key_3"): K("Alt-Shift-Key_3"), # set_layout
K("Alt-Shift-Key_4"): pass_through_key, # cancel set_layout
K("C-Alt-Key_4"): K("Alt-Shift-Key_4"), # set_layout
K("Alt-Shift-Key_8"): pass_through_key, # cancel set_layout
K("C-Alt-Shift-Key_2"): K("Alt-Shift-Key_8"), # set_layout
K("Alt-Shift-Key_9"): pass_through_key, # cancel set_layout
K("C-Alt-Shift-Key_3"): K("Alt-Shift-Key_9"), # set_layout
K("Alt-Shift-Key_5"): pass_through_key, # cancel set_layout
K("C-Alt-Shift-Key_5"): K("Alt-Shift-Key_5"), # set_layout
# K(""): pass_through_key, # cancel
# K(""): K(""), #
}, "Sublime Text")
define_keymap(re.compile("^konsole$", re.IGNORECASE),{
# Ctrl Tab - In App Tab Switching
K("LC-Tab") : K("Shift-Right"),
K("LC-Shift-Tab") : K("Shift-Left"),
K("LC-Grave") : K("Shift-Left"),
}, "Konsole tab switching")
define_keymap(re.compile("^Io.elementary.terminal$|^kitty$", re.IGNORECASE),{
# Ctrl Tab - In App Tab Switching
K("LC-Tab") : K("LC-Shift-Right"),
K("LC-Shift-Tab") : K("LC-Shift-Left"),
K("LC-Grave") : K("LC-Shift-Left"),
}, "Elementary Terminal tab switching")
define_keymap(re.compile("^deepin-terminal$", re.IGNORECASE),{
K("RC-w"): K("Alt-w"), # Close only current tab, instead of all other tabs
K("RC-j"): None, # Block Cmd+J from remapping to vertical split (Ctrl+Shift+J)
K("RC-minus"): K("C-minus"), # Decrease font size/zoom out
K("RC-equal"): K("C-equal"), # Increase font size/zoom in
},"Deepin Terminal fixes")
define_keymap(re.compile("alacritty", re.IGNORECASE),{
K("RC-K"): K("C-L"), # clear log
})
define_keymap(re.compile(termStr, re.IGNORECASE),{
K("LC-RC-f"): K("Alt-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-Alt-Right"), # Default SL - Change workspace (budgie)
# K("LC-Left"):K("C-Alt-Left"), # Default SL - Change workspace (budgie)
# K("LC-Left"):K("C-Alt-End"), # SL - Change workspace xfce4
# K("LC-Left"):K("Super-Left"), # SL - Change workspace eos
# K("LC-Right"):K("C-Alt-Home"), # SL - Change workspace xfce4
# K("LC-Right"):K("Super-Right"), # SL - Change workspace eos
# K("LC-Right"):K("Super-Page_Up"), # SL - Change workspace (ubuntu/fedora)
# K("LC-Left"):K("Super-Page_Down"), # SL - Change workspace (ubuntu/fedora)
# K("LC-Right"):K("Super-C-Up"), # SL - Change workspace (popos)
# K("LC-Left"):K("Super-C-Down"), # SL - Change workspace (popos)
# Ctrl Tab - In App Tab Switching
K("LC-Tab") : K("LC-PAGE_DOWN"),
K("LC-Shift-Tab") : K("LC-PAGE_UP"),
K("LC-Grave") : K("LC-PAGE_UP"),
# K("Alt-Tab"): pass_through_key, # Default - Cmd Tab - App Switching Default
# K("RC-Tab"): K("Alt-Tab"), # Default - Cmd Tab - App Switching Default
# K("RC-Shift-Tab"): K("Alt-Shift-Tab"), # Default - Cmd Tab - App Switching Default
# Converts Cmd to use Ctrl-Shift
K("RC-MINUS"): K("C-MINUS"),
K("RC-EQUAL"): K("C-Shift-EQUAL"),
K("RC-BACKSPACE"): K("C-Shift-BACKSPACE"),
K("RC-W"): K("C-Shift-W"),
K("RC-E"): K("C-Shift-E"),
K("RC-R"): K("C-Shift-R"),
K("RC-T"): K("C-Shift-t"),
K("RC-Y"): K("C-Shift-Y"),
K("RC-U"): K("C-Shift-U"),
K("RC-I"): K("C-Shift-I"),
K("RC-O"): K("C-Shift-O"),
K("RC-P"): K("C-Shift-P"),
K("RC-LEFT_BRACE"): K("C-Shift-LEFT_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-S"): K("C-Shift-S"),
K("RC-D"): K("C-Shift-D"),
K("RC-F"): K("C-Shift-F"),
K("RC-G"): K("C-Shift-G"),
K("RC-H"): K("C-Shift-H"),
K("RC-J"): K("C-Shift-J"),
K("RC-K"): K("C-Shift-K"),
K("RC-L"): K("C-Shift-L"),
K("RC-SEMICOLON"): K("C-Shift-SEMICOLON"),
K("RC-APOSTROPHE"): K("C-Shift-APOSTROPHE"),
K("RC-GRAVE"): K("C-Shift-GRAVE"),
K("RC-Z"): K("C-Shift-Z"),
K("RC-X"): K("C-Shift-X"),
K("RC-C"): K("C-Shift-C"),
K("RC-V"): K("C-Shift-V"),
K("RC-B"): K("C-Shift-B"),
K("RC-N"): K("C-Shift-N"),
K("RC-M"): K("C-Shift-M"),
K("RC-COMMA"): K("C-Shift-COMMA"),
K("RC-Dot"): K("LC-c"),
K("RC-SLASH"): K("C-Shift-SLASH"),
K("RC-KPASTERISK"): K("C-Shift-KPASTERISK"),
}, "terminals")

View File

@@ -1,14 +0,0 @@
[Unit]
Description=xkeysnail
[Service]
Type=simple
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'
ExecStop={sudo}/bin/bash -c '{sudo}pkill -f bin/xkeysnail && exit 0'
Restart=on-failure
RestartSec=3
Environment=DISPLAY={displayid}
[Install]
WantedBy=graphical.target

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")
os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"')
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:
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:
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:
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:
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)
@@ -52,32 +52,32 @@ def windows_setup():
print("Uninstall of Kinto is Complete.")
if default == 3:
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/(; )(.*)(; WinModifiers\/CB)/$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/g" .\\windows\\kinto-new.ahk')
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/(; )(.*)(; WinModifiers\/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')
if default == 4:
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')
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers/CB/IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
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)
print("\nWill now install Ubuntu Terminal Theme as default...")
print("\nWill now install Ubuntu Termimnal Theme as default...")
os.system('regedit "' + path + '\\windows\\theme_ubuntu.reg"')
os.system('robocopy "'+ path + '\\assets" "%userprofile%\\.kinto\\assets" /E')
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 )):
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('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\\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%\\Start Menu\\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\\toggle_kb.bat" "%userprofile%\\.kinto\\toggle_kb.bat"')
os.system('copy /Y "'+ homedir + '\\kinto-new.ahk" "%userprofile%\\.kinto\\kinto.ahk"')
os.system("del /f " + homedir + "\\kinto-new.ahk")
os.system('copy /Y "'+ path + '\\windows\\kinto-new.ahk" "%userprofile%\\.kinto\\kinto.ahk"')
os.system("del /f .\\windows\\kinto-new.ahk")
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]
print('Starting... "' + userpath + '\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs"')
@@ -113,7 +113,7 @@ if len(check_x11) == 0:
sys.exit()
distro = cmdline("awk -F= '$1==\"NAME\" { print $2 ;}' /etc/os-release").replace('"','').strip().split(" ")[0]
dename = cmdline("./linux/system-config/dename.sh").replace('"','').strip().split(" ")[0].lower()
dename = cmdline("./system-config/dename.sh").replace('"','').strip().split(" ")[0].lower()
run_pkg = ""

View File

@@ -1,4 +1,36 @@
#!/bin/bash
#!/usr/bin/env bash
unamestr=$(uname)
if [ "$unamestr" = 'FreeBSD' ]; then
DESKTOP="unknown"
ps -aux | grep -E '[s]tart-hello'
if [ $? -ne 1 ];then
echo "hellosystem"
exit 0
fi
ps -aux | grep -E '[o]penbox'
if [ $? -ne 1 ];then
echo "openbox"
exit 0
fi
ps -aux | grep -E '[m]ate-panel'
if [ $? -ne 1 ];then
echo "mate"
exit 0
fi
ps -aux | grep -E '[x]fce4-session'
if [ $? -ne 1 ];then
echo "xfce"
exit 0
fi
fi
function detect_budgie()
{

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
if pkgmgr="$( which apt-get )" 2> /dev/null; then
echo "Debian"

Binary file not shown.

View File

@@ -9,7 +9,7 @@
; https://www.autohotkey.com/boards/viewtopic.php?t=9501
OnMessage(0x404, "AHK_NOTIFYICON")
AHK_NOTIFYICON(wParam, lParam)
AHK_NOTIFYICON(wParam, lParam)
{
if (lParam = 0x202) { ; user left-clicked tray icon
;ADD ANY SUBROUTINE OR FUNCTION HERE
@@ -62,8 +62,6 @@ Menu, Tray, Add, Autodetect Keyboards, autodetect
; Menu, Tray, check, Autodetect Keyboards ; Autodetect
; Menu, Tray, disable, Autodetect Keyboards ; CB/IBM
Menu, Tray, Add, Suspend Kinto, tray_suspend
; Add tray menu item for toggling Option key special character entry scheme
Menu, Tray, Add, OptSpecialChars Shift+Opt+Cmd+O, toggle_optspecialchars
; Menu, Tray, Add, Returns to Desktop, min
Menu, Tray, Add
Menu, Tray, Add, Close, Exit
@@ -133,7 +131,6 @@ Exit() {
SetTitleMatchMode, 2
GroupAdd, terminals, ahk_exe ubuntu.exe
GroupAdd, terminals, ahk_exe ubuntu2004.exe
GroupAdd, terminals, ahk_exe ConEmu.exe
GroupAdd, terminals, ahk_exe ConEmu64.exe
GroupAdd, terminals, ahk_exe powershell.exe
@@ -147,7 +144,6 @@ GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow
GroupAdd, terminals, ahk_class Console_2_Main
GroupAdd, posix, ahk_exe ubuntu.exe
GroupAdd, posix, ahk_exe ubuntu2004.exe
GroupAdd, posix, ahk_exe ConEmu.exe
GroupAdd, posix, ahk_exe ConEmu64.exe
GroupAdd, posix, ahk_exe Hyper.exe
@@ -174,15 +170,8 @@ GroupAdd, browsers, ahk_exe msedge.exe
; Disable Key Remapping for Virtual Machines
; Disable for Remote desktop solutions too
GroupAdd, remotes, ahk_exe VirtualBoxVM.exe
GroupAdd, remotes, ahk_exe mstsc.exe
GroupAdd, remotes, ahk_exe anydesk.exe
GroupAdd, remotes, ahk_exe msrdc.exe
GroupAdd, remotes, ahk_exe nxplayer.bin
GroupAdd, remotes, ahk_exe vmconnect.exe
GroupAdd, remotes, ahk_exe RemoteDesktopManagerFree.exe
GroupAdd, remotes, ahk_exe vncviewer.exe
GroupAdd, remotes, Remote Desktop ahk_class ApplicationFrameWindow
GroupAdd, virtm, ahk_exe VirtualBoxVM.exe
GroupAdd, virtm, ahk_exe mstsc.exe
; Disabled Edge for now - no ability to close all instances
; GroupAdd, browsers, Microsoft Edge ahk_class ApplicationFrameWindow
@@ -197,99 +186,7 @@ GroupAdd, intellij, ahk_exe idea64.exe
; SetCapsLockState, AlwaysOff ; CB/IBM
; Keyboards w/o media keys can use this Remap
; 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
; #########################################################################
; ############# START OF FINDER MODS FOR FILE MANAGERS ################
; #########################################################################
; Finder Mods for Windows File Explorer (explore.exe)
#IfWinActive ahk_class CabinetWClass ahk_exe explorer.exe
^i::Send !{Enter} ; Cmd+i: Get Info / Properties
^r::Send {F5} ; Cmd+R: Refresh view (Not actually a Finder shortcut? But works in Linux file browsers too.)
^1::Send ^+2 ; Cmd+1: View as Icons
^2::Send ^+6 ; Cmd+2: View as List (Detailed)
^3::Send ^+5 ; Cmd+3: View as List (Compact)
^4::Send ^+1 ; Cmd+4: View as Gallery
^Up::Send !{Up} ; Cmd+Up: Up to parent folder
^Left::Send !{Left} ; Cmd+Left: Go to prior location in history
^Right::Send !{Right} ; Cmd+Right: Go to next location in history
^Down:: ; Cmd-Down: Navigate into the selected directory
For window in ComObjCreate("Shell.Application").Windows
If WinActive() = window.hwnd
For item in window.document.SelectedItems {
window.Navigate(item.Path)
Return
}
Return
^[::Send !{Left} ; Cmd+Left_Brace: Go to prior location in history
^]::Send !{Right} ; Cmd+Right_Brace: Go to next location in history
^+o::Send ^{Enter} ; Cmd+Shift+o: Open in new window (tabs not available)
^Delete::Send {Delete} ; Cmd+Delete: Delete / Send to Trash
^BackSpace::Send {Delete} ; Cmd+Delete: Delete / Send to Trash
^d::return, ; Block the unusual Explorer "delete" shortcut of Ctrl+D, used for "bookmark" in similar apps
$Enter:: ; Use Enter key to rename (F2), unless focus is inside a text input field.
ControlGetFocus, fc, A
If fc contains Edit,Search,Notify,Windows.UI.Core.CoreWindow1,SysTreeView321
Send {Enter}
Else Send {F2}
Return
$BackSpace:: ; Backspace (without Cmd): Block Backspace key with error beep, unless inside text input field
ControlGetFocus, fc, A
If fc contains Edit,Search,Notify,Windows.UI.Core.CoreWindow1
Send {BackSpace}
Else SoundBeep, 600, 300
Return
$Delete:: ; Delete (without Cmd): Block Delete key with error beep, unless inside text input field
ControlGetFocus, fc, A
If fc contains Edit,Search,Notify,Windows.UI.Core.CoreWindow1
Send {Delete}
Else SoundBeep, 600, 300
Return
#IfWinActive
; #########################################################################
; ############## END OF FINDER MODS FOR FILE MANAGERS #################
; #########################################################################
#IfWinNotActive ahk_group remotes
; 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
#IfWinNotActive ahk_group virtm
; New AltTab and CtrlTab fix
*tab::
@@ -347,7 +244,7 @@ GroupAdd, intellij, ahk_exe idea64.exe
; Tertiary::LWin
; $LAlt::LCtrl ; CB/IBM
; $RAlt::RCtrl ; IBM
; $RAlt::RCtrl ; CB/IBM
; $RCtrl::RAlt ; CB/IBM
; $CapsLock::LWin ; IBM
; $LCtrl::LAlt ; CB/IBM
@@ -363,15 +260,8 @@ GroupAdd, intellij, ahk_exe idea64.exe
; $LCtrl::LWin ; MacModifiers
; Hack to disable start menu on winkey
; Static - Does not apply to IBM or Chromebooks
; $LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up} ; Default
; LWin::return ; Chromebook
; RWin::return ; Chromebook
; RAlt::return ; Chromebook
; Disable Win-Up/Down - interferes with Sublime text 3 multi-cursors
#Down::return
#Up::return
; Static
$LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up}
; temporary hack to ensure keys don't get stuck
; impacts Alt-Tab fix
@@ -380,26 +270,6 @@ GroupAdd, intellij, ahk_exe idea64.exe
; $LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; MacModifiers
; $LAlt up::Send {LWin up}{CapsLock up}{LAlt up}{LCtrl up} ; CB/IBM
!Enter::
{
if (GetKeyState("RAlt", "P")) {
Send {Insert}
}
else{
Send {Alt down}{Enter}{Alt up}
}
Return
}
; Remap Alt+Esc to Break/Pause
!Esc::SendInput, {Pause}
; Go up or down a page
#IfWinNotActive ahk_group editors
$!Down::Send {PgDn}
$!Up::Send {PgUp}
#If
; Close Apps
^q::Send !{F4}
@@ -442,8 +312,7 @@ GroupAdd, intellij, ahk_exe idea64.exe
^F3::Send #d
; Emoji Panel
; #^Space::Send {LWin down};{LWin up} ; Default
; !^Space::Send {LWin down};{LWin up} ; CB/IBM
#^Space::Send {LWin down};{LWin up}
; Full Screenshot
^+3::Send {PrintScreen}
@@ -451,56 +320,23 @@ GroupAdd, intellij, ahk_exe idea64.exe
; Region Screenshot
^+4::Send #+{S}
; Open File Browser
; !^space::Send #e ; Default
; #^space::Send #e ; CB/IBM
; wordwise support
$^Left::Send {Home}
$^+Left::Send +{Home}
$^Right::Send {End}
$^+Right::Send +{End}
^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}
; #if GetKeyState("LWin", "P") || GetKeyState("RAlt", "P") ; Chromebook
; Space::Send ^{Esc} ; Chromebook
; 0::Send #0 ; Chromebook
; 1::Send #1 ; Chromebook
; 2::Send #2 ; Chromebook
; 3::Send #3 ; Chromebook
; 4::Send #4 ; Chromebook
; 5::Send #5 ; Chromebook
; 6::Send #6 ; Chromebook
; 7::Send #7 ; Chromebook
; 8::Send #8 ; Chromebook
; 9::Send #9 ; Chromebook
; -::Send #- ; Chromebook
; =::Send #= ; Chromebook
; `::Send #` ; Chromebook
; `;::Send #; ; Chromebook
; a::Send #a ; Chromebook
; b::Send #b ; Chromebook
; c::Send #c ; Chromebook
; d::Send #d ; Chromebook
; e::Send #e ; Chromebook
; f::Send #f ; Chromebook
; g::Send #g ; Chromebook
; h::Send #h ; Chromebook
; i::Send #i ; Chromebook
; j::Send #j ; Chromebook
; k::Send #k ; Chromebook
; l::Send #l ; Chromebook
; m::Send #m ; Chromebook
; n::Send #n ; Chromebook
; o::Send #o ; Chromebook
; p::Send #p ; Chromebook
; q::Send #q ; Chromebook
; r::Send #r ; Chromebook
; s::Send #s ; Chromebook
; t::Send #t ; Chromebook
; u::Send #u ; Chromebook
; v::Send #v ; Chromebook
; w::Send #w ; Chromebook
; x::Send #x ; Chromebook
; y::Send #y ; Chromebook
; z::Send #z ; Chromebook
; #If ; Chromebook
#If Not WinActive("ahk_group terminals") and Not WinActive("ahk_group remotes")
^.::Send {Esc}
#IfWinNotActive ahk_group terminals
; emacs style
#n::Send {Down}
#p::Send {Up}
@@ -516,8 +352,6 @@ GroupAdd, intellij, ahk_exe idea64.exe
$^Space::Send ^{Esc}
#IfWinActive ahk_group intellij
; $#c::Send ^{c} ; Default - Sigints interrupt
; $!c::Send ^{c} ; CB/IBM
; General
^0::Send !{0} ;Open corresponding tool window
^1::Send !{1} ;Open corresponding tool window
@@ -609,16 +443,6 @@ GroupAdd, intellij, ahk_exe idea64.exe
; Close all browsers
#IfWinActive ahk_group browsers
; Page Navigation
^[::send !{Left} ; Go to prior page
^]::send !{Right} ; Go to next page
;Tab Navigation
^+[::send ^{PgUp} ; Go to prior tab (left)
^+]::send ^{PgDn} ; Go to next tab (right)
^!Left::send ^{PgUp} ; Go to prior tab (left)
^!Right::send ^{PgDn} ; Go to next tab (right)
#Left::send ^{PgUp} ; Go to prior tab (left)
#Right::send ^{PgDn} ; Go to next tab (right)
^q::send {Alt Down}f{Alt Up}x ; exit all windows
; Dev Tools
!^i::send {Ctrl Down}{Shift Down}i{Shift Up}{Ctrl Up}
@@ -626,7 +450,6 @@ GroupAdd, intellij, ahk_exe idea64.exe
; Open preferences
#IfWinActive ahk_exe firefox.exe
^,::send, {Ctrl Down}t{Ctrl Up}about:preferences{Enter}
^+n::send ^+p
#If
#IfWinActive ahk_exe chrome.exe
^,::send {Alt Down}e{Alt Up}s{Enter}
@@ -655,19 +478,12 @@ GroupAdd, intellij, ahk_exe idea64.exe
!+g::send ^+{G} ; View source control
; $#c::Send {Ctrl down}c{Ctrl up} ; Default - Sigints interrupt
; $!c::Send {Ctrl down}c{Ctrl up} ; CB/IBM
; $#x::Send {Ctrl down}x{Ctrl up} ; Default - Sigints interrupt
; $!x::Send {Ctrl down}x{Ctrl up} ; CB/IBM
; #Space::Send ^{Space} ; Default - Basic code completion
; !Space::Send ^{Space} ; CB/IBM - Basic code completion
#If
#IfWinActive ahk_exe sublime_text.exe
; #x::Send ^{x} ; Default - Terminal - Ctrl-x
; #c::Send ^{c} ; Default - Terminal - Ctrl-c sigint
; !x::Send ^{x} ; CB/IBM
; !c::Send ^{c} ; CB/IBM - Sigint
; #c::send ^{Pause} ; cancel_build
; #Space::Send ^{Space} ; Default - Basic code completion
; !Space::Send ^{Space} ; CB/IBM - Basic code completion
#^Up::send !{O} ; Switch file
@@ -679,8 +495,8 @@ GroupAdd, intellij, ahk_exe idea64.exe
^!Down::send ^{Down} ; scroll_lines down
; #+Up::send {shift up}^!{Up} ; Default - multi-cursor up
; #+Down::send {shift up}^!{Down} ; Default - multi-cursor down
; !+Up::send {shift up}^!{Up} ; CB/IBM - multi-cursor up
; !+Down::send {shift up}^!{Down} ; CB/IBM - multi-cursor down
; #+Up::send {shift up}^!{Up} ; CB/IBM - multi-cursor up
; #+Down::send {shift up}^!{Down} ; CB/IBM - multi-cursor down
^PgDn::Return ; cancel next_view
^PgUp::Return ; cancel prev_view
^+{::send ^{PgDn} ; next_view
@@ -689,7 +505,7 @@ GroupAdd, intellij, ahk_exe idea64.exe
^!Left::send ^{PgUp} ; prev_view
Insert::Return ; cancel toggle_overwrite
^!O::send {Insert} ; toggle_overwrite
; !c::Return ; Default - cancel toggle_case_sensitive
!c::Return ; cancel toggle_case_sensitive
^!c::send !{c} ; toggle_case_sensitive
; ^h::Return ; cancel replace
^!f::send ^{h} ; replace
@@ -697,7 +513,6 @@ GroupAdd, intellij, ahk_exe idea64.exe
^!e::send ^+{h} ; replace_next
F3::Return ; cancel 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
^+g::send +{F3} ; find_prev
#!g::send ^{F3} ; find_under
@@ -709,7 +524,7 @@ GroupAdd, intellij, ahk_exe idea64.exe
^+Down::Return ; cancel swap_line_down
#!Down::send ^+{Down} ; swap_line_down
^Pause::Return ; cancel cancel_build
; #c::send ^{Pause} ; cancel_build
#c::send ^{Pause} ; cancel_build
F9::Return ; cancel sort_lines case_s false
F5::send {F9} ; sort_lines case_s false
#F9::Return ; cancel sort_lines case_s true
@@ -773,7 +588,6 @@ GroupAdd, intellij, ahk_exe idea64.exe
; Sigints - interrupt
; $#c::Send {Ctrl down}c{Ctrl up} ; Default
; $!c::Send {Ctrl down}c{Ctrl up} ; CB/IBM
$^.::Send {Ctrl down}c{Ctrl up}
; Windows Terminal
; Ctrl+Shift+C should do nothing
@@ -827,45 +641,45 @@ GroupAdd, intellij, ahk_exe idea64.exe
; Clear Terminal and Scroll Buffer
^k::Send clear && printf '\e[3J'{Enter}
; Remap Physical Ctrl back to Ctrl
; #0::Send {LCtrl down}0{Ctrl up} ; Default
; #1::Send {LCtrl down}1{Ctrl up} ; Default
; #2::Send {LCtrl down}2{Ctrl up} ; Default
; #3::Send {LCtrl down}3{Ctrl up} ; Default
; #4::Send {LCtrl down}4{Ctrl up} ; Default
; #5::Send {LCtrl down}5{Ctrl up} ; Default
; #6::Send {LCtrl down}6{Ctrl up} ; Default
; #7::Send {LCtrl down}7{Ctrl up} ; Default
; #8::Send {LCtrl down}8{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
; #a::Send {LCtrl down}a{Ctrl up} ; Default
; #b::Send {LCtrl down}b{Ctrl up} ; Default
; #c::Send {LCtrl down}c{Ctrl up} ; Default
; #d::Send {LCtrl down}d{Ctrl up} ; Default
; #e::Send {LCtrl down}e{Ctrl up} ; Default
; #f::Send {LCtrl down}f{Ctrl up} ; Default
; #g::Send {LCtrl down}g{Ctrl up} ; Default
; #h::Send {LCtrl down}h{Ctrl up} ; Default
; #i::Send {LCtrl down}i{Ctrl up} ; Default
; #j::Send {LCtrl down}j{Ctrl up} ; Default
; #k::Send {LCtrl down}k{Ctrl up} ; Default
; #l::Send {LCtrl down}l{Ctrl up} ; Default
; #m::Send {LCtrl down}m{Ctrl up} ; Default
; #n::Send {LCtrl down}n{Ctrl up} ; Default
; #o::Send {LCtrl down}o{Ctrl up} ; Default
; #p::Send {LCtrl down}p{Ctrl up} ; Default
; #q::Send {LCtrl down}q{Ctrl up} ; Default
; #r::Send {LCtrl down}r{Ctrl up} ; Default
; #s::Send {LCtrl down}s{Ctrl up} ; Default
; #t::Send {LCtrl down}t{Ctrl up} ; Default
; #u::Send {LCtrl down}u{Ctrl up} ; Default
; #v::Send {LCtrl down}v{Ctrl up} ; Default
; #w::Send {LCtrl down}w{Ctrl up} ; Default
; #x::Send {LCtrl down}x{Ctrl up} ; Default
; #y::Send {LCtrl down}y{Ctrl up} ; Default
; #z::Send {LCtrl down}z{Ctrl up} ; Default
#0::Send {LCtrl down}0{Ctrl up} ; Default
#1::Send {LCtrl down}1{Ctrl up} ; Default
#2::Send {LCtrl down}2{Ctrl up} ; Default
#3::Send {LCtrl down}3{Ctrl up} ; Default
#4::Send {LCtrl down}4{Ctrl up} ; Default
#5::Send {LCtrl down}5{Ctrl up} ; Default
#6::Send {LCtrl down}6{Ctrl up} ; Default
#7::Send {LCtrl down}7{Ctrl up} ; Default
#8::Send {LCtrl down}8{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
#a::Send {LCtrl down}a{Ctrl up} ; Default
#b::Send {LCtrl down}b{Ctrl up} ; Default
#c::Send {LCtrl down}c{Ctrl up} ; Default
#d::Send {LCtrl down}d{Ctrl up} ; Default
#e::Send {LCtrl down}e{Ctrl up} ; Default
#f::Send {LCtrl down}f{Ctrl up} ; Default
#g::Send {LCtrl down}g{Ctrl up} ; Default
#h::Send {LCtrl down}h{Ctrl up} ; Default
#i::Send {LCtrl down}i{Ctrl up} ; Default
#j::Send {LCtrl down}j{Ctrl up} ; Default
#k::Send {LCtrl down}k{Ctrl up} ; Default
#l::Send {LCtrl down}l{Ctrl up} ; Default
#m::Send {LCtrl down}m{Ctrl up} ; Default
#n::Send {LCtrl down}n{Ctrl up} ; Default
#o::Send {LCtrl down}o{Ctrl up} ; Default
#p::Send {LCtrl down}p{Ctrl up} ; Default
#q::Send {LCtrl down}q{Ctrl up} ; Default
#r::Send {LCtrl down}r{Ctrl up} ; Default
#s::Send {LCtrl down}s{Ctrl up} ; Default
#t::Send {LCtrl down}t{Ctrl up} ; Default
#u::Send {LCtrl down}u{Ctrl up} ; Default
#v::Send {LCtrl down}v{Ctrl up} ; Default
#w::Send {LCtrl down}w{Ctrl up} ; Default
#x::Send {LCtrl down}x{Ctrl up} ; Default
#y::Send {LCtrl down}y{Ctrl up} ; Default
#z::Send {LCtrl down}z{Ctrl up} ; Default
; !0::Send {LCtrl down}0{Ctrl up} ; CB/IBM
; !1::Send {LCtrl down}1{Ctrl up} ; CB/IBM
; !2::Send {LCtrl down}2{Ctrl up} ; CB/IBM
@@ -917,299 +731,4 @@ Send {RWin up}
Send {LWin up}
Send {RShift up}
Send {LShift up}
return
; ###############################################################################################################
; ### Special character insertion like Apple/macOS Option key methods, mapping to Unicode input method
; ### Common symbols available with Option+key or Shift+Option+key, accented keys with Option+Key1, then Key2
; ###############################################################################################################
; Shortcut to activate Option key special character scheme
^+!o::Gosub, toggle_optspecialchars
; Function (subroutine?) for activation by tray menu item or keyboard shortcut
toggle_optspecialchars:
optspecialchars:=!optspecialchars ; Toggle value of optspecialchars variable on/off
if (optspecialchars = 1) {
Menu, Tray, Check, OptSpecialChars Shift+Opt+Cmd+O
MsgBox, 0, ALERT, % "Option key special character entry scheme is now ENABLED.`n`n"
. "WARNING: This will interfere with many Alt and Alt-Shift shortcuts.`n`n"
. "Disable from tray menu or with Shift+Opt+Cmd+O."
return
}
if (optspecialchars = 0) {
Menu, Tray, Uncheck, OptSpecialChars Shift+Opt+Cmd+O
MsgBox, 0, ALERT, Option key special character entry scheme is now DISABLED.
return
}
return
; #IfWinNotActive ahk_group remotes
#If !WinActive("ahk_group remotes") && optspecialchars = 1
; ###### NUMBER KEYS ROW ######
; Dead_Keys_Accent_Grave
; ### SC029 is ` (Grave key above Tab)
; Grave accent: Option+`, then key to accent
$!SC029::
; Use Apple "dead keys" Option key method to attach accents to next character typed
; Grave accent activated by Option+` (Alt plus scan code SC029, or !SC029)
StringCaseSense, On
; watch next input string
Input, UserInput, L1
Switch UserInput {
Case Esc: Return ; Watch for Escape key, cancel dead keys sequence
Case "a": Send, {U+00E0} ; à {U+00E0} (Alt+0224)
Case "e": Send, {U+00E8} ; è {U+00E8} (Alt+0232)
Case "i": Send, {U+00EC} ; ì {U+00EC} (Alt+0236)
Case "o": Send, {U+00F2} ; ò {U+00F2} (Alt+0242)
Case "u": Send, {U+00F9} ; ù {U+00F9} (Alt+0249)
Case "A": Send, {U+00C0} ; À {U+00C0} (Alt+0192)
Case "E": Send, {U+00C8} ; È {U+00C8} (Alt+0200)
Case "I": Send, {U+00CC} ; Ì {U+00CC} (Alt+0204)
Case "O": Send, {U+00D2} ; Ò {U+00D2} (Alt+0210)
Case "U": Send, {U+00D9} ; Ù {U+00D9} (Alt+0217)
Default: Send, %UserInput% ; No match? Send input through.
}
Return
; ### SC029 is ` (Grave key above Tab)
$!+SC029::Send, {U+0060} ; Grave Accent diacritic (non-combining) {U+0060}: ` (Alt+96)
$!1::Send, {U+00A1} ; Inverted Exclamation Mark {U+00A1}: ¡ (Alt+0161)
$!+1::Send, {U+2044} ; Fraction Slash, solidus (U+2044): (Alt+8260) [Needs Unicode]
$!2::Send, {U+2122} ; Trade Mark Sign Emoji {U+2122}: ™ (Alt+0153)
$!+2::Send, {U+20AC} ; Euro currency symbol {U+20AC}: € (Alt+0128)
$!3::Send, {U+00A3} ; British Pound currency symbol {U+00A3}: £ (Alt+0163)
$!+3::Send, {U+2039} ; Single Left-Pointing Angle Quotation mark {U+2039}: (Alt+0139)
$!4::Send, {U+00A2} ; Cent currency symbol {U+00A2}: ¢ (Alt+0162)
$!+4::Send, {U+203A} ; Single Right-Pointing Angle Quotation mark (U+203A): (Alt+0155)
$!5::Send, {U+221E} ; Infinity mathematical symbol {U+221E}: ∞ (Alt+236)
$!+5::Send, {U+FB01} ; fi latin small ligature: fi (U+FB01) (Alt+64257) [Needs Unicode]
$!6::Send, {U+00A7} ; Section symbol {U+00A7}: § (Alt+0167)
$!+6::Send, {U+FB02} ; fl small ligature: (U+FB02) (Alt+64258) [Needs Unicode.]
$!7::Send, {U+00B6} ; Paragraph mark (Pilcrow) symbol {U+00B6}: ¶ (Alt+0182)
$!+7::Send, {U+2021} ; Double dagger (cross) symbol {U+2021}: ‡ (Alt+0135)
$!8::Send, {U+2022} ; Bullet point symbol {U+2022}: • (Alt+0149)
$!+8::Send, {U+00B0} ; Degree symbol {U+00B0}: ° (Alt+0176)
$!9::Send, {U+00AA} ; Feminine Ordinal Indicator symbol {U+00AA}: ª (Alt+0170)
$!+9::Send, {U+00B7} ; Middle Dot (interpunct/middot) symbol {U+00B7}: · (Alt+0183)
$!0::Send, {U+00BA} ; Masculine Ordinal Indicator symbol {U+00BA}: º (Alt+0186)
$!+0::Send, {U+201A} ; Single low-9 quotation mark {U+201A}: (Alt+0130)
$!-::Send, {U+2013} ; En Dash symbol {U+2013}: (Alt+0150)
$!+-::Send, {U+2014} ; Em Dash symbol {U+2014}: — (Alt+0151)
$!=::Send, {U+2260} ; Not Equal To symbol (U+2260): ≠ (Alt+8800) [Needs Unicode]
$!+=::Send, {U+00B1} ; Plus Minus symbol {U+00B1}: ± (Alt+0177)
; ###### LETTER AND PUNCTUATION KEYS ###### [ in QWERTY order ]
; ##############
; ### 1st row: Tab-key row [ qwertyuiop[]\ ] [ QWERTYUIOP{}| ]
$!q::Send, {U+0153} ; Small oe (oethel) ligature {U+0153}: œ (Alt+0156)
$!+q::Send, {U+0152} ; Capital OE (Oethel) ligature {U+0152}: Œ (Alt+0140)
$!w::Send, {U+2211} ; N-Ary Summation (sigma) notation (U+2211}: ∑ [Needs Unicode]
$!+w::Send, {U+201E} ; Double Low-9 Quotation mark {U+201E}: „ (Alt+0132)
; Dead_Keys_Accent_Acute
; Acute accent: Option+e, then key to accent
$!e::
; Use Apple "dead keys" Option key method to attach accents to next character typed
; Acute accent activated by Option+e (logical Alt+e)
StringCaseSense, On
; watch next input string
Input, UserInput, L1
Switch UserInput {
Case Esc: Return ; Watch for Escape key, cancel dead keys sequence
Case "a": Send, {U+00E1} ; á {U+00E1} (Alt+0225)
Case "e": Send, {U+00E9} ; é {U+00E9} (Alt+0233)
Case "i": Send, {U+00ED} ; í {U+00ED} (Alt+0237)
Case "o": Send, {U+00F3} ; ó {U+00F3} (Alt+0243)
Case "u": Send, {U+00FA} ; ú {U+00FA} (Alt+0250)
Case "A": Send, {U+00C1} ; Á {U+00C1} (Alt+0193)
Case "E": Send, {U+00C9} ; É {U+00C9} (Alt+0201)
Case "I": Send, {U+00CD} ; Í {U+00CD} (Alt+0205)
Case "O": Send, {U+00D3} ; Ó {U+00D3} (Alt+0211)
Case "U": Send, {U+00DA} ; Ú {U+00DA} (Alt+0218)
Default: Send, %UserInput% ; No match? Send input through.
}
Return
$!+e::Send, {U+00B4} ; Acute accent diacritic (non-combining) {U+00B4}: ´ (Alt+0180)
$!r::Send, {U+00AE} ; Registered Trade Mark Sign {U+00AE}: ® (Alt+0174)
$!+r::Send, {U+2030} ; Per mille symbol {U+2030}: ‰ (Alt+0137)
$!t::Send, {U+2020} ; Simple dagger (cross) symbol {U+2020}: † (Alt+0134)
$!+t::Send, {U+02C7} ; Caron/hacek diacritic (non-combining) (U+02C7): ˇ (Alt+0134)
$!y::Send, {U+00A5} ; Yen currency symbol {U+00A5}: ¥ (Alt+0165)
$!+y::Send, {U+00C1} ; Latin Capital Letter a with Acute (U+00C1): Á (Alt+0193)
; Dead_Keys_Accent_Umlaut
; Umlaut/Diaeresis accent: Option+u, then key to accent
$!u::
; Use Apple "dead keys" Option key method to attach accents to next character typed
; Umlaut/Diaeresis accent activated by Option+u (logical Alt+u)
StringCaseSense, On
; watch next input string
Input, UserInput, L1
Switch UserInput {
Case Esc: Return ; Watch for Escape key, cancel dead keys sequence
Case "a": Send, {U+00E4} ; ä {U+00E4} (Alt+0228)
Case "e": Send, {U+00EB} ; ë {U+00EB} (Alt+0235)
Case "i": Send, {U+00EF} ; ï {U+00EF} (Alt+0239)
Case "o": Send, {U+00F6} ; ö {U+00F6} (Alt+0246)
Case "u": Send, {U+00FC} ; ü {U+00FC} (Alt+0252)
Case "y": Send, {U+00FF} ; ÿ {U+00FF} (Alt+0255)
Case "A": Send, {U+00C4} ; Ä {U+00C4} (Alt+0196)
Case "E": Send, {U+00CB} ; Ë {U+00CB} (Alt+0203)
Case "I": Send, {U+00CF} ; Ï {U+00CF} (Alt+0207)
Case "O": Send, {U+00D6} ; Ö {U+00D6} (Alt+0214)
Case "U": Send, {U+00DC} ; Ü {U+00DC} (Alt+0220)
Case "Y": Send, {U+0178} ; Ÿ {U+0178} (Alt+0159)
Default: Send, %UserInput% ; No match? Send input through.
}
Return
$!+u::Send, {U+00A8} ; Umlaut/Diaeresis diacritic (non-combining) {U+00A8}: (Alt+0168)
; Dead_Keys_Accent_Circumflex
; Circumflex accent: Option+i, then key to accent
$!i::
; Use Apple "dead keys" Option key method to attach accents to next character typed
; Circumflex accent activated by Option+i (logical Alt+i)
StringCaseSense, On
; watch next input string
Input, UserInput, L1
Switch UserInput {
Case Esc: Return ; Watch for Escape key, cancel dead keys sequence
Case "a": Send, {U+00E2} ; â {U+00E2} (Alt+0226)
Case "e": Send, {U+00EA} ; ê {U+00EA} (Alt+0234)
Case "i": Send, {U+00EE} ; î {U+00EE} (Alt+0238)
Case "o": Send, {U+00F4} ; ô {U+00F4} (Alt+0244)
Case "u": Send, {U+00FB} ; û {U+00FB} (Alt+0251)
Case "A": Send, {U+00C2} ; Â {U+00C2} (Alt+0194)
Case "E": Send, {U+00CA} ; Ê {U+00CA} (Alt+0202)
Case "I": Send, {U+00CE} ; Î {U+00CE} (Alt+0206)
Case "O": Send, {U+00D4} ; Ô {U+00D4} (Alt+0212)
Case "U": Send, {U+00DB} ; Û {U+00DB} (Alt+0219)
Default: Send, %UserInput% ; No match? Send input through.
}
Return
$!+i::Send, {U+02C6} ; Modifier Letter Circumflex Accent (U+02C6): ˆ (Alt+0137)
$!o::Send, {U+00F8} ; Latin Small Letter o with Stroke {U+00F8}: ø (Alt+0248)
$!+o::Send, {U+00D8} ; Latin Capital Letter O with Stroke {U+00D8}: Ø (Alt+0216)
$!p::Send, {U+03C0} ; Greek Small Letter Pi {U+03C0}: π (Alt+227)
$!+p::Send, {U+220F} ; N-Ary Product mathematical symbol (U+220F): ∏ [Needs Unicode]
$![::Send, {U+201C} ; Left Double Quotation Mark {U+201C}: “ (Alt+0147)
$!+[::Send, {U+201D} ; Right Double Quotation Mark {U+201D}: ” (Alt+8)
$!]::Send, {U+2018} ; Left Single Quotation Mark {U+2018}: (Alt+0145)
$+!]::Send, {U+2019} ; Right Single Quotation Mark {U+2019}: (Alt+0146)
$!\::Send, {U+00AB} ; LEFT-POINTING DOUBLE ANGLE QUOTATION MARK {U+00AB}: « (Alt+0171)
$!+\::Send, {U+00BB} ; RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK {U+00BB}: » (Alt+0187)
; ##############
; ### 2nd row: Caps Lock row [ asdfghjkl;' ] [ ASDFGHJKL:" ]
$!a::Send, {U+00E5} ; Small Letter a with Ring Above {U+00E5}: å (Alt+0229)
$!+a::Send, {U+00C5} ; Capital Letter A with Ring Above {U+00C5}: Å (Alt+0197)
$!s::Send, {U+00DF} ; German Eszett/beta (Sharfes/Sharp S) {U+00DF}: ß (Alt+0223)
$!+s::Send, {U+00CD} ; Latin Capital Letter I with Acute {U+00CD}: Í (Alt+0205)
$!d::Send, {U+2202} ; Partial Differential mathematical symbol {U+2202}: ∂ (Alt+2202) [Needs Unicode]
$!+d::Send, {U+00CE} ; Latin Capital Letter I with Circumflex {U+00CE}: Î (Alt+0206)
$!f::Send, {U+0192} ; Function/florin currency symbol {U+0192}: ƒ (Alt+159)
$!+f::Send, {U+00CF} ; Latin Capital Letter I with Diaeresis {U+00CF}: Ï (Alt+0207)
; #######################################################################
; ## Problem: Option+g (Win+g) brings up Windows XBox Game Bar!
; ## To remove/disable paste this text in PowerShell (without quotes):
; ## "Get-AppxPackage Microsoft.XboxGamingOverlay | Remove-AppxPackage"
; #######################################################################
$!g::Send, {U+00A9} ; Copyright Sign {U+00A9}: © (Alt+0169)
$!+g::Send, {U+02DD} ; Double Acute Accent diacritic (non-combining) {U+02DD}: ˝ [Needs Unicode]
$!h::Send, {U+02D9} ; Dot Above diacritic (non-combining) {U+02D9}: ˙ [Needs Unicode]
$!+h::Send, {U+00D3} ; Latin Capital Letter O with Acute {U+00D3}: Ó (Alt+0211)
$!j::Send, {U+2206} ; Increment, laplace operator symbol {U+2206}: ∆ [Needs Unicode]
$!+j::Send, {U+00D4} ; Latin Capital Letter O with Circumflex {U+00D4}: Ô (Alt+0212)
$!k::Send, {U+02DA} ; Ring Above diacritic (non-combining) {U+02DA}: ˚ [Needs Unicode] (NOT degree sign/symbol)
; Apple logo {U+F8FF}:  [Unicode Private Use Area, req's Baskerville Old Face font]
; $!+k::Send, {U+F8FF} ; This Unicode address only works with Mac fonts
$!+k::
Send, {U+F000} ; Change font of inserted character (may be invisible) to Baskerville Old Face
apple_logo_alert:=1 ; Set to zero to disable, one to enable (default is enabled)
if (apple_logo_alert=1) {
MsgBox, 0, ALERT, % "ALERT: Change the font of the inserted character!`n`n"
. "Apple logo character requires the Baskerville Old Face font.`n`n`n"
. "Note 1: The character has been inserted but may be INVISIBLE`n"
. " (i.e., non-printing) in its current font.`n`n`n"
. "Note 2: The inserted character will probably NOT be portable`n"
. " to a Mac document/font. Use only for print/PDF `n"
. " purposes on PC.`n`n`n"
. "Note 3: Search for apple_logo_alert in kinto.ahk config and `n"
. " set it to zero to disable this MsgBox.`n`n`n"
}
return
; #######################################################################
; ## Option+L works, but will also trigger the Win+L screen locking.
; ## The screen locking shortcut can only be disabled in the registry.
; #######################################################################
$!l::Send, {U+00AC} ; Not Sign angled dash symbol {U+00AC}: ¬ (Alt+170)
$!+l::Send, {U+00D2} ; Latin Capital Letter O with Grave {U+00D2}: Ò (Alt+0210)
$!;::Send, {U+2026} ; Horizontal elipsis {U+2026}: … (Alt+0133)
$!+;::Send, {U+00DA} ; Latin Capital Letter U with Acute {U+00DA}: Ú (Alt+0218)
; #######################################################################
; ## SC028 is single-quote key scan code
; #######################################################################
$!SC028::Send, {U+00E6} ; Small ae ligature {U+00E6}: æ (Alt+0230)
$!+SC028::Send, {U+00C6} ; Capital AE ligature {U+00C6}: Æ (Alt+0198)
; ##############
; ### 3rd row: Shift-Keys row [ zxcvbnm,./ ] [ ZXCVBNM<>? ]
$!z::Send, {U+03A9} ; Greek Capital Letter Omega symbol {U+03A9} Ω (Alt+234)
$!+z::Send, {U+00B8} ; Spacing Cedilla diacritic symbol (non-combining) {U+00B8}: ¸ (Alt+0184)
$!x::Send, {U+2248} ; Almost Equal To symbol (U+2248): ≈ (Alt+247)
$!+x::Send, {U+02DB} ; Ogonek diacritic (non-combining) (U+02DB): ˛ [Needs Unicode]
$!c::Send, {U+00E7} ; Small Letter c with Cedilla {U+00E7}: ç (Alt+0231)
$!+c::Send, {U+00C7} ; Capital Letter C with Cedilla {U+00C7}: Ç (Alt+0199)
$!v::Send, {U+221A} ; Square Root radical sign (U+221A): √ (Alt+251)
$!+v::Send, {U+25CA} ; Lozenge (diamond) shape symbol (U+25CA): ◊ [Needs Unicode]
$!b::Send, {U+222B} ; Integral mathematical symbol (U+222B): ∫ [Needs Unicode]
$!+b::Send, {U+0131} ; Latin Small Letter Dotless i (U+0131): ı [Needs Unicode]
; Dead_Keys_Accent_Tilde
; Tilde accent: Option+n, then key to accent
$!n::
; Use Apple "dead keys" Option key method to attach accents to next character typed
; Tilde accent activated by Option+n (logical Alt+n)
StringCaseSense, On
; watch next input string
Input, UserInput, L1
Switch UserInput {
Case Esc: Return ; Watch for Escape key, cancel dead keys sequence
Case "a": Send, {U+00E3} ; ã {U+00E3} (Alt+0227)
Case "n": Send, {U+00F1} ; ñ {U+00F1} (Alt+0241)
Case "o": Send, {U+00F5} ; õ {U+00F5} (Alt+0245)
Case "A": Send, {U+00C3} ; Ã {U+00C3} (Alt+0195)
Case "N": Send, {U+00D1} ; Ñ {U+00D1} (Alt+0209)
Case "O": Send, {U+00D5} ; Õ {U+00D5} (Alt+0213)
Default: Send, %UserInput% ; No match? Send input through.
}
Return
$!+n::Send, {U+02DC} ; Small Tilde character (U+02DC): ˜ (Alt+0152)
$!m::Send, {U+00B5} ; Micro (mu) symbol {U+00B5}: µ (Alt+0181)
$!+m::Send, {U+00C2} ; Latin Capital Letter a with Circumflex (U+00C2): Â (Alt+0194)
$!,::Send, {U+2264} ; Less than or equal to symbol {U+2264}: ≤ (Alt+243)
$!+,::Send, {U+00AF} ; Macron/overline/apl overbar (non-combining) (U+00AF): ¯ (Alt+0175)
$!.::Send, {U+2265} ; Greater than or equal to symbol {U+2265}: ≥ (Alt+242)
$!+.::Send, {U+02D8} ; Breve diacritic (non-combining) {U+02D8}: ˘ [Needs Unicode]
$!/::Send, {U+00F7} ; Obelus/Division symbol {U+00F7}: ÷ (Alt+0247)
$!+/::Send, {U+00BF} ; Inverted Question Mark {U+00BF}: ¿ (Alt+0191)
#If ; ### END of special character insertion with Option(Alt) key
return

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
dbus-monitor --session "type='signal',interface='org.gnome.SessionManager.Logout'" | grep '1' |
while read x; do
# echo "$x"

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
import gi,os,time,fcntl,argparse,re
import warnings
warnings.filterwarnings("ignore")
gi.require_version('Gtk', '3.0')
gi.require_version('Vte', '2.91')
from gi.repository import Gtk,Gdk,GdkPixbuf
@@ -50,21 +48,13 @@ class MyWindow(Gtk.Window):
page = 1
label = Gtk.Label()
label.set_halign(Gtk.Align.END)
label.set_alignment(1, 0)
ostype = os.environ.get('XDG_CURRENT_DESKTOP')
global openWin
openWin = False
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
winkb = Gtk.RadioMenuItem(label='Windows')
@@ -124,15 +114,9 @@ class MyWindow(Gtk.Window):
None,
)
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:
self.command = "journalctl -f --unit=xkeysnail.service -b\n"
self.command = "journalctl -f --unit=xkeysnail.service -b\n"
self.InputToTerm(self.command)
@@ -169,14 +153,6 @@ class MyWindow(Gtk.Window):
menuitem_file = Gtk.MenuItem(label="File")
menubar.append(menuitem_file)
submenu_file = Gtk.Menu()
menuitem_restart = Gtk.MenuItem(label="Restart")
menuitem_restart.connect('activate',self.runRestart)
submenu_file.append(menuitem_restart)
menuitem_stop = Gtk.MenuItem(label="Stop")
menuitem_stop.connect('activate',self.runStop)
submenu_file.append(menuitem_stop)
menuitem_file.set_submenu(submenu_file)
submenu_file.append(self.menuitem_auto)
kintotray = int(self.queryConfig('ps -aux | grep [k]intotray >/dev/null 2>&1 && echo "1" || echo "0"'))
@@ -188,6 +164,12 @@ class MyWindow(Gtk.Window):
self.menuitem_systray.signal_id = self.menuitem_systray.connect('activate',self.checkTray,True)
menuitem_file.connect('activate',self.refreshFile)
submenu_file.append(self.menuitem_systray)
menuitem_restart = Gtk.MenuItem(label="Restart")
menuitem_restart.connect('activate',self.runRestart)
submenu_file.append(menuitem_restart)
menuitem_stop = Gtk.MenuItem(label="Stop")
menuitem_stop.connect('activate',self.runStop)
submenu_file.append(menuitem_stop)
menuitem_quit = Gtk.MenuItem(label="Quit")
submenu_file.append(menuitem_quit)
@@ -197,19 +179,19 @@ class MyWindow(Gtk.Window):
menubar.append(menuitem_edit)
submenu_edit = Gtk.Menu()
menuitem_edit.set_submenu(submenu_edit)
edititem_tweaks = Gtk.MenuItem(label="Tweaks")
edititem_tweaks = Gtk.MenuItem("Tweaks")
edititem_tweaks.connect('activate',self.setTweaks)
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)
submenu_edit.append(edititem_config)
edititem_service = Gtk.MenuItem(label="Kinto Service")
edititem_service = Gtk.MenuItem("Kinto Service")
edititem_service.connect('activate',self.setService)
submenu_edit.append(edititem_service)
edititem_shortcuts = Gtk.MenuItem(label="System Shortcuts")
edititem_shortcuts = Gtk.MenuItem("System Shortcuts")
edititem_shortcuts.connect('activate',self.setSysKB)
submenu_edit.append(edititem_shortcuts)
edititem_language = Gtk.MenuItem(label="Change Language")
edititem_language = Gtk.MenuItem("Change Language")
edititem_language.connect('activate',self.setRegion)
submenu_edit.append(edititem_language)
@@ -223,11 +205,11 @@ class MyWindow(Gtk.Window):
helpitem_debug = Gtk.MenuItem(label="Debug")
helpitem_debug.connect('activate',self.runDebug)
submenu_help.append(helpitem_debug)
helpitem_support = Gtk.MenuItem(label="Support")
helpitem_support = Gtk.MenuItem("Support")
helpitem_support.connect('activate',self.openSupport)
submenu_help.append(helpitem_support)
menuitem_help.set_submenu(submenu_help)
helpitem_about = Gtk.MenuItem(label="About")
helpitem_about = Gtk.MenuItem("About")
helpitem_about.connect('activate',self.runAbout)
submenu_help.append(helpitem_about)
@@ -353,12 +335,13 @@ class MyWindow(Gtk.Window):
self.queryConfig('cp '+os.environ['HOME']+'/.config/kinto/xkeysnail.desktop '+os.environ['HOME']+'/.config/autostart/xkeysnail.desktop')
if self.options["systray"]:
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.set_active(True)
self.menuitem_systray.signal_id = self.menuitem_systray.connect('activate',self.checkTray,False)
restartsvc = True
def initSetup(self):
global win,openWin,restartsvc
@@ -435,20 +418,21 @@ class MyWindow(Gtk.Window):
pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.environ['HOME']+'/.config/kinto/gui/tuxcry4.png')
pixbuf = pixbuf.scale_simple(600, 360, GdkPixbuf.InterpType.BILINEAR)
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 = pixbuf.scale_simple(600, 360, GdkPixbuf.InterpType.BILINEAR)
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 = pixbuf.scale_simple(600, 360, GdkPixbuf.InterpType.BILINEAR)
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.set_alignment(0, 1)
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_overlay(self.container)
self.setupwin.add(self.container)
@@ -470,7 +454,7 @@ class MyWindow(Gtk.Window):
def image2pixbuf(self,im):
data = im.tobytes()
w, h = im.size
# print(im.size)
print(im.size)
data = GLib.Bytes.new(data)
pix = GdkPixbuf.Pixbuf.new_from_bytes(data, GdkPixbuf.Colorspace.RGB,True, 8, w, h, w * 4)
return pix
@@ -531,10 +515,7 @@ class MyWindow(Gtk.Window):
return
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)
def openSupport(self,button):
@@ -616,7 +597,7 @@ class MyWindow(Gtk.Window):
if tray_bool:
Popen(['cp',os.environ['HOME']+'/.config/kinto/kintotray.desktop',os.environ['HOME']+'/.config/autostart/kintotray.desktop'])
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.set_active(True)
self.menuitem_systray.signal_id = self.menuitem_systray.connect('activate',self.checkTray,False)
@@ -627,10 +608,7 @@ class MyWindow(Gtk.Window):
self.queryConfig(killspawn)
time.sleep(1)
global child_pid
if sysv:
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)
self.kinto_status = Popen("while :; do clear; systemctl is-active xkeysnail; sleep 2; done", stdout=PIPE, shell=True)
child_pid = self.kinto_status.pid
self.menuitem_systray.disconnect(self.menuitem_systray.signal_id)
self.menuitem_systray.set_active(False)
@@ -638,7 +616,6 @@ class MyWindow(Gtk.Window):
return
def setKB(self,button,kbtype):
global sysv
try:
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'
@@ -675,10 +652,7 @@ class MyWindow(Gtk.Window):
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'
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]
cmdsTerm = Popen(cmds)
@@ -770,14 +744,11 @@ class MyWindow(Gtk.Window):
}
def on_delete_event(event, self, widget):
global restartsvc, openWin, sysv
global restartsvc, openWin
if restartsvc == True:
try:
if sysv:
restartcmd = ['sudo', '-E','/etc/init.d/kinto','restart']
else:
restartcmd = ['sudo', 'systemctl','restart','xkeysnail']
restartcmd = ['sudo', 'systemctl','restart','xkeysnail']
Popen(restartcmd)
restartsvc = False
@@ -897,12 +868,8 @@ class MyWindow(Gtk.Window):
return
def runRestart(self,button):
global sysv
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()
time.sleep(1)
res = Popen(['pgrep','xkeysnail'])
@@ -911,23 +878,15 @@ class MyWindow(Gtk.Window):
if res.returncode == 0:
pkillxkey = Popen(['sudo', 'pkill','-f','bin/xkeysnail'])
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'])
self.command = "send \003 journalctl -f --unit=xkeysnail.service -b\n"
Popen(['sudo', 'systemctl','start','xkeysnail'])
self.command = "send \003 journalctl -f --unit=xkeysnail.service -b\n"
self.InputToTerm(self.command)
except:
Popen(['notify-send','Kinto: Errror restarting Kinto!'])
def runStop(self,button):
global sysv
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()
time.sleep(1)
res = Popen(['pgrep','xkeysnail'])
@@ -1116,7 +1075,7 @@ class MyWindow(Gtk.Window):
except:
pass
# print(Vte.get_minor_version())
print(Vte.get_minor_version())
# def on_menu_auto(self, widget):
# print("add file open dialog")
@@ -1145,36 +1104,34 @@ class UninstallPage(Gtk.Box):
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_valign(Gtk.Align.START)
label_start.set_halign(Gtk.Align.START)
label_start.set_alignment(0,0)
label_start.set_line_wrap(True)
vbox.add(label_start)
scroller.add(vbox)
hbox = Gtk.HBox()
previous = Gtk.Button(label="Uninstall")
previous = Gtk.Button("Uninstall")
previous.connect("clicked", self.goback)
previous.set_margin_end(206)
previous.set_margin_right(206)
hbox.add(previous)
onward = Gtk.Button(label="Continue")
onward = Gtk.Button("Continue")
onward.connect("clicked", self.forward)
hbox.add(onward)
hbox.set_hexpand(False)
hbox.set_vexpand(False)
hbox.set_margin_bottom(6)
hbox.set_margin_end(25)
hbox.set_margin_right(25)
scroller.set_hexpand(True)
scroller.set_vexpand(True)
vbox_container.add(scroller)
vbox_container.set_margin_top(55)
vbox_container.set_margin_end(25)
self.grid.set_margin_start(157)
vbox_container.set_margin_right(25)
self.grid.set_margin_left(157)
vbox_container.set_margin_bottom(18)
vbox.set_margin_end(10)
vbox.set_margin_right(10)
vbox.set_margin_bottom(18)
self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1206,19 +1163,18 @@ class FirstPage(Gtk.Box):
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_valign(Gtk.Align.START)
label_start.set_halign(Gtk.Align.START)
label_start.set_alignment(0,0)
label_start.set_line_wrap(True)
vbox.add(label_start)
scroller.add(vbox)
hbox = Gtk.HBox()
previous = Gtk.Button(label="")
previous = Gtk.Button("")
for child in previous.get_children():
child.set_label("<b>Decline</b>")
child.set_use_markup(True)
previous.connect("clicked", self.goback)
previous.set_margin_end(245)
previous.set_margin_right(245)
hbox.add(previous)
self.__parent_window.first_onward.set_label("")
@@ -1232,16 +1188,16 @@ class FirstPage(Gtk.Box):
hbox.set_hexpand(False)
hbox.set_vexpand(False)
hbox.set_margin_bottom(6)
hbox.set_margin_end(25)
hbox.set_margin_right(25)
scroller.set_hexpand(True)
scroller.set_vexpand(True)
vbox_container.add(scroller)
vbox_container.set_margin_top(55)
vbox_container.set_margin_end(28)
self.grid.set_margin_start(157)
vbox_container.set_margin_right(28)
self.grid.set_margin_left(157)
vbox_container.set_margin_bottom(18)
vbox.set_margin_end(10)
vbox.set_margin_right(10)
vbox.set_margin_bottom(18)
self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1280,38 +1236,37 @@ class SecondPage(Gtk.Box):
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_valign(Gtk.Align.START)
label_start.set_halign(Gtk.Align.START)
label_start.set_alignment(0,0)
label_start.set_line_wrap(True)
vbox.add(label_start)
scroller.add(vbox)
hbox = Gtk.HBox()
previous = Gtk.Button(label="")
previous = Gtk.Button("")
for child in previous.get_children():
child.set_label("<b>Go Back</b>")
child.set_use_markup(True)
previous.connect("clicked", self.goback)
previous.set_margin_end(315)
previous.set_margin_right(315)
hbox.add(previous)
# onward = Gtk.Button(label="Continue")
# onward = Gtk.Button("Continue")
# onward.connect("clicked", self.forward)
# hbox.add(onward)
hbox.set_hexpand(False)
hbox.set_vexpand(False)
hbox.set_margin_bottom(6)
hbox.set_margin_end(25)
hbox.set_margin_right(25)
scroller.set_hexpand(True)
scroller.set_vexpand(True)
vbox_container.add(scroller)
vbox_container.set_margin_top(55)
vbox_container.set_margin_end(25)
self.grid.set_margin_start(157)
vbox_container.set_margin_right(25)
self.grid.set_margin_left(157)
vbox_container.set_margin_bottom(18)
vbox.set_margin_end(10)
vbox.set_margin_right(10)
vbox.set_margin_bottom(18)
self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1365,38 +1320,37 @@ class CapsPage(Gtk.Box):
label_start = Gtk.Label()
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_halign(Gtk.Align.START)
label_start.set_alignment(0,0)
label_start.set_line_wrap(True)
vbox.add(label_start)
scroller.add(vbox)
hbox = Gtk.HBox()
previous = Gtk.Button(label="")
previous = Gtk.Button("")
for child in previous.get_children():
child.set_label("<b>Go Back</b>")
child.set_use_markup(True)
previous.connect("clicked", self.goback)
previous.set_margin_end(315)
previous.set_margin_right(315)
hbox.add(previous)
# onward = Gtk.Button(label="Continue")
# onward = Gtk.Button("Continue")
# onward.connect("clicked", self.forward)
# hbox.add(onward)
hbox.set_hexpand(False)
hbox.set_vexpand(False)
hbox.set_margin_bottom(6)
hbox.set_margin_end(25)
hbox.set_margin_right(25)
scroller.set_hexpand(True)
scroller.set_vexpand(True)
vbox_container.add(scroller)
vbox_container.set_margin_top(55)
vbox_container.set_margin_end(25)
self.grid.set_margin_start(157)
vbox_container.set_margin_right(25)
self.grid.set_margin_left(157)
vbox_container.set_margin_bottom(18)
vbox.set_margin_end(10)
vbox.set_margin_right(10)
vbox.set_margin_bottom(18)
self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1433,9 +1387,9 @@ class SuccessPage(Gtk.Box):
self.grid = Gtk.Grid()
hbox = Gtk.HBox()
previous = Gtk.Button(label=" ")
previous = Gtk.Button(" ")
previous.props.relief = Gtk.ReliefStyle.NONE
previous.set_margin_end(245)
previous.set_margin_right(245)
hbox.add(previous)
self.__parent_window.last_onward.set_label("")
@@ -1448,7 +1402,7 @@ class SuccessPage(Gtk.Box):
hbox.set_hexpand(False)
hbox.set_vexpand(False)
hbox.set_margin_bottom(6)
hbox.set_margin_end(25)
hbox.set_margin_right(25)
scroller = Gtk.ScrolledWindow()
scroller.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER)
@@ -1457,11 +1411,11 @@ class SuccessPage(Gtk.Box):
vbox = Gtk.VBox()
vbox_container = Gtk.VBox()
vbox_container.set_margin_top(55)
vbox_container.set_margin_end(28)
vbox_container.set_margin_right(28)
vbox_container.add(scroller)
self.grid.set_margin_start(157)
self.grid.set_margin_left(157)
vbox_container.set_margin_bottom(18)
vbox.set_margin_end(10)
vbox.set_margin_right(10)
vbox.set_margin_bottom(18)
self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1481,4 +1435,4 @@ if openWin:
win.show_all()
openWin = False
Gtk.main()
Gtk.main()

View File

@@ -4,7 +4,7 @@ Name=Kinto.sh
GenericName=Kinto.sh
Categories=Utility;
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=/usr/share/icons/Pocillo/kinto-color.svg
Terminal=false

0
linux/gui/tuxbg.png → xkeysnail-config/gui/tuxbg.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

View File

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

View File

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 172 KiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
xkeycount=$(pgrep 'xkeysnail' | wc -l)

492
xkeysnail-config/kinto.py Normal file
View File

@@ -0,0 +1,492 @@
# -*- coding: utf-8 -*-
# autostart = true
import re
from xkeysnail.transform import *
# Use the following for testing terminal keymaps
# terminals = [ "", ... ]
# xbindkeys -mk
terminals = ["kinto-gui.py","gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal","tilix","xfce4-terminal","hyper"]
terminals = [term.casefold() for term in terminals]
termStr = "|".join(str(x) for x in terminals)
# Use for browser specific hotkeys
browsers = ["Chromium","Chromium-browser","Google-chrome","microsoft-edge-dev","microsoft-edge","Epiphany","Firefox","Discord"]
browsers = [browser.casefold() for browser in browsers]
browserStr = "|".join(str(x) for x in browsers)
chromes = ["Chromium","Chromium-browser","Google-chrome","microsoft-edge-dev","microsoft-edge"]
chromes = [chrome.casefold() for chrome in chromes]
chromeStr = "|".join(str(x) for x in chromes)
# edges = ["microsoft-edge-dev","microsoft-edge"]
# edges = [edge.casefold() for edge in edges]
# edgeStr = "|".join(str(x) for x in edges)
mscodes = ["code","vscodium"]
codeStr = "|".join(str(x) for x in mscodes)
define_multipurpose_modmap(
# {Key.ENTER: [Key.ENTER, Key.RIGHT_CTRL] # Enter2Cmd
# {Key.CAPSLOCK: [Key.ESC, Key.RIGHT_CTRL] # Caps2Esc
# {Key.LEFT_META: [Key.ESC, Key.RIGHT_CTRL] # Caps2Esc - Chromebook
{ # Placeholder
})
# [Global modemap] Change modifier keys as in xmodmap
define_conditional_modmap(lambda wm_class: wm_class.casefold() not in terminals,{
# Key.CAPSLOCK: Key.RIGHT_CTRL, # Caps2Cmd
# Key.LEFT_META: Key.RIGHT_CTRL, # Caps2Cmd - Chromebook
# - IBM
# Key.LEFT_ALT: Key.RIGHT_CTRL, # IBM
# Key.LEFT_CTRL: Key.LEFT_ALT, # IBM
# Key.CAPSLOCK: Key.LEFT_META, # IBM
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # IBM - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # IBM - Multi-language (Remove)
# - Chromebook
# Key.LEFT_ALT: Key.RIGHT_CTRL, # Chromebook
# Key.LEFT_CTRL: Key.LEFT_ALT, # Chromebook
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # Chromebook - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # Chromebook - Multi-language (Remove)
# - Default Mac/Win
# - Default Win
# Key.LEFT_ALT: Key.RIGHT_CTRL, # WinMac
# Key.LEFT_META: Key.LEFT_ALT, # WinMac
# Key.LEFT_CTRL: Key.LEFT_META, # WinMac
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac - Multi-language (Remove)
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_META, # WinMac - Multi-language (Remove)
# - Mac Only
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac
# Key.LEFT_CTRL: Key.LEFT_META, # Mac
# Key.RIGHT_META: Key.RIGHT_CTRL, # Mac - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_META, # Mac - Multi-language (Remove)
})
# [Conditional modmap] Change modifier keys in certain applications
define_conditional_modmap(re.compile(termStr, re.IGNORECASE), {
# - IBM
# Key.LEFT_ALT: Key.RIGHT_CTRL, # IBM
# # Left Ctrl Stays Left Ctrl
# Key.CAPSLOCK: Key.LEFT_ALT, # IBM
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # IBM - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # IBM
# # Right Meta does not exist on chromebooks
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # IBM - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # IBM - Multi-language (Remove)
# - Chromebook
# Key.LEFT_ALT: Key.RIGHT_CTRL, # Chromebook
# # Left Ctrl Stays Left Ctrl
# Key.LEFT_META: Key.LEFT_ALT, # Chromebook
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # Chromebook - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # Chromebook
# # Right Meta does not exist on chromebooks
# - Default Mac/Win
# - Default Win
# Key.LEFT_ALT: Key.RIGHT_CTRL, # WinMac
# Key.LEFT_META: Key.LEFT_ALT, # WinMac
# Key.LEFT_CTRL: Key.LEFT_CTRL, # WinMac
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac - Multi-language (Remove)
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # WinMac - Multi-language (Remove)
# - Mac Only
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac
# # Left Ctrl Stays Left Ctrl
# Key.RIGHT_META: Key.RIGHT_CTRL, # Mac - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # Mac - Multi-language (Remove)
})
# Keybindings for IntelliJ
define_keymap(re.compile("jetbrains-idea", re.IGNORECASE),{
# General
K("C-Key_0"): K("M-Key_0"), # Open corresponding tool window
K("C-Key_1"): K("M-Key_1"), # Open corresponding tool window
K("C-Key_2"): K("M-Key_2"), # Open corresponding tool window
K("C-Key_3"): K("M-Key_3"), # Open corresponding tool window
K("C-Key_4"): K("M-Key_4"), # Open corresponding tool window
K("C-Key_5"): K("M-Key_5"), # Open corresponding tool window
K("C-Key_6"): K("M-Key_6"), # Open corresponding tool window
K("C-Key_7"): K("M-Key_7"), # Open corresponding tool window
K("C-Key_8"): K("M-Key_8"), # Open corresponding tool window
K("C-Key_9"): K("M-Key_9"), # Open corresponding tool window
K("Super-Grave"): K("C-Grave"), # Quick switch current scheme
K("C-Comma"): K("C-M-s"), # Open Settings dialog
K("C-Semicolon"): K("C-M-Shift-s"), # Open Project Structure dialog
# Debugging
K("C-M-r"): K("F9"), # Resume program
# Search/Replace
K("C-g"): K("F3"), # Find next
K("C-Shift-F3"): K("Shift-F3"), # Find previous
K("Super-g"): K("M-j"), # Select next occurrence
K("C-Super-g"): K("C-M-Shift-j"), # Select all occurrences
K("Super-Shift-g"): K("M-Shift-j"), # Unselect occurrence
# Editing
K("Super-Space"): K("LC-Space"), # Basic code completion
K("Super-Shift-Space"): K("LC-Shift-Space"),# Smart code completion
K("Super-j"): K("C-q"), # Quick documentation lookup
K("C-n"): K("M-Insert"), # Generate code...
K("Super-o"): K("C-o"), # Override methods
K("Super-i"): K("C-i"), # Implement methods
K("M-Up"): K("C-w"), # Extend selection
K("M-Down"): K("C-Shift-w"), # Shrink selection
K("Super-Shift-q"): K("M-q"), # Context info
K("Super-M-o"): K("C-M-o"), # Optimize imports
K("Super-M-i"): K("C-M-i"), # Auto-indent line(s)
K("C-Backspace"): K("C-y"), # Delete line at caret
K("Super-Shift-j"): K("C-Shift-j"), # Smart line join
K("M-Delete"): K("C-Delete"), # Delete to word end
K("M-Backspace"): K("C-Backspace"), # Delete to word start
K("C-Shift-Equal"): K("C-KPPLUS"), # Expand code block
K("C-Minus"): K("C-KPMINUS"), # Collapse code block
K("C-Shift-Equal"): K("C-Shift-KPPLUS"), # Expand all
K("C-Shift-Minus"): K("C-Shift-KPMINUS"), # Collapse all
K("C-w"): K("C-F4"), # Close active editor tab
# Refactoring
K("C-Delete"): K("M-Delete"), # Safe Delete
K("C-T"): K("C-M-Shift-t"), # Refactor this
# Navigation
K("C-o"): K("C-n"), # Go to class
K("C-Shift-o"): K("C-Shift-n"), # Go to file
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-Left"): K("M-Left"), # Go to previous editor tab
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("C-Y"): K("C-Shift-i"), # Open quick definition lookup
K("Super-Shift-b"): K("C-Shift-b"), # Go to type declaration
K("Super-Up"): K("M-Up"), # Go to previous
K("Super-Down"): K("M-Down"), # Go to next method
K("Super-h"): K("C-h"), # Type hierarchy
K("Super-M-h"): K("C-M-h"), # Call hierarchy
K("C-Down"): K("C-Enter"), # Edit source/View source
K("M-Home"): K("M-Home"), # Show navigation bar
K("F2"): K("F11"), # Toggle bookmark
K("Super-F3"): K("C-F11"), # Toggle bookmark with mnemonic
K("Super-Key_0"): K("C-Key_0"), # Go to numbered bookmark
K("Super-Key_1"): K("C-Key_1"), # Go to numbered bookmark
K("Super-Key_2"): K("C-Key_2"), # Go to numbered bookmark
K("Super-Key_3"): K("C-Key_3"), # Go to numbered bookmark
K("Super-Key_4"): K("C-Key_4"), # Go to numbered bookmark
K("Super-Key_5"): K("C-Key_5"), # Go to numbered bookmark
K("Super-Key_6"): K("C-Key_6"), # Go to numbered bookmark
K("Super-Key_7"): K("C-Key_7"), # Go to numbered bookmark
K("Super-Key_8"): K("C-Key_8"), # Go to numbered bookmark
K("Super-Key_9"): K("C-Key_9"), # Go to numbered bookmark
K("C-F3"): K("Shift-F11"), # Show bookmarks
# Compile and Run
K("Super-M-r"): K("M-Shift-F10"), # Select configuration and run
K("Super-M-d"): K("M-Shift-F9"), # Select configuration and debug
K("Super-r"): K("Shift-F10"), # Run
K("Super-d"): K("Shift-F9"), # Debug
K("Super-Shift-r"): K("C-Shift-F10"), # Run context configuration from editor
K("Super-Shift-d"): K("C-Shift-F9"), # Debug context configuration from editor
# VCS/Local History
K("Super-v"): K("M-Grave"), # VCS quick popup
K("Super-c"): K("LC-c"), # Sigints - interrupt
})
# Keybindings for Nautilus
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
K("RC-Left"): K("M-Left"), # Go Back
K("RC-Right"): K("M-Right"), # Go Forward
})
# Keybindings for Browsers
define_keymap(re.compile(browserStr, re.IGNORECASE),{
K("RC-Q"): K("RC-Q"), # Close all browsers Instances
K("M-RC-I"): K("RC-Shift-I"), # Dev tools
K("M-RC-J"): K("RC-Shift-J"), # Dev tools
})
# 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")],
})
define_keymap(re.compile(chromeStr, re.IGNORECASE),{
K("C-comma"): [K("M-e"), K("s"),K("Enter")],
})
# Opera C-F12
define_keymap(None,{
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-LC-f"):K("M-F10"), # Default SL - Maximize app (gnome/kde)
# 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("RC-Q"): K("M-F4"), # Default SL - not-popos
K("RC-H"):K("Super-h"), # Default SL - Minimize app (gnome/budgie/popos/fedora)
K("M-Tab"): pass_through_key, # Default not-xfce4 - 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 not-xfce4 - Cmd Tab - App Switching Default
K("RC-Grave"): K("M-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching
K("RC-Shift-Grave"): K("M-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching
# 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-Right"):K("Super-C-Up"), # SL - Change workspace (popos)
# K("Super-Left"):K("Super-C-Down"), # SL - Change workspace (popos)
# K("RC-Q"):K("Super-q"), # SL - Close Apps (popos)
# K("RC-Space"): K("Super-Space"), # SL - Launch Application Menu (eos)
# K("RC-H"): K("Super-Page_Down"), # SL - Minimize app (kde_neon)
# SL - Default SL - Change workspace (kde_neon)
# K("RC-Space"): K("LC-Esc"), # SL- Launch Application Menu xfce4
# K("RC-F3"):K("C-M-d"), # SL- Show Desktop xfce4
# K("RC-LC-f"):K("Super-Up"), # SL- Maximize app eos
# K("RC-LC-f"):K("Super-PAGE_UP"), # SL- Maximize app manjaro
# Basic App hotkey functions
# K("RC-H"):K("M-F9"), # SL - Minimize app xfce4
# 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
# 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-Grave") : K("C-Shift-Tab"), # Chromebook/IBM - In-App Tab switching
K("Super-Tab"): K("LC-Tab"), # Default not-chromebook
K("Super-Shift-Tab"): K("LC-Shift-Tab"), # Default not-chromebook
# emacs style
K("Super-a"): K("Home"), # Beginning of Line
K("Super-e"): K("End"), # End of Line
K("Super-b"): K("Left"),
K("Super-f"): K("Right"),
K("Super-n"): K("Down"),
K("Super-p"): K("Up"),
K("Super-k"): [K("Shift-End"), K("Backspace")],
K("Super-d"): K("Delete"),
# Wordwise
K("RC-Left"): K("Home"), # Beginning of Line
K("RC-Shift-Left"): K("Shift-Home"), # Select all to Beginning of Line
K("RC-Right"): K("End"), # End of Line
K("RC-Shift-Right"): K("Shift-End"), # Select all to End of Line
# K("RC-Left"): K("C-LEFT_BRACE"), # Firefox-nw - Back
# K("RC-Right"): K("C-RIGHT_BRACE"), # Firefox-nw - Forward
# K("RC-Left"): K("M-LEFT"), # Chrome-nw - Back
# K("RC-Right"): K("M-RIGHT"), # Chrome-nw - Forward
K("RC-Up"): K("C-Home"), # Beginning of File
K("RC-Shift-Up"): K("C-Shift-Home"), # Select all to Beginning of File
K("RC-Down"): K("C-End"), # End of File
K("RC-Shift-Down"): K("C-Shift-End"), # Select all to End of File
# K("M-Backspace"): K("Delete"), # Chromebook/IBM - Delete
K("Super-Backspace"): K("C-Backspace"), # Default not-chromebook - Delete Left Word of Cursor
K("Super-Delete"): K("C-Delete"), # Default not-chromebook - Delete Right Word of Cursor
K("Alt-Backspace"): K("C-Backspace"), # Default not-chromebook - Delete Left Word of Cursor
K("Alt-Delete"): K("C-Delete"), # Default not-chromebook - Delete Right Word of Cursor
# K(""): pass_through_key, # cancel
# K(""): K(""), #
})
define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{
# Wordwise remaining - for Everything but VS Code
K("M-Left"): K("C-Left"), # Left of Word
K("M-Shift-Left"): K("C-Shift-Left"), # Select Left of Word
K("M-Right"): K("C-Right"), # Right of Word
K("M-Shift-Right"): K("C-Shift-Right"), # Select Right of Word
K("M-Shift-g"): K("C-Shift-g"), # View source control
# ** VS Code fix **
# Electron issue precludes normal keybinding fix.
# Alt menu auto-focus/toggle gets in the way.
#
# refer to ./xkeysnail-config/vscode_keybindings.json
# **
#
# ** Firefox fix **
# User will need to set "ui.key.menuAccessKeyFocuses"
# under about:config to false.
#
# https://superuser.com/questions/770301/pentadactyl-how-to-disable-menu-bar-toggle-by-alt
# **
#
})
# Keybindings for VS Code
define_keymap(re.compile(codeStr, re.IGNORECASE),{
K("Super-Space"): K("LC-Space"), # Basic code completion
# Wordwise remaining - for VS Code
# Alt-F19 hack fixes Alt menu activation
K("M-Left"): [K("M-F19"),K("C-Left")], # Left of Word
K("M-Right"): [K("M-F19"),K("C-Right")], # Right of Word
K("M-Shift-Left"): [K("M-F19"),K("C-Shift-Left")], # Select Left of Word
K("M-Shift-Right"): [K("M-F19"),K("C-Shift-Right")], # Select Right of Word
# K("C-PAGE_DOWN"): pass_through_key, # cancel next_view
# K("C-PAGE_UP"): pass_through_key, # cancel prev_view
K("C-M-Left"): K("C-PAGE_UP"), # next_view
K("C-M-Right"): K("C-PAGE_DOWN"), # prev_view
# VS Code Shortcuts
K("C-g"): pass_through_key, # cancel Go to Line...
K("Super-g"): K("C-g"), # Go to Line...
K("F3"): pass_through_key, # cancel Find next
K("C-h"): pass_through_key, # cancel replace
K("C-M-f"): K("C-h"), # replace
K("C-Shift-h"): pass_through_key, # cancel replace_next
K("C-M-e"): K("C-Shift-h"), # replace_next
K("f3"): pass_through_key, # cancel find_next
K("C-g"): K("f3"), # find_next
K("Shift-f3"): pass_through_key, # cancel find_prev
K("C-Shift-g"): K("Shift-f3"), # find_prev
K("Super-c"): K("LC-c"), # Sigints - interrupt
# K("Super-C-g"): K("C-f2"), # Default - Sublime - find_all_under
# K("C-M-g"): K("C-f2"), # Chromebook/IBM - Sublime - find_all_under
# K("Super-Shift-up"): K("M-Shift-up"), # multi-cursor up - Sublime
# K("Super-Shift-down"): K("M-Shift-down"), # multi-cursor down - Sublime
# K(""): pass_through_key, # cancel
# K(""): K(""), #
}, "Code")
# Keybindings for Sublime Text
define_keymap(re.compile("Sublime_text", re.IGNORECASE),{
K("Super-Space"): K("C-Space"), # Basic code completion
K("C-Super-up"): K("M-o"), # Switch file
K("Super-RC-f"): K("f11"), # toggle_full_screen
K("C-M-v"): [K("C-k"), K("C-v")], # paste_from_history
K("C-up"): pass_through_key, # cancel scroll_lines up
K("C-M-up"): K("C-up"), # scroll_lines up
K("C-down"): pass_through_key, # cancel scroll_lines down
K("C-M-down"): K("C-down"), # scroll_lines down
K("Super-Shift-up"): K("M-Shift-up"), # multi-cursor up
K("Super-Shift-down"): K("M-Shift-down"), # multi-cursor down
K("C-PAGE_DOWN"): pass_through_key, # cancel next_view
K("C-PAGE_UP"): pass_through_key, # cancel prev_view
K("C-Shift-left_brace"): K("C-PAGE_DOWN"), # next_view
K("C-Shift-right_brace"): K("C-PAGE_UP"), # prev_view
K("C-M-right"): K("C-PAGE_DOWN"), # next_view
K("C-M-left"): K("C-PAGE_UP"), # prev_view
K("insert"): pass_through_key, # cancel toggle_overwrite
K("C-M-o"): K("insert"), # toggle_overwrite
K("M-c"): pass_through_key, # cancel toggle_case_sensitive
K("C-M-c"): K("M-c"), # toggle_case_sensitive
K("C-h"): pass_through_key, # cancel replace
K("C-M-f"): K("C-h"), # replace
K("C-Shift-h"): pass_through_key, # cancel replace_next
K("C-M-e"): K("C-Shift-h"), # replace_next
K("f3"): pass_through_key, # cancel find_next
K("C-g"): K("f3"), # find_next
K("Shift-f3"): pass_through_key, # cancel find_prev
K("C-Shift-g"): K("Shift-f3"), # find_prev
K("C-f3"): pass_through_key, # cancel find_under
K("Super-M-g"): K("C-f3"), # find_under
K("C-Shift-f3"): pass_through_key, # cancel find_under_prev
K("Super-M-Shift-g"): K("C-Shift-f3"), # find_under_prev
K("M-f3"): pass_through_key, # Default - cancel find_all_under
# K("M-Refresh"): pass_through_key, # Chromebook/IBM - cancel find_all_under
# K("M-C-g"): K("M-Refresh"), # Chromebook/IBM - find_all_under
K("Super-C-g"): K("M-f3"), # Default - find_all_under
K("C-Shift-up"): pass_through_key, # cancel swap_line_up
K("Super-M-up"): K("C-Shift-up"), # swap_line_up
K("C-Shift-down"): pass_through_key, # cancel swap_line_down
K("Super-M-down"): K("C-Shift-down"), # swap_line_down
K("C-Pause"): pass_through_key, # cancel cancel_build
K("Super-c"): K("C-Pause"), # cancel_build
K("f9"): pass_through_key, # cancel sort_lines case_s false
K("f5"): K("f9"), # sort_lines case_s false
K("Super-f9"): pass_through_key, # cancel sort_lines case_s true
K("Super-f5"): K("Super-f9"), # sort_lines case_s true
K("M-Shift-Key_1"): pass_through_key, # cancel set_layout
K("C-M-Key_1"): K("M-Shift-Key_1"), # set_layout
K("M-Shift-Key_2"): pass_through_key, # cancel set_layout
K("C-M-Key_2"): K("M-Shift-Key_2"), # set_layout
K("M-Shift-Key_3"): pass_through_key, # cancel set_layout
K("C-M-Key_3"): K("M-Shift-Key_3"), # set_layout
K("M-Shift-Key_4"): pass_through_key, # cancel set_layout
K("C-M-Key_4"): K("M-Shift-Key_4"), # set_layout
K("M-Shift-Key_8"): pass_through_key, # cancel set_layout
K("C-M-Shift-Key_2"): K("M-Shift-Key_8"), # set_layout
K("M-Shift-Key_9"): pass_through_key, # cancel set_layout
K("C-M-Shift-Key_3"): K("M-Shift-Key_9"), # set_layout
K("M-Shift-Key_5"): pass_through_key, # cancel set_layout
K("C-M-Shift-Key_5"): K("M-Shift-Key_5"), # set_layout
# K(""): pass_through_key, # cancel
# K(""): K(""), #
}, "Sublime Text")
define_keymap(re.compile("konsole", re.IGNORECASE),{
# Ctrl Tab - In App Tab Switching
K("LC-Tab") : K("Shift-Right"),
K("LC-Shift-Tab") : K("Shift-Left"),
K("LC-Grave") : K("Shift-Left"),
}, "Konsole tab switching")
define_keymap(re.compile("Io.elementary.terminal|kitty", re.IGNORECASE),{
# Ctrl Tab - In App Tab Switching
K("LC-Tab") : K("LC-Shift-Right"),
K("LC-Shift-Tab") : K("LC-Shift-Left"),
K("LC-Grave") : K("LC-Shift-Left"),
}, "Elementary Terminal tab switching")
define_keymap(re.compile(termStr, re.IGNORECASE),{
# 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-End"), # SL - Change workspace xfce4
# K("LC-Left"):K("Super-Left"), # SL - Change workspace eos
# K("LC-Right"):K("C-M-Home"), # SL - Change workspace xfce4
# K("LC-Right"):K("Super-Right"), # SL - Change workspace eos
# K("LC-Right"):K("Super-Page_Up"), # SL - Change workspace (ubuntu/fedora)
# K("LC-Left"):K("Super-Page_Down"), # SL - Change workspace (ubuntu/fedora)
# K("LC-Right"):K("Super-C-Up"), # SL - Change workspace (popos)
# K("LC-Left"):K("Super-C-Down"), # SL - Change workspace (popos)
# Ctrl Tab - In App Tab Switching
K("LC-Tab") : K("LC-PAGE_DOWN"),
K("LC-Shift-Tab") : K("LC-PAGE_UP"),
K("LC-Grave") : K("LC-PAGE_UP"),
# Converts Cmd to use Ctrl-Shift
K("RC-Tab"): K("RC-F13"),
K("RC-Shift-Tab"): K("RC-Shift-F13"),
K("RC-V"): K("C-Shift-V"),
K("RC-MINUS"): K("C-Shift-MINUS"),
K("RC-EQUAL"): K("C-Shift-EQUAL"),
K("RC-BACKSPACE"): K("C-Shift-BACKSPACE"),
K("RC-W"): K("C-Shift-W"),
K("RC-E"): K("C-Shift-E"),
K("RC-R"): K("C-Shift-R"),
K("RC-T"): K("C-Shift-t"),
K("RC-Y"): K("C-Shift-Y"),
K("RC-U"): K("C-Shift-U"),
K("RC-I"): K("C-Shift-I"),
K("RC-O"): K("C-Shift-O"),
K("RC-P"): K("C-Shift-P"),
K("RC-LEFT_BRACE"): K("C-Shift-LEFT_BRACE"),
K("RC-RIGHT_BRACE"): K("C-Shift-RIGHT_BRACE"),
K("RC-A"): K("C-Shift-A"),
K("RC-S"): K("C-Shift-S"),
K("RC-D"): K("C-Shift-D"),
K("RC-F"): K("C-Shift-F"),
K("RC-G"): K("C-Shift-G"),
K("RC-H"): K("C-Shift-H"),
K("RC-J"): K("C-Shift-J"),
K("RC-K"): K("C-Shift-K"),
K("RC-L"): K("C-Shift-L"),
K("RC-SEMICOLON"): K("C-Shift-SEMICOLON"),
K("RC-APOSTROPHE"): K("C-Shift-APOSTROPHE"),
K("RC-GRAVE"): K("C-Shift-GRAVE"),
K("RC-BACKSLASH"): K("C-Shift-BACKSLASH"),
K("RC-Z"): K("C-Shift-Z"),
K("RC-X"): K("C-Shift-X"),
K("RC-C"): K("C-Shift-C"),
K("RC-V"): K("C-Shift-V"),
K("RC-B"): K("C-Shift-B"),
K("RC-N"): K("C-Shift-N"),
K("RC-M"): K("C-Shift-M"),
K("RC-COMMA"): K("C-Shift-COMMA"),
K("RC-DOT"): K("C-Shift-DOT"),
K("RC-SLASH"): K("C-Shift-SLASH"),
K("RC-KPASTERISK"): K("C-Shift-KPASTERISK"),
}, "terminals")

View File

@@ -1,7 +1,4 @@
# /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} start 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=NOPASSWD: {pkill} -f logoff
%{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: /usr/lib/systemd/system/xkeysnail.service

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
if [ -f {homedir}/.config/systemd/user/keyswap.timer ]; then
systemctl --user stop keyswap.timer >/dev/null 2>&1
systemctl --user disable keyswap.timer >/dev/null 2>&1

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# /usr/local/bin/logoff.sh
while true; do
w | grep -E "$1.*$2" > /dev/null 2>&1 || (sudo systemctl stop xkeysnail && sudo pkill -f logoff)

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -3,19 +3,15 @@
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
gi.require_version('Notify', '0.7')
import signal,time,os,fcntl,datetime,re
from subprocess import Popen, PIPE, CalledProcessError
from shutil import which
from gi.repository import Gtk,GLib,GdkPixbuf
from gi.repository import AppIndicator3 as appindicator
from gi.repository import Notify as notify
try:
gi.require_version('AyatanaAppIndicator3', '0.1')
from gi.repository import AyatanaAppIndicator3 as appindicator
except ValueError:
gi.require_version('AppIndicator3', '0.1')
from gi.repository import AppIndicator3 as appindicator
import signal
@@ -33,15 +29,7 @@ APPINDICATOR_ID = 'Kinto'
class Indicator():
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("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)
kinto_status = Popen("while :; do clear; systemctl is-active xkeysnail; sleep 2s; done", stdout=PIPE, shell=True)
child_pid = kinto_status.pid
homedir = os.path.expanduser("~")
@@ -54,52 +42,44 @@ class Indicator():
autostart_bool = False
menu = Gtk.Menu()
menukb = Gtk.Menu()
checkbox_autostart = Gtk.CheckMenuItem(label='Autostart')
restart = Gtk.MenuItem(label='Restart')
stop = Gtk.MenuItem(label='Stop')
keyboards = Gtk.MenuItem(label='Keyboard Types')
checkbox_autostart = Gtk.CheckMenuItem('Autostart')
restart = Gtk.MenuItem('Restart')
stop = Gtk.MenuItem('Stop')
keyboards = Gtk.MenuItem('Keyboard Types')
keyboards.set_submenu(menukb)
winkb = Gtk.RadioMenuItem(label='Windows')
mackb = Gtk.RadioMenuItem(label='Apple',group=winkb)
chromekb = Gtk.RadioMenuItem(label='Chromebook',group=winkb)
ibmkb = Gtk.RadioMenuItem(label='IBM (No Super/Win key)',group=winkb)
winmackb = Gtk.RadioMenuItem(label='Windows & Apple*',group=winkb)
edit = Gtk.MenuItem(label='Customize')
edit = Gtk.MenuItem('Customize')
edit_submenu = Gtk.Menu()
edit.set_submenu(edit_submenu)
tweaks = Gtk.MenuItem(label='Tweaks')
rightmod = Gtk.CheckButton(label='AltGr on Right Cmd')
vsc2st3 = Gtk.CheckButton(label='ST3 hotkeys for VS Code')
caps2esc = Gtk.CheckButton(label='Capslock is Escape when tapped, Cmd when held')
caps2cmd = Gtk.CheckButton(label='Capslock is Cmd')
button_config = Gtk.MenuItem(label='Kinto Config (shortcuts)')
service = Gtk.MenuItem(label='Kinto Service')
tweaks = Gtk.MenuItem('Tweaks')
rightmod = Gtk.CheckButton('AltGr on Right Cmd')
vsc2st3 = Gtk.CheckButton('ST3 hotkeys for VS Code')
caps2esc = Gtk.CheckButton('Capslock is Escape when tapped, Cmd when held')
caps2cmd = Gtk.CheckButton('Capslock is Cmd')
button_config = Gtk.MenuItem('Kinto Config (shortcuts)')
service = Gtk.MenuItem('Kinto Service')
# Keyboard type set below
button_syskb = Gtk.MenuItem(label='System Shortcuts')
button_region = Gtk.MenuItem(label='Change Language')
systray = Gtk.CheckMenuItem(label='Tray Enabled')
helpm = Gtk.MenuItem(label='Help')
button_syskb = Gtk.MenuItem('System Shortcuts')
button_region = Gtk.MenuItem('Change Language')
systray = Gtk.CheckMenuItem('Tray Enabled')
helpm = Gtk.MenuItem('Help')
help_submenu = Gtk.Menu()
helpm.set_submenu(help_submenu)
debug = Gtk.MenuItem(label='Debug')
opengui = Gtk.MenuItem(label='Open Kinto')
support = Gtk.MenuItem(label='Support')
about = Gtk.MenuItem(label='About')
debug = Gtk.MenuItem('Debug')
opengui = Gtk.MenuItem('Open Kinto')
support = Gtk.MenuItem("Support")
about = Gtk.MenuItem('About')
global restartsvc
restartsvc = False
unixts = int(time.time())
last_status = ''
last_status = ""
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()
if res.returncode == 0:
@@ -120,8 +100,6 @@ class Indicator():
with open(self.kconfig) as configfile:
autostart_line = configfile.read().split('\n')[1]
autostart_bool = False
# Autostart
if "autostart = true" in autostart_line.casefold():
autostart_bool = True
@@ -205,7 +183,7 @@ class Indicator():
# self.button_region.connect('activate',self.setRegion)
# self.menu.append(self.button_region)
item_quit = Gtk.MenuItem(label='Close')
item_quit = Gtk.MenuItem('Close')
item_quit.connect('activate', quit)
self.menu.append(item_quit)
self.menu.show_all()
@@ -423,10 +401,10 @@ class Indicator():
self.lbl = Gtk.Label()
global restartsvc
restartsvc = False
self.rightmod = Gtk.CheckButton(label='AltGr on Right Cmd')
self.vsc2st3 = Gtk.CheckButton(label='ST3 hotkeys for VS Code')
self.caps2esc = Gtk.CheckButton(label='Capslock is Escape when tapped, Cmd when held')
self.caps2cmd = Gtk.CheckButton(label='Capslock is Cmd')
self.rightmod = Gtk.CheckButton('AltGr on Right Cmd')
self.vsc2st3 = Gtk.CheckButton('ST3 hotkeys for VS Code')
self.caps2esc = Gtk.CheckButton('Capslock is Escape when tapped, Cmd when held')
self.caps2cmd = Gtk.CheckButton('Capslock is Cmd')
if rightmod_result == 0:
self.rightmod.set_active(True)
@@ -468,10 +446,7 @@ class Indicator():
global restartsvc
if restartsvc == True:
try:
if sysv:
restartcmd = ['sudo', '-E','/etc/init.d/kinto','restart']
else:
restartcmd = ['sudo', 'systemctl','restart','xkeysnail']
restartcmd = ['sudo', 'systemctl','restart','xkeysnail']
Popen(restartcmd)
restartsvc = False
@@ -580,12 +555,8 @@ class Indicator():
return
def runRestart(self,button):
global sysv
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()
time.sleep(1)
res = Popen(['pgrep','xkeysnail'])
@@ -596,20 +567,13 @@ class Indicator():
pkillxkey = Popen(['sudo', 'pkill','-f','bin/xkeysnail'])
pkillxkey.wait()
if sysv:
Popen(['sudo', '-E','/etc/init.d/kinto','start'])
else:
Popen(['sudo', 'systemctl','start','xkeysnail'])
Popen(['sudo', 'systemctl','start','xkeysnail'])
except:
Popen(['notify-send','Kinto: Error restarting Kinto!'])
def runStop(self,button):
global sysv
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()
time.sleep(1)
res = Popen(['pgrep','xkeysnail'])
@@ -625,9 +589,9 @@ class Indicator():
def runDebug(self,button,opendebug):
try:
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:
Popen(['/usr/bin/python3',os.environ['HOME']+'/.config/kinto/gui/kinto-gui.py'])
Popen([os.environ['HOME']+'/.config/kinto/gui/kinto-gui.py'])
except:
Popen(['notify-send','Kinto: Error opening Kinto!'])
@@ -725,10 +689,7 @@ class Indicator():
cmdsTerm = Popen(cmds)
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)
except CalledProcessError:

View File

View File

@@ -0,0 +1,14 @@
[Unit]
Description=xkeysnail
[Service]
Type=simple
KillMode=process
ExecStart=/usr/bin/sudo /bin/bash -c '/usr/bin/xhost +SI:localuser:root && {homedir}/.config/kinto/killdups.sh && {xkeysnail} --quiet --watch {homedir}/.config/kinto/kinto.py'
ExecStop=/usr/bin/sudo /bin/bash -c '/usr/bin/sudo pkill -f bin/xkeysnail && exit 0'
Restart=on-failure
RestartSec=3
Environment=DISPLAY={displayid}
[Install]
WantedBy=graphical.target

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# >/dev/null 2>&1
if [ -f /usr/local/bin/xkeysnail ];then

View File

@@ -1,19 +1,12 @@
#!/bin/bash
#!/usr/bin/env bash
# set about:config?filter=ui.key.menuAccessKeyFocuses
# to false for wordwise to work in Firefox
function pause(){
read -s -n 1 -p "Press any key to continue . . ."
echo ""
}
typeset -l distro
distro=$(awk -F= '$1=="NAME" { gsub("[\",!,_, ]","",$2);print $2 ;}' /etc/os-release)
typeset -l dename
dename=$(./linux/system-config/dename.sh | cut -d " " -f1)
sysv=$(pidof systemd >/dev/null 2>&1 && echo "1" || echo "0")
dename=$(./system-config/dename.sh | cut -d " " -f1)
function uninstall {
@@ -45,11 +38,7 @@ function uninstall {
mv ~/.config/kglobalshortcutsrc ~/.config/kglobalshortcutsrc.kinto
elif [ "$dename" == "xfce" ];then
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
fi
cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
fi
elif [ "$yn" == "r" ]; then
echo "Restore original user shortcuts"
@@ -88,12 +77,6 @@ function uninstall {
echo -e "\nWill still be restoring the overlay key"
echo -e "gsettings set org.gnome.mutter overlay-key 'super'\n"
gsettings set org.gnome.mutter overlay-key 'super'
# 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
}
@@ -140,14 +123,14 @@ function budgieUpdate {
if [ "$yn" == "y" ]; then
budgieVersion="$(/usr/bin/budgie-desktop --version | awk '{ print $2; }' | head -n1)"
if [ "$budgieVersion" == "10.5.1" ]; then
if ! [ -f ./linux/system-config/budgie-daemon_10.5.1 ]; then
wget https://github.com/rbreaves/budgie-desktop/blob/binaries/binaries/budgie-daemon_10.5.1?raw=true -O ./linux/system-config/budgie-daemon_10.5.1
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
wget https://github.com/rbreaves/budgie-desktop/blob/binaries/binaries/budgie-daemon_10.5.1?raw=true -O ./system-config/budgie-daemon_10.5.1
fi
bdmd5=$(md5sum /usr/bin/budgie-daemon | awk '{ print $1 }')
newbdmd5=$(md5sum ./linux/system-config/budgie-daemon_10.5.1 | awk '{ print $1 }')
newbdmd5=$(md5sum ./system-config/budgie-daemon_10.5.1 | awk '{ print $1 }')
if [ "$bdmd5" != "$newbdmd5" ]; then
cp /usr/bin/budgie-daemon ./budgie-daemon_"$budgieVersion".bak
sudo pkill budgie-daemon && sudo cp ./linux/system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
sudo pkill budgie-daemon && sudo cp ./system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
echo "Updated Budgie to use App Switching Patch"
else
echo "Budgie-daemon already patched, skipping replacement."
@@ -163,11 +146,11 @@ function budgieUpdate {
esac
done
if [ "$yn" == "y" ]; then
if ! [ -f ./linux/system-config/budgie-daemon_10.5.1 ]; then
wget https://github.com/rbreaves/budgie-desktop/raw/43d3b44243b0bcaee3262a79818024a651475b58/binaries/budgie-daemon_10.5.1 -O ./linux/system-config/budgie-daemon_10.5.1
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
wget https://github.com/rbreaves/budgie-desktop/raw/43d3b44243b0bcaee3262a79818024a651475b58/binaries/budgie-daemon_10.5.1 -O ./system-config/budgie-daemon_10.5.1
fi
cp /usr/bin/budgie-daemon ./budgie-daemon_"$budgieVersion".bak
sudo pkill budgie-daemon && sudo cp ./linux/system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
sudo pkill budgie-daemon && sudo cp ./system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
echo "Updated Budgie to use App Switching Patch"
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 /usr/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/graphical.target.wants/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 disable 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
if [ "$distro" == "manjarolinux" ]; then
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
pip3 install pillow
# 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.."
gsettings set org.gnome.mutter overlay-key ''
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
# if ls /etc/apt/sources.list.d/system76* 1> /dev/null 2>&1; then
@@ -305,21 +239,19 @@ fi
if [[ $distro == "elementaryos" ]]; then
gsettings set io.elementary.terminal.settings natural-copy-paste false
sudo ./linux/system-config/unipkg.sh libvte-2.91-dev
fi
if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then
if [ "$distro" == "manjarolinux" ]; then
sudo ./linux/system-config/unipkg.sh "xorg-xhost gcc"
sudo ./system-config/unipkg.sh "xorg-xhost gcc"
fi
fi
if [[ $dename == "kde" ]]; then
if [[ $distro == "manjarolinux" ]] || cat /etc/os-release | grep -E "^ID(_LIKE)?" | grep -q arch; then # Manjario or other arch-like distros: SteamOS3,HoloISO
sudo ./linux/system-config/unipkg.sh vte3
sudo ./linux/system-config/unipkg.sh python-pip
if [[ $distro == "manjarolinux" ]]; then
sudo ./system-config/unipkg.sh vte3
else
sudo ./linux/system-config/unipkg.sh libvte-2.91-dev
sudo ./system-config/unipkg.sh libvte-2.91-dev
fi
fi
if [[ $distro == 'kdeneon' ]]; then
@@ -330,7 +262,26 @@ if [[ $distro == 'kdeneon' ]]; then
kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &
fi
if [[ $distro == 'fedora' ]] || [[ $distro == 'fedoralinux' ]]; 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
gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d']"
else
@@ -373,43 +324,39 @@ expsh=" "
# sudo systemctl enable xkeysnail >/dev/null 2>&1
# if ! [ -x "$(command -v inotifywait)" ]; then
# 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 ./system-config/unipkg.sh inotify-tools
# 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
echo "Will need to install python3-pip..."
sudo ./linux/system-config/unipkg.sh python3-pip
if [ "$distro" == "freebsd" ]; then
sudo python3 -m ensurepip
else
echo "Will need to install python3-pip..."
sudo ./system-config/unipkg.sh python3-pip
fi
fi
if ! [ -x "$(command -v python3-config)" ]; then
if [ "$distro" == "ubuntu" ] || [ "${distro::6}" == "debian" ] || [ "$distro" == 'linuxmint' ]; then
pydev="python3-dev python3-tk"
elif [ "$distro" == "fedora" ] || [ "$distro" == "fedoralinux" ]; then
pydev="python3-devel python3-tkinter"
if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] || [ "$distro" == 'linuxmint' ]; then
pydev="python3-dev"
elif [ "$distro" == "fedora" ]; then
pydev="python3-devel"
fi
if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "$distro" == "fedoralinux" ] || [ "${distro::6}" == "debian" ] || [ "$distro" == 'linuxmint' ] ; then
if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "$distro" == "debian" ] || [ "$distro" == 'linuxmint' ]; then
echo "Will need to install $pydev..."
sudo ./linux/system-config/unipkg.sh "$pydev"
sudo ./system-config/unipkg.sh "$pydev"
fi
fi
# if [ "$distro" == "ubuntu" ] && [ "$dename" == "gnome" ];then
# sudo ./linux/system-config/unipkg.sh gnome-tweaks gnome-shell-extension-appindicator gir1.2-appindicator3-0.1
# sudo ./system-config/unipkg.sh gnome-tweaks gnome-shell-extension-appindicator gir1.2-appindicator3-0.1
# fi
if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then
if [ "$distro" == "\"manjaro linux\"" ]; then
sudo ./linux/system-config/unipkg.sh "xorg-xhost gcc"
sudo ./system-config/unipkg.sh "xorg-xhost gcc"
fi
fi
if [ "$distro" == 'linuxmint' ] ; then
if [ "$distro" == 'linuxmint' ]; then
pip3 install setuptools
elif [ "${distro::6}" == "debian" ]; then
sudo pip3 install setuptools wheel
fi
pip3 install pillow
# echo "Transferring files..."
mkdir -p ~/.config/kinto
@@ -420,153 +367,125 @@ mkdir -p ~/.config/kinto
# KDE startup - xhost fix
mkdir -p ~/.config/autostart
if [ ! "$sysv" -eq 0 ];then
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 ./xkeysnail-config/xkeysnail.desktop ~/.config/kinto/xkeysnail.desktop
# yes | cp -rf ./linux/xkeystart.sh ~/.config/kinto/xkeystart.sh
# yes | cp -rf ./xkeysnail-config/xkeystart.sh ~/.config/kinto/xkeystart.sh
# *** More testing needing, universal way of killing kinto on user log out? ***
# yes | sudo cp -rf linux/root_logoff.sh /usr/local/bin/logoff.sh
# yes | sudo cp -rf xkeysnail-config/root_logoff.sh /usr/local/bin/logoff.sh
# sudo chown root:root /usr/local/bin/logoff.sh
# sudo chmod u+rwx /usr/local/bin/logoff.sh
# sudo chmod go-w+rx /usr/local/bin/logoff.sh
# *** End universal killing of kinto
# 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 xkeysnail-config/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
elif [ -f "./dl_version" ]; then
cp ./dl_version ~/.config/kinto/version
echo "$(git describe --tag --abbrev=0 | head -n 1)" "build" "$(git rev-parse --short HEAD)" > ~/.config/kinto/version
yes | cp -rf ./xkeysnail-config/kinto.py ./xkeysnail-config/kinto.py.new
yes | cp -rf ./xkeysnail-config/limitedadmins ./xkeysnail-config/limitedadmins.new
yes | cp -rf ./xkeysnail-config/gui/ ~/.config/kinto/gui
yes | cp -nrf ./xkeysnail-config/initkb ~/.config/kinto/initkb
yes | cp -rf ./xkeysnail-config/killdups.sh ~/.config/kinto/killdups.sh
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/kintotray.py ~/.config/kinto/kintotray.py
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/kintotray.desktop ~/.config/kinto/kintotray.desktop
yes | cp -rf ./xkeysnail-config/gui/kinto.desktop ./xkeysnail-config/gui/kinto.desktop.new
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/icons/kinto-color-16.svg ~/.config/kinto/kinto-color.svg
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/icons/kinto-color-16.svg ~/.config/kinto/kinto-color-48.svg
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/icons/kinto-invert-16.svg ~/.config/kinto/kinto-invert.svg
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/icons/kinto-solid-16.svg ~/.config/kinto/kinto-solid.svg
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/icons/kinto.svg ~/.config/kinto/kinto.svg
# yes | cp -rf ./system-config/caret_status_xkey.sh ~/.config/kinto/caret_status_xkey.sh
yes | cp -rf ./xkeysnail-config/xkeysnail.service ./xkeysnail-config/xkeysnail.service.new
# yes | cp -rf ./xkeysnail-config/xkeysnail.timer ~/.config/systemd/user/xkeysnail.timer
sed -i "s#{experimental-caret}#$exp#g" ./xkeysnail-config/xkeysnail.service.new
if [ "$expsh" != " " ];then
sed -i "s#{kill-caret}#/usr/bin/pkill -f $expsh#g" ./xkeysnail-config/xkeysnail.service.new
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/gui/ ~/.config/kinto/
yes | cp -nrf ./linux/initkb ~/.config/kinto/initkb
yes | cp -rf ./linux/killdups.sh ~/.config/kinto/killdups.sh
yes | cp -rf ./linux/trayapps/appindicator/kintotray.py ~/.config/kinto/kintotray.py
yes | cp -rf ./linux/trayapps/appindicator/kintotray.desktop ~/.config/kinto/kintotray.desktop
yes | cp -rf ./linux/gui/kinto.desktop ./linux/gui/kinto.desktop.new
yes | cp -rf ./linux/trayapps/appindicator/icons/kinto-color-16.svg ~/.config/kinto/kinto-color.svg
yes | cp -rf ./linux/trayapps/appindicator/icons/kinto-color-16.svg ~/.config/kinto/kinto-color-48.svg
yes | cp -rf ./linux/trayapps/appindicator/icons/kinto-invert-16.svg ~/.config/kinto/kinto-invert.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/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.timer ~/.config/systemd/user/xkeysnail.timer
sed -i "s#{experimental-caret}#$exp#g" ./linux/xkeysnail.service.new
if [ "$expsh" != " " ];then
sed -i "s#{kill-caret}#/usr/bin/pkill -f $expsh#g" ./linux/xkeysnail.service.new
else
sed -i "s#{kill-caret}#$expsh#g" ./linux/xkeysnail.service.new
fi
sed -i "s/{username}/`whoami`/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..."
sed -i "s#{kill-caret}#$expsh#g" ./xkeysnail-config/xkeysnail.service.new
fi
sed -i "s/{username}/`whoami`/g" ./xkeysnail-config/xkeysnail.service.new
sed -i "s#{homedir}#`echo "$HOME"`#g" ./xkeysnail-config/xkeysnail.service.new
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" ./linux/gui/kinto.desktop.new
sudo mv ./linux/gui/kinto.desktop.new /usr/share/applications/kinto.desktop
sed -i "s#{homedir}#`echo "$HOME"`#g" ./xkeysnail-config/gui/kinto.desktop.new
sudo mv ./xkeysnail-config/gui/kinto.desktop.new /usr/share/applications/kinto.desktop
sed -i "s#{xhost}#`\\which xhost`#g" ./xkeysnail-config/xkeysnail.service.new
sed -i "s/{username}/`whoami`/g" ./xkeysnail-config/limitedadmins.new
sed -i "s#{systemctl}#`\\which systemctl`#g" ./xkeysnail-config/limitedadmins.new
sed -i "s#{pkill}#`\\which pkill`#g" ./xkeysnail-config/limitedadmins.new
sed -i "s#{systemctl}#`\\which systemctl`#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/prexk.sh
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ./xkeysnail-config/xkeysnail.service.new
# sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/kinto/prexk.sh
if [[ $dename == "budgie" ]]; then
perl -pi -e "s/\s{4}(# )(K.*)(# Default SL - Change workspace.*budgie.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
perl -pi -e "s/\s{4}(# )(K.*)(# Default SL - Change workspace.*budgie.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
fi
if [[ $distro == "popos" ]]; then
perl -pi -e "\s{4}(# )(K.*)(# SL - .*popos.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
perl -pi -e "\s{4}(# )(K.*)(# SL - .*popos.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
fi
if [[ $distro == 'fedora' ]] || [[ $distro == 'fedoralinux' ]]; then
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
if [[ $distro == "fedora" ]]; then
perl -pi -e "\s{4}(# )(K.*)(# SL - .*fedora.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
fi
if [[ $distro == "elementaryos" ]]; then
perl -pi -e "\s{4}(# )(K.*)(# SL - .*eos.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
perl -pi -e "\s{4}(# )(K.*)(# SL - .*eos.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
fi
if [[ "$distro" == "manjaro"* ]]; then
perl -pi -e "\s{4}(# )(K.*)(# SL - .*manjaro.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
perl -pi -e "\s{4}(# )(K.*)(# SL - .*manjaro.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
fi
if [[ $dename == "gnome" ]]; then
perl -pi -e "\s{4}(# )(K.*)(# SL - .*ubuntu.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
perl -pi -e "\s{4}(# )(K.*)(# SL - .*ubuntu.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
fi
if [[ $dename == "kde" ]]; then
echo "Applying Cmd-Space to open App Launcher for KDE..."
perl -pi -e "s/(# )(.*)(#.*kde)/\$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
perl -pi -e "s/(# )(.*)(#.*kde)/\$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
fi
if [[ $dename == "xfce" ]]; then
perl -pi -e "\s{4}(# )(K.*)(# SL - .*xfce.*)/ \$2\$3/g" ./linux/kinto.py.new >/dev/null 2>&1
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./linux/kinto.py.new
perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./linux/kinto.py.new
perl -pi -e "\s{4}(# )(K.*)(# SL - .*xfce.*)/ \$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
fi
if [[ $dename == "xfce" ]] && ls /etc/apt/sources.list.d/enso* 1> /dev/null 2>&1; then
echo "enso OS detected, applying Cmd-Space for Launchy..."
perl -pi -e "s/(K\(\"RC-Space)(.*)(# )(xfce4)/\$3\$1\$2\$3\$4/g" ./linux/kinto.py.new >/dev/null 2>&1
perl -pi -e "s/(K\(\"RC-Space)(.*)(# )(xfce4)/\$3\$1\$2\$3\$4/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary>space" --create --type string --set "launchy"
fi
if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
mv ./linux/kinto.py.new ~/.config/kinto/kinto.py
mv ./xkeysnail-config/kinto.py.new ~/.config/kinto/kinto.py
# if [ "$distro" == "fedora" ];then
if [ ! "$sysv" -eq 0 ];then
# echo "Using systemd..."
sudo rm /etc/systemd/system/xkeysnail.service >/dev/null 2>&1
else
# echo "Using sysvinit..."
echo ""
fi
sudo rm /etc/systemd/system/xkeysnail.service >/dev/null 2>&1
if [ -d /usr/lib/systemd/system ];then
xkeypath="/usr/lib/systemd/system/"
elif [ -d /lib/systemd/system ];then
xkeypath="/lib/systemd/system/"
fi
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
git pull --depth 10
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
giturl=$(git ls-remote --get-url)
if [ "$giturl" != "https://github.com/rbreaves/xkeysnail.git" ];then
echo -e "\nreplacing xkeysnail with fork...\n"
cd ..
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
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
fi
sudo pip3 install --upgrade . --break-system-packages
sudo pip3 install --upgrade .
cd ..
which xkeysnail
if [ $? -eq 1 ]; then
@@ -575,42 +494,19 @@ if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
echo -e "Run 'sudo pip3 install --upgrade .' to debug issue"
exit 0
fi
sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./linux/limitedadmins.new
if [[ $distro == 'fedora' ]] || [[ $distro == 'fedoralinux' ]]; then
echo "Changing SELinux context"
sudo chcon -v --user=$selinuxuser --type=$selinuxtype "$xkeypath"xkeysnail.service
fi
sudo chown root:root ./linux/limitedadmins.new
sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./xkeysnail-config/xkeysnail.service.new
sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./xkeysnail-config/limitedadmins.new
sudo mv ./xkeysnail-config/xkeysnail.service.new "$xkeypath"xkeysnail.service && echo "Service file added to "$xkeypath"xkeysnail.service"
sudo chown root:root ./xkeysnail-config/limitedadmins.new
# Add a check here for xkeysnail path resolving
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' ]] || [[ $distro == 'fedoralinux' ]]; 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 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/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 disable 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 mv ./xkeysnail-config/limitedadmins.new /etc/sudoers.d/limitedadmins
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 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 systemctl daemon-reload
sudo systemctl disable xkeysnail
sudo systemctl stop xkeysnail
# sudo systemctl --state=not-found --all | grep xkeysnail
# if [ "$distro" == "fedora" ];then
# systemctl enable xkeysnail.service
@@ -618,9 +514,8 @@ if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
# sudo systemctl enable xkeysnail.service
# fi
# sudo systemctl restart xkeysnail
sudo pkill -f kintotray &
# >/dev/null 2>&1
if [[ $dename == "kde" ]];then
sudo pkill -f kintotray >/dev/null 2>&1
if [[ $dename == "gnome" || $dename == "kde" ]];then
sed -i "s/systray = true/systray = false/g" ~/.config/kinto/initkb
fi
nohup python3 ~/.config/kinto/gui/kinto-gui.py >/dev/null 2>&1 &
@@ -651,24 +546,6 @@ if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
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 "\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
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"