I would start small and check for air in your high pressure fuel lines to injectors. 98% of the time there is rough idling with my diesels it is air in high pressure lines. Hard for it to get there randomly, but it can. Easy for it to get there if changing filters etc, or there are any fuel/air leaks in your system.
Way to bleed is start truck, bring up to idle where it will stay idling... Crack metal line to injectors one at a time with engine running. Probably want to put towel over injector while you are doing this otherwise diesel goes everywhere. Let fuel pour out a little then tighten. Do not overtighten. Use air to blow off diesel that has accumulated, if still leaking then loosen and retighten, do not over tighten... Do this on all 4 cyls, one at a time, then rev a few times to get any residual air through and outof system. If idle doesn't stabilize then check elsewhere. If you attempt bleed and F something up so it won't run or start, don't worry, turn off truck if not already off, loosen all four lines where it meets injectors, put towel over, and crnak for about 20-30 seconds. Then tighten, clean up, then start. Then rev. Then you should be fine, if not, repeat individual bleeding as described before. If none of this helps anything then start checking elsewhere. It is probably not something majorly mechanical is my guess...
Again, it is very possible to get air in system with changing of filters etc... Or if you run out of fuel somehow. Usually you can 'drive out' of it by revving hard and that will consume air, if its only minimal, but if not then you may have to bleed. If it was running well and you were on any weird angle or changed a filter, or simply ran out of fuel, you usually have to do this... Andre