diff --git a/home-manager/assets/waybar.css b/home-manager/assets/waybar.css new file mode 100644 index 0000000..6cd0ded --- /dev/null +++ b/home-manager/assets/waybar.css @@ -0,0 +1,211 @@ +* { + border: none; + border-radius: 10px; + font-family: monospace; + font-size: 15px; + min-height: 10px; +} + +window#waybar { + background: transparent; +} + +window#waybar.hidden { + opacity: 0.2; +} + +.modules-left { + background-color: #ccc; +} + +label { + color: black; +} + +.modules-left {} + +#window { + margin-top: 6px; + padding-left: 10px; + padding-right: 10px; + border-radius: 10px; + transition: none; + color: transparent; + background: transparent; +} + +#tags { + margin-top: 6px; + margin-left: 12px; + font-size: 4px; + margin-bottom: 0px; + border-radius: 10px; + background: #161320; + transition: none; +} + +#tags button { + transition: none; + color: #B5E8E0; + background: transparent; + font-size: 16px; + border-radius: 2px; +} + +#tags button.occupied { + transition: none; + color: #F28FAD; + background: transparent; + font-size: 4px; +} + +#tags button.focused { + color: #ABE9B3; + border-top: 2px solid #ABE9B3; + border-bottom: 2px solid #ABE9B3; +} + +#tags button:hover { + transition: none; + box-shadow: inherit; + text-shadow: inherit; + color: #FAE3B0; + border-color: #E8A2AF; + color: #E8A2AF; +} + +#tags button.focused:hover { + color: #E8A2AF; +} + +#network { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #bd93f9; +} + +#pulseaudio { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #1A1826; + background: #FAE3B0; +} + +#battery { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #B5E8E0; +} + +#battery.charging, +#battery.plugged { + color: #161320; + background-color: #B5E8E0; +} + +#battery.critical:not(.charging) { + background-color: #B5E8E0; + color: #161320; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +@keyframes blink { + to { + background-color: #BF616A; + color: #B5E8E0; + } +} + +#backlight { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #F8BD96; +} + +#clock { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #ABE9B3; + /*background: #1A1826;*/ +} + +#memory { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + margin-bottom: 0px; + padding-right: 10px; + border-radius: 10px; + transition: none; + color: #161320; + background: #DDB6F2; +} + +#cpu { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + margin-bottom: 0px; + padding-right: 10px; + border-radius: 10px; + transition: none; + color: #161320; + background: #96CDFB; +} + +#tray { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + margin-bottom: 0px; + padding-right: 10px; + border-radius: 10px; + transition: none; + color: #B5E8E0; + background: #161320; +} + +#custom-media { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #F2CDCD; +} \ No newline at end of file diff --git a/home-manager/modules/vm/swaybar.nix b/home-manager/modules/vm/swaybar.nix index 2464303..2da2c09 100644 --- a/home-manager/modules/vm/swaybar.nix +++ b/home-manager/modules/vm/swaybar.nix @@ -10,10 +10,12 @@ let theme = config.colorScheme.palette; in { - options = { }; + # options.programs.waybar.settings = mkOption { + # type = types.either (types.listOf interfaceModule) (types.attrsOf interfaceModule); + # }; config = { - programs.i3status-rust = { + programs.waybar = { enable = true; bars.default = { theme = "modern"; @@ -43,61 +45,102 @@ in } ]; - # settings.theme = { - # inherit theme; - # overrides = { }; - # }; - }; - }; + settings.main-bar = { + layer = "top"; + position = "bottom"; + mode = "hide"; - wayland.windowManager.sway.config.bars = [{ - statusCommand = "${getExe pkgs.i3status-rust} ${config.home.homeDirectory}/${config.xdg.configFile."i3status-rust/config-default.toml".target}"; - hiddenState = "hide"; - mode = "hide"; - fonts.size = 11.0; + ipc = true; + id = "bar-0"; + + modules-left = [ "sway/workspaces" "sway/window" ]; + modules-center = [ "sway/language" ]; + modules-right = [ "custom/media" "cpu" "memory" "backlight" "pulseaudio" "clock" "battery" "tray" ]; + + pulseaudio = { + tooltip = false; + scroll-step = 5; + format = "{icon} {volume}%"; + format-muted = "{icon} {volume}%"; + on-click = "pactl set-sink-mute @DEFAULT_SINK@ toggle"; + format-icons.default = [ "" "" "" ]; + }; + + network = { + tooltip = false; + format-wifi = " {essid}"; + format-ethernet = ""; + }; - colors = { - background = "#${theme.base00}"; - focusedBackground = "#${theme.base00}"; - separator = "#cccccc"; - focusedSeparator = "#cccccc"; - statusline = "#cccccc"; - focusedStatusline = "#cccccc"; - - focusedWorkspace = rec { - text = "#${theme.base07}"; - background = "#${theme.base0C}"; - border = background; + backlight = { + tooltip = false; + format = " {}%"; + interval = 1; + on-scroll-up = "light -A 5"; + on-scroll-down = "light -U 5"; }; - inactiveWorkspace = rec { - text = "#${theme.base05}"; - background = "#${theme.base01}"; - border = background; + battery = { + states = { good = 95; warning = 30; critical = 15; }; + format = "{icon} {capacity}%"; + format-charging = " {capacity}%"; + format-plugged = " {capacity}%"; + format-alt = "{time} {icon}"; + format-icons = [ "" "" "" "" "" ]; }; - activeWorkspace = rec { - text = "#${theme.base08}"; - background = "#${theme.base0C}"; - border = background; + tray = { + icon-size = 18; + spacing = 10; }; - urgentWorkspace = rec { - text = "#ffffff"; - background = "#${theme.base0F}"; - border = background; + clock.format = "{:%H:%M}  "; + + cpu = { + interval = 15; + format = " {}%"; + max-length = 10; + }; + + memory = { + interval = 30; + format = " {}%"; + max-length = 10; }; - bindingMode = rec { - text = "#ffffff"; - background = "#${theme.base0F}"; - border = background; + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + }; + + "custom/media" = { + interval = 30; + format = "{icon} {}"; + return-type = "json"; + max-length = 20; + format-icons = { + spotify = " "; + default = " "; + }; + escape = true; + exec = "$HOME/.config/system_scripts/mediaplayer.py 2> /dev/null"; + on-click = "playerctl play-pause"; }; }; - # Would be nice to have rounded corners and padding when appearing + style = readFile ../../assets/waybar.css; + }; + + wayland.windowManager.sway.config.bars = [{ + command = getExe pkgs.waybar; + hiddenState = "hide"; + mode = "hide"; + fonts.size = 11.0; - extraConfig = "icon_theme Papirus"; + # extraConfig = "icon_theme Papirus"; }]; }; }