Skip to content

Commit

Permalink
Merge pull request #46 from rbreaves/hotfix
Browse files Browse the repository at this point in the history
- Resolved possible issue with Display env variable
  • Loading branch information
rbreaves authored Feb 25, 2020
2 parents 0e23aae + c8ca073 commit 0196cc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions keyswap_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ systemctl --user stop keyswap >/dev/null 2>&1
systemctl --user disable keyswap >/dev/null 2>&1
systemctl --user stop keyswap.timer >/dev/null 2>&1
systemctl --user disable keyswap.timer >/dev/null 2>&1
swapcmd="\/bin\/bash -c \"\/home\/`whoami`\/.config\/kinto\/xactive.sh carrots\""
swapstopcmd="\/bin\/bash \/home\/`whoami`\/.config\/kinto\/cleanup.sh"
mkdir -p ~/.config/systemd/user
mkdir -p ~/.config/autostart
cp ./system-config/keyswap.service ~/.config/systemd/user/keyswap.service
Expand All @@ -16,6 +14,11 @@ cp ./system-config/caret_status.sh ~/.config/kinto/caret_status.sh
cp ./system-config/cleanup.sh ~/.config/kinto/cleanup.sh
cp ./system-config/.firefox-nw ~/.config/kinto/.firefox-nw
sed -i "s/{username}/`whoami`/g" ~/.config/systemd/user/keyswap.service
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/systemd/user/keyswap.service
if [ "${#DISPLAY}" -gt 2 ]
then
sed -i "s/#Environment/Environment/g" ~/.config/systemd/user/keyswap.service
fi
systemctl --user daemon-reload
systemctl --user enable keyswap
systemctl --user start keyswap
3 changes: 2 additions & 1 deletion system-config/keyswap.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ PartOf=graphical-session.target
[Service]
Type=simple
Restart=always
#Environment=DISPLAY=:0.0
# eg DISPLAY=:0.0
#Environment=DISPLAY={displayid}
RestartSec=1
WorkingDirectory=/home/{username}/.config/kinto
ExecStart=/bin/bash -c "/home/{username}/.config/kinto/xactive.sh carrots"
Expand Down

0 comments on commit 0196cc3

Please sign in to comment.