Merge pull request #155 from rbreaves/dev

- Added terminals & improved uninstaller
This commit is contained in:
Ben Reaves
2020-05-07 13:00:22 -05:00
committed by GitHub
5 changed files with 31 additions and 8 deletions

View File

@@ -70,6 +70,7 @@ def setShortcuts():
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward \"['<Primary>F14','<Primary><Shift>F14','<Alt><Shift>Tab']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
cmdline("gsettings set org.gnome.mutter overlay-key ''")
if distro == "ubuntu" and dename == "gnome":
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up \"['<Super>Up','<Super>Left']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down \"['<Super>Down','<Super>Right']\"")
@@ -251,6 +252,10 @@ def Uninstall():
cmdline("gsettings reset-recursively org.gnome.desktop.wm.keybindings")
print("gsettings reset-recursively org.gnome.mutter.keybindings")
cmdline("gsettings reset-recursively org.gnome.mutter.keybindings")
print("gsettings set org.gnome.mutter overlay-key 'super'")
cmdline("gsettings set org.gnome.mutter overlay-key 'super'")
cmdline('dconf dump /org/gnome/mutter/ > mutter.conf')
cmdline('dconf load /org/gnome/mutter/ < mutter.conf')
elif dename == "kde":
print("Resetting DE hotkeys...\n")
cmdline('mv ~/.config/kwinrc ~/.config/kwinrc.kinto')
@@ -357,7 +362,12 @@ color_arr = [bcolors.CBEIGE,bcolors.CRED2,bcolors.CGREEN,bcolors.CYELLOW ]
print("\nKinto - Type in Linux like it's a Mac.\n")
kintotype = int(input(color_arr[2] + "1) Kinto - xkeysnail (udev/x11) - Recommended\n" + color_arr[0] + "2) Kinto - Original xkb/x11 implementation\n\n" + bcolors.ENDC))
kintotype = int(input(color_arr[2] +
"1) Kinto - xkeysnail (udev/x11) - Recommended\n" + color_arr[0] +
"2) Kinto - Original xkb/x11 implementation\n" + color_arr[3] +
"3) Uninstall Kinto - xkeysnail\n" +
"4) Uninstall Kinto - Original xkb\n\n"
+ bcolors.ENDC))
print("")
if(kintotype == 1):
subprocess.check_call(shlex.split("./xkeysnail_service.sh"))
@@ -365,6 +375,14 @@ if(kintotype == 1):
setShortcuts()
exit()
if(kintotype == 3):
subprocess.check_call(shlex.split("./xkeysnail_service.sh uninstall"))
exit()
if(kintotype == 4):
Uninstall()
exit()
for index, item in enumerate(data['defaulttypes']):
ossym = ""
if item == "windows":

View File

@@ -14,5 +14,6 @@ rm ~/.config/systemd/user/keyswap.timer
rm -rf ~/.config/autostart/kinto.desktop
rm -rf ~/.config/kinto
rm -rf ~/.xkb
systemctl daemon-reload
sed -i '/xkb/d' ~/.Xsession 2>/dev/null
sudo systemctl daemon-reload
sed -i '/xkb/d' ~/.Xsession 2>/dev/null
exit 0

View File

@@ -16,7 +16,7 @@
"symbols":"",
"types":"",
"de":[],
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty" ]
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty" ]
},
{
"name": "firefox",
@@ -73,4 +73,4 @@
"run_term":"",
"run_gui":""
}]
}
}

View File

@@ -3,7 +3,7 @@
import re
from xkeysnail.transform import *
terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty"]
terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty"]
terminals = [term.casefold() for term in terminals]
termStr = "|".join(str(x) for x in terminals)
@@ -220,7 +220,7 @@ define_keymap(re.compile("konsole", re.IGNORECASE),{
}, "Konsole tab switching")
define_keymap(re.compile("Io.elementary.terminal", re.IGNORECASE),{
define_keymap(re.compile("Io.elementary.terminal|kitty", re.IGNORECASE),{
# Ctrl Tab - In App Tab Switching
K("LC-Tab") : K("LC-Shift-Right"),
K("LC-Shift-Tab") : K("LC-Shift-Left"),

View File

@@ -27,6 +27,10 @@ function uninstall {
gsettings reset-recursively org.gnome.desktop.wm.keybindings
echo "gsettings reset-recursively org.gnome.mutter.keybindings"
gsettings reset-recursively org.gnome.mutter.keybindings
echo "gsettings set org.gnome.mutter overlay-key 'super'"
gsettings set org.gnome.mutter overlay-key 'super'
dconf dump /org/gnome/mutter/ > mutter.conf
dconf load /org/gnome/mutter/ < mutter.conf
elif [ "$dename" == "kde" ];then
echo "Resetting DE hotkeys..."
mv ~/.config/kwinrc ~/.config/kwinrc.kinto
@@ -73,7 +77,7 @@ if [ $# -eq 0 ]; then
echo " 1) Windows & Mac (HID driver)"
echo " 2) Mac Only & VMs on Macbooks"
echo " 3) Chromebook"
echo " 4) Uninstall"
# echo " 4) Uninstall"
read n