Compare commits

...

87 Commits

Author SHA1 Message Date
Ben Reaves
39ed3c83f9 Merge pull request #574 from rbreaves/hotfix
Add Waterfox to browsers & Hyper-V to remote exclusions
2021-10-24 13:30:11 -05:00
Ben Reaves
bf35285914 Added Hyper-V VMs to remote exclusions group 2021-10-24 13:28:44 -05:00
Ben Reaves
7a3d9cbd7c Added waterfox to browsers on Linux 2021-10-24 13:22:20 -05:00
Ben Reaves
2a920d0622 Merge pull request #568 from lydell/patch-1
Add support for Firefox Developer Edition
2021-09-13 01:12:07 -05:00
Simon Lydell
253b061b12 Add support for Firefox Developer Edition
I made this change `~/.config/kinto/kinto.py` and restarted the service. Then cmd-option-left/right worked in Firefox Developer Edition as well – https://github.com/rbreaves/kinto/issues/535#issuecomment-917612176

I’m quite new to Kinto so I’m not 100% sure this is the correct fix, but it seems to work.

Thanks for Kinto btw! It’s awesome.
2021-09-12 13:05:34 +02:00
Ben Reaves
c8a28fe3e0 Merge pull request #490 from RedBearAK/patch-21
Open Firefox private window with Ctrl+Shift+N
2021-09-07 23:19:45 -05:00
Ben Reaves
9f5ba6e14e Open Firefox private window - Windows 2021-09-07 23:19:12 -05:00
Ben Reaves
f855da301c Merge pull request #500 from RedBearAK/patch-23
Toggle maximized window state shortcut (KDE Neon)
2021-09-07 23:13:47 -05:00
Ben Reaves
4e33e5516b Merge pull request #536 from RedBearAK/patch-30
Add Cmd+Opt+Left/Right and Cmd+Shift+Braces for browser tab navigation
2021-09-07 23:11:38 -05:00
Ben Reaves
5c25cd15cb Updated browser tab switching for Windows parity 2021-09-07 23:10:42 -05:00
Ben Reaves
af4b4ea08e Merge pull request #541 from RedBearAK/patch-29
Add Cmd+Shift+Braces for tab navigation in file managers
2021-09-07 22:39:26 -05:00
Ben Reaves
e69e529a18 Move lines properly in Editors. Closes #481
Fixes issue in VSCode with moving lines on Alt-Up/Down
2021-07-27 13:42:28 -05:00
Ben Reaves
f717db9aaa Update README.md 2021-07-14 22:05:27 -05:00
Ben Reaves
353c2c6bb4 Update README.md 2021-07-14 22:04:21 -05:00
Ben Reaves
dcbf1e8382 Added Remmina name variation for Ubuntu 18.04, improves remote access functionality 2021-07-05 00:26:36 -05:00
Ben Reaves
9a52bd864a Merge pull request #542 from rbreaves/make_intall_on_fedora_work_in_enforcing_mode
Make intall on fedora work in enforcing mode
2021-07-04 00:22:27 -05:00
Ben Reaves
9b87fda382 Merge branch 'master' into make_intall_on_fedora_work_in_enforcing_mode 2021-07-04 00:10:05 -05:00
RedBearAK
b3fc4c9202 Minor formatting fix 2021-07-01 03:09:11 -08:00
RedBearAK
4858b9cf28 Add Cmd+Shift+Braces for tab navigation in file managers
This adds Cmd+Shift+Braces as an option for tab navigation in most Linux file managers. Also fixes the standard tab navigation shortcuts (Ctrl+PgUp/PgDn) to work in SpaceFM. 

This shortcut works in Finder on macOS. 

Tested this code in: 

Caja
Dolphin
Nautilus
Nemo
PCManFM[-Qt]
SpaceFM (default is Ctrl+Tab/Ctrl+Shift+Tab, now remapping from Ctrl+PgUp/PgDn)
Thunar
2021-07-01 03:04:16 -08:00
RedBearAK
45ad4f3f68 Adding Cmd+Shift+Braces for tab navigation 2021-07-01 02:18:10 -08:00
Ben Reaves
e54dba20a1 Merge pull request #540 from rbreaves/chrome-fix
Fix for toggling between Chrome/IBM/Windows/Mac on Windows
2021-06-30 00:58:58 -05:00
Ben Reaves
56cae8a009 Fixed chrome/IBM setup issues on Windows 2021-06-30 00:54:20 -05:00
Ben Reaves
e7dd3684c2 Fixed syntax issue and regex formulas for chrome/ibm on Windows 2021-06-29 20:38:12 -05:00
Ben Reaves
982cdcb92a Fixes Chrome/IBM layout issue on Windows 2021-06-29 20:23:45 -05:00
Ben Reaves
829289ba78 Merge branch 'hotfix' 2021-06-29 00:27:54 -05:00
Ben Reaves
b8793cff49 Added missing Go to shortcut for Sublime & VSCode for Windows 2021-06-29 00:26:28 -05:00
Ben Reaves
8b522461a5 Update README.md 2021-06-27 23:57:44 -05:00
RedBearAK
1f4b2bb451 Add Cmd+Opt+Left/Right for browser tab navigation
Adding mapping to enable Cmd+Opt+Left/Right to supplement Ctrl+PgUp/PgDn for browser tab navigation. 

Shortcut is verified by testing to work on Firefox, Google Chrome and Opera in macOS, so it should be suitable for inclusion in Kinto. 

Included are some line changes from PR #487, which should close that PR if this is merged.
2021-06-27 17:03:35 -08:00
Ben Reaves
04bc3f60e4 Merge branch 'hotfix' 2021-06-05 02:37:51 -05:00
Ben Reaves
8ffd3159c8 Allowing system tray to be enabled on Gnome by default 2021-06-05 02:37:34 -05:00
Ben Reaves
b19b0bea4b Merge pull request #527 from RedBearAK/patch-28
Make window maximize toggle shortcut work in terminals too
2021-06-03 22:45:49 -05:00
RedBearAK
07bee26ddb Make window maximize toggle shortcut work in terminals too
No Super key in terminals, so "maximize" toggle shortcut from GUI block needs to be modified for the terminals block.
2021-06-03 19:36:13 -08:00
Ben Reaves
6dc97a5628 Merge pull request #526 from RedBearAK/patch-27
Fix zoom in/out (font size) shortcuts in terminals
2021-06-03 22:01:42 -05:00
RedBearAK
59e47dbbd6 Fix zoom in/out (font size) shortcuts in terminals
On macOS the terminal, like a web browser, lets you "zoom" in and out with Cmd+Equal and Cmd+Minus. It doesn't force you to type Cmd+Shift+Equal to get to the "Plus" keycode on the Equal key. On Linux of course, terminals want you to use Ctrl+Shift+Equal (Plus) to zoom in (increase font size) and then Ctrl+Minus without the Shift key to decrease the font size (zoom out). This is very awkward. 

Mapping RC-Minus to C-Minus in the termStr block instead of to C-Shift-Minus lets the user zoom in and out in terminals by just pressing the equivalent of Cmd-(Equal/Minus) keys, without ever worrying about the Shift key. Same as terminals in macOS, and GUI web browsers. 

