mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-06 10:58:26 +02:00
Merge pull request #174 from rbreaves/dev
- Budgie patch for App Switching. Also fixes Ctrl-Tab regression.
This commit is contained in:
3
setup.py
3
setup.py
@@ -154,6 +154,8 @@ def setShortcuts():
|
|||||||
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_term')
|
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_term')
|
||||||
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Elementary cmdtab)/\$2\$3/g" ~/.xkb/symbols/mac_gui')
|
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Elementary cmdtab)/\$2\$3/g" ~/.xkb/symbols/mac_gui')
|
||||||
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_gui')
|
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_gui')
|
||||||
|
# elif distro == "budgie" and dename == "gnome":
|
||||||
|
# print("Apply budgie shortcuts here")
|
||||||
elif distro == "galliumos" and dename == "xfce":
|
elif distro == "galliumos" and dename == "xfce":
|
||||||
print("Applying GalliumOS (xfce) shortcuts...")
|
print("Applying GalliumOS (xfce) shortcuts...")
|
||||||
cmdline('cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ./xfce4-keyboard-shortcuts_`date +"%Y.%m.%d-%s"`.xml')
|
cmdline('cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ./xfce4-keyboard-shortcuts_`date +"%Y.%m.%d-%s"`.xml')
|
||||||
@@ -382,6 +384,7 @@ if(kintotype == 1):
|
|||||||
subprocess.check_call(shlex.split("./xkeysnail_service.sh"))
|
subprocess.check_call(shlex.split("./xkeysnail_service.sh"))
|
||||||
if os.path.isdir(homedir + "/.config/kinto") == True:
|
if os.path.isdir(homedir + "/.config/kinto") == True:
|
||||||
setShortcuts()
|
setShortcuts()
|
||||||
|
subprocess.check_call(shlex.split("./xkeysnail_service.sh budgieUpdate"))
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
if(kintotype == 3):
|
if(kintotype == 3):
|
||||||
|
1
system-config/budgie-daemon_10.5.1.md5
Normal file
1
system-config/budgie-daemon_10.5.1.md5
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3cd35e15350ca7dac0c3cbfce1c661f7 /usr/bin/budgie-daemon
|
1
system-config/budgie-desktop_10.5.1.md5
Normal file
1
system-config/budgie-desktop_10.5.1.md5
Normal file
@@ -0,0 +1 @@
|
|||||||
|
8660c2f8e0a9d3cff896254f6c0f9159 /usr/bin/budgie-desktop
|
@@ -16,7 +16,7 @@
|
|||||||
"symbols":"",
|
"symbols":"",
|
||||||
"types":"",
|
"types":"",
|
||||||
"de":[],
|
"de":[],
|
||||||
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal" ]
|
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal","tilix" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "firefox",
|
"name": "firefox",
|
||||||
|
@@ -3,10 +3,13 @@
|
|||||||
import re
|
import re
|
||||||
from xkeysnail.transform import *
|
from xkeysnail.transform import *
|
||||||
|
|
||||||
terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal"]
|
terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal","tilix"]
|
||||||
terminals = [term.casefold() for term in terminals]
|
terminals = [term.casefold() for term in terminals]
|
||||||
termStr = "|".join(str(x) for x in terminals)
|
termStr = "|".join(str(x) for x in terminals)
|
||||||
|
|
||||||
|
mscodes = ["code","vscodium"]
|
||||||
|
codeStr = "|".join(str(x) for x in mscodes)
|
||||||
|
|
||||||
# [Global modemap] Change modifier keys as in xmodmap
|
# [Global modemap] Change modifier keys as in xmodmap
|
||||||
define_conditional_modmap(lambda wm_class: wm_class.casefold() not in terminals,{
|
define_conditional_modmap(lambda wm_class: wm_class.casefold() not in terminals,{
|
||||||
# # Chromebook
|
# # Chromebook
|
||||||
@@ -97,7 +100,7 @@ define_keymap(None,{
|
|||||||
# K(""): K(""), #
|
# K(""): K(""), #
|
||||||
})
|
})
|
||||||
|
|
||||||
define_keymap(lambda wm_class: wm_class.casefold() not in ("code"),{
|
define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{
|
||||||
# Wordwise remaining - for Everything but VS Code
|
# Wordwise remaining - for Everything but VS Code
|
||||||
K("M-Left"): K("C-Left"), # Left of Word
|
K("M-Left"): K("C-Left"), # Left of Word
|
||||||
K("M-Shift-Left"): K("C-Shift-Left"), # Select Left of Word
|
K("M-Shift-Left"): K("C-Shift-Left"), # Select Left of Word
|
||||||
@@ -120,7 +123,7 @@ define_keymap(lambda wm_class: wm_class.casefold() not in ("code"),{
|
|||||||
})
|
})
|
||||||
|
|
||||||
# Keybindings for VS Code
|
# Keybindings for VS Code
|
||||||
define_keymap(re.compile("code", re.IGNORECASE),{
|
define_keymap(re.compile(codeStr, re.IGNORECASE),{
|
||||||
# Wordwise remaining - for VS Code
|
# Wordwise remaining - for VS Code
|
||||||
# Alt-F19 hack fixes Alt menu activation
|
# Alt-F19 hack fixes Alt menu activation
|
||||||
K("M-Left"): [K("M-F19"),K("C-Left")], # Left of Word
|
K("M-Left"): [K("M-F19"),K("C-Left")], # Left of Word
|
||||||
@@ -128,6 +131,11 @@ define_keymap(re.compile("code", re.IGNORECASE),{
|
|||||||
K("M-Shift-Left"): [K("M-F19"),K("C-Shift-Left")], # Select Left 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("M-Shift-Right"): [K("M-F19"),K("C-Shift-Right")], # Select Right of Word
|
||||||
|
|
||||||
|
# K("C-PAGE_DOWN"): pass_through_key, # cancel next_view
|
||||||
|
# K("C-PAGE_UP"): pass_through_key, # cancel prev_view
|
||||||
|
K("C-M-Left"): K("C-PAGE_UP"), # next_view
|
||||||
|
K("C-M-Right"): K("C-PAGE_DOWN"), # prev_view
|
||||||
|
|
||||||
# VS Code Shortcuts
|
# VS Code Shortcuts
|
||||||
K("C-g"): pass_through_key, # cancel Go to Line...
|
K("C-g"): pass_through_key, # cancel Go to Line...
|
||||||
K("Super-g"): K("C-g"), # Go to Line...
|
K("Super-g"): K("C-g"), # Go to Line...
|
||||||
|
@@ -72,6 +72,69 @@ function uninstall {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function budgieUninstall {
|
||||||
|
if [ -f /usr/bin/budgie-desktop ];then
|
||||||
|
read -n 1 -s -r -p "Your system may log you off immediately during the restoration of budgie-daemon. Press any key to continue..."
|
||||||
|
bdmd5="$(md5sum /usr/bin/budgie-daemon | awk '{ print $1 }')"
|
||||||
|
oldbdmd5=$(md5sum ./budgie-daemon_10.5.1.bak | awk '{ print $1 }')
|
||||||
|
if [ "$bdmd5" != "$oldbdmd5" ]; then
|
||||||
|
echo -e "\nReplacing budgie-daemon with backup..."
|
||||||
|
sudo pkill budgie-daemon && sudo cp ./budgie-daemon_10.5.1.bak /usr/bin/budgie-daemon
|
||||||
|
else
|
||||||
|
echo -e "\nBudgie-daemon is already an original."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function budgieUpdate {
|
||||||
|
# Check for budgie and install App Switching hack
|
||||||
|
if [ -f /usr/bin/budgie-desktop ];then
|
||||||
|
while true; do
|
||||||
|
read -rep $'Would you like to update Budgie to support proper App Switching? (y/n)\n(Your system will immediately log you out after this runs.)\n' yn
|
||||||
|
case $yn in
|
||||||
|
[Yy]* ) yn="y"; break;;
|
||||||
|
[Nn]* ) yn="n";break;;
|
||||||
|
* ) echo "Please answer yes or no.";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
if [ "$yn" == "y" ]; then
|
||||||
|
budgieVersion="$(/usr/bin/budgie-desktop --version | awk '{ print $2; }' | head -n1)"
|
||||||
|
if [ "$budgieVersion" == "10.5.1" ]; then
|
||||||
|
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
|
||||||
|
wget https://github.com/rbreaves/budgie-desktop/raw/43d3b44243b0bcaee3262a79818024a651475b58/binaries/budgie-daemon_10.5.1 -O ./system-config/budgie-daemon_10.5.1
|
||||||
|
fi
|
||||||
|
bdmd5=$(md5sum /usr/bin/budgie-daemon | awk '{ print $1 }')
|
||||||
|
newbdmd5=$(md5sum ./system-config/budgie-daemon_10.5.1 | awk '{ print $1 }')
|
||||||
|
if [ "$bdmd5" != "$newbdmd5" ]; then
|
||||||
|
cp /usr/bin/budgie-daemon ./budgie-daemon_"$budgieVersion".bak
|
||||||
|
sudo pkill budgie-daemon && sudo cp ./system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
|
||||||
|
echo "Updated Budgie to use App Switching Patch"
|
||||||
|
else
|
||||||
|
echo "Budgie-daemon already patched, skipping replacement."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Your Budgie version was $budgieVersion and the patch is for 10.5.1."
|
||||||
|
while true; do
|
||||||
|
read -rep $'Would you like to replace it any ways? (y/n)\n(A backup will be made)\n' yn
|
||||||
|
case $yn in
|
||||||
|
[Yy]* ) yn="y"; break;;
|
||||||
|
[Nn]* ) yn="n";break;;
|
||||||
|
* ) echo "Please answer yes or no.";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
if [ "$yn" == "y" ]; then
|
||||||
|
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
|
||||||
|
wget https://github.com/rbreaves/budgie-desktop/raw/43d3b44243b0bcaee3262a79818024a651475b58/binaries/budgie-daemon_10.5.1 -O ./system-config/budgie-daemon_10.5.1
|
||||||
|
fi
|
||||||
|
cp /usr/bin/budgie-daemon ./budgie-daemon_"$budgieVersion".bak
|
||||||
|
sudo pkill budgie-daemon && sudo cp ./system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
|
||||||
|
echo "Updated Budgie to use App Switching Patch"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
echo "Install Kinto - xkeysnail (udev)"
|
echo "Install Kinto - xkeysnail (udev)"
|
||||||
echo " 1) Windows & Mac (HID driver)"
|
echo " 1) Windows & Mac (HID driver)"
|
||||||
@@ -125,6 +188,7 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
|||||||
sudo ./system-config/unipkg.sh "xorg-xhost gcc"
|
sudo ./system-config/unipkg.sh "xorg-xhost gcc"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# echo "Transferring files..."
|
# echo "Transferring files..."
|
||||||
mkdir -p ~/.config/kinto
|
mkdir -p ~/.config/kinto
|
||||||
|
|
||||||
@@ -189,17 +253,20 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
|||||||
sudo ln -s "$xkeypath"xkeysnail.service /etc/systemd/system/xkeysnail.service && echo "Created soft symlink..." || echo "Failed to create soft symlink..."
|
sudo ln -s "$xkeypath"xkeysnail.service /etc/systemd/system/xkeysnail.service && echo "Created soft symlink..." || echo "Failed to create soft symlink..."
|
||||||
sudo ln -s "$xkeypath"xkeysnail.service /etc/systemd/system/graphical.target.wants/xkeysnail.service && echo "Created soft symlink for graphical target..." || echo "Failed to create soft symlink for graphical target..."
|
sudo ln -s "$xkeypath"xkeysnail.service /etc/systemd/system/graphical.target.wants/xkeysnail.service && echo "Created soft symlink for graphical target..." || echo "Failed to create soft symlink for graphical target..."
|
||||||
xhost +SI:localuser:root
|
xhost +SI:localuser:root
|
||||||
git clone --depth 1 https://github.com/rbreaves/xkeysnail.git
|
git clone --depth 5 https://github.com/rbreaves/xkeysnail.git
|
||||||
|
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
|
||||||
cd xkeysnail
|
cd xkeysnail
|
||||||
giturl=$(git ls-remote --get-url)
|
giturl=$(git ls-remote --get-url)
|
||||||
if [ "$geturl" != "https://github.com/rbreaves/xkeysnail.git" ];then
|
if [ "$geturl" != "https://github.com/rbreaves/xkeysnail.git" ];then
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf ./xkeysnail
|
rm -rf ./xkeysnail
|
||||||
git clone --depth 1 https://github.com/rbreaves/xkeysnail.git
|
git clone --depth 5 https://github.com/rbreaves/xkeysnail.git
|
||||||
|
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
|
||||||
cd xkeysnail
|
cd xkeysnail
|
||||||
fi
|
fi
|
||||||
git pull origin master
|
git pull origin master
|
||||||
sudo pip3 install --upgrade .
|
sudo pip3 install --upgrade .
|
||||||
|
cd ..
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl --state=not-found --all | grep xkeysnail
|
sudo systemctl --state=not-found --all | grep xkeysnail
|
||||||
if [ "$distro" == "fedora" ];then
|
if [ "$distro" == "fedora" ];then
|
||||||
@@ -242,9 +309,7 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
|||||||
echo "You can run 'sudo systemctl status xkeysnail' for more info"
|
echo "You can run 'sudo systemctl status xkeysnail' for more info"
|
||||||
echo "You can also run 'sudo journalctl -u xkeysnail'"
|
echo "You can also run 'sudo journalctl -u xkeysnail'"
|
||||||
fi
|
fi
|
||||||
elif ! [[ $1 == "4" || $1 == "uninstall" ]]; then
|
elif [[ $1 == "4" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
|
||||||
echo "Expected argument was not provided"
|
|
||||||
else
|
|
||||||
echo "Uninstalling Kinto - xkeysnail (udev)"
|
echo "Uninstalling Kinto - xkeysnail (udev)"
|
||||||
uninstall
|
uninstall
|
||||||
# Undo Apple keyboard cmd & alt swap
|
# Undo Apple keyboard cmd & alt swap
|
||||||
@@ -263,5 +328,10 @@ else
|
|||||||
sudo rm /usr/lib/systemd/system/xkeysnail.service
|
sudo rm /usr/lib/systemd/system/xkeysnail.service
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl --state=not-found --all | grep xkeysnail
|
sudo systemctl --state=not-found --all | grep xkeysnail
|
||||||
|
budgieUninstall
|
||||||
exit 0
|
exit 0
|
||||||
|
elif [[ $1 == "5" || $1 == "budgieUpdate" ]]; then
|
||||||
|
budgieUpdate
|
||||||
|
else
|
||||||
|
echo "Expected argument was not provided"
|
||||||
fi
|
fi
|
Reference in New Issue
Block a user