We study a nonlinear periodic problem driven by the p(t)-Laplacian and having a nonsmooth potential (hemivariational inequalities). Using a variational method based on nonsmooth critical point theory for locally Lipschitz functions, we first prove the existence of at least two nontrivial solutions under the generalized subquadratic and then establish the existence of at least one nontrivial solution under the generalized superquadratic.