nix/home-manager/common/desktops/hyprland/themes/green/waybar-conf.nix
2023-11-19 20:57:34 +09:00

274 lines
8 KiB
Nix

{ ...}: {
imports = [ ../../common/waybar/scripts.nix ];
home.file = {
# https://yewtu.be/watch?v=tWQB1NDDA9c
# https://github.com/DN-debug/waybar-examples
# Inspiration:
# https://github.com/Pipshag/dotfiles_gruvbox
# Font Search:
# https://www.nerdfonts.com/cheat-sheet
# Online CSS testing
# https://www.w3schools.com/css/tryit.asp?filename=trycss_border_round
# Waybar configuration
".config/waybar/config.jsonc" = {
enable = true;
executable = false;
text = ''
{
"layer": "top",
"position": "top",
"modules-left": [
"custom/wlogout",
"idle_inhibitor",
"clock",
"mpris",
],
"modules-center": [
"hyprland/workspaces",
],
"modules-right": [
"pulseaudio",
"custom/tailscale",
"network",
"battery",
],
"custom/wlogout": {
"format": "",
"on-click": "wlogout"
},
"custom/tailscale": {
"format": "{icon} ",
"exec": "$HOME/.config/waybar/scripts/tailscale.sh",
"exec-if": "pgrep tailscaled",
"return-type": "json",
"interval": 5,
"format-icons": {
"Running": "󰌆",
"Stopped": "󰌊",
}
},
"idle_inhibitor": {
"format": "{icon} ",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"mpris": {
"format": "{player_icon} {dynamic}",
"format-paused": "{status_icon} <i>{dynamic}</i>",
"player-icons": { "default": "" },
"status-icons": { "paused": "" },
"max-length": 30,
},
"hyprland/workspaces": {
"on-click": "activate",
},
"clock": {
"format": "󰥔 {:%H:%M}",
"format-alt": "󰃭 {:%A, %d %b, %Y}",
"tooltip-format": "<tt><small>{calendar}</small></tt>",
"calendar": {
"mode" : "month",
"mode-mon-col" : 3,
"weeks-pos" : "left",
"on-scroll" : 1,
"format": {
"months": "<span color='#d9eed2'><b>{}</b></span>",
"days": "<span color='#d9eed2'><b>{}</b></span>",
"weeks": "<span color='#2a9b34'><b>W{}</b></span>",
"weekdays": "<span color='#a6ff3e'><b>{}</b></span>",
"today": "<span color='#22ff71'><b><u>{}</u></b></span>"
}
},
"actions": {
"on-click-right": "kitty -e calcurse",
"on-click-middle": "mode",
"on-scroll-up": "shift_up",
"on-scroll-down": "shift_down"
}
},
"pulseaudio": {
"scroll-step": 1,
"format": "{icon} {format_source}",
"format-bluetooth": "<span foreground='#fb0029'>{volume}% {icon} {format_source}</span>",
"format-bluetooth-muted": " ",
"format-muted": "󰝟 {format_source}",
"format-source": " <span foreground='#fb0029'></span>",
"format-source-muted": " ",
"format-icons": {
"headphone": " ",
"headset": " ",
"default": ["󰕿", "󰖀", "󰕾"]
},
"tooltip": false,
"on-click": "kitty -e pulsemixer",
},
"network": {
"format": "{ifname}",
"format-wifi": " ",
"format-ethernet": " {ipaddr}",
"format-disconnected": "", // An empty format will hide the module.
"tooltip-format": "{ifname} via {gwaddr} ",
"tooltip-format-wifi": "{essid} ({signalStrength}%) ",
"tooltip-format-ethernet": "{ifname} ",
"tooltip-format-disconnected": "Disconnected",
"max-length": 50,
"on-click": "kitty --class=nmtui -e nmtui"
},
"battery": {
"tooltip": true,
"tooltip-format": "{time}",
"states": {
"warning": 35,
"critical": 20
},
"format": "{icon} {capacity}%",
"format-charging": "󰂄 {capacity}%",
"format-plugged": " {capacity}%",
"format-icons": ["", "", "", "", ""]
},
}
'';
};
# Waybar theming
".config/waybar/style.css" = {
enable = true;
executable = false;
text = ''
* {
border: none;
border-radius: 0;
font-family: JetbrainsMono Regular;
}
#waybar {
background-color: rgba(50, 48, 47, 0.8);
padding: 15px;
}
#workspaces button.visible,
#workspaces button {
font-size: 15px;
border-radius: 50px;
padding: 0px 5px;
margin: 5px;
color: rgba(200, 200, 200, 0.5);
background-color: #282828;
}
#workspaces button.active {
padding: 0px 15px;
background-color: #7A7740;
color: rgba(0, 0, 0, 0.5);
}
#workspaces button:hover,
#workspaces button.focused:hover,
#workspaces button.visible:hover {
color: rgba(0, 0, 0, 0.5);
background-color: #649a25;
}
#workspaces button.urgent {
background-color: #cc241d;
color: rgba(200, 200, 200, 0.5);
}
/*
* General background
*/
#network,
#mpris,
#memory,
#backlight,
#cpu,
#pulseaudio,
#temperature,
#battery,
#tray,
#submap,
#clock,
#idle_inhibitor,
#custom-tailscale,
#custom-wlogout,
#window {
font-size: 16px;
padding: 0px 10px;
margin: 5px;
border-radius: 5px;
color: rgba(58,60,62, 0.6);
background-color: #649a25;
font-weight: bold;
}
/*
* General background
*/
#network button:hover,
#mpris button:hover,
#memory button:hover,
#backlight button:hover,
#cpu button:hover,
#pulseaudio button:hover,
#temperature button:hover,
#battery button:hover,
#tray button:hover,
#submap button:hover,
#clock button:hover,
#idle_inhibitor button:hover,
#custom-tailscale button:hover,
#custom-wlogout button:hover,
#window button:hover{
background-color: #d9eed2;
}
/*
* Warning plugins state
*/
#battery.warning {
background-color: #d1ff6d;
}
/*
* Critical plugins state
*/
#idle_inhibitor.activated,
#battery.critical,
#custom-tailscale.Stopped,
#network.disconnected {
color: #d9eed2;
background-color: #fb0029;
}
#battery.charging {
background-color: #2a9b34;
}
#battery.plugged {
background-color: #458588;
}
#pulseaudio.bluetooth {
background-color: #458588;
}
tooltip {
color: #d9eed2;
font-size: 14px;
}
'';
};
};
}