From 0e23aae082c1d548eccba35fdfde072a6fca2e9a Mon Sep 17 00:00:00 2001 From: Ryan Reaves Date: Tue, 25 Feb 2020 15:22:48 -0600 Subject: [PATCH 1/3] - Updated installer to check for x11 more reliably --- setup.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 8cd370e..d6c2db5 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,8 @@ def install_ibus(): input("IBus has been set as the default Input Method.\nPress any key to exit and re-run after logoff & logon...") sys.exit() -check_x11 = cmdline("env | grep -i x11").strip() +# check_x11 = cmdline("env | grep -i x11").strip() +check_x11 = cmdline("loginctl show-session \"$XDG_SESSION_ID\" -p Type | awk -F= '{print $2}'").strip() if len(check_x11) == 0: print("You are not using x11, please logout and back in using x11/Xorg") @@ -55,8 +56,6 @@ if len(pkgm) == 0: pkgm = cmdline("which pacman 2>/dev/null").strip() if len(pkgm) > 0: pkgm += " -S " -else: - print("hello") if len(pkgm) == 0: From c8ca073875cfce1fd8ed3778445b8f1384f2e945 Mon Sep 17 00:00:00 2001 From: Ryan Reaves Date: Tue, 25 Feb 2020 15:56:29 -0600 Subject: [PATCH 2/3] - Resolved possible issue with Display env variable --- keyswap_service.sh | 7 +++++-- system-config/keyswap.service | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/keyswap_service.sh b/keyswap_service.sh index 3b9841b..aea1719 100755 --- a/keyswap_service.sh +++ b/keyswap_service.sh @@ -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 @@ -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 diff --git a/system-config/keyswap.service b/system-config/keyswap.service index e0da960..cfc5896 100755 --- a/system-config/keyswap.service +++ b/system-config/keyswap.service @@ -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" From c5f1764dfa20212269c7ff8d9b646d454bf73ff1 Mon Sep 17 00:00:00 2001 From: Ryan Reaves Date: Tue, 25 Feb 2020 16:39:47 -0600 Subject: [PATCH 3/3] - Added both x11 checks to further compatibility --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d6c2db5..66071d0 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ def install_ibus(): sys.exit() # check_x11 = cmdline("env | grep -i x11").strip() -check_x11 = cmdline("loginctl show-session \"$XDG_SESSION_ID\" -p Type | awk -F= '{print $2}'").strip() +check_x11 = cmdline("env | grep -i x11 || loginctl show-session \"$XDG_SESSION_ID\" -p Type | awk -F= '{print $2}'").strip() if len(check_x11) == 0: print("You are not using x11, please logout and back in using x11/Xorg")