- Updated keyswap service template and added service.sh install script

This commit is contained in:
Ryan Reaves
2019-07-29 23:06:29 -05:00
parent a0778dede7
commit 930279ba9e
2 changed files with 25 additions and 1 deletions

24
keyswap_service.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
swapbehavior=$1
newparams=$2
noswapcmd=$3
if [[ "$swapbehavior" == "yes" ]]; then
swapcmd="/bin/bash /home/`whoami`/.config/xactive.sh $2"
cp ./system-config/keyswap.service ~/.config/systemd/user/keyswap.service
sed -i "s/{username}/${whoami}/g" ~/.config/systemd/user/keyswap.service
sed -i "s/ExecStart=/ExecStart=${swapcmd}/g" ~/.config/systemd/user/keyswap.service
else
#/usr/bin/setxkbmap
#/usr/bin/xkbcomp
#echo $XDG_SESSION_TYPE
if [ ! -f "~/.Xsession" ]; then
echo "$noswapcmd" > ~/.Xsession
fi
grep "xkb" ~/.Xsession 1>/dev/null
if [ $? -eq 1 ]; then
echo "$noswapcmd" >> ~/.Xsession
fi
fi