NixOS-Vista/nixosVista/homeManager/wofi/style.nix
2026-02-12 15:32:45 +01:00

235 lines
5.1 KiB
Nix

{
config,
lib,
nixosVista,
...
}: let
cfg = nixosVista.wofi;
############################################################
# DEFAULT PRESET
############################################################
defaultStyle = ''
* {
font-family: Noto Sans;
color: #ffffff;
background: transparent;
}
#window {
background: rgba(0,20,20,0.5);
border-radius: 9px;
margin: auto;
padding: 12px;
border-style: solid;
border-color: rgb(0,0,0);
border-width: 1px;
}
#input {
padding: 10px;
border-radius: 8px;
border-style: solid;
border-width: 1px;
border-color: rgb(0,0,0);
margin: 8px;
background-image: linear-gradient(to top, rgba(90,90,90,0.6), rgba(35,35,35,0.8));
box-shadow: inset 0px -5px 8px rgba(0,0,0,0.4);
}
#outer-box {
padding: 0px;
box-shadow inset 0px 0px 8px rgba(0,0,0,1);
}
#inner-box {
padding: 0px;
}
#entry {
border-radius: 10px;
border-width: 1px;
border-style: solid;
border-color: rgba(255,255,255,0.01);
border-bottom-color: rgba(255,255,255,0.25);
border-right-color: rgba(255,255,255,0.25);
padding: 4px;
margin: 4px;
margin-left: 8px;
margin-right: 8px;
background-image: linear-gradient(to bottom, rgba(255,255,255,0.3)0%, rgba(20,20,20,0.2)50%, rgba(0,0,0,0.3)50%);
}
#entry:selected {
background-color: rgba(0,255,255,0.4);
outline: none;
box-shadow: 0px 0px 6px rgba(0,0,0,0.4);
}
#img {
margin-right: 6px;
}
#text {
margin: 2px;
}
'';
############################################################
# TRANSLUCENT PRESET (Real Glass Blur)
############################################################
translucentStyle = ''
* {
font-family: Noto Sans;
color: #ffffff;
background: transparent;
}
#window {
background: rgba(0,20,20,0.5);
border-radius: 9px;
margin: auto;
padding: 12px;
border-style: solid;
border-color: rgb(0,0,0);
border-width: 1px;
}
#input {
padding: 10px;
border-radius: 8px;
border-style: solid;
border-width: 1px;
border-color: rgb(0,0,0);
margin: 8px;
background-image: linear-gradient(to top, rgba(90,90,90,0.6), rgba(35,35,35,0.8));
box-shadow: inset 0px -5px 8px rgba(0,0,0,0.4);
}
#outer-box {
padding: 0px;
box-shadow inset 0px 0px 8px rgba(0,0,0,1);
}
#inner-box {
padding: 0px;
}
#entry {
border-radius: 10px;
border-width: 1px;
border-style: solid;
border-color: rgba(255,255,255,0.01);
border-bottom-color: rgba(255,255,255,0.25);
border-right-color: rgba(255,255,255,0.25);
padding: 4px;
margin: 4px;
margin-left: 8px;
margin-right: 8px;
background-image: linear-gradient(to bottom, rgba(255,255,255,0.3)0%, rgba(20,20,20,0.2)50%, rgba(0,0,0,0.3)50%);
}
#entry:selected {
background-color: rgba(0,255,255,0.4);
outline: none;
box-shadow: 0px 0px 6px rgba(0,0,0,0.4);
}
#img {
margin-right: 6px;
}
#text {
margin: 2px;
}
'';
############################################################
# OPAQUE PRESET
############################################################
opaqueStyle = ''
* {
font-family: Noto Sans;
color: #ffffff;
background: transparent;
}
#window {
background-image: linear-gradient(to bottom, rgb(200,200,200), rgb(160,160,160));
border-radius: 9px;
margin: auto;
padding: 12px;
border-style: solid;
border-color: rgb(0,0,0);
border-width: 1px;
}
#input {
padding: 10px;
border-radius: 8px;
border-style: solid;
border-width: 1px;
border-color: rgb(18,18,18);
margin: 8px;
background-image: linear-gradient(to top, rgb(190,190,190), rgb(130,130,130));
}
#outer-box {
padding: 0px;
box-shadow inset 0px 0px 8px rgba(0,0,0,1);
}
#inner-box {
padding: 0px;
}
#entry {
border-radius: 10px;
padding: 4px;
margin: 4px;
margin-left: 8px;
margin-right: 8px;
background-image: linear-gradient(to bottom, rgba(130,130,130,0.6), rgba(20,20,20,0.8));
border-style: solid;
border-width: 1px;
border-color: rgb(18,18,18);
}
#entry:selected {
background-color: rgba(0,255,255,0.5);
outline: none;
box-shadow: 0px 0px 5px rgba(0,0,0,0.35);
}
#img {
margin-right: 6px;
}
#text {
margin: 2px;
}
'';
############################################################
# SELECT PRESET
############################################################
selectedStyle =
if cfg.style.preset == "default"
then defaultStyle
else if cfg.style.preset == "translucent"
then translucentStyle
else if cfg.style.preset == "opaque"
then opaqueStyle
else "";
in {
programs.wofi = lib.mkIf (cfg.enable && cfg.style.preset != "none") {
style = selectedStyle;
};
}