Starting in sway config crashes, after sway the same command works #1

Closed
opened 2023-01-24 02:01:36 +01:00 by redxef · 1 comment
Owner

Some python library imports seem to be the culprit (starting in i3 works fine).

sway.conf

exec --no-startup-id sh -c '/usr/local/bin/i3toolwait > boot.log' 

/usr/local/bin/i3toolwait

#!/usr/bin/env pyhthon3
# -*- coding: utf-8 -*-

print("before import")

import string
import typing
#import asyncio
#import time
import signal
import os
import functools
import json
#import logging
#
import yaml
#import click
#import pydantic
#import i3ipc
#import i3ipc.aio

print("after import")

try:
    from yaml import CSafeLoader as SafeLoader
except ImportError:
    from yaml import SafeLoader

Works with this and prints (both) statements. Uncommenting any of the imports breaks the autostart (but not when calling the same script manually after sway has started). It won't print any of the two statements, any command after the script (added with ; echo "after" for example) will also not be executed.

sh-5.1$ uname -srvmpio
Linux 6.1.7-1-MANJARO-ARM #1 SMP PREEMPT Thu Jan 19 03:22:26 CET 2023 aarch64 unknown unknown GNU/Linux
sh-5.1$ python3 --version
Python 3.10.9
sh-5.1$ sway --version
sway version 1.8
sh-5.1$ i3 --version
i3 version 4.22 (2023-01-02) © 2009 Michael Stapelberg and contributors 
sh-5.1$ cd /usr/src/i3toolwait && git show-ref HEAD
d3d4530cfdf91e7c31fea3274e0f6f877e1373db refs/remotes/origin/HEAD
Some python library imports seem to be the culprit (starting in i3 works fine). *sway.conf* ``` exec --no-startup-id sh -c '/usr/local/bin/i3toolwait > boot.log' ``` */usr/local/bin/i3toolwait* ```python3 #!/usr/bin/env pyhthon3 # -*- coding: utf-8 -*- print("before import") import string import typing #import asyncio #import time import signal import os import functools import json #import logging # import yaml #import click #import pydantic #import i3ipc #import i3ipc.aio print("after import") try: from yaml import CSafeLoader as SafeLoader except ImportError: from yaml import SafeLoader ``` Works with this and prints (both) statements. Uncommenting any of the imports breaks the autostart (but not when calling the same script manually after sway has started). It won't print any of the two statements, any command after the script (added with `; echo "after"` for example) will also not be executed. ```sh sh-5.1$ uname -srvmpio Linux 6.1.7-1-MANJARO-ARM #1 SMP PREEMPT Thu Jan 19 03:22:26 CET 2023 aarch64 unknown unknown GNU/Linux sh-5.1$ python3 --version Python 3.10.9 sh-5.1$ sway --version sway version 1.8 sh-5.1$ i3 --version i3 version 4.22 (2023-01-02) © 2009 Michael Stapelberg and contributors sh-5.1$ cd /usr/src/i3toolwait && git show-ref HEAD d3d4530cfdf91e7c31fea3274e0f6f877e1373db refs/remotes/origin/HEAD ```
Author
Owner

A few updates later with

sh-5.1$ uname -srvmpio
Linux 6.2.8-1-MANJARO-ARM #1 SMP PREEMPT Sun Mar 26 04:50:09 CEST 2023 aarch64 unknown unknown GNU/Linux
sh-5.1$ python3 --version
Python 3.10.10
sh-5.1$ sway --version
sway version 1.8.1
sh-5.1$ i3 --version
i3 version 4.22 (2023-01-02) © 2009 Michael Stapelberg and contributors
sh-5.1$ cd /usr/src/i3toolwait && git show-ref HEAD
d3d4530cfdf91e7c31fea3274e0f6f877e1373db refs/remotes/origin/HEAD

Everything works fine.

A few updates later with ```sh sh-5.1$ uname -srvmpio Linux 6.2.8-1-MANJARO-ARM #1 SMP PREEMPT Sun Mar 26 04:50:09 CEST 2023 aarch64 unknown unknown GNU/Linux sh-5.1$ python3 --version Python 3.10.10 sh-5.1$ sway --version sway version 1.8.1 sh-5.1$ i3 --version i3 version 4.22 (2023-01-02) © 2009 Michael Stapelberg and contributors sh-5.1$ cd /usr/src/i3toolwait && git show-ref HEAD d3d4530cfdf91e7c31fea3274e0f6f877e1373db refs/remotes/origin/HEAD ``` Everything works fine.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: redxef/i3toolwait#1
No description provided.