You are not logged in.

#1 2022-05-11 17:50:17

difri84
Member
Registered: 2021-12-09
Posts: 78

i3 bind weird behaviour [SOLVED]

i made a script with the purpuse of creating 2 containers calling a json i3 layout,  load thunar ~/Music and vlc on the workspace 7

if i launch the script from terminal it works perfeclty

if i bind it in i3 the behaviour is quite odd:
it creates the 2 containers, the thunar container is fully black and vlc is loaded fine. i can see thunar in pgrep tough.

how is this possible?
when i was using pcmanfm it was working fine.

Last edited by difri84 (2022-05-11 21:43:03)

Offline

#2 2022-05-11 19:11:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,497
Website

Re: i3 bind weird behaviour [SOLVED]

difri84 wrote:

i made a script ... if i bind it in i3 the behaviour is quite odd ... how is this possible?

If you actually want an answer, shouldn't you post or link to the script?  Without all you'll get is riduculously wild guesses - though perhaps the common theme would simply be that the running environment differs.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2022-05-11 19:49:16

difri84
Member
Registered: 2021-12-09
Posts: 78

Re: i3 bind weird behaviour [SOLVED]

i thought it wouldn't be necessary since the script works perfectly fine if called from terminal,

anyway..

Script:

#!/bin/bash
i3-msg "workspace 7:; append_layout ~/.config/i3/music/music.json"
thunar ~/Music &
vlc

Json layout file:

{
    "border": "pixel",
    "floating": "auto_off",
    "layout": "splitv",
    "percent": null,
    "type": "con",
    "nodes": [
        {
            "border": "pixel",
            "floating": "auto_off",
            "percent": 0.9,
            "swallows": [
               {
               "class": "^Thunar",
               "instance": "^thunar",
               "title": "Music"
               }
            ],
            "type": "con"
        },
        {
            "border": "pixel",
            "floating": "auto_off",
            "percent": 0.1,
            "swallows": [
            {
            "class": "^vlc",
            "instance": "^vlc",
            "title": "*"
            }
       ],
       "type": "con"
       }
    ]
}

call command in i3 config:

bindsym $mod+Control 7 exec ~/.config/i3/music/music.sh

Last edited by difri84 (2022-05-11 19:51:19)

Offline

#4 2022-05-11 20:55:22

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,244

Re: i3 bind weird behaviour [SOLVED]

Race?
What if you "sleep 1" after the i3-msg?

Offline

#5 2022-05-11 21:22:18

difri84
Member
Registered: 2021-12-09
Posts: 78

Re: i3 bind weird behaviour [SOLVED]

just tried it and nothing different happens sad
maybe is there some problem in the way i call the script in i3 config?

i dont understand the race? question

Last edited by difri84 (2022-05-11 21:26:33)

Offline

#6 2022-05-11 21:25:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,244

Re: i3 bind weird behaviour [SOLVED]

https://en.wikipedia.org/wiki/Race_condition

The shortcut will cause an active keyboard grab - you could try to sleep *before* the i3-msg to allow yourself to release the key.
Not sure whether that's the cause, though.

Offline

#7 2022-05-11 21:29:31

difri84
Member
Registered: 2021-12-09
Posts: 78

Re: i3 bind weird behaviour [SOLVED]

same result again.
thing is the same script was working fine with pcmanfm
the only reason i switched to thunar is the feature about remember specific folder view preference.
can i achieve the same with pcmanfm? it seemed not to me when i looked for it but maybe i missed something

EDIT
solved switching to nemo

CONCLUSION
since the problem happens only using thunar i guess there's something in thunar code causing it

Last edited by difri84 (2022-05-11 21:42:37)

Offline

Board footer

Powered by FluxBB