From ad996d7e0fa0fdf95c30a7b359b9f6a005262e27 Mon Sep 17 00:00:00 2001 From: Trevor Vallender Date: Mon, 3 Apr 2023 16:40:01 +0100 Subject: [PATCH] Waybar config --- system/configuration.nix | 10 ++ users/tsv/home.nix | 3 + users/tsv/hyprland/hyprland.conf | 6 +- users/tsv/waybar/config | 147 ++++++++++++++++++++++++++++ users/tsv/waybar/style.css | 161 +++++++++++++++++++++++++++++++ 5 files changed, 324 insertions(+), 3 deletions(-) create mode 100644 users/tsv/waybar/config create mode 100644 users/tsv/waybar/style.css diff --git a/system/configuration.nix b/system/configuration.nix index df2195d..3d5e3c4 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -98,6 +98,16 @@ in nixpkgs.config.allowUnfree = true; + nixpkgs.overlays = [ + (self: super: { + # Experimental features in Waybar gives us access to workspace selectors + waybar = super.waybar.overrideAttrs (oldAttrs: { + mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; + }); + }) + ]; + + virtualisation.docker.enable = true; services.openssh = { diff --git a/users/tsv/home.nix b/users/tsv/home.nix index 3193190..50d8da6 100644 --- a/users/tsv/home.nix +++ b/users/tsv/home.nix @@ -48,6 +48,7 @@ lshw nerdfonts pandoc + pavucontrol pspg ripgrep ruby_3_1 @@ -119,6 +120,8 @@ xdg.configFile."aerc/accounts.conf".source = ./aerc/accounts.conf; xdg.configFile."hypr/hyprland.conf".source = ./hyprland/hyprland.conf; xdg.configFile."hypr/hyprpaper.conf".source = ./hyprland/hyprpaper.conf; + xdg.configFile."waybar/config".source = ./waybar/config; + xdg.configFile."waybar/style.css".source = ./waybar/style.css; home.file.".ssh/config".source = ./ssh/config; home.file.".LESS_TERMCAP".source = ./LESS_TERMCAP; services.syncthing.enable = true; diff --git a/users/tsv/hyprland/hyprland.conf b/users/tsv/hyprland/hyprland.conf index a19437c..29606bb 100644 --- a/users/tsv/hyprland/hyprland.conf +++ b/users/tsv/hyprland/hyprland.conf @@ -41,9 +41,9 @@ general { # See https://wiki.hyprland.org/Configuring/Variables/ for more gaps_in = 5 - gaps_out = 20 + gaps_out = 10 border_size = 2 - col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + col.active_border = rgba(fbf0c9ee) col.inactive_border = rgba(595959aa) layout = dwindle @@ -52,7 +52,7 @@ general { decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more - rounding = 10 + rounding = 5 blur = yes blur_size = 3 blur_passes = 1 diff --git a/users/tsv/waybar/config b/users/tsv/waybar/config new file mode 100644 index 0000000..7529a36 --- /dev/null +++ b/users/tsv/waybar/config @@ -0,0 +1,147 @@ +{ + "layer": "top", + "position": "top", + "height": 32, + "margin-top": 6, + "margin-bottom": -12, + + "modules-left": [ + "custom/leftside", + "wlr/workspaces", + "battery", + "cpu", + "temperature", + "custom/rightside", + ], + "modules-center": [ + "custom/leftside", + "clock", + "custom/rightside", + ], + "modules-right": [ + "custom/leftside", + "idle_inhibitor", + "network", + "pulseaudio", + "tray", + "custom/power", + "custom/rightside", + ], + + "wlr/workspaces": { + "all-outputs": true, + "sort-by-number": true, + "on-click": "activate", + "sort-by-number": true, + "on-scroll-up": "hyprctl dispatch workspace e+1", + "on-scroll-down": "hyprctl dispatch workspace e-1", + "format": "{name}: {icon} ", + "format-icons": { + "urgent": "", + "active": "", + "default": "", + }, + }, + + "custom/rightside":{ + "format":" ", + }, + "custom/middle":{ + "format":" ", + }, + + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "", + } + }, + + "tray": { + "icon-size": 15, + "spacing": 8, + }, + + "clock": { + "interval": 1, + "format": "{: %a %d %b | %I:%M %p}", + "tooltip": true, + "tooltip-format": "{:%B %Y \t}\n{calendar}", + }, + + "cpu": { + "interval": 15, + "format": " {usage}%", + "tooltip": false + }, + + "memory": { + "interval": 30, + "format": " {}%", + "tooltip": false + }, + + "temperature": { + "thermal-zone": 1, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 90, + // "format-critical": "{temperatureC}°C {icon}", + "format": " {temperatureC}°C", + // "format-icons": ["", "", ""] + }, + + "battery": { + "states": { + // "good": 95, + "warning": 15, + "critical": 5 + }, + "format": "{capacity}% {icon} ", + "format-charging": "{capacity}%  ", + "format-plugged": "{capacity}%  ", + "format-alt": "{time} {icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "{signalStrength}% ", + "format-ethernet": " {ipaddr}/{cidr}", + "tooltip-format": "{ifname} on {essid} via {gwaddr} 󰈀", + "format-linked": "No IP 󰈀", + "format-disconnected": "Disconnected ⚠", + "format-alt": " {bandwidthUpBits} |  {bandwidthDownBits}", + }, + + "pulseaudio": { + "scroll-step": 5, // %, can be a float + "format": "{icon} {volume}%", + "format-bluetooth": "{icon} {volume}% {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": " {format_source}", + "format-source": "{volume}% ", + "format-source-muted": " ", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + }, + + "custom/power":{ + "format": " ", + "on-click": "$HOME/.config/waybar/scripts/powermenu", + }, + + "custom/tray": { + "format": "hello" + } +} diff --git a/users/tsv/waybar/style.css b/users/tsv/waybar/style.css new file mode 100644 index 0000000..22e4ce8 --- /dev/null +++ b/users/tsv/waybar/style.css @@ -0,0 +1,161 @@ +* { + border: none; + font-family: "JetbrainsMono Nerd Font"; + font-size: 14px; + min-height: 14px; +} + +window#waybar { + background: transparent; +} + +.modules-left, +.modules-center, +.modules-right { + padding: 2px 10px 2px 10px; + + background: rgba(20, 22, 30, 0.7); + color: #979eab; + + border-radius: 10px; + margin-top: 8px; + margin-bottom: 10px; + margin-left: 10px; + margin-right: 10px; + + border: 4px transparent; + box-shadow: 5px 5px 5px 1px rgba(10, 10, 12, 0.7); +} + +#custom-launcher { + color: #a6e3a1; + font-size: 16px; + padding-right: 14px; + padding-left: 8px; +} +#workspaces, +#workspaces button { + color: #a9b1d6; +} +#workspaces button.inactive { + color: #a9b1d6; +} +#workspaces button.active { + color: rgb(83, 193, 237); +} +#workspaces button.urgent { + color: #FF3E96; +} +#custom-kitty { + font-size: 14px; + color: #94E2D5; + padding-right: 12px; +} +#custom-firefox { + font-size: 12px; + color: #94E2D5; + padding-right: 12px; +} +#custom-file { + font-size: 14px; + color: #94E2D5; + padding-right: 12px; +} +#custom-code { + font-size: 14px; + color: #94E2D5; + padding-right: 12px; +} +#custom-spot { + padding-right: 12px; + color: #94E2D5; +} +#cpu { + color: #74c7ec; + padding-left: 10px; + padding-right: 10px; +} +#memory { + color: #87b0f9; + padding-left: 10px; + padding-right: 10px; +} +#temperature { + color: #b4befe; + padding-left: 10px; + padding-right: 5px; +} +#clock { + color: #c0caf5; + padding-left: 5px; + padding-right: 10px; +} +#custom-weather { + color: #89dceb; + padding-left: 10px; + padding-right: 5px; +} +#custom-spotify { + color: #A6E3A1; + padding-left: 15px; + padding-right: 5px; +} +#idle_inhibitor { + color: #f5e0dc; + padding-left: 5px; + padding-right: 10px; +} +#idle_inhibitor.activated { + color: #e0af68; + padding-left: 5px; + padding-right: 10px; +} +#custom-gamemode { + padding-right: 10px; + transition: none; + color: #41a6b5; +} +#custom-screenshot { + padding-left: 20px; + padding-right: 12px; + transition: none; + color: #cba6f7; +} +#custom-wallpaper { + padding-right: 12px; + transition: none; + color: #cba6f7; +} +#custom-keybindings { + padding-right: 12px; + transition: none; + color: #cba6f7; + font-size: 18px; +} +#custom-updates { + padding-left: 10px; + padding-right: 10px; + transition: none; + color: #f5c2e7; +} +#network { + padding-left: 10px; + padding-right: 10px; + transition: none; + color: #fab387; +} +#pulseaudio { + padding-left: 10px; + padding-right: 10px; + transition: none; + color: #f38ba8; +} +#tray { + padding-left: 10px; + padding-right: 10px; + color: #31BEF7; +} +#custom-power { + padding-left: 15px; + color: #FF3E96; +}