mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-01 16:56:38 +02:00
- Updated xkeysnail installer and permissions
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# /etc/sudoers.d/limitedadmins
|
# /etc/sudoers.d/limitedadmins
|
||||||
%{username} ALL=NOPASSWD: /bin/systemctl restart xkeysnail
|
%{username} ALL=NOPASSWD: {systemctl} restart xkeysnail
|
||||||
%{username} ALL=NOPASSWD: /bin/systemctl start xkeysnail
|
%{username} ALL=NOPASSWD: {systemctl} start xkeysnail
|
||||||
%{username} ALL=NOPASSWD: /bin/systemctl stop xkeysnail
|
%{username} ALL=NOPASSWD: {systemctl} stop xkeysnail
|
||||||
%{username} ALL=NOPASSWD: /bin/systemctl status xkeysnail
|
%{username} ALL=NOPASSWD: {systemctl} status xkeysnail
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
Name=Kinto_xkey
|
Name=Kinto_xkey
|
||||||
GenericName=Kinto_xkey
|
GenericName=Kinto_xkey
|
||||||
Comment=Make Linux Type Like it's a Mac
|
Comment=Make Linux Type Like it's a Mac
|
||||||
Exec=/bin/bash -c "/usr/bin/xhost +SI:localuser:root && sudo /bin/systemctl restart xkeysnail"
|
Exec=/bin/bash -c "{xhost} +SI:localuser:root && sudo {systemctl} restart xkeysnail"
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
X-GNOME-Autostart-enabled=true
|
X-GNOME-Autostart-enabled=true
|
@@ -4,7 +4,7 @@ Description=xkeysnail
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
KillMode=process
|
KillMode=process
|
||||||
ExecStartPre=/usr/bin/xhost +SI:localuser:root;/sbin/runuser -l {username} -c /home/{username}/.config/kinto/prexk.sh
|
ExecStartPre=/bin/bash -c "{xhost} +SI:localuser:root && /sbin/runuser -l {username} -c /home/{username}/.config/kinto/prexk.sh"
|
||||||
ExecStart=/usr/bin/sudo /bin/bash -c '/home/{username}/.config/kinto/xkeystart.sh "/tmp/kinto/kinto.py"'
|
ExecStart=/usr/bin/sudo /bin/bash -c '/home/{username}/.config/kinto/xkeystart.sh "/tmp/kinto/kinto.py"'
|
||||||
ExecStop=/usr/bin/sudo /usr/bin/killall xkeysnail
|
ExecStop=/usr/bin/sudo /usr/bin/killall xkeysnail
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
@@ -34,12 +34,18 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
|||||||
|
|
||||||
yes | cp -rf ./xkeysnail-config/xkeystart.sh ~/.config/kinto/xkeystart.sh
|
yes | cp -rf ./xkeysnail-config/xkeystart.sh ~/.config/kinto/xkeystart.sh
|
||||||
yes | cp -rf ./xkeysnail-config/kinto.py ./xkeysnail-config/kinto.py.new
|
yes | cp -rf ./xkeysnail-config/kinto.py ./xkeysnail-config/kinto.py.new
|
||||||
|
yes | cp -rf ./xkeysnail-config/limitedadmins ./xkeysnail-config/limitedadmins.new
|
||||||
yes | cp -rf ./xkeysnail-config/prexk.sh ~/.config/kinto/prexk.sh
|
yes | cp -rf ./xkeysnail-config/prexk.sh ~/.config/kinto/prexk.sh
|
||||||
yes | cp -rf ./xkeysnail-config/start-xkeysnail.sh ~/.config/kinto/start-xkeysnail.sh
|
|
||||||
yes | cp -rf ./xkeysnail-config/xkeysnail.service ./xkeysnail-config/xkeysnail.service.new
|
yes | cp -rf ./xkeysnail-config/xkeysnail.service ./xkeysnail-config/xkeysnail.service.new
|
||||||
yes | cp -rf ./xkeysnail-config/user_xkeysnail.service ~/.config/systemd/user/xkeysnail.service
|
|
||||||
# yes | cp -rf ./xkeysnail-config/xkeysnail.timer ~/.config/systemd/user/xkeysnail.timer
|
# yes | cp -rf ./xkeysnail-config/xkeysnail.timer ~/.config/systemd/user/xkeysnail.timer
|
||||||
sed -i "s/{username}/`whoami`/g" ./xkeysnail-config/xkeysnail.service.new
|
sed -i "s/{username}/`whoami`/g" ./xkeysnail-config/xkeysnail.service.new
|
||||||
|
sed -i "s#{xhost}#`which xhost`#g" ./xkeysnail-config/xkeysnail.service.new
|
||||||
|
sed -i "s/{username}/`whoami`/g" ./xkeysnail-config/limitedadmins.new
|
||||||
|
sed -i "s#{systemctl}#`which systemctl`#g" ./xkeysnail-config/limitedadmins.new
|
||||||
|
sudo chown root:root ./xkeysnail-config/limitedadmins.new
|
||||||
|
sudo mv ./xkeysnail-config/limitedadmins.new /etc/sudoers.d/limitedadmins
|
||||||
|
sed -i "s#{systemctl}#`which systemctl`#g" ~/.config/autostart/xkeysnail.desktop
|
||||||
|
sed -i "s#{xhost}#`which xhost`#g" ~/.config/autostart/xkeysnail.desktop
|
||||||
sed -i "s/{username}/`whoami`/g" ~/.config/kinto/prexk.sh
|
sed -i "s/{username}/`whoami`/g" ~/.config/kinto/prexk.sh
|
||||||
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ./xkeysnail-config/xkeysnail.service.new
|
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ./xkeysnail-config/xkeysnail.service.new
|
||||||
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/kinto/prexk.sh
|
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/kinto/prexk.sh
|
||||||
@@ -84,16 +90,23 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
|||||||
# grep -qF -- "$LINE" ~/.xinitrc || echo "$LINE" >> ~/.xinitrc
|
# grep -qF -- "$LINE" ~/.xinitrc || echo "$LINE" >> ~/.xinitrc
|
||||||
|
|
||||||
# remove kintox11 login startup
|
# remove kintox11 login startup
|
||||||
rm ~/.config/autostart/kinto.desktop
|
if test -f "~/.config/autostart/kinto.desktop"; then
|
||||||
|
rm ~/.config/autostart/kinto.desktop
|
||||||
|
fi
|
||||||
elif ! [[ $1 == "4" || $1 == "uninstall" ]]; then
|
elif ! [[ $1 == "4" || $1 == "uninstall" ]]; then
|
||||||
echo "Expected argument was not provided"
|
echo "Expected argument was not provided"
|
||||||
else
|
else
|
||||||
echo "Uninstalling Kinto - xkeysnail (udev)"
|
echo "Uninstalling Kinto - xkeysnail (udev)"
|
||||||
echo '0' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd;echo 'options hid_apple swap_opt_cmd=0' | sudo tee -a /etc/modprobe.d/hid_apple.conf;sudo update-initramfs -u -k all
|
# Undo Apple keyboard cmd & alt swap
|
||||||
# sudo systemctl stop xkeysnail.timer
|
if test -f "/sys/module/hid_apple/parameters/swap_opt_cmd" && [ `cat /sys/module/hid_apple/parameters/swap_opt_cmd` == "1" ]; then
|
||||||
# sudo systemctl disable xkeysnail.timer
|
echo '0' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd
|
||||||
sudo systemctl enable xkeysnail
|
echo 'options hid_apple swap_opt_cmd=0' | sudo tee -a /etc/modprobe.d/hid_apple.conf
|
||||||
sudo systemctl restart xkeysnail
|
sudo update-initramfs -u -k all
|
||||||
|
fi
|
||||||
|
sudo systemctl stop xkeysnail
|
||||||
|
sudo systemctl disable xkeysnail
|
||||||
|
sudo rm /etc/sudoers.d/limitedadmins
|
||||||
|
rm ~/.config/autostart/xkeysnail.desktop
|
||||||
rm -rf ~/.config/kinto
|
rm -rf ~/.config/kinto
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user