I wrote to the developer of the CWP Dark Theme variant on GitHub with some suggestions, but I'll post this here, too. As others point out, the admin theme customizations are overwritten with each update, so you have to call this script via cron after the update or manually run this script to re-apply the dark theme. I took the opportunity to clean up his code a bit, but this is what I am using.
Create the file:
/scripts/dark_cwp
Set it as executable:
chmod +x /scripts/dark_cwp
Here is the updated script:
#!/bin/bash
#=====================================#
# StingRay's Total Dark Theme for CWP #
#=====================================#
# Need to be a sudoer/root
sudo -p "Please authenticate to enable CWP Dark Theme (admin password): " printf "" || {
echo "Abort: could not authenticate" >&2
exit 1
}
echo "Applying Dark Theme to CWP..."
sudo chattr -i /usr/local/cwpsrv/htdocs/admin/design/css/custom.css
sudo chmod 644 /usr/local/cwpsrv/htdocs/admin/design/css/custom.css
sudo tee -a /usr/local/cwpsrv/htdocs/admin/design/css/custom.css <<'END' > /dev/null
/* DARK THEME */
html,.deleted
{
background:#000;
-webkit-filter:invert(1) hue-rotate(180deg)!important;
-moz-filter:invert(1) hue-rotate(180deg)!important;
filter:invert(1) hue-rotate(180deg)!important;
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=0,xray=0,mirror=0,invert=1,opacity=1,rotation=2)!important;
-webkit-transition:100ms ease all;
transition:100ms ease all;
-o-transition-duration:100ms ease all
}
img,embed[flashvars],[type*=\"application/x-shockwave-flash\"],[type*=\"application/x-silverlight\"]
{
-webkit-filter:invert(1) hue-rotate(180deg)!important;
-moz-filter:invert(1) hue-rotate(180deg)!important;
filter:invert(1) hue-rotate(180deg)!important;
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=0,xray=0,mirror=0,invert=1,opacity=1,rotation=2)!important;
}
tr > td > a > img,th > a > img
{
filter:url(\"data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'invert\'><feColorMatrix type=\'matrix\' values=\'-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0\$filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=0,xray=0,mirror=0,invert=0,opacity=1,rotation=2)!important
}
END
sudo chattr +i /usr/local/cwpsrv/htdocs/admin/design/css/custom.css
echo "Dark Theme applied successfully!"