There are two potential ways to have your shields adjust. One from remote sensing, one from direct sensing.
Remote Sensing:
For a light-speed weapon, if the first time it is fired in a battle is against you and if it hits on that shot then the first notice (outside having a "shell" of FTL sensing somethings) you will get of that is of it actually hitting you. See direct sensing for that case. However, if it is ever fired other times prior to the shot that hits you (against other targets, or against you and missing) then you have a chance to determine its frequency. Lasers have one very telling property that makes them relatively easy to discern, and that is they are extremely monochromatic. This is what makes it relatively easy to make laser "radar detectors" (really lidar detectors) for cars on earth. The laser of a police lidar is scattered somewhat by dust and by whatever else it hits and that scattering combined with the fact it is extremely monochromatic makes it relatively easy to distinguish from other EM sources. For space-born laser weapons, well, even in space there are some particles. The Earth's observable exosphere extends to at least 10,000km. For some planets this could conceivably extend much, much further. Even far away from a planet with an atmosphere, there is always some dust, some hydrogen - in some areas much more than others. And, presumably, in an area where there is a space battle, there could be a lot of "stuff" around that might cause some scattering of a laser weapon. Gas and particulate from engines and thrusters, debris, vented ship atmosphere, and the hulls of other ships being hit with the same weapons. And with laser weapons, which are presumably quite powerful, it wouldn't take much to create enough scatter for another ship to detect it. In fact, there may be enough scatter just from the laser's own focusing lens, since no lens is perfect. Ships' combat and target threat management systems and operators can be set up to look for that monochromatic scatter and trace it back to the firing ship in order to determine the best shield parameters to use for that ship's weapons. While the firing ship may have more than one laser weapon, it's unlikely that any one weapon will be able to fire many different frequencies. Lasers are something, at least with technology we can reasonably foresee today, that you can't really make to be frequency agile.
Direct Sensing
As noted above, in a scenario where there is a surprise shot, where an enemy ship fires for the first time on you and that shot hits, then the first notice you will have is that shot hitting you. Outside of FTL somethings. However, that doesn't mean the game is over. People tend to think of a laser as either hitting or not hitting. In reality it is, of course, more complicated. The amount of energy actually transmitted by a laser weapon will depend on the power output of the laser (in watts) and the length of time it dwells on target: E = P × t which means that a large factor in your shields protecting you against a laser they are not currently configured for will be their reaction time. The better welding masks, that protect your eyes from the extremely high intensity light of arc welding at close distances, are LCD masks. They are, essentially, just a large single cell of liquid crystal between two panes of glass, connected to a light sensor. When the light sensor goes off, the LCD goes dark and blocks the light. But this means some of that light has already passed the filter by the time it reacts. The key is, was there enough to do any damage to the retina? The answer is no - these type of masks are proven safe and are regulated by many different national standards agencies. So, the lower the length of time, t, that the laser is on you, the less power is actually transmitted to the ship. With a sufficiently rapid shield reaction, there would be essentially no damage. No matter the power, P, of the laser, as t approaches zero, so does the amount of energy transmitted to the ship. Of course, the more powerful the weapon, the faster the shields must react to prevent damage. This might infer an "arms race" trying to make lasers that produce very high energy pulses, and shields that react more quickly.