Since this is probably just one of the keys that was blanket remapped from RC to C-Shift, I don't know of any reason this should be harmful.
2021-06-03 17:42:30 -08:00
Ben Reaves
e6d0512ff4 Update README.md 2021-06-02 18:54:28 -05:00
Ben Reaves
6587a149ce Merge branch 'hotfix' 2021-06-01 21:03:20 -05:00
Ben Reaves
f80a1d616d Reconfigured media keys for Windows w/o mapping over the delete key 2021-06-01 21:02:56 -05:00
Ben Reaves
c391b6abf8 Update README.md 2021-06-01 16:05:24 -05:00
Ben Reaves
f6d57eae4c Update README.md 2021-06-01 16:04:33 -05:00
Ben Reaves
06531dd6cc Update README.md 2021-05-31 12:53:23 -05:00
Ben Reaves
4c2a4993ef Merge branch 'hotfix' 2021-05-28 10:54:42 -05:00
Ben Reaves
572739360e Added NoMachine for Windows => Linux 2021-05-28 10:53:54 -05:00
Ben Reaves
d87802918d Merge pull request #521 from rbreaves/hotfix
Added TERM env fix to remove garbage in syslog. Closes #515
2021-05-27 19:07:12 -05:00
Ben Reaves
e5b2ef8155 Added TERM env fix to remove garbage in syslog. Closes #515 2021-05-27 18:59:36 -05:00
Ben Reaves
7149b4ab24 Merge pull request #519 from rbreaves/hotfix
Closes #518, regex now matches whole wm_class names only & Commented media keys for Windows
2021-05-24 21:01:09 -05:00
Ben Reaves
db61f2d937 Closes #518. Joining wm_class names into regex updated to be whole matches only 2021-05-24 20:59:06 -05:00
Ben Reaves
19aefd68e0 Added commented out media keys for Windows 2021-05-24 18:57:13 -05:00
Ben Reaves
9fb72c95b1 Renamed virtm group to remotes, added msrdc 2021-05-18 17:27:46 -05:00
Ben Reaves
ec8b0fdc22 Merge pull request #514 from RedBearAK/patch-26
Add qemu-system- WM_CLASS variants to remotes list
2021-05-13 09:35:38 -05:00
RedBearAK
1e98cfc29d Add qemu-system- WM_CLASS variants to remotes list
Adding a regex for variants of `qemu-system-.*` to remotes list to bypass Kinto mapping. This is working for me. 

Variants I've seen on my system: 
`qemu-system-i386`
`qemu-system-x86_64`

A snap package called Sosumi operates as a QEMU/KVM front end, and caused a problem because it wanted to see Control_L+Alt_L+G to let go of mouse and keyboard. This solves that problem.
2021-05-13 00:08:34 -08:00
Ben Reaves
e92bc37308 Merge pull request #513 from RedBearAK/patch-26
Add Virt-manager to remotes WM_CLASS list, alphabetize list
2021-05-12 19:57:01 -05:00
RedBearAK
14021fbf67 Add Virt-manager to remotes WM_CLASS list, alphabetize list
Just adding "Virt-manager" WM_CLASS and re-ordering `remotes` alphabetically to conform to other lists.
2021-05-12 16:26:06 -08:00
Ben Reaves
1562096889 Merge pull request #510 from RedBearAK/patch-25
Add Station terminal WM_CLASS to terminals list
2021-05-11 15:23:29 -05:00
RedBearAK
c84d13118a Add Station terminal WM_CLASS to terminals list
Nitrux Linux default terminal is called Station, with WM_CLASS name "station".
2021-05-11 12:14:57 -08:00
Ben Reaves
bec547bbda Merge pull request #509 from rakin406/add-rakin-fork
Add more terminal emulators
2021-05-11 13:28:13 -05:00
rakin406
724006ef3a Add more terminal emulators 2021-05-11 20:02:17 +06:00
Ben Reaves
ef60bf8a59 Fixed broken system tray for linux 1.2-9 2021-05-07 10:46:13 -05:00
Ben Reaves
44080c25da Update README.md 2021-05-05 21:26:45 -05:00
Ben Reaves
6fa6d05123 Update README.md 2021-05-05 21:24:08 -05:00
Ben Reaves
1d1971f7cc Merge pull request #498 from rbreaves/dev
Add support for sysvinit & mxlinux w/ xfce
2021-05-05 21:16:29 -05:00
Ben Reaves
eb113125b5 Corrected the killing of xkeysnail under sysvinit 2021-05-05 21:11:30 -05:00
Ben Reaves
c298bd2b5a Fixes Cmd-Grave for In-App switching 2021-05-05 06:55:42 -05:00
Ben Reaves
e1f1907e46 Reverted adding back of Super for now, fixed Ctrl-Tab for xfce4 2021-05-05 06:17:06 -05:00
Ben Reaves
5d1b1d6598 XFCE super key install conflict resolved. Improved launcher detection/remapping. 2021-05-05 05:30:59 -05:00
Ben Reaves
7375dd78bf Updated hotkeys for xfce4 2021-05-05 01:43:06 -05:00
Ben Reaves
e4540afcb5 Update README.md 2021-05-05 00:30:40 -05:00
Ben Reaves
2490417b85 Updated linux.sh install file to accept use wget or curl 2021-05-05 00:22:00 -05:00
Ben Reaves
9a3521d05c Added missing sysvinit file copy 2021-05-04 23:58:09 -05:00
RedBearAK
9a5b44661c Toggle maximized window state shortcut (KDE Neon)
Putting this in as disabled. It will need some logic in the installer to enable it if Neon is detected, and disable the `(gnome/kde)` line above it. But at least it will be there already, to be manually enabled if necessary. 

See issue #477 for discussion.
2021-05-04 20:26:39 -08:00
Ben Reaves
32fba15d75 Aligning systray w/ GUI app for sysv detection 2021-05-04 18:19:46 -05:00
Ben Reaves
23e2f7018b Merge pull request #495 from rbreaves/feature/mxlinux
Adding support for sysvinit & mxlinux w/ xfce
2021-05-04 18:07:43 -05:00
Ben Reaves
eeb5cc9ecb Quieted most warnings & updated gtk methods 2021-05-04 17:17:26 -05:00
Ben Reaves
4a65034713 Adding support for sysvinit for mxlinux w/ xfce 2021-05-04 16:10:03 -05:00
Ben Reaves
3418e6bf3f Update README.md 2021-05-02 16:59:11 -05:00
Ben Reaves
dbd614783f Update README.md 2021-05-02 05:09:38 -05:00
RedBearAK
d19e5836a5 Open Firefox private window with Ctrl+Shift+N
Safari and Chrome/Chromium use Ctrl+Shift+N to open private/incognito windows. Firefox for some reason wants to use Ctrl+Shift+P. This makes Firefox respond to Ctrl+Shift+N the same way as Safari and the Chromes. Ctrl+Shift+P of course still works also. 

No pre-existing action for Ctrl+Shift+N seems to exist in the current Firefox version. So no known conflict.
2021-04-28 17:40:08 -08:00
Ben Reaves
cf15be6414 Merge pull request #479 from RedBearAK/patch-17
Add GNOME Boxes WM_CLASS for Linux, and a comma
2021-04-13 18:28:35 -05:00
RedBearAK
87dae12d9b Add GNOME Boxes WM_CLASS for Linux, and a comma
Note: I'm trying to consistently leave a comma after the last item in each vertically formatted python list, so that when someone with less python knowledge wants to add something to the list and does it the "lazy way" by just copying the last line, pasting it on the end and editing it to add a new item, they won't cause the "missing comma" python error too easily. Having a comma on the very end of the list with no element after it doesn't seem to cause any harm or python errors. And you can copy/paste the last item as many times as you want without getting into trouble.
2021-04-12 23:40:36 -08:00
Ben Reaves
3b5c35f806 Merge pull request #476 from rbreaves/feature/virtualbox
Added Virtualbox host exception for Linux
2021-04-10 02:14:24 -05:00
Ben Reaves
cf72e880d5 Added Virtualbox host exception for Linux 2021-04-10 02:13:23 -05:00
Ben Reaves
0bcdb8c9b2 Merge pull request #471 from rbreaves/feature/KI-469-File-Managers-Followup
Feature/ki 469 file managers followup
2021-04-07 03:07:13 -05:00
Ben Reaves
e71fa554d3 KI-469 Aligned comments 2021-04-07 03:06:18 -05:00
RedBearAK
2ff2b4c082 Tabs to spaces 2021-04-06 23:31:35 -08:00
RedBearAK
2b83e34c3f Fix comment alignment (two more spaces if line is disabled) 2021-04-06 23:23:16 -08:00
RedBearAK
9af4d29bbf Add PCManFM-Qt to PCManFM override, Fix typos, clarify Dolphin
Just doing some sweeping up and prettifying. Main thing is adding the PCManFM fork, PCManFM-Qt to the overrides block for PCManFM. Working on the Nautilus variant reminded me.
2021-04-06 21:59:59 -08:00
Johannes von Bargen
5e28015a31 remove extra space 2021-03-31 01:22:58 +02:00
Johannes von Bargen
3a59edb51e make the installation run on fedora
* in enforcing mode
* without sudo in the unit file
2021-03-31 01:16:57 +02:00
12 changed files with 624 additions and 286 deletions

