- Several changes, need to do more testing before merging into master. It appears to work on chromebooks though, the more difficult of the 3.

This commit is contained in:
Ryan Reaves
2019-07-30 02:33:52 -05:00
parent 930279ba9e
commit 53ad0d579f
6 changed files with 78 additions and 63 deletions

18
keyswap_service.sh Normal file → Executable file
View File

@@ -1,15 +1,23 @@
#!/bin/bash
swapbehavior=$1
newparams=$2
noswapcmd=$3
noswapcmd=$2
if [[ "$swapbehavior" == "yes" ]]; then
swapcmd="/bin/bash /home/`whoami`/.config/xactive.sh $2"
systemtype=$3
internalid=$4
usbid=$5
chromeswap=$6
if [[ "$swapbehavior" == "1" ]]; then
swapcmd="\/bin\/bash\ \/home\/`whoami`\/.config\/xactive.sh\ ${systemtype}\ ${internalid}\ ${usbid}\ ${chromeswap}"
mkdir -p ~/.config/systemd/user
cp ./system-config/keyswap.service ~/.config/systemd/user/keyswap.service
sed -i "s/{username}/${whoami}/g" ~/.config/systemd/user/keyswap.service
cp ./system-config/keyswap.sh ~/.config/autostart/keyswap.sh
cp ./system-config/xactive.sh ~/.config/xactive.sh
sed -i "s/{username}/`whoami`/g" ~/.config/systemd/user/keyswap.service
sed -i "s/ExecStart=/ExecStart=${swapcmd}/g" ~/.config/systemd/user/keyswap.service
systemctl --user enable keyswap
systemctl --user start keyswap
else
#/usr/bin/setxkbmap
#/usr/bin/xkbcomp