mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +01:00
feat: move waybar config to nixos-config as well so that i don't have to copy that per machine
This commit is contained in:
parent
6146fb6f32
commit
7e0015d8a0
1 changed files with 466 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, user, ... }:
|
||||
{ config, lib, pkgs, username, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
|
|
@ -14,5 +14,470 @@
|
|||
target = "graphical-session.target";
|
||||
};
|
||||
};
|
||||
home.file = {
|
||||
"/home/${username}/.config/waybar/config" = {
|
||||
text = ''
|
||||
[{
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
|
||||
"modules-left": [
|
||||
"sway/workspaces",
|
||||
"hyprland/workspaces",
|
||||
"privacy",
|
||||
"group/network",
|
||||
"tray",
|
||||
],
|
||||
"modules-right": [
|
||||
"custom/yubikey#icon",
|
||||
"custom/yubikey#data",
|
||||
"group/hardware",
|
||||
"group/resources",
|
||||
"bluetooth",
|
||||
// "wireplumber",
|
||||
"group/audio",
|
||||
"battery",
|
||||
"custom/notification",
|
||||
"group/clock"
|
||||
],
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// modules-left
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
"sway/workspaces": {
|
||||
"all-outputs": true,
|
||||
"disable-scroll": true,
|
||||
"format": "{name}"
|
||||
},
|
||||
|
||||
"hyprland/workspaces": {
|
||||
"all-outputs": true,
|
||||
"disable-scroll": true,
|
||||
"format": "{name}"
|
||||
},
|
||||
|
||||
"group/network": {
|
||||
"orientation": "horizontal",
|
||||
"modules": [
|
||||
"network",
|
||||
"custom/vpn",
|
||||
],
|
||||
"drawer": {
|
||||
"transition-left-to-right": true,
|
||||
"transition-duration": 500
|
||||
}
|
||||
},
|
||||
|
||||
"network": {
|
||||
"format": " {ifname}",
|
||||
"format-wifi": " {ipaddr}/{cidr} <span color='#aaaaaa'>{signalStrength}%</span>",
|
||||
"format-ethernet": " {ipaddr}/{cidr}",
|
||||
"format-disconnected": "",
|
||||
"tooltip-format": "{ifname} via {gwaddr}",
|
||||
"tooltip-format-wifi": "{essid} ({signalStrength}%)",
|
||||
"tooltip-format-ethernet": "{ifname}",
|
||||
"tooltip-format-disconnected": "Disconnected"
|
||||
},
|
||||
|
||||
// "custom/vpn": {
|
||||
// "format": "{icon} VPN <span color='#aaaaaa'>{}</span>",
|
||||
// "format-icons": {
|
||||
// "connected": "",
|
||||
// "disconnected": ""
|
||||
// },
|
||||
// "return-type": "json",
|
||||
// "exec": "/usr/local/bin/waybar-vpn current",
|
||||
// "on-click": "/usr/local/bin/waybar-vpn connect",
|
||||
// "on-click-middle": "/usr/local/bin/waybar-vpn disconnect",
|
||||
// "on-click-right": "/usr/local/bin/get-public-ip-info",
|
||||
// "interval": 30
|
||||
// },
|
||||
|
||||
"privacy": {
|
||||
"icon-spacing": 8,
|
||||
"icon-size": 14,
|
||||
"transition-duration": 250,
|
||||
"modules": [
|
||||
{
|
||||
"type": "screenshare",
|
||||
"tooltip": true,
|
||||
"tooltip-icon-size": 24
|
||||
},
|
||||
{
|
||||
"type": "audio-out",
|
||||
"tooltip": true,
|
||||
"tooltip-icon-size": 24
|
||||
},
|
||||
{
|
||||
"type": "audio-in",
|
||||
"tooltip": true,
|
||||
"tooltip-icon-size": 24
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"tray": {
|
||||
"icon-size": 12,
|
||||
"spacing": 0
|
||||
},
|
||||
|
||||
"sway/mode": {
|
||||
"format": " {}",
|
||||
"tooltip": false
|
||||
},
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// modules-right
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
"custom/yubikey#icon": {
|
||||
"exec": "~/.local/bin/waybar-yubikey 0",
|
||||
"return-type": "json"
|
||||
},
|
||||
|
||||
"custom/yubikey#data": {
|
||||
"exec": "~/.local/bin/waybar-yubikey 1",
|
||||
"return-type": "json"
|
||||
},
|
||||
|
||||
"group/hardware": {
|
||||
"orientation": "horizontal",
|
||||
"modules": [
|
||||
"cpu",
|
||||
"temperature#cpu",
|
||||
"temperature#gpu",
|
||||
"temperature#nvme",
|
||||
"temperature#wifi"
|
||||
],
|
||||
"drawer": {
|
||||
"transition-left-to-right": false,
|
||||
"transition-duration": 500
|
||||
}
|
||||
},
|
||||
|
||||
"cpu": {
|
||||
"interval": 30,
|
||||
"format": " {avg_frequency:3.2f}GHz <span color='#aaaaaa'>{usage}%</span>",
|
||||
"states": {
|
||||
"warning": 70,
|
||||
"critical": 90
|
||||
},
|
||||
},
|
||||
|
||||
"temperature#cpu": {
|
||||
"hwmon-path": "/sys/class/hwmon/hwmon5/temp1_input",
|
||||
"critical-threshold": 80,
|
||||
"format": " CPU <span color='#aaaaaa'>{temperatureC}°C</span>"
|
||||
},
|
||||
|
||||
"temperature#gpu": {
|
||||
"hwmon-path": "/sys/class/hwmon/hwmon0/temp1_input",
|
||||
"critical-threshold": 80,
|
||||
"format": "· GPU <span color='#aaaaaa'>{temperatureC}°C</span>"
|
||||
},
|
||||
|
||||
"temperature#nvme": {
|
||||
"hwmon-path": "/sys/class/hwmon/hwmon1/temp1_input",
|
||||
"critical-threshold": 80,
|
||||
"format": "· NVMe <span color='#aaaaaa'>{temperatureC}°C</span>"
|
||||
},
|
||||
|
||||
"temperature#wifi": {
|
||||
"hwmon-path": "/sys/class/hwmon/hwmon11/temp1_input",
|
||||
"critical-threshold": 80,
|
||||
"format": "· WiFi <span color='#aaaaaa'>{temperatureC}°C</span>"
|
||||
},
|
||||
|
||||
"group/resources": {
|
||||
"orientation": "horizontal",
|
||||
"modules": [ "memory", "disk#root" ],
|
||||
"drawer": {
|
||||
"transition-left-to-right": false,
|
||||
"transition-duration": 500
|
||||
}
|
||||
},
|
||||
|
||||
"memory": {
|
||||
"interval": 60,
|
||||
"format": " {used:3.1f}GiB/<span color='#aaaaaa'>{total:3.1f}GiB</span>"
|
||||
},
|
||||
|
||||
"disk#root": {
|
||||
"interval": 360,
|
||||
"format": " {used}/<span color='#aaaaaa'>{total}</span>",
|
||||
"path": "/"
|
||||
},
|
||||
|
||||
"bluetooth": {
|
||||
// "controller": "controller1",
|
||||
"on-click": "~/.local/bin/waybar-bluetooth toggle",
|
||||
"format": "<span color='#aaaaaa'></span>",
|
||||
"format-disabled": "<span color='#333333'></span>",
|
||||
"format-connected": "",
|
||||
"format-connected-battery": " {device_battery_percentage}%",
|
||||
"tooltip-format": "{controller_alias}\t\t[{controller_address}]",
|
||||
"tooltip-format-connected": "{controller_alias}\t\t[{controller_address}]\n\n{device_enumerate}",
|
||||
"tooltip-format-connected-battery": "{controller_alias}\t\t[{controller_address}]\n\n{device_enumerate}",
|
||||
"tooltip-format-enumerate-connected": "{device_alias}\t\t[{device_address}]",
|
||||
"tooltip-format-enumerate-connected-battery": "{device_alias} ({device_battery_percentage})\t\t[{device_address}]"
|
||||
},
|
||||
|
||||
"group/audio": {
|
||||
"orientation": "horizontal",
|
||||
"modules": [
|
||||
"wireplumber",
|
||||
"custom/audio-internal",
|
||||
"custom/audio-headphones",
|
||||
"custom/audio-hdmi"
|
||||
],
|
||||
"drawer": {
|
||||
"transition-left-to-right": false,
|
||||
"transition-duration": 500
|
||||
}
|
||||
},
|
||||
|
||||
"wireplumber": {
|
||||
"format": "{icon} {node_name}/<span color='#aaaaaa'>{volume}</span>",
|
||||
"format-muted": "",
|
||||
"on-click": "pavucontrol-qt",
|
||||
"on-click-right": "helvum",
|
||||
"format-icons": ["", "", ""]
|
||||
},
|
||||
|
||||
"custom/audio-internal": {
|
||||
"format": " ",
|
||||
"tooltip-format": "Internal",
|
||||
"on-click": "audio-router analog",
|
||||
"interval": "once"
|
||||
},
|
||||
|
||||
"custom/audio-hdmi": {
|
||||
"format": " ",
|
||||
"tooltip-format": "HDMI",
|
||||
"on-click": "audio-router hdmi",
|
||||
"interval": "once"
|
||||
},
|
||||
|
||||
"battery": {
|
||||
"bat": "BAT1",
|
||||
"interval": 30,
|
||||
"states": {
|
||||
"warning": 20,
|
||||
"critical": 10
|
||||
},
|
||||
"format-time": "{H}:{m}",
|
||||
"format": "{icon} {time} <span color='#aaaaaa'>{capacity}%</span>",
|
||||
"format-discharging": "{icon} <span color='#aaaaaa'>{capacity}%</span>",
|
||||
"format-discharging-warning": "{icon} <span color='#FF5F1F'>{capacity}%</span>",
|
||||
"format-discharging-critical": "{icon} <span color='#FF3131'>{capacity}%</span>",
|
||||
"format-charging": "{icon} <span color='#DAF7A6'>{capacity}%</span><span color='#aaaaaa'> @ {power:2.0f}W</span>",
|
||||
"format-full": " <span color='#aaaaaa'>{capacity}%</span>",
|
||||
"format-not-charging": " <span color='#aaaaaa'>{capacity}%</span>",
|
||||
"format-icons": ["", "", "", "", ""],
|
||||
},
|
||||
|
||||
"custom/notification": {
|
||||
"tooltip": false,
|
||||
"format": "{icon} ",
|
||||
"format-icons": {
|
||||
"notification": "",
|
||||
"none": "",
|
||||
"dnd-notification": "",
|
||||
"dnd-none": "",
|
||||
"inhibited-notification": "",
|
||||
"inhibited-none": "",
|
||||
"dnd-inhibited-notification": "",
|
||||
"dnd-inhibited-none": ""
|
||||
},
|
||||
"return-type": "json",
|
||||
"exec-if": "which swaync-client",
|
||||
"exec": "swaync-client -swb",
|
||||
"on-click": "swaync-client -t -sw",
|
||||
"on-click-right": "swaync-client -d -sw",
|
||||
"escape": true
|
||||
},
|
||||
|
||||
"group/clock": {
|
||||
"orientation": "horizontal",
|
||||
"modules": [ "clock#time", "clock#date" ],
|
||||
"drawer": {
|
||||
"transition-left-to-right": false,
|
||||
"transition-duration": 500
|
||||
}
|
||||
},
|
||||
|
||||
"clock#date": {
|
||||
"interval": 60,
|
||||
"format": " <span color='#ffffff'> {:%a %e %b %Y}</span>",
|
||||
"tooltip-format": "<big>{:%B %Y}</big>\n<tt>{calendar}</tt>",
|
||||
"calendar": {
|
||||
"mode" : "year",
|
||||
"mode-mon-col" : 2,
|
||||
"weeks-pos" : "right",
|
||||
"on-scroll" : 1,
|
||||
"format": {
|
||||
"months": "<span color='#ffead3'><b>{}</b></span>",
|
||||
"days": "<span color='#ecc6d9'><b>{}</b></span>",
|
||||
"weeks": "<span color='#99ffdd'><b>W{}</b></span>",
|
||||
"weekdays": "<span color='#ffcc66'><b>{}</b></span>",
|
||||
"today": "<span color='#ff6699'><b><u>{}</u></b></span>"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
"on-click-right": "mode",
|
||||
"on-scroll-up": "shift_up",
|
||||
"on-scroll-down": "shift_down"
|
||||
}
|
||||
},
|
||||
|
||||
"clock#time": {
|
||||
"interval": 60,
|
||||
"format": " <span color='#aaaaaa'>{:%I:%M %p (%Z)}</span>",
|
||||
"tooltip": true,
|
||||
"tooltip-format": "{tz_list}",
|
||||
"timezones": [
|
||||
"Europe/Amsterdam",
|
||||
],
|
||||
"actions": {
|
||||
"on-scroll-up": "tz_up",
|
||||
"on-scroll-down": "tz_down"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
'';
|
||||
};
|
||||
"/home/${username}/.config/waybar/style.css" = {
|
||||
text = ''
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: 'CommitMono Nerd Font';
|
||||
font-weight: 400;
|
||||
font-size: 11px;
|
||||
min-height: 26px;
|
||||
/* margin: 0 0px; */
|
||||
}
|
||||
|
||||
window#waybar.top {
|
||||
background-color: rgba(115, 116, 116, 0.22);
|
||||
border-bottom: none;
|
||||
color: #eeeeee;
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
label#window {
|
||||
text-shadow: 0px 0px 3px #18181e;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background: rgba(43, 48, 59, 0.5);
|
||||
border: 1px solid rgba(100, 114, 125, 0.5);
|
||||
}
|
||||
|
||||
tooltip label {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.modules-left > widget > label,
|
||||
.modules-left > box > widget > label,
|
||||
.modules-right > widget > label,
|
||||
.modules-right > box > widget > label {
|
||||
padding: 0 10px;
|
||||
margin: 0px 0px 0px 10px;
|
||||
}
|
||||
|
||||
#network, #resources, #audio, #clock {
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.drawer-child > label {
|
||||
margin: 0px 10px;
|
||||
}
|
||||
|
||||
#custom-audio-internal,
|
||||
#custom-audio-motu,
|
||||
#custom-audio-headphones,
|
||||
#custom-audio-hdmi
|
||||
{
|
||||
padding: 4px 2px;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
/*padding: 4px 6px;*/
|
||||
padding: 4px 6px;
|
||||
color: #555555;
|
||||
border-radius: 0px;
|
||||
/*min-width: 32px;*/
|
||||
}
|
||||
|
||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||
|
||||
#workspaces button:hover {
|
||||
box-shadow: inherit;
|
||||
text-shadow: inherit;
|
||||
background: transparent;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
color: #eeeeee;
|
||||
}
|
||||
|
||||
#workspaces button.focused:hover {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
color: #ffffff;
|
||||
background-color: #e27878;
|
||||
}
|
||||
|
||||
#language {
|
||||
/* margin: 0px 0px 0px 0px; */
|
||||
color: #cccccc;
|
||||
}
|
||||
|
||||
#tray {
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
/* margin-left: 10px; */
|
||||
}
|
||||
|
||||
#tray image {
|
||||
margin: 0px 10px 0px 0px;
|
||||
}
|
||||
|
||||
#mode {
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
border: 2px solid #e2a478;
|
||||
margin: 0px 10px 0px 0px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#custom-yubikey.icon {
|
||||
background: #f9409d;
|
||||
}
|
||||
|
||||
#custom-notification {
|
||||
padding: 0;
|
||||
color: #ffffff;
|
||||
margin: 0px 10px;
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue