Thats what I do, although make sure your speakers are turned off when you have your headphones plugged in, I was once listening to loud music on headphones one night, only to then realise its also waking everyone up from my speakers, nice, lol.

Just get yourself a Plantronics Audio headphone switch.
Cost about £10 delivered.
Just google it.
It's great as i don't have to go under my desk everynight when i use my headphone 