The sentence goes like this:
ハジメの場合、単に面倒というだけでなく、学校の居心地がすこぶる付きで悪いが故の憂鬱さが多分に含まれていたが。
I know the sentence goes something like this
In Hajime case, it wasn't just mere trouble, the reason he was not feeling good at school was due to feeling depressed.
But I still don't get the で in 付きで悪い