diff --git a/configuration.nix b/configuration.nix index 0eb62a8..cf0dc0a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -75,19 +75,9 @@ in }; displayManager = { sddm.enable = conf.wm == "plasma" || conf.wm == "xmonad"; - defaultSession = if conf.wm == "i3" then "xfce+i3" else null; + defaultSession = if conf.wm == "i3" then "xfce" else null; }; windowManager = { - i3 = if conf.wm == "i3" then { - enable = true; - extraPackages = - with pkgs; [ - dmenu - i3status - i3lock - i3blocks - ]; - } else {}; }; }; diff --git a/flake.nix b/flake.nix index 6269af5..c862390 100644 --- a/flake.nix +++ b/flake.nix @@ -19,7 +19,7 @@ let # :( # could do like nix-i3, nix-hyprland but that would be LAME - conf = (import ./build.conf.nix) { wm = "hyprland"; }; + conf = (import ./build.conf.nix) { wm = "i3"; }; modules = [ ((import ./configuration.nix) conf) home-manager.nixosModules.home-manager diff --git a/home.nix b/home.nix index 3789428..06cecfa 100644 --- a/home.nix +++ b/home.nix @@ -183,9 +183,32 @@ in ''; } else {}; - # xsession.windowManager.i3 = if wm == "i3" - # then { - # enable = true; + wayland.windowManager.sway = if wm == "sway" + then { + enable = true; + config = rec { + modifier = "Mod4"; + terminal = "kitty"; + startup = [ + ]; + }; + } else {}; - # } else {}; + services.polybar = if wm == "i3" + then { + enable = true; + script = "polybar bar &"; + settings = import ./polybar.conf.nix; + config = { + client.focused = ["#665c54" "#665c54" "#121212" "#665c54" "#a89984"]; + client.unfocused = ["#282828" "#282828" "#a89984" "#282828" "#282828"]; + client.focused_inactive = ["#282828" "#282828" "#a89984" "#282828" "#282828"]; + client.urgent = ["#282828" "#282828" "#a89984" "#282828" "#282828"]; + }; + } else {}; + + xsession.windowManager.i3 = if wm == "i3" + then { + enable = true; + } else {}; } diff --git a/polybar.conf.nix b/polybar.conf.nix new file mode 100644 index 0000000..6083dc4 --- /dev/null +++ b/polybar.conf.nix @@ -0,0 +1,466 @@ +# https://pastebin.com/AreP6tnU; +rec { + colors = { + background = "#121212"; + background-alt = "#282828"; + + foreground = "#f9f5d7"; + foreground-alt = "#7c6f64"; + primary = "#ffb52a"; + secondary = "#e60053"; + alert = "#cc241d"; + }; + + bar.primary = { + width = "100%"; + height = "26"; + + radius = "0.0"; + fixed-center = "true"; + bottom = "true"; + + background = "${colors.background}"; + foreground = "${colors.foreground}"; + + line-size = "0"; + line-color = "#f00"; + + border-size = "0"; + border-color = "#a89984"; + + padding-left = "2"; + padding-right = "2"; + + module-margin-left = "1"; + module-margin-right = "1"; + + "#font-0" = "fixed:pixelsize=9"; + "#font-1" = "unifont:fontformat=truetype:size=8:antialias=false"; + "#font-2" = "siji:pixelsize=10"; + "#font-3" = "Material Icons:size=13"; + "#font-4" = "Font Awesome 5 Free Solid:size=10"; + "#font-5" = "Font Awesome 5 Free Regular:size=10"; + "#font-6" = "Font Awesome 5 Brands:size=11"; + "#font-7" = "Material-Design-Iconic-Font:size=13"; + font-0 = "Plex Custom:size=9.5"; + font-1 = "Material\\-Design\\-Iconic\\-Font:size=12"; + font-2 = "Font Awesome 5 Free Solid:size=10"; + font-3 = "Font Awesome 5 Free Regular:size=10"; + font-4 = "BlexMono NF:size=14"; + font-5 = "Font Awesome 5 Brands:size=11"; + + modules-left = "time memory cpu mpd"; + modules-center = "i3"; + modules-right = "battery pulseaudio wlan eth"; + + tray-position = "right"; + tray-padding = "3"; + tray-background = "${colors.background}"; + tray-maxsize = "22"; + tray-scale = "1.1"; + + wm-restack = "i3"; + + cursor-click = "pointer"; + cursor-scroll = "ns-resize"; + + enable-ipc = "true"; + }; + + bar.secondary = { + width = "100%"; + height = "25"; + + radius = "0.0"; + fixed-center = "true"; + bottom = "true"; + + background = "${colors.background}"; + foreground = "${colors.foreground}"; + + line-size = "0"; + line-color = "#f00"; + + border-size = "0"; + + border-color = "#a89984"; + + padding-left = "3"; + padding-right = "3"; + + module-margin-left = "1"; + module-margin-right = "1"; + + font-0 = "Plex Custom:size=9.5"; + font-1 = "Material-Design-Iconic-Font:size=13"; + font-2 = "Font Awesome 5 Free Solid:size=10"; + font-3 = "Font Awesome 5 Free Regular:size=10"; + font-4 = "BlexMono NF:size=14"; + font-5 = "Font Awesome 5 Brands:size=11"; + + modules-left = "time memory cpu mpd"; + modules-center = "i3"; + modules-right = "battery pulseaudio wlan eth"; + + tray-position = "none"; + + wm-restack = "i3"; + + cursor-click = "pointer"; + cursor-scroll = "ns-resize"; + + enable-ipc = "true"; + }; + + module.xkeyboard = { + type = "internal/xkeyboard"; + blacklist-0 = "num lock"; + + format-prefix = " "; + format-prefix-foreground = "${colors.foreground-alt}"; + format-prefix-underline = "${colors.secondary}"; + + label-layout = "%layout%"; + label-layout-underline = "${colors.secondary}"; + + label-indicator-padding = "2"; + label-indicator-margin = "1"; + label-indicator-background = "${colors.secondary}"; + label-indicator-underline = "${colors.secondary}"; + }; + + module.filesystem = { + type = "internal/fs"; + interval = "25"; + + mount-0 = "/"; + + label-mounted = "%{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%"; + label-unmounted = "%mountpoint% not mounted"; + label-unmounted-foreground = "${colors.foreground-alt}"; + }; + + module.bspwm = { + type = "internal/bspwm"; + + label-focused = "%index%"; + label-focused-background = "${colors.background-alt}"; + label-focused-underline= "${colors.primary}"; + label-focused-padding = "2"; + + label-occupied = "%index%"; + label-occupied-padding = "2"; + + label-urgent = "%index%!"; + label-urgent-background = "${colors.alert}"; + label-urgent-padding = "2"; + + label-empty = "%index%"; + label-empty-foreground = "${colors.foreground-alt}"; + label-empty-padding = "2"; + }; + + module.i3 = { + type = "internal/i3"; + format = " "; + index-sort = "true"; + wrapping-scroll = "false"; + + pin-workspaces = "true"; + + label-mode-padding = "1"; + label-mode-foreground = "#000"; + label-mode-background = "${colors.primary}"; + + label-focused = "%index%"; + label-focused-background = "${colors.background-alt}"; + label-focused-foreground = "${colors.foreground}"; + label-focused-underline= "${colors.primary}"; + label-focused-padding = "1"; + + label-unfocused = "%index%"; + label-unfocused-padding = "1"; + + label-visible = "%index%"; + label-visible-background = "${self.label-focused-background}"; + label-visible-foreground = "${self.label-focused-foreground}"; + label-visible-underline = "${self.label-focused-underline}"; + label-visible-padding = "${self.label-focused-padding}"; + + label-urgent = "%index%"; + label-urgent-background = "${colors.alert}"; + label-urgent-padding = "1"; + }; + + module.mpd = { + type = "internal/mpd"; + label-song-background = "${colors.foreground}"; + label-song-foreground = "${colors.background}"; + + label-song-padding = "1"; + format-playing = " "; + format-paused = " "; + format-stopped = ""; + label-song = "ﱘ %title%"; + + port=6000; + + icon-prev = ""; + icon-stop = ""; + icon-play = ""; + icon-pause = ""; + icon-next = ""; + + label-song-maxlen = "15"; + label-song-ellipsis = "true"; + }; + + module.xbacklight = { + type = "internal/xbacklight"; + + format = "