I recently compiled ladybird in an SerenityOS using i3wm. I am trying to figure out how to bind i3wm to the hotkey
$mod+w
I have tried running it using the following code
bindsym exec --no-startup-id /home/hasabob/ladybird/Meta/ladybird.sh run ladybird
I tried running the pure bash equivalent of this in a terminal
/home/hasabob/ladybird/Meta/ladybird.sh run ladybird
and it worked, but only inside the directory. As soon as i exited the directory i would get an error message along the lines of 'this directory is not a git repository, neither are any of its parents' (i don't currently have access to the system, most of this is going of my memory of the issue). This means, as far as i can tell, that i need to run that command within the directory, somehow, from the config file. I tried making a shell script that just runs this command from within the Meta/
directory, but when i run the shell script outside the Meta/
directory, i get the exact same error message. I am neither intelligent enough nor patient enough to solve this problem. Sorry for the really stupid question by the way, i am noob.
EDIT:
i found a solution. I was originally going to use subshells (very useful if you don't know about them, just quickly check all that out) I ended up playing around a little and found that the following works
set $ladyDir /home/hasabob/ladybird/Meta
bindsym $mod+w exec --no-startup-id alacritty -e sh -c "cd $ladyDir && ./ladybird.sh run"
Im not actually totally sure why this works rather than subshells, so can some please tell me? i would really like to learn.