From a592039b005a1337d0fb3f3882b487d1a873bc2a Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Thu, 27 Feb 2020 16:10:45 +0100 Subject: [PATCH] Switch to i3status-rust instead of waybar --- profiles/graphical/default.nix | 2 +- programs/neovim/base.nix | 1 + programs/sway/default.nix | 20 ++- programs/sway/status-configuration.nix | 39 +++++ programs/sway/waybar.nix | 191 ------------------------- 5 files changed, 59 insertions(+), 194 deletions(-) create mode 100644 programs/sway/status-configuration.nix delete mode 100644 programs/sway/waybar.nix diff --git a/profiles/graphical/default.nix b/profiles/graphical/default.nix index ffc6c096..40afcf30 100644 --- a/profiles/graphical/default.nix +++ b/profiles/graphical/default.nix @@ -32,7 +32,7 @@ fonts = with pkgs; [ fira-code fira-code-symbols - font-awesome + font-awesome_4 noto-fonts noto-fonts-cjk noto-fonts-emoji diff --git a/programs/neovim/base.nix b/programs/neovim/base.nix index 7461000a..88d04ea5 100644 --- a/programs/neovim/base.nix +++ b/programs/neovim/base.nix @@ -26,6 +26,7 @@ in set autoread "" Theming + set termguicolors set background=light colorscheme snow diff --git a/programs/sway/default.nix b/programs/sway/default.nix index 1aa3bb0c..d921e4b1 100644 --- a/programs/sway/default.nix +++ b/programs/sway/default.nix @@ -5,11 +5,11 @@ let launcher = import ./launcher.nix { inherit pkgs stdenv; }; color-picker = import ./color-picker.nix { inherit pkgs; }; screenshot = import ./screenshot.nix { inherit pkgs; }; + status-configuration = import ./status-configuration.nix { inherit pkgs; }; in { imports = [ ./kanshi.nix - ./waybar.nix ]; programs = { sway = { @@ -290,7 +290,23 @@ in # # Read `man 5 sway-bar` for more information about this section. bar { - swaybar_command ${pkgs.waybar}/bin/waybar + position top + + status_command ${pkgs.i3status-rust}/bin/i3status-rs ${status-configuration} + status_padding 0 + + font Fira Code Normal 9 + + colors { + statusline #535c65 + background #fbffff + focused_workspace #2b7ab2 #2b7ab2 #fbffff + active_workspace #6d7782 #6d7782 #fbffff + inactive_workspace #fbffff #fbffff #535c65 + urgent_workspace #ae5865 #ae5865 #fbffff + } + + icon_theme Arc } default_border pixel diff --git a/programs/sway/status-configuration.nix b/programs/sway/status-configuration.nix new file mode 100644 index 00000000..e9c1f5ae --- /dev/null +++ b/programs/sway/status-configuration.nix @@ -0,0 +1,39 @@ +{ pkgs, ... }: + +pkgs.writeText "configuration.toml" '' + [theme] + name = "gruvbox-light" + [theme.overrides] + idle_bg="#fbffff" + idle_fg="#535c65" + info_bg="#2b7ab2" + info_fg="#fbffff" + good_bg="#2b7ab2" + good_fg="#fbffff" + warning_bg="#2b7ab2" + warning_fg="#fbffff" + critical_bg="#2b7ab2" + critical_fg="#fbffff" + separator="" + + [icons] + name = "awesome" + + [[block]] + block = "focused_window" + max_width = 100 + + [[block]] + block = "battery" + + [[block]] + block = "backlight" + + [[block]] + block = "sound" + + [[block]] + block = "time" + interval = 1 + format = "%a %d/%m %H:%M:%S" +'' diff --git a/programs/sway/waybar.nix b/programs/sway/waybar.nix deleted file mode 100644 index 70f2e50e..00000000 --- a/programs/sway/waybar.nix +++ /dev/null @@ -1,191 +0,0 @@ -{ pkgs, ... }: - -{ - home-manager.users.charlotte = { pkgs, ... }: { - nixpkgs.overlays = [ - (self: super: { waybar = super.waybar.override { pulseSupport = true; mpdSupport = false; }; }) - ]; - xdg.configFile = { - "waybar/config".text = '' - { - "layer": "bottom", - "position": "top", - "modules-left": ["sway/workspaces", "sway/mode"], - "modules-center": ["sway/window"], - "modules-right": ["idle_inhibitor", "pulseaudio", "network", "backlight", "battery", "tray", "clock"], - "sway/mode": { - "format": "{}" - }, - "sway/window": { - "max-length": 50 - }, - "idle_inhibitor": { - "format": "{icon}", - "format-icons": { - "activated": "", - "deactivated": "" - } - }, - "tray": { - "spacing": 10 - }, - "clock": { - "format": "{:%a %Y-%m-%d %H:%M}" - }, - "cpu": { - "format": "{usage}% " - }, - "memory": { - "format": "{}% " - }, - "backlight": { - "format": "{percent}% {icon}", - "format-icons": ["", ""] - }, - "battery": { - "bat": "BAT0", - "states": { - "warning": 30, - "critical": 15 - }, - "format": "{capacity}% {icon}", - "format-icons": ["", "", "", "", ""] - }, - "network": { - "format-wifi": "{essid} ({signalStrength}%) ", - "format-ethernet": "{ipaddr} ", - "format-disconnected": "Disconnected ⚠" - }, - "pulseaudio": { - "format": "{volume}% {icon}", - "format-bluetooth": "{volume}% {icon}", - "format-muted": "", - "format-icons": { - "headphones": "", - "handsfree": "", - "headset": "", - "phone": "", - "portable": "", - "car": "", - "default": ["", ""] - }, - "on-click": "pavucontrol" - } - } - ''; - "waybar/style.css".text = '' - * { - border: none; - border-radius: 0; - font-family: Noto; - font-size: 13px; - min-height: 0; - } - - window#waybar { - background: rgba(43, 48, 59, 0.5); - border-bottom: 3px solid rgba(100, 114, 125, 0.5); - color: white; - } - - /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ - #workspaces button { - padding: 0 5px; - background: transparent; - color: white; - border-bottom: 3px solid transparent; - } - - #workspaces button.focused { - background: #64727D; - border-bottom: 3px solid white; - } - - #mode { - background: #64727D; - border-bottom: 3px solid white; - } - - #clock, #battery, #cpu, #memory, #backlight, #network, #pulseaudio, #custom-spotify, #tray, #mode, #idle_inhibitor { - padding: 5px 10px; - margin: 0 5px; - } - - #clock { - background-color: #64727D; - } - - #battery { - background-color: #ffffff; - color: black; - } - - #battery.charging { - color: white; - background-color: #26A65B; - } - - @keyframes blink { - to { - background-color: #ffffff; - color: black; - } - } - - #battery.critical:not(.charging) { - background: #f53c3c; - color: white; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } - - #cpu { - background: #2ecc71; - color: #000000; - } - - #memory { - background: #9b59b6; - } - - #backlight { - background: #90b1b1; - } - - #network { - background: #2980b9; - } - - #network.disconnected { - background: #f53c3c; - } - - #pulseaudio { - background: #f1c40f; - color: black; - } - - #pulseaudio.muted { - background: #90b1b1; - color: #2a5c45; - } - - #tray { - background-color: #2980b9; - } - - #idle_inhibitor { - background-color: #2d3436; - } - - #idle_inhibitor.activated { - background-color: #ecf0f1; - color: #2d3436; - } - ''; - }; - }; -}