From 30b25bf02da12bb86272d30a57d4f089fb5f0e8d Mon Sep 17 00:00:00 2001 From: Roman Godmaire Date: Sun, 14 Apr 2024 14:31:51 -0400 Subject: [PATCH] sway: riced --- home-manager/diana.nix | 145 ++++++++++++++++++++++++++++++++++++++++- sway/config | 32 ++++----- 2 files changed, 153 insertions(+), 24 deletions(-) diff --git a/home-manager/diana.nix b/home-manager/diana.nix index 5ccaf35..02fa28e 100644 --- a/home-manager/diana.nix +++ b/home-manager/diana.nix @@ -7,7 +7,6 @@ home.homeDirectory = "/var/home/digyx"; home.file = { - ".config/i3status-rust".source = ../i3status-rust; ".config/rofi".source = ../rofi; ".config/sway".source = ../sway; @@ -20,9 +19,149 @@ image=/var/home/digyx/Pictures/ina_bday_2021_4k.png scaling=fill ''; - }; - home.packages = with pkgs; [ i3status-rust ]; + ".config/waybar/config.jsonc".text = '' + // -*- mode: jsonc -*- + { + "layer": "top", // Waybar at top layer + "position": "top", + "height": 30, // Waybar height (to be removed for auto height) + // "width": 1280, // Waybar width + "spacing": 0, // Gaps between modules (4px) + + "modules-left": [ + "sway/mode", + "network" + ], + "modules-center": [ + "sway/workspaces" + ], + "modules-right": [ + "battery", + "temperature", + "cpu", + "memory", + "clock", + ], + + // Modules configuration + "clock": { + "interval": 1, + "timezone": "America/New_York", + "format": " {:%m/%d %H:%M:%S}", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format-alt": " {:%Y-%m-%d}" + }, + "cpu": { + "format": " {usage}%", + "tooltip": false + }, + "memory": { + "format": " {}%", + "format-alt": " {used} GiB", + "tooltip": false, + }, + "temperature": { + "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + + "format": "{icon} {temperatureC}°C", + "format-icons": ["", "", ""], + "format-critical": "{icon} {temperatureC}°C", + "tooltip": false, + }, + "battery": { + "states": { + "good": 65, + "warning": 30, + "critical": 15 + }, + "full-at": 85, + + "format": "{icon} {capacity}%", + "format-full": "{icon}", + "format-charging": " {capacity}%", + "format-plugged": " {capacity}%", + "format-icons": ["", "", "", "", ""] + }, + "network": { + "format-wifi": " {essid}", + "format-ethernet": " Wired", + "format-disconnected": " Disconnected", + "format-alt": " {ifname}: {ipaddr}/{cidr}", + "tooltip": false, + } + } + ''; + + ".config/waybar/style.css".text = '' + /* Gruvbox Colours -- https://github.com/doomemacs/themes/blob/master/themes/doom-gruvbox-theme.el */ + + * { + border: none; + font-family: 'Noto Sans Mono', 'Font Awesome 6 Free', 'Font Awesome 6 Brands', monospace; + font-size: 13px; + color: rgba(235, 219, 178, 1); + border-radius: 20px; + } + + window#waybar { + background: rgba(0, 0, 0, 0); + } + + /*-----module groups----*/ + .modules-right { + background-color: rgba(40,40,40,0.85); + margin: 2px 10px 0 0; + } + .modules-center { + background-color: rgba(40,40,40,0.85); + margin: 2px 0 0 0; + } + .modules-left { + margin: 2px 0 0 5px; + background-color: rgba(40,40,40,0.85); + } + + /*-----modules indv----*/ + #workspaces button { + padding: 1px 5px; + background-color: transparent; + } + #workspaces button:hover { + background-color: rgba(13, 16, 17, 1); + box-shadow: inherit; + } + + #workspaces button.focused { + background-color: rgba(13, 16, 17, 0.85); + } + + #battery, + #clock, + #cpu, + #memory, + #network, + #temperature { + padding: 0 10px; + } + + /*-----Indicators----*/ + #battery.charging { + color: #b8bb26; + } + #battery.warning:not(.charging) { + color: #fabd2f; + } + #battery.critical:not(.charging) { + color: #fb4934; + } + + #temperature.critical { + color: #fb4934; + } + ''; + }; # Services services.syncthing.enable = true; diff --git a/sway/config b/sway/config index e6a4183..4423959 100644 --- a/sway/config +++ b/sway/config @@ -15,6 +15,9 @@ set $menu $rofi_cmd -show drun output * bg /var/home/digyx/Pictures/ina_bday_2021_4k.png fill output eDP-1 resolution 2256x1504 scale 1.5 +gaps inner 10 +gaps outer 4 + ### Idle configuration exec swayidle -w \ timeout 300 'swaylock -f -c 000000' \ @@ -173,6 +176,7 @@ mode "resize" { bindsym $mod+r mode "resize" # ========== THEME ========== +set $fg #ebdbb2 set $bg #282828f2 set $red #cc241d set $green #98971a @@ -181,30 +185,16 @@ set $blue #458588 set $purple #b16286 set $aqua #689d68 set $gray #a89984 -set $darkgray #1d2021 -bar { - font pango:DejaVu Sans Mono, FontAwesome 10 - position top - status_command i3status-rs - separator_symbol " | " - tray_output none +bar swaybar_command waybar - colors { - background $bg - statusline $yellow - # workspaces section - # border backgr. text - focused_workspace $bg $bg $green - inactive_workspace $bg $bg $yellow - active_workspace $bg $bg $blue - urgent_workspace $bg $bg $red - } -} - -default_border pixel 1 +default_border pixel 3 default_floating_border none -hide_edge_borders both + +# class border background text indicator child_border +client.focused $fg $fg $fg $green $fg +client.unfocused $bg $bg $bg $bg $bg +client.urgent $red $red $red $red $red # Include configs from 3 locations: # - /usr/share/sway/config.d