Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authoradvaithm <advaith.madhukar@gmail.com>2021-04-09 13:16:39 +0530
committeradvaithm <advaith.madhukar@gmail.com>2021-04-09 13:16:39 +0530
commit349c3ec5b4e84a1c0df72eb2167fb04a3722b208 (patch)
treedf64a86518b8cbd850807808a0d55f16391dc113 /profiles
parent8a39bdde4b331a10376ae238b2b3df3a351ba06c (diff)
Update sway.py
Diffstat (limited to 'profiles')
-rw-r--r--profiles/sway.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/profiles/sway.py b/profiles/sway.py
index 8dd12c42..7a0b9beb 100644
--- a/profiles/sway.py
+++ b/profiles/sway.py
@@ -19,7 +19,19 @@ def _prep_function(*args, **kwargs):
print('Deprecated (??): xorg profile has no _prep_function() anymore')
def _post_install(*args, **kwargs):
- installation.log("we use the default configartion shipped by arch linux, if you wish to change it you should chroot into the installation and do it there\nto start sway run the command sway")
+ choice = input("Would you like to autostart sway on login [Y/n]: ")
+ if choice.lower == "y":
+ with open(f"{installation.mountpoint}/etc/profile", "a") as f:
+ x = """
+ if [ -z $DISPLAY ] && [ "$(tty)" == "/dev/tty1" ]; then
+ exec sway
+ fi
+ """
+ f.write(x)
+ f.close()
+ else:
+ installation.log("to start sway run the command sway")
+ installation.log("we use the default configartion shipped by arch linux, if you wish to change it you should chroot into the installation and modify it")
# Ensures that this code only gets executed if executed
# through importlib.util.spec_from_file_location("kde", "/somewhere/kde.py")
# or through conventional import kde