- xkeysnail install improvements wip

This commit is contained in:
Ben Reaves
2020-05-02 17:55:46 -05:00
parent 49d9cee349
commit 78efb69287
2 changed files with 44 additions and 11 deletions

View File

@@ -1,14 +1,12 @@
#!/bin/bash
if systemctl -q --user is-enabled keyswap.timer; then
systemctl --user stop keyswap.timer
systemctl --user disable keyswap.timer
if [ -f /home/{username}/.config/systemd/user/keyswap.timer ]; then
systemctl --user stop keyswap.timer >/dev/null 2>&1
systemctl --user disable keyswap.timer >/dev/null 2>&1
fi
if systemctl -q --user is-active keyswap; then
systemctl --user stop keyswap
fi
if systemctl -q --user is-enabled keyswap; then
systemctl --user disable keyswap
if [ -f /home/{username}/.config/systemd/user/keyswap.service ]; then
systemctl --user stop keyswap >/dev/null 2>&1
systemctl --user disable keyswap >/dev/null 2>&1
fi
# export DISPLAY={displayid};/usr/bin/xhost +SI:localuser:root

View File

@@ -3,6 +3,9 @@
# set about:config?filter=ui.key.menuAccessKeyFocuses
# to false for wordwise to work in Firefox
typeset -l distro
distro=$(awk -F= '$1=="NAME" { print $2 ;}' /etc/os-release)
function uninstall {
typeset -l dename
dename=$(./system-config/dename.sh | cut -d " " -f1)
@@ -102,7 +105,17 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
echo "Will need to install python3-pip..."
sudo ./system-config/unipkg.sh python3-pip
fi
if ! [ -x "$(command -v python3-config)" ]; then
if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ]; then
pydev="python3-dev"
elif [ "$distro" == "fedora" ]; then
pydev="python3-devel"
fi
if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "$distro" == "debian" ]; then
echo "Will need to install $pydev..."
sudo ./system-config/unipkg.sh "$pydev"
fi
fi
# echo "Transferring files..."
mkdir -p ~/.config/kinto
@@ -154,7 +167,18 @@ fi
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
mv ./xkeysnail-config/kinto.py.new ~/.config/kinto/kinto.py
sudo mv ./xkeysnail-config/xkeysnail.service.new /etc/systemd/system/xkeysnail.service
# if [ "$distro" == "fedora" ];then
sudo rm /etc/systemd/system/xkeysnail.service
sudo mv ./xkeysnail-config/xkeysnail.service.new /usr/lib/systemd/system/xkeysnail.service
sudo chown -R root:root /usr/lib/systemd/system/xkeysnail.service
sudo chmod 644 /usr/lib/systemd/system/xkeysnail.service
sudo ln -s /usr/lib/systemd/system/xkeysnail.service /etc/systemd/system/xkeysnail.service
sudo ln -s /usr/lib/systemd/system/xkeysnail.service /etc/systemd/system/graphical.target.wants/xkeysnail.service
# else
# sudo mv ./xkeysnail-config/xkeysnail.service.new /etc/systemd/system/xkeysnail.service
# sudo chown -R root:root /etc/systemd/system/xkeysnail.service
# sudo chmod 644 /etc/systemd/system/xkeysnail.service
# fi
xhost +SI:localuser:root
git clone --depth 1 https://github.com/rbreaves/xkeysnail.git
cd xkeysnail
@@ -167,8 +191,13 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
fi
git pull origin master
sudo pip3 install --upgrade .
sudo systemctl enable xkeysnail.service
sudo systemctl daemon-reload
sudo systemctl --state=not-found --all | grep xkeysnail
if [ "$distro" == "fedora" ];then
systemctl enable xkeysnail.service
else
sudo systemctl enable xkeysnail.service
fi
sudo systemctl restart xkeysnail
echo -e "Adding xhost fix...\n"
@@ -219,4 +248,10 @@ else
sudo rm /etc/sudoers.d/limitedadmins
rm ~/.config/autostart/xkeysnail.desktop
rm -rf ~/.config/kinto
sudo rm /etc/systemd/system/xkeysnail.service
sudo rm /etc/systemd/system/graphical.target.wants/xkeysnail.service
sudo rm /usr/lib/systemd/system/xkeysnail.service
sudo systemctl daemon-reload
sudo systemctl --state=not-found --all | grep xkeysnail
exit 0
fi