diff --git a/flake.nix b/flake.nix index 529a828..e0b0686 100644 --- a/flake.nix +++ b/flake.nix @@ -24,6 +24,7 @@ package = "victor-mono"; name = "Victor Mono"; }; + theme = "gruvbox"; gtkTheme = "Adwaita-dark"; }; in { @@ -39,6 +40,7 @@ ./hosts/desktop/hardware-configuration.nix ./modules/common.nix ./modules/desktop + ./modules/theme ./modules/hardware ./modules/system ./modules/shell diff --git a/modules/applications/alacritty.nix b/modules/applications/alacritty.nix index eea6130..090ed3e 100644 --- a/modules/applications/alacritty.nix +++ b/modules/applications/alacritty.nix @@ -1,4 +1,4 @@ -{ pkgs, identity, gui, ... }: { +{ config, pkgs, identity, gui, ... }: { home-manager.users.${identity.user} = { xsession.windowManager.i3.config.terminal = "alacritty"; @@ -14,7 +14,7 @@ x = 20; y = 20; }; - opacity = 0.7; + opacity = config.theme.opacity; }; scrolling.history = 10000; font = { @@ -39,36 +39,37 @@ action = "ToggleViMode"; } ]; - colors = { - primary = { - background = "#282828"; - foreground = "#d5c4a1"; - }; - cursor = { - text = "#1d2021"; - cursor = "#d5c4a1"; - }; - normal = { - black = "#1d2021"; - red = "#fb4934"; - green = "#b8bb26"; - yellow = "#fabd2f"; - blue = "#83a598"; - magenta = "#d3869b"; - cyan = "#8ec07c"; - white = "#d5c4a1"; - }; - bright = { - black = "#665c54"; - red = "#fe8019"; - green = "#3c3836"; - yellow = "#504945"; - blue = "#bdae93"; - magenta = "#ebdbb2"; - cyan = "#d65d0e"; - white = "#fbf1c7"; - }; - }; + colors = config.theme.colors; + # colors = { + # primary = { + # background = "#282828"; + # foreground = "#d5c4a1"; + # }; + # cursor = { + # text = "#1d2021"; + # cursor = "#d5c4a1"; + # }; + # normal = { + # black = "#1d2021"; + # red = "#fb4934"; + # green = "#b8bb26"; + # yellow = "#fabd2f"; + # blue = "#83a598"; + # magenta = "#d3869b"; + # cyan = "#8ec07c"; + # white = "#d5c4a1"; + # }; + # bright = { + # black = "#665c54"; + # red = "#fe8019"; + # green = "#3c3836"; + # yellow = "#504945"; + # blue = "#bdae93"; + # magenta = "#ebdbb2"; + # cyan = "#d65d0e"; + # white = "#fbf1c7"; + # }; + # }; draw_bold_text_with_bright_colors = false; }; }; diff --git a/modules/desktop/i3.nix b/modules/desktop/i3.nix index cb777e7..26559f0 100644 --- a/modules/desktop/i3.nix +++ b/modules/desktop/i3.nix @@ -201,7 +201,8 @@ }; startup = [ { - command = "feh --bg-scale $HOME/Downloads/carbon-fiber.jpg"; + command = + "feh --bg-fill ${builtins.toString config.theme.wallpaper}"; always = true; notification = false; } @@ -220,18 +221,18 @@ }; workspaceAutoBackAndForth = false; workspaceOutputAssign = [ ]; - gaps = { - bottom = 0; - top = 0; - left = 0; - right = 0; - horizontal = 0; - vertical = 0; - inner = 0; - outer = 0; - smartBorders = "off"; - smartGaps = false; - }; + # gaps = { + # bottom = 8; + # top = 8; + # left = 8; + # right = 8; + # horizontal = 15; + # vertical = 15; + # inner = 15; + # outer = 0; + # smartBorders = "off"; + # smartGaps = false; + # }; }; extraConfig = ""; }; diff --git a/modules/desktop/picom.nix b/modules/desktop/picom.nix index 02728f6..4aa64a3 100644 --- a/modules/desktop/picom.nix +++ b/modules/desktop/picom.nix @@ -4,26 +4,35 @@ home-manager.users.${identity.user} = { services.picom = { - enable = true; - blur = false; + enable = false; + blur = true; blurExclude = [ ]; # extraOptions = '' - # shadow-radius = 60 - # corner-radius = 20 + # shadow-radius = 20 # ''; + extraOptions = '' + shadow-radius = 20 + corner-radius = 10 + blur-size = 20 + rounded-corners-exclude = [ + "window_type = 'dock'", + "class_g = 'i3-frame'" + ] + ''; fade = false; experimentalBackends = true; inactiveDim = "0.05"; inactiveOpacity = "1.0"; menuOpacity = "1.0"; noDNDShadow = false; + noDockShadow = false; opacityRule = [ "0:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_HIDDEN'" # Hide tabbed windows ]; - shadow = false; + shadow = true; shadowExclude = [ ]; - shadowOffsets = [ (-30) (-30) ]; - shadowOpacity = "0.25"; + shadowOffsets = [ (-10) (-10) ]; + shadowOpacity = "0.5"; vSync = false; }; diff --git a/modules/desktop/polybar.nix b/modules/desktop/polybar.nix index b73491b..7606454 100644 --- a/modules/desktop/polybar.nix +++ b/modules/desktop/polybar.nix @@ -34,14 +34,14 @@ radius = 0; # offset-y = "5%"; # dpi = 96; - background = "#00000000"; - foreground = colors.foreground; + background = config.theme.colors.primary.background; + foreground = config.theme.colors.primary.foreground; line-size = "3pt"; border-top-size = 0; border-right-size = 0; border-left-size = 0; border-bottom-size = "4pt"; - border-color = "#1d2021"; + border-color = config.theme.colors.cursor.text; padding-left = 2; padding-right = 2; module-margin = 1; @@ -67,16 +67,17 @@ "module/xworkspaces" = { type = "internal/xworkspaces"; label-active = "%name%"; - label-active-background = colors.background-alt; - label-active-underline = colors.primary; + label-active-background = config.theme.colors.primary.foreground; + label-active-foreground = config.theme.colors.primary.background; + # label-active-underline = config.theme.colors.normal.yellow; label-active-padding = 1; label-occupied = "%name%"; label-occupied-padding = 1; label-urgent = "%name%"; - label-urgent-background = colors.alert; + label-urgent-background = config.theme.colors.bright.red; label-urgent-padding = 1; label-empty = "%name%"; - label-empty-foreground = colors.disabled; + label-empty-foreground = config.theme.colors.normal.white; label-empty-padding = 1; }; "module/xwindow" = { @@ -98,9 +99,10 @@ format-volume = " "; # format-volume-background = colors.background; # label-volume-background = colors.background; + format-volume-foreground = config.theme.colors.primary.foreground; label-volume = "%percentage%%"; label-muted = "ﱝ ---"; - label-muted-foreground = colors.disabled; + label-muted-foreground = config.theme.colors.normal.white; ramp-volume-0 = ""; ramp-volume-1 = "墳"; ramp-volume-2 = ""; @@ -149,10 +151,10 @@ "module/date" = { type = "internal/date"; interval = 1; - date = "%H:%M"; + date = "%H:%M %p"; date-alt = "%Y-%m-%d %H:%M:%S"; - label = " %date%"; - label-foreground = colors.primary; + label = "%date%"; + # label-foreground = config.theme.colors.normal.yellow; # format-background = colors.background; }; "settings" = { diff --git a/modules/theme/carbonfiber/carbon-fiber.jpg b/modules/theme/carbonfiber/carbon-fiber.jpg new file mode 100644 index 0000000..8adc8e4 Binary files /dev/null and b/modules/theme/carbonfiber/carbon-fiber.jpg differ diff --git a/modules/theme/carbonfiber/default.nix b/modules/theme/carbonfiber/default.nix new file mode 100644 index 0000000..a34f60a --- /dev/null +++ b/modules/theme/carbonfiber/default.nix @@ -0,0 +1,35 @@ +{ + name = "carbonfiber"; + colors = { + primary = { + background = "#282828"; + foreground = "#d5c4a1"; + }; + cursor = { + text = "#1d2021"; + cursor = "#d5c4a1"; + }; + normal = { + black = "#1d2021"; + red = "#fb4934"; + green = "#b8bb26"; + yellow = "#fabd2f"; + blue = "#83a598"; + magenta = "#d3869b"; + cyan = "#8ec07c"; + white = "#d5c4a1"; + }; + bright = { + black = "#665c54"; + red = "#fe8019"; + green = "#3c3836"; + yellow = "#504945"; + blue = "#bdae93"; + magenta = "#ebdbb2"; + cyan = "#d65d0e"; + white = "#fbf1c7"; + }; + }; + wallpaper = ./carbon-fiber.jpg; + opacity = 0.8; +} diff --git a/modules/theme/default.nix b/modules/theme/default.nix new file mode 100644 index 0000000..380f38a --- /dev/null +++ b/modules/theme/default.nix @@ -0,0 +1,38 @@ +{ config, lib, gui, ... }: + +let + + themes = { + "carbonfiber" = ./carbonfiber; + "gruvbox" = ./gruvbox; + "nord" = ./nord; + }; + +in { + + options.theme = { + name = lib.mkOption { + type = lib.types.str; + default = ""; + description = "Name of the theme"; + }; + colors = lib.mkOption { + type = lib.types.attrs; + default = { }; + description = "Set of colors"; + }; + wallpaper = lib.mkOption { + type = lib.types.path; + default = ./.; + description = "Path to wallpaper image"; + }; + opacity = lib.mkOption { + type = lib.types.float; + default = 1.0; + description = "Opacity of certain windows"; + }; + }; + + config.theme = (import themes.${gui.theme}); + +} diff --git a/modules/theme/gruvbox/default.nix b/modules/theme/gruvbox/default.nix new file mode 100644 index 0000000..63585c0 --- /dev/null +++ b/modules/theme/gruvbox/default.nix @@ -0,0 +1,35 @@ +{ + name = "gruvbox"; + colors = { + primary = { + background = "#282828"; + foreground = "#d5c4a1"; + }; + cursor = { + text = "#1d2021"; + cursor = "#d5c4a1"; + }; + normal = { + black = "#1d2021"; + red = "#fb4934"; + green = "#b8bb26"; + yellow = "#fabd2f"; + blue = "#83a598"; + magenta = "#d3869b"; + cyan = "#8ec07c"; + white = "#d5c4a1"; + }; + bright = { + black = "#665c54"; + red = "#fe8019"; + green = "#3c3836"; + yellow = "#504945"; + blue = "#bdae93"; + magenta = "#ebdbb2"; + cyan = "#d65d0e"; + white = "#fbf1c7"; + }; + }; + wallpaper = ./gray-forest.jpg; + opacity = 1.0; +} diff --git a/modules/theme/gruvbox/gray-forest.jpg b/modules/theme/gruvbox/gray-forest.jpg new file mode 100644 index 0000000..5b8e025 Binary files /dev/null and b/modules/theme/gruvbox/gray-forest.jpg differ