No problem at all. Now that we have dealt with the GUI issue, you can move on to resolve the bluetooth keyboard issue. Are you still unable to pair the device?
First of all, please check whether the required kernel modules have been loaded:
$ lsmod | grep "btusb"
$ lsmod | grep "bluetooth"
Bluetooth keyboards usually aren’t too difficult to set up. I recommend starting with the steps described in the following article:
Yes, they appear to be loaded. Can you try the steps described in the Arch Wiki? If something goes wrong, hopefully, one of those commands will output an error message that can help us diagnose the problem.
Btw, Just to understand my issues a bit better.
Initially I had issue with my bluetooth right, because I could login once I disabled bluetooth service.
After that, I faced issue with the display manager?
How did you login at that time after you disabled the bluetooth service? If you logged in via the TTY after disabling the bluetooth service, then the fact that you were able to login might not have anything to do with the bluetooth service having been disabled at all.
My guess is that the display manager was preventing you from logging into your graphical environment and the bluetooth issue is a different issue, but I could be wrong.
The only thing I did was disabled the bluetooth service with systemctl and changed AutoEnable to false, and rebooted. It did log me in to i3 just with it.
Not sure if you really need the sed command. The output of tty is usually a path of the device file (e.g: /dev/tty1). You can just check whether the value of TTY is equals to /dev/tty1.
Similarly, I don’t think you need this as well.
You can also use command substitution instead of assigning the result of the tty command to a shell variable. In doing so, you can eliminate the awkward unset commands in the conditional.
if [ -z ${DISPLAY} ] && [ "$(tty)" = "/dev/tty1" ]
then
exec startx
fi
Alternatively, you can also do this:
if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" = 1 ]; then
exec startx
fi