View File

@@ -13,6 +13,10 @@ v1.2 Release - Kinto now includes a system tray and simple wizard to setup the i
Kinto is powered by [xkeysnail](https://github.com/mooz/xkeysnail) for Linux & by [Autohotkey](https://github.com/Lexikos/AutoHotkey_L) for Windows 10.
Note: If you plan to remote into Linux via VNC, xRDP, Synergy or other remote desktop solutions then remove the current release & try an earlier [v1.0.7-3](https://github.com/rbreaves/kinto/releases/tag/1.0.7-3) release. It uses xkb so it'll work with virtual xinput devices. Some v1.1-x releases may offer both, but all v1.2.x releases ended support for xkb. I do plan to bring offical support back for virtual input devices.
Additionally VMware, Virtualbox, KVM and other virtualization technologies work best with the current release - so *this note only applies to remote desktop into Linux* - not virtualization.
### [Table of Contents ](#Table-of-Contents)
## Donations
@@ -36,12 +40,12 @@ Video Tutorial: [Install Kinto.sh for Linux in less than a minute](https://www.y
Paste the following into your Terminal
```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/rbreaves/kinto/HEAD/install/linux.sh)"
/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 <( curl https://raw.githubusercontent.com/rbreaves/kinto/HEAD/install/linux.sh ) -r
/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
@@ -76,7 +80,7 @@ Try toggling numlock on & off (clear key on official mac keyboards). If it still
If you want a global menu app similar to what mac users have then I strongly recommend Ubuntu Budgie as it has the Vala Appmenu built in and ready for activation. Short of that Vala-AppMenu can be installed in various distros, mileage will vary. If you try to activate it in the latest 20.xx releases with XFCE then you may need to run the following commands.
```
sudo apt install xfce4-appmenu-plugin vala-panel-appmenu-common
sudo apt install xfce4-appmenu-plugin vala-panel-appmenu-common appmenu-gtk2-module appmenu-gtk3-module appmenu-gtk-module-common
xfconf-query -c xsettings -p /Gtk/Modules -n -t string -s "appmenu-gtk-module"
```
@@ -140,6 +144,7 @@ RDP fully works as long as the entire keyboard input is being captured. RDP had
|Program|Src/Remote Client ⇒|Dst/Remote Server|Works? |Notes|
|---|---|---|---|---|
|Official MS RDP (mstsc.exe)| ❖Windows ⇒| 🐧Linux | ✅ Yes| Note: [v1.0.7-3 Only](https://github.com/rbreaves/kinto/releases/tag/1.0.7-3). Should work for xRDP/VNC and other remote server protocols. |
|Official MS RDP (mstsc.exe)| ❖Windows ⇒| ❖Windows | ✅ Yes| |
|Official MS RDP| 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"|
@@ -152,6 +157,10 @@ RDP fully works as long as the entire keyboard input is being captured. RDP had
|Royal TSX Client| 🍎macOS⇒| ❖Windows | ❌ No|Initial Cmd key press not being passed|
|Official MS RDP| 🍎🤖iOS/Android⇒| ❖Windows | ❌ No|No workaround atm|
## How to Remap Windows keyboards for remote access to macOS
Quick summary - Swap Alt & Win to conform with Apple keyboard layouts. Sharpkeys for Windows, Setkeycodes for Linux, then install Kinto.sh or change/update the Keyboard Type to Apple in the system tray.
https://benreaves.medium.com/macos-to-linux-back-again-c6151200f4dc
## FreeRDP for macOS
1. Install [brew.sh](https://brew.sh).
@@ -252,7 +261,7 @@ Additionally, if you are using a cross-platform app and if it happens to have a
## What does Kinto require?
- Python
- systemd
- systemd or sysvinit
- x11
- xkeysnail
@@ -310,10 +319,16 @@ In the above example I am also showing that you can define a single shortcut to
You can also make changes to the file in your /tmp/kinto/xkeysnail/kinto.py location and see them take affect in real time, but for your changes to be permanent you will need to make your changes in the ~/.config/kinto/kinto.py location & restart the xkeysnail service.
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)
@@ -375,25 +390,53 @@ 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?

View File

@@ -2,11 +2,11 @@
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/rbreaves/kinto/master/install/linux.sh)"
curl https://github.com/rbreaves/kinto/archive/refs/heads/master.zip -J -L -o ~/Downloads/kinto.zip
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=`curl -s https://api.github.com/repos/rbreaves/kinto/releases/latest | awk -F'tag_name": ' '{if ($2) print $2}' | tr -d \",`
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}

View File

@@ -1,6 +1,8 @@
#!/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
@@ -48,13 +50,21 @@ class MyWindow(Gtk.Window):
page = 1
label = Gtk.Label()
label.set_alignment(1, 0)
label.set_halign(Gtk.Align.END)
ostype = os.environ.get('XDG_CURRENT_DESKTOP')
global openWin
openWin = False
global child_pid
kinto_status = Popen("while :; do clear; systemctl is-active xkeysnail; sleep 2; done", stdout=PIPE, shell=True)
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)
child_pid = kinto_status.pid
winkb = Gtk.RadioMenuItem(label='Windows')
@@ -114,9 +124,15 @@ class MyWindow(Gtk.Window):
None,
)
if self.args.debug:
self.command = 'sudo systemctl stop xkeysnail && sudo pkill -f bin/xkeysnail && sudo xkeysnail ~/.config/kinto/kinto.py\n'
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'
else:
self.command = "journalctl -f --unit=xkeysnail.service -b\n"
if sysv:
self.command = "tail -f /tmp/kinto.log\n"
else:
self.command = "journalctl -f --unit=xkeysnail.service -b\n"
self.InputToTerm(self.command)
@@ -181,19 +197,19 @@ class MyWindow(Gtk.Window):
menubar.append(menuitem_edit)
submenu_edit = Gtk.Menu()
menuitem_edit.set_submenu(submenu_edit)
edititem_tweaks = Gtk.MenuItem("Tweaks")
edititem_tweaks = Gtk.MenuItem(label="Tweaks")
edititem_tweaks.connect('activate',self.setTweaks)
submenu_edit.append(edititem_tweaks)
edititem_config = Gtk.MenuItem("Kinto Config (shortcuts)")
edititem_config = Gtk.MenuItem(label="Kinto Config (shortcuts)")
edititem_config.connect('activate',self.setConfig)
submenu_edit.append(edititem_config)
edititem_service = Gtk.MenuItem("Kinto Service")
edititem_service = Gtk.MenuItem(label="Kinto Service")
edititem_service.connect('activate',self.setService)
submenu_edit.append(edititem_service)
edititem_shortcuts = Gtk.MenuItem("System Shortcuts")
edititem_shortcuts = Gtk.MenuItem(label="System Shortcuts")
edititem_shortcuts.connect('activate',self.setSysKB)
submenu_edit.append(edititem_shortcuts)
edititem_language = Gtk.MenuItem("Change Language")
edititem_language = Gtk.MenuItem(label="Change Language")
edititem_language.connect('activate',self.setRegion)
submenu_edit.append(edititem_language)
@@ -207,11 +223,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("Support")
helpitem_support = Gtk.MenuItem(label="Support")
helpitem_support.connect('activate',self.openSupport)
submenu_help.append(helpitem_support)
menuitem_help.set_submenu(submenu_help)
helpitem_about = Gtk.MenuItem("About")
helpitem_about = Gtk.MenuItem(label="About")
helpitem_about.connect('activate',self.runAbout)
submenu_help.append(helpitem_about)
@@ -343,7 +359,6 @@ class MyWindow(Gtk.Window):
self.menuitem_systray.signal_id = self.menuitem_systray.connect('activate',self.checkTray,False)
restartsvc = True
def initSetup(self):
global win,openWin,restartsvc
@@ -420,21 +435,20 @@ 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_alignment(0, 1)
self.bgsuccess4.set_valign(Gtk.Align.END)
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_alignment(0, 1)
self.bguninstall.set_valign(Gtk.Align.END)
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_alignment(0, 1)
self.background.set_valign(Gtk.Align.END)
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_alignment(0, 1)
self.bgspace.set_valign(Gtk.Align.END)
self.overlay.add(self.background)
self.overlay.add_overlay(self.container)
self.setupwin.add(self.container)
@@ -456,7 +470,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
@@ -517,7 +531,10 @@ class MyWindow(Gtk.Window):
return
def runDebug(self,button):
command = 'send \003 sudo systemctl stop xkeysnail && sudo pkill -f bin/xkeysnail && sudo xkeysnail ~/.config/kinto/kinto.py\n'
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'
self.InputToTerm(command)
def openSupport(self,button):
@@ -610,7 +627,10 @@ class MyWindow(Gtk.Window):
self.queryConfig(killspawn)
time.sleep(1)
global child_pid
self.kinto_status = Popen("while :; do clear; systemctl is-active xkeysnail; sleep 2; done", stdout=PIPE, shell=True)
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)
child_pid = self.kinto_status.pid
self.menuitem_systray.disconnect(self.menuitem_systray.signal_id)
self.menuitem_systray.set_active(False)
@@ -618,6 +638,7 @@ 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'
@@ -654,7 +675,10 @@ 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'
restart = ['sudo', 'systemctl','restart','xkeysnail']
if sysv:
restart = ['sudo', '-E','/etc/init.d/kinto','restart']
else:
restart = ['sudo', 'systemctl','restart','xkeysnail']
cmds = ['perl','-pi','-e',setkb,self.kconfig]
cmdsTerm = Popen(cmds)
@@ -746,11 +770,14 @@ class MyWindow(Gtk.Window):
}
def on_delete_event(event, self, widget):
global restartsvc, openWin
global restartsvc, openWin, sysv
if restartsvc == True:
try:
restartcmd = ['sudo', 'systemctl','restart','xkeysnail']
if sysv:
restartcmd = ['sudo', '-E','/etc/init.d/kinto','restart']
else:
restartcmd = ['sudo', 'systemctl','restart','xkeysnail']
Popen(restartcmd)
restartsvc = False
@@ -870,8 +897,12 @@ class MyWindow(Gtk.Window):
return
def runRestart(self,button):
global sysv
try:
stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
if sysv:
stop = Popen(['sudo', '-E','/etc/init.d/kinto','stop'])
else:
stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
stop.wait()
time.sleep(1)
res = Popen(['pgrep','xkeysnail'])
@@ -880,15 +911,23 @@ class MyWindow(Gtk.Window):
if res.returncode == 0:
pkillxkey = Popen(['sudo', 'pkill','-f','bin/xkeysnail'])
pkillxkey.wait()
Popen(['sudo', 'systemctl','start','xkeysnail'])
self.command = "send \003 journalctl -f --unit=xkeysnail.service -b\n"
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"
self.InputToTerm(self.command)
except:
Popen(['notify-send','Kinto: Errror restarting Kinto!'])
def runStop(self,button):
global sysv
try:
stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
if sysv:
stop = Popen(['sudo', '-E','/etc/init.d/kinto','stop'])
else:
stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
stop.wait()
time.sleep(1)
res = Popen(['pgrep','xkeysnail'])
@@ -1077,7 +1116,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")
@@ -1106,34 +1145,36 @@ 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_alignment(0,0)
label_start.set_valign(Gtk.Align.START)
label_start.set_halign(Gtk.Align.START)
label_start.set_line_wrap(True)
vbox.add(label_start)
scroller.add(vbox)
hbox = Gtk.HBox()
previous = Gtk.Button("Uninstall")
previous = Gtk.Button(label="Uninstall")
previous.connect("clicked", self.goback)
previous.set_margin_right(206)
previous.set_margin_end(206)
hbox.add(previous)
onward = Gtk.Button("Continue")
onward = Gtk.Button(label="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_right(25)
hbox.set_margin_end(25)
scroller.set_hexpand(True)
scroller.set_vexpand(True)
vbox_container.add(scroller)
vbox_container.set_margin_top(55)
vbox_container.set_margin_right(25)
self.grid.set_margin_left(157)
vbox_container.set_margin_end(25)
self.grid.set_margin_start(157)
vbox_container.set_margin_bottom(18)
vbox.set_margin_right(10)
vbox.set_margin_end(10)
vbox.set_margin_bottom(18)
self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1165,18 +1206,19 @@ 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_alignment(0,0)
label_start.set_valign(Gtk.Align.START)
label_start.set_halign(Gtk.Align.START)
label_start.set_line_wrap(True)
vbox.add(label_start)
scroller.add(vbox)
hbox = Gtk.HBox()
previous = Gtk.Button("")
previous = Gtk.Button(label="")
for child in previous.get_children():
child.set_label("<b>Decline</b>")
child.set_use_markup(True)
previous.connect("clicked", self.goback)
previous.set_margin_right(245)
previous.set_margin_end(245)
hbox.add(previous)
self.__parent_window.first_onward.set_label("")
@@ -1190,16 +1232,16 @@ class FirstPage(Gtk.Box):
hbox.set_hexpand(False)
hbox.set_vexpand(False)
hbox.set_margin_bottom(6)
hbox.set_margin_right(25)
hbox.set_margin_end(25)
scroller.set_hexpand(True)
scroller.set_vexpand(True)
vbox_container.add(scroller)
vbox_container.set_margin_top(55)
vbox_container.set_margin_right(28)
self.grid.set_margin_left(157)
vbox_container.set_margin_end(28)
self.grid.set_margin_start(157)
vbox_container.set_margin_bottom(18)
vbox.set_margin_right(10)
vbox.set_margin_end(10)
vbox.set_margin_bottom(18)
self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1238,37 +1280,38 @@ 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_alignment(0,0)
label_start.set_valign(Gtk.Align.START)
label_start.set_halign(Gtk.Align.START)
label_start.set_line_wrap(True)
vbox.add(label_start)
scroller.add(vbox)
hbox = Gtk.HBox()
previous = Gtk.Button("")
previous = Gtk.Button(label="")
for child in previous.get_children():
child.set_label("<b>Go Back</b>")
child.set_use_markup(True)
previous.connect("clicked", self.goback)
previous.set_margin_right(315)
previous.set_margin_end(315)
hbox.add(previous)
# onward = Gtk.Button("Continue")
# onward = Gtk.Button(label="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_right(25)
hbox.set_margin_end(25)
scroller.set_hexpand(True)
scroller.set_vexpand(True)
vbox_container.add(scroller)
vbox_container.set_margin_top(55)
vbox_container.set_margin_right(25)
self.grid.set_margin_left(157)
vbox_container.set_margin_end(25)
self.grid.set_margin_start(157)
vbox_container.set_margin_bottom(18)
vbox.set_margin_right(10)
vbox.set_margin_end(10)
vbox.set_margin_bottom(18)
self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1322,37 +1365,38 @@ 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_alignment(0,0)
label_start.set_valign(Gtk.Align.START)
label_start.set_halign(Gtk.Align.START)
label_start.set_line_wrap(True)
vbox.add(label_start)
scroller.add(vbox)
hbox = Gtk.HBox()
previous = Gtk.Button("")
previous = Gtk.Button(label="")
for child in previous.get_children():
child.set_label("<b>Go Back</b>")
child.set_use_markup(True)
previous.connect("clicked", self.goback)
previous.set_margin_right(315)
previous.set_margin_end(315)
hbox.add(previous)
# onward = Gtk.Button("Continue")
# onward = Gtk.Button(label="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_right(25)
hbox.set_margin_end(25)
scroller.set_hexpand(True)
scroller.set_vexpand(True)
vbox_container.add(scroller)
vbox_container.set_margin_top(55)
vbox_container.set_margin_right(25)
self.grid.set_margin_left(157)
vbox_container.set_margin_end(25)
self.grid.set_margin_start(157)
vbox_container.set_margin_bottom(18)
vbox.set_margin_right(10)
vbox.set_margin_end(10)
vbox.set_margin_bottom(18)
self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)
@@ -1389,9 +1433,9 @@ class SuccessPage(Gtk.Box):
self.grid = Gtk.Grid()
hbox = Gtk.HBox()
previous = Gtk.Button(" ")
previous = Gtk.Button(label=" ")
previous.props.relief = Gtk.ReliefStyle.NONE
previous.set_margin_right(245)
previous.set_margin_end(245)
hbox.add(previous)
self.__parent_window.last_onward.set_label("")
@@ -1404,7 +1448,7 @@ class SuccessPage(Gtk.Box):
hbox.set_hexpand(False)
hbox.set_vexpand(False)
hbox.set_margin_bottom(6)
hbox.set_margin_right(25)
hbox.set_margin_end(25)
scroller = Gtk.ScrolledWindow()
scroller.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER)
@@ -1413,11 +1457,11 @@ class SuccessPage(Gtk.Box):
vbox = Gtk.VBox()
vbox_container = Gtk.VBox()
vbox_container.set_margin_top(55)
vbox_container.set_margin_right(28)
vbox_container.set_margin_end(28)
vbox_container.add(scroller)
self.grid.set_margin_left(157)
self.grid.set_margin_start(157)
vbox_container.set_margin_bottom(18)
vbox.set_margin_right(10)
vbox.set_margin_end(10)
vbox.set_margin_bottom(18)
self.grid.add(vbox_container)
self.grid.attach_next_to(hbox, vbox_container, Gtk.PositionType.BOTTOM, 2, 1)

57
linux/kinto-service.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/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

@@ -21,24 +21,34 @@ terminals = [
"lxterminal",
"mate-terminal",
"qterminal",
"st",
"sakura",
"station",
"terminator",
"termite",
"tilda",
"tilix",
"urxvt",
"xfce4-terminal",
"xterm",
]
terminals = [term.casefold() for term in terminals]
termStr = "|".join(str(x) for x in terminals)
termStr = "|".join(str('^'+x+'$') for x in terminals)
mscodes = ["code","vscodium"]
codeStr = "|".join(str(x) for x in mscodes)
codeStr = "|".join(str('^'+x+'$') for x in mscodes)
# 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-.*",
"Virt-manager",
"VirtualBox",
"VirtualBox Machine",
"xfreerdp",
]
remotes = [client.casefold() for client in remotes]
@@ -54,12 +64,14 @@ browsers = [
"Discord",
"Epiphany",
"Firefox",
"Firefox Developer Edition",
"Waterfox",
"Google-chrome",
"microsoft-edge",
"microsoft-edge-dev",
]
browsers = [browser.casefold() for browser in browsers]
browserStr = "|".join(str(x) for x in browsers)
browserStr = "|".join(str('^'+x+'$') for x in browsers)
chromes = [
"Chromium",
@@ -69,11 +81,11 @@ chromes = [
"microsoft-edge-dev",
]
chromes = [chrome.casefold() for chrome in chromes]
chromeStr = "|".join(str(x) for x 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)
# edgeStr = "|".join(str('^'+x+'$') for x in edges)
define_multipurpose_modmap(
# {Key.ENTER: [Key.ENTER, Key.RIGHT_CTRL] # Enter2Cmd
@@ -132,7 +144,7 @@ define_conditional_modmap(re.compile(termStr, re.IGNORECASE), {
# 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)
@@ -253,67 +265,72 @@ define_keymap(re.compile("^jetbrains-(?!.*toolbox).*$", re.IGNORECASE),{
### START OF FILE MANAGER GROUP OF KEYMAPS ###
##############################################
# Keybindings overrides for Caja
# 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
# 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")
# Keybindings overrides for DDE (Deepin) File Manager
# 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"): K("RC-comma"), # Open preferences dialog (doesn't work, no shortcut available?)
K("RC-Up"): K("RC-Up"), # Go Up dir
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
},"Overrides for DDE File Manager - Finder")
# Keybindings overrides for Dolphin
# Keybindings overrides for Dolphin
# (overrides some bindings from general file manager code block below)
define_keymap(re.compile("dolphin", re.IGNORECASE),{
K("RC-Super-o"): K("RC-Shift-o"), # Open in new window (or new tab, user's choice)
# "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.
###
##########################################################################################
### "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")
# Keybindings overrides for elementary OS Files
# Keybindings overrides for elementary OS Files
# (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 availabe
K("RC-Comma"): None, # Disable preferences shortcut since none available
},"Overrides for Pantheon - Finder")
# Keybindings overrides for Nautilus
# 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-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
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")
# Keybindings overrides for PCManFM
# Keybindings overrides for PCManFM and PCManFM-Qt
# (overrides some bindings from general file manager code block below)
define_keymap(re.compile("pcmanfm", re.IGNORECASE),{
define_keymap(re.compile("pcmanfm|pcmanfm-qt", re.IGNORECASE),{
K("RC-Backspace"): [K("Delete"),K("Enter")], # Move to Trash (delete, bypass dialog)
},"Overrides for PCManFM - Finder")
# 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-N"): [K("RC-F")], # Create new folder is Ctrl+F by default
K("RC-Backspace"): [K("Delete"),K("Enter")], # Move to Trash (delete, bypass dialog)
K("RC-comma"): [K("M-V"),K("p")], # Overrides "Open preferences dialog" shortcut below
# This shortcut ^^^^^^^^^^^^^^^ is not fully working in SpaceFM. Opens "View" menu but not Preferences.
# SpaceFM seems to be doing some nasty binding that blocks things like Alt+Tab while the menu is open.
# 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")
# Keybindings overrides for Thunar
# 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
@@ -334,10 +351,10 @@ filemanagers = [
"thunar",
]
filemanagers = [filemanager.casefold() for filemanager in filemanagers]
filemanagerStr = "|".join(str(x) for x in filemanagers)
filemanagerStr = "|".join(str('^'+x+'$') for x in filemanagers)
# Currently supported Linux file managers (file browsers):
#
# 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)
@@ -348,8 +365,8 @@ filemanagerStr = "|".join(str(x) for x in filemanagers)
# PCManFM-Qt (LXQt file manager)
# SpaceFM (Fork of PCManFM file manager)
# Thunar File Manager (Xfce file manager)
#
# Keybindings for general Linux file managers group:
#
# 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 ###
@@ -363,9 +380,11 @@ define_keymap(re.compile(filemanagerStr, re.IGNORECASE),{
K("RC-Left"): K("M-Left"), # Go Back
K("RC-Right"): K("M-Right"), # Go Forward
K("RC-Up"): K("M-Up"), # Go Up dir
# K("RC-Down"): K("M-Down"), # Go Down dir (only works on folders) [not universal]
# K("RC-Down"): K("RC-O"), # Go Down dir (open folder/file) [not universal]
# K("RC-Down"): K("M-Down"), # Go Down dir (only works on folders) [not universal]
# K("RC-Down"): K("RC-O"), # Go Down dir (open folder/file) [not universal]
K("RC-Down"): K("Enter"), # Go Down dir (open folder/file) [universal]
K("RC-Shift-Left_Brace"): K("C-Page_Up"), # Go to prior tab
K("RC-Shift-Right_Brace"): K("C-Page_Down"), # Go to next tab
###########################################################################################################
### Open in New Window | Move to Trash | Duplicate file/folder ###
###########################################################################################################
@@ -376,15 +395,15 @@ define_keymap(re.compile(filemanagerStr, re.IGNORECASE),{
### 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("Enter"): K("F2"), # Rename with Enter key
# K("RC-Shift-Enter"): K("Enter"), # Remap alternative "Enter" key to easily activate/exit text fields
},"File Managers - Finder")
############################################
### END OF FILE MANAGER GROUP OF KEYMAPS ###
############################################
# Keybindings for Browsers
# Keybindings for General Web 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
@@ -398,9 +417,20 @@ define_keymap(re.compile(browserStr, re.IGNORECASE),{
K("RC-Key_7"): K("M-Key_7"),
K("RC-Key_8"): K("M-Key_8"),
K("RC-Key_9"): K("M-Key_9"), # Jump to last tab
K("C-Left_Brace"): K("C-Page_Up"),
K("C-Right_Brace"): K("C-Page_Down"),
})
# 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-M-Left"): K("C-Page_Up"), # Go to prior tab
K("RC-M-Right"): K("C-Page_Down"), # Go to next tab
# Enable Ctrl+PgUp/PgDn for tab navigation
K("Super-Page_Up"): K("C-Page_Up"), # Go to prior tab
K("Super-Page_Down"): K("C-Page_Down"), # Go to next tab
# Use Cmd+Braces keys for tab navigation instead of page navigation
# K("C-Left_Brace"): K("C-Page_Up"),
# K("C-Right_Brace"): K("C-Page_Down"),
}, "General Web Browsers")
# Open preferences in browsers
define_keymap(re.compile("Firefox", re.IGNORECASE),{
@@ -409,6 +439,7 @@ define_keymap(re.compile("Firefox", re.IGNORECASE),{
K("Shift-SEMICOLON"),K("p"),K("r"),K("e"),K("f"),
K("e"),K("r"),K("e"),K("n"),K("c"),K("e"),K("s"),K("Enter")
],
K("RC-Shift-N"): K("RC-Shift-P"), # Open private window with Ctrl+Shift+N like other browsers
})
define_keymap(re.compile(chromeStr, re.IGNORECASE),{
K("C-comma"): [K("M-e"), K("s"),K("Enter")],
@@ -426,16 +457,19 @@ define_keymap(lambda wm_class: wm_class.casefold() not in terminals,{
define_keymap(lambda wm_class: wm_class.casefold() not in remotes,{
K("RC-Space"): K("Alt-F1"), # Default SL - Launch Application Menu (gnome/kde)
K("RC-F3"):K("Super-d"), # Default SL - Show Desktop (gnome/kde,eos)
K("RC-Super-f"):K("M-F10"), # Default SL - Maximize app (gnome/kde)
K("RC-Super-f"):K("M-F10"), # Default SL - Maximize app (gnome/kde)
# K("RC-Super-f"): K("Super-Page_Up"), # SL - Toggle maximized window state (kde_neon)
# K("Super-Right"):K("C-M-Right"), # Default SL - Change workspace (budgie)
# K("Super-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("M-Tab"): pass_through_key, # Default - Cmd Tab - App Switching Default
K("RC-Tab"): K("M-Tab"), # Default - Cmd Tab - App Switching Default
K("RC-Shift-Tab"): K("M-Shift-Tab"), # Default - Cmd Tab - App Switching Default
K("RC-Grave"): K("M-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching
K("RC-Shift-Grave"): K("M-Shift-Grave"), # Default not-xfce4 - Cmd ` - Same App Switching
# K("RC-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)
@@ -451,10 +485,6 @@ define_keymap(lambda wm_class: wm_class.casefold() not in remotes,{
# 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
@@ -464,7 +494,7 @@ define_keymap(lambda wm_class: wm_class.casefold() not in remotes,{
# Fn to Alt style remaps
K("RM-Enter"): K("insert"), # Insert
# emacs style
K("Super-a"): K("Home"), # Beginning of Line
K("Super-e"): K("End"), # End of Line
@@ -475,7 +505,7 @@ define_keymap(lambda wm_class: wm_class.casefold() not in remotes,{
K("Super-k"): [K("Shift-End"), K("Backspace")],
K("Super-d"): K("Delete"),
# K("M-RC-Space"): K(""), # Open Finder - Placeholder
# K("M-RC-Space"): K(""), # Open Finder - Placeholder
# Wordwise
K("RC-Left"): K("Home"), # Beginning of Line
@@ -533,7 +563,7 @@ define_keymap(re.compile(codeStr, re.IGNORECASE),{
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
@@ -650,11 +680,14 @@ define_keymap(re.compile("Io.elementary.terminal|kitty", re.IGNORECASE),{
}, "Elementary Terminal tab switching")
define_keymap(re.compile(termStr, re.IGNORECASE),{
K("LC-RC-f"): K("M-F10"), # Toggle window maximized state
# K("RC-Grave"): K("Super-Tab"), # xfce4 Switch within app group
# K("RC-Shift-Grave"): K("Super-Shift-Tab"), # xfce4 Switch within app group
# K("LC-Right"):K("C-M-Right"), # Default SL - Change workspace (budgie)
# K("LC-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-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)
@@ -664,15 +697,11 @@ define_keymap(re.compile(termStr, re.IGNORECASE),{
K("LC-Tab") : K("LC-PAGE_DOWN"),
K("LC-Shift-Tab") : K("LC-PAGE_UP"),
K("LC-Grave") : K("LC-PAGE_UP"),
# 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
# 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
# K("M-Tab"): pass_through_key, # Default - Cmd Tab - App Switching Default
# K("RC-Tab"): K("M-Tab"), # Default - Cmd Tab - App Switching Default
# K("RC-Shift-Tab"): K("M-Shift-Tab"), # Default - Cmd Tab - App Switching Default
# Converts Cmd to use Ctrl-Shift
K("RC-MINUS"): K("C-Shift-MINUS"),
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"),
@@ -698,7 +727,6 @@ define_keymap(re.compile(termStr, re.IGNORECASE),{
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"),

View File

@@ -1,4 +1,7 @@
# /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
@@ -6,5 +9,6 @@
%{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} /home/{username}/.config/kinto/kinto.py
%{username} ALL=NOPASSWD: {xkeysnail} *
%{username} ALL=NOPASSWD: {systemctl} is-active --quiet xkeysnail
%{username} ALL=NOPASSWD: /usr/lib/systemd/system/xkeysnail.service

View File

@@ -29,7 +29,15 @@ APPINDICATOR_ID = 'Kinto'
class Indicator():
global child_pid
kinto_status = Popen("while :; do clear; systemctl is-active xkeysnail; sleep 2s; done", stdout=PIPE, shell=True)
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)
child_pid = kinto_status.pid
homedir = os.path.expanduser("~")
@@ -42,44 +50,52 @@ class Indicator():
autostart_bool = False
menu = Gtk.Menu()
menukb = Gtk.Menu()
checkbox_autostart = Gtk.CheckMenuItem('Autostart')
restart = Gtk.MenuItem('Restart')
stop = Gtk.MenuItem('Stop')
keyboards = Gtk.MenuItem('Keyboard Types')
checkbox_autostart = Gtk.CheckMenuItem(label='Autostart')
restart = Gtk.MenuItem(label='Restart')
stop = Gtk.MenuItem(label='Stop')
keyboards = Gtk.MenuItem(label='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('Customize')
edit = Gtk.MenuItem(label='Customize')
edit_submenu = Gtk.Menu()
edit.set_submenu(edit_submenu)
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')
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')
# Keyboard type set below
button_syskb = Gtk.MenuItem('System Shortcuts')
button_region = Gtk.MenuItem('Change Language')
systray = Gtk.CheckMenuItem('Tray Enabled')
helpm = Gtk.MenuItem('Help')
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')
help_submenu = Gtk.Menu()
helpm.set_submenu(help_submenu)
debug = Gtk.MenuItem('Debug')
opengui = Gtk.MenuItem('Open Kinto')
support = Gtk.MenuItem("Support")
about = Gtk.MenuItem('About')
debug = Gtk.MenuItem(label='Debug')
opengui = Gtk.MenuItem(label='Open Kinto')
support = Gtk.MenuItem(label='Support')
about = Gtk.MenuItem(label='About')
global restartsvc
restartsvc = False
unixts = int(time.time())
last_status = ""
last_status = ''
def __init__(self):
res = Popen(['sudo', 'systemctl','is-active','--quiet','xkeysnail'])
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.wait()
if res.returncode == 0:
@@ -183,7 +199,7 @@ class Indicator():
# self.button_region.connect('activate',self.setRegion)
# self.menu.append(self.button_region)
item_quit = Gtk.MenuItem('Close')
item_quit = Gtk.MenuItem(label='Close')
item_quit.connect('activate', quit)
self.menu.append(item_quit)
self.menu.show_all()
@@ -401,10 +417,10 @@ class Indicator():
self.lbl = Gtk.Label()
global restartsvc
restartsvc = False
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')
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')
if rightmod_result == 0:
self.rightmod.set_active(True)
@@ -446,7 +462,10 @@ class Indicator():
global restartsvc
if restartsvc == True:
try:
restartcmd = ['sudo', 'systemctl','restart','xkeysnail']
if sysv:
restartcmd = ['sudo', '-E','/etc/init.d/kinto','restart']
else:
restartcmd = ['sudo', 'systemctl','restart','xkeysnail']
Popen(restartcmd)
restartsvc = False
@@ -555,8 +574,12 @@ class Indicator():
return
def runRestart(self,button):
global sysv
try:
stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
if sysv:
stop = Popen(['sudo', '-E','/etc/init.d/kinto','stop'])
else:
stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
stop.wait()
time.sleep(1)
res = Popen(['pgrep','xkeysnail'])
@@ -567,13 +590,20 @@ class Indicator():
pkillxkey = Popen(['sudo', 'pkill','-f','bin/xkeysnail'])
pkillxkey.wait()
Popen(['sudo', 'systemctl','start','xkeysnail'])
if sysv:
Popen(['sudo', '-E','/etc/init.d/kinto','start'])
else:
Popen(['sudo', 'systemctl','start','xkeysnail'])
except:
Popen(['notify-send','Kinto: Error restarting Kinto!'])
def runStop(self,button):
global sysv
try:
stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
if sysv:
stop = Popen(['sudo', '-E','/etc/init.d/kinto','stop'])
else:
stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
stop.wait()
time.sleep(1)
res = Popen(['pgrep','xkeysnail'])
@@ -689,7 +719,10 @@ class Indicator():
cmdsTerm = Popen(cmds)
cmdsTerm.wait()
restart = ['sudo', 'systemctl','restart','xkeysnail']
if sysv:
restart = ['sudo', '-E','/etc/init.d/kinto','restart']
else:
restart = ['sudo', 'systemctl','restart','xkeysnail']
Popen(restart)
except CalledProcessError:

View File

@@ -4,8 +4,8 @@ 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'
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}

8
linux/xkeysnail_sysv.desktop Executable file
View File

@@ -0,0 +1,8 @@
[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" "' + path + '\\windows\\kinto-new.ahk"')
os.system('copy /Y "' + path + '\\windows\\kinto.ahk" "' + homedir + '\\kinto-new.ahk"')
if default < 3:
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Default)(?!( - ST2CODE))(.*)/$2$3$5/g" .\\windows\\kinto-new.ahk')
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Default)(?!( - ST2CODE))(.*)/$2$3$5/gm" ' + homedir + '\\kinto-new.ahk')
if default == 1:
kbtype = "mac"
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" .\\windows\\kinto-new.ahk')
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/gm" ' + homedir + '\\kinto-new.ahk')
elif default == 2:
kbtype = "win"
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" .\\windows\\kinto-new.ahk')
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/gm" ' + homedir + '\\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/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')
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')
if default == 3 or default == 4:
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB\/IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers\/CB\/IBM)/$2$3/g" .\\windows\\kinto-new.ahk')
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')
if default == 4:
kbtype = "ibm"
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/(; )(.*)(; IBM)/$2$3/gm" ' + homedir + '\\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...")
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/g" .\\windows\\kinto-new.ahk')
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Default - ST2CODE)/$2$3/gm" ' + homedir + '\\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/g" .\\windows\\kinto-new.ahk')
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB/IBM - ST2CODE)/$2$3/gm" ' + homedir + '\\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 + '/g" "%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('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('copy /Y "'+ path + '\\windows\\NoShell.vbs" "%userprofile%\\.kinto\\NoShell.vbs"')
os.system('copy /Y "'+ path + '\\windows\\toggle_kb.bat" "%userprofile%\\.kinto\\toggle_kb.bat"')
os.system('copy /Y "'+ path + '\\windows\\kinto-new.ahk" "%userprofile%\\.kinto\\kinto.ahk"')
os.system("del /f .\\windows\\kinto-new.ahk")
os.system('copy /Y "'+ homedir + '\\kinto-new.ahk" "%userprofile%\\.kinto\\kinto.ahk"')
os.system("del /f " + homedir + "\\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"')

View File

@@ -172,8 +172,11 @@ GroupAdd, browsers, ahk_exe msedge.exe
; Disable Key Remapping for Virtual Machines
; Disable for Remote desktop solutions too
GroupAdd, virtm, ahk_exe VirtualBoxVM.exe
GroupAdd, virtm, ahk_exe mstsc.exe
GroupAdd, remotes, ahk_exe VirtualBoxVM.exe
GroupAdd, remotes, ahk_exe mstsc.exe
GroupAdd, remotes, ahk_exe msrdc.exe
GroupAdd, remotes, ahk_exe nxplayer.bin
GroupAdd, remotes, ahk_exe vmconnect.exe
; Disabled Edge for now - no ability to close all instances
; GroupAdd, browsers, Microsoft Edge ahk_class ApplicationFrameWindow
@@ -188,7 +191,19 @@ GroupAdd, intellij, ahk_exe idea64.exe
; SetCapsLockState, AlwaysOff ; CB/IBM
#IfWinNotActive ahk_group virtm
; 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
#IfWinNotActive ahk_group remotes
; New AltTab and CtrlTab fix
*tab::
@@ -294,8 +309,10 @@ GroupAdd, intellij, ahk_exe idea64.exe
!Esc::SendInput, {Pause}
; Go up or down a page
$!Down::Send {PgDn};
$!Up::Send {PgUp};
#IfWinNotActive ahk_group editors
$!Down::Send {PgDn}
$!Up::Send {PgUp}
#If
; Close Apps
^q::Send !{F4}
@@ -522,6 +539,13 @@ GroupAdd, intellij, ahk_exe idea64.exe
; Close all browsers
#IfWinActive ahk_group browsers
;Tab Navigation
^+[::send ^{PgUp}
^+]::send ^{PgDn}
^!Left::send ^{PgUp}
^!Right::send ^{PgDn}
#Left::send ^{PgUp}
#Right::send ^{PgDn}
^q::send {Alt Down}f{Alt Up}x ; exit all windows
; Dev Tools
!^i::send {Ctrl Down}{Shift Down}i{Shift Up}{Ctrl Up}
@@ -529,6 +553,7 @@ 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}
@@ -568,7 +593,7 @@ GroupAdd, intellij, ahk_exe idea64.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
; !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
@@ -592,7 +617,6 @@ GroupAdd, intellij, ahk_exe idea64.exe
Insert::Return ; cancel toggle_overwrite
^!O::send {Insert} ; toggle_overwrite
; !c::Return ; Default - cancel toggle_case_sensitive
; $!c::send ^{c} ; CB/IBM - Sigint
^!c::send !{c} ; toggle_case_sensitive
; ^h::Return ; cancel replace
^!f::send ^{h} ; replace
@@ -600,6 +624,7 @@ 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
@@ -729,45 +754,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
@@ -819,4 +844,4 @@ Send {RWin up}
Send {LWin up}
Send {RShift up}
Send {LShift up}
return
return

View File

@@ -3,11 +3,18 @@
# 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")
function uninstall {
echo -e "\nNote: Restoring keys is only relevant if you had installed a version prior to 1.2 of Kinto. You should skip this step if 1.2+ is all you have installed."
@@ -38,7 +45,11 @@ function uninstall {
mv ~/.config/kglobalshortcutsrc ~/.config/kglobalshortcutsrc.kinto
elif [ "$dename" == "xfce" ];then
echo "Resetting DE hotkeys..."
cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
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
fi
elif [ "$yn" == "r" ]; then
echo "Restore original user shortcuts"
@@ -77,6 +88,12 @@ 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
}
@@ -189,6 +206,7 @@ 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
@@ -207,6 +225,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
@@ -236,6 +257,34 @@ 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
@@ -280,25 +329,6 @@ if [[ $distro == 'kdeneon' ]]; then
fi
if [[ $distro == 'fedora' ]]; then
echo "Checking SELinux status..."
if [[ $(perl -ne 'print if /^SELINUX=enforcing/' /etc/selinux/config | wc -l) != 0 ]]; then
while true; do
read -rep $'\nWould you like to update your SELinux state from enforcing to permissive? (y/n)\n' yn
case $yn in
[Yy]* ) setSE='yes'; break;;
[Nn]* ) exp='no'; expsh=" " break;;
# * ) echo "Please answer yes or no.";;
esac
done
if [[ $yn == "yes" ]]; then
sed -i "s/SELINUX=enforcing/SELINUX=permissive/g" /etc/selinux/config
echo "/etc/selinux/config has been updated. Please reboot your computer before continuing."
exit 0
fi
else
echo "SELinux state should be ok for Kinto to install"
fi
if [[ $(gsettings get org.gnome.desktop.wm.keybindings show-desktop | grep "\[\]" | wc -l) == 1 ]];then
gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d']"
else
@@ -352,12 +382,12 @@ if ! [ -x "$(command -v pip3)" ]; then
sudo ./linux/system-config/unipkg.sh python3-pip
fi
if ! [ -x "$(command -v python3-config)" ]; then
if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] || [ "$distro" == 'linuxmint' ]; then
if [ "$distro" == "ubuntu" ] || [ "${distro::6}" == "debian" ] || [ "$distro" == 'linuxmint' ]; then
pydev="python3-dev"
elif [ "$distro" == "fedora" ]; then
pydev="python3-devel"
fi
if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "$distro" == "debian" ] || [ "$distro" == 'linuxmint' ]; then
if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "${distro::6}" == "debian" ] || [ "$distro" == 'linuxmint' ]; then
echo "Will need to install $pydev..."
sudo ./linux/system-config/unipkg.sh "$pydev"
fi
@@ -370,8 +400,10 @@ if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then
sudo ./linux/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
@@ -386,7 +418,11 @@ mkdir -p ~/.config/kinto
# KDE startup - xhost fix
mkdir -p ~/.config/autostart
yes | cp -rf ./linux/xkeysnail.desktop ~/.config/kinto/xkeysnail.desktop
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 ./linux/xkeystart.sh ~/.config/kinto/xkeystart.sh
@@ -411,7 +447,6 @@ else
fi
yes | cp -rf ./linux/kinto.py ./linux/kinto.py.new
yes | cp -rf ./linux/limitedadmins ./linux/limitedadmins.new
yes | cp -rf ./linux/gui/ ~/.config/kinto/
yes | cp -nrf ./linux/initkb ~/.config/kinto/initkb
yes | cp -rf ./linux/killdups.sh ~/.config/kinto/killdups.sh
@@ -424,29 +459,36 @@ yes | cp -rf ./linux/trayapps/appindicator/icons/kinto-invert-16.svg ~/.config/k
yes | cp -rf ./linux/trayapps/appindicator/icons/kinto-solid-16.svg ~/.config/kinto/kinto-solid.svg
yes | cp -rf ./linux/trayapps/appindicator/icons/kinto.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/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
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
sed -i "s#{kill-caret}#$expsh#g" ./linux/xkeysnail.service.new
echo "Using sysvinit..."
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#{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#{xhost}#`\\which xhost`#g" ./linux/xkeysnail.service.new
sed -i "s/{username}/`whoami`/g" ./linux/limitedadmins.new
sed -i "s#{systemctl}#`\\which systemctl`#g" ./linux/limitedadmins.new
sed -i "s#{pkill}#`\\which pkill`#g" ./linux/limitedadmins.new
sed -i "s#{systemctl}#`\\which systemctl`#g" ~/.config/kinto/xkeysnail.desktop
sed -i "s#{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" ./linux/xkeysnail.service.new
# sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/kinto/prexk.sh
if [[ $dename == "budgie" ]]; then
@@ -459,6 +501,11 @@ fi
if [[ $distro == "fedora" ]]; 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
fi
if [[ $distro == "elementaryos" ]]; then
@@ -491,9 +538,16 @@ if [[ $dename == "xfce" ]] && ls /etc/apt/sources.list.d/enso* 1> /dev/null 2>&1
fi
if ! [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
mv ./linux/kinto.py.new ~/.config/kinto/kinto.py
# if [ "$distro" == "fedora" ];then
sudo rm /etc/systemd/system/xkeysnail.service >/dev/null 2>&1
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
if [ -d /usr/lib/systemd/system ];then
xkeypath="/usr/lib/systemd/system/"
elif [ -d /lib/systemd/system ];then
@@ -521,19 +575,42 @@ 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/xkeysnail.service.new
sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./linux/limitedadmins.new
sudo mv ./linux/xkeysnail.service.new "$xkeypath"xkeysnail.service && echo "Service file added to "$xkeypath"xkeysnail.service"
if [[ $distro == "fedora" ]]; then
echo "Changing SELinux context"
sudo chcon -v --user=$selinuxuser --type=$selinuxtype "$xkeypath"xkeysnail.service
fi
sudo chown root:root ./linux/limitedadmins.new
# Add a check here for xkeysnail path resolving
sudo mv ./linux/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
if [ ! "$sysv" -eq 0 ];then
# echo "Using systemd..."
sed -i "s#{xkeysnail}#`which xkeysnail`#g" ./linux/xkeysnail.service.new
sudo mv ./linux/xkeysnail.service.new "$xkeypath"xkeysnail.service && echo "Service file added to "$xkeypath"xkeysnail.service"
if [[ $distro == "fedora" ]]; then
sudo cp "$xkeypath"xkeysnail.service /etc/systemd/system/xkeysnail.service && echo "Copied service file to system..." || echo "Failed to create copy..."
sudo cp "$xkeypath"xkeysnail.service /etc/systemd/system/graphical.target.wants/xkeysnail.service && echo "Copied service file to system for graphical target..." || echo "Failed to create copy for graphical target..."
sudo chown -R root:root /etc/systemd/system/xkeysnail.service && echo "Ownership set for root..." || echo "Failed to set ownership..."
sudo chown -R root:root /etc/systemd/system/graphical.target.wants/xkeysnail.service && echo "Ownership set for root..." || echo "Failed to set ownership..."
sudo chmod 644 /etc/systemd/system/xkeysnail.service && echo "Permissions set to 644..." || echo "Failed to set permissions..."
sudo chmod 644 /etc/systemd/system/graphical.target.wants/xkeysnail.service && echo "Permissions set to 644..." || echo "Failed to set permissions..."
else
sudo chown -R root:root "$xkeypath"xkeysnail.service && echo "Ownership set for root..." || echo "Failed to set ownership..."
sudo 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 systemctl --state=not-found --all | grep xkeysnail
# if [ "$distro" == "fedora" ];then
# systemctl enable xkeysnail.service
@@ -541,8 +618,9 @@ 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 == "gnome" || $dename == "kde" ]];then
sudo pkill -f kintotray &
# >/dev/null 2>&1
if [[ $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 &
@@ -573,6 +651,24 @@ 